diff options
author | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2008-01-21 06:57:56 (GMT) |
---|---|---|
committer | erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0> | 2008-01-21 06:57:56 (GMT) |
commit | 8b457cc86a396a1d9ffd9524aa22fc3ffc80de1f (patch) | |
tree | b54a7de1dfe291cfb36ae2be4a7e9a877181b2d0 /constants.py | |
parent | 121ccc9cbda6c33666d6dd99cce9054811c4ffed (diff) |
51 final (?)
git-svn-id: http://mediamods.com/public-svn/camera-activity/tags/51@1019 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'constants.py')
-rw-r--r-- | constants.py | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/constants.py b/constants.py index 1c797eb..a6a1ee8 100644 --- a/constants.py +++ b/constants.py @@ -25,6 +25,7 @@ class Constants: activityId = None recdTitle = "title" + recdTags = "tags" recdTime = "time" recdRecorderName = "photographer" recdRecorderHash = "recorderHash" @@ -67,7 +68,7 @@ class Constants: DURATION_2 = 2 DURATION_4 = 4 DURATION_6 = 6 - DURATIONS = [] + DURATIONS = [] DURATIONS.append(DURATION_2) DURATIONS.append(DURATION_4) DURATIONS.append(DURATION_6) @@ -88,9 +89,26 @@ class Constants: gfxPath = os.path.join(activity.get_bundle_path(), "gfx") soundClick = os.path.join(gfxPath, 'photoShutter.wav') - istrsTest = {} - for i in range (0,10): - istrsTest[str(i)] = str(i) + + #defensive method against variables not translated correctly + def _(s): + #todo: permanent variable + istrsTest = {} + for i in range (0,4): + istrsTest[str(i)] = str(i) + + i = s + try: + #test translating the string with many replacements + i = gt(s) + test = i % istrsTest + except: + #if it doesn't work, revert + i = s + + return i + + istrActivityName = _('Record') istrPhoto = _('Photo') istrVideo = _('Video') @@ -278,8 +296,6 @@ class Constants: for i in range (0, longestTime): self.createCountdownPng( i ) - checkInternationalStrings() - def createCountdownPng(self, num): todisk = True @@ -336,15 +352,3 @@ class Constants: img.set_from_pixmap(pixmap, None) self.__class__.countdownImgs[int(num)] = img - - - def _(self, s): - i = s - try: - #test translating the string with many replacements - i = gt(s) % self.__class__.istrTests - except: - #if it doesn't work, revert - i = s - - return i |