Mercurial > p > roundup > code
comparison roundup/roundupdb.py @ 3621:77ed6c517793
timezone support (patch [SF#1465296])
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Sat, 06 May 2006 17:19:58 +0000 |
| parents | 7b25567f0f54 |
| children | 06d7816976bc |
comparison
equal
deleted
inserted
replaced
| 3620:17124caa2491 | 3621:77ed6c517793 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: roundupdb.py,v 1.123 2006-04-27 01:39:47 richard Exp $ | 18 # $Id: roundupdb.py,v 1.124 2006-05-06 17:19:58 a1s Exp $ |
| 19 | 19 |
| 20 """Extending hyperdb with types specific to issue-tracking. | 20 """Extending hyperdb with types specific to issue-tracking. |
| 21 """ | 21 """ |
| 22 __docformat__ = 'restructuredtext' | 22 __docformat__ = 'restructuredtext' |
| 23 | 23 |
| 70 def getUserTimezone(self): | 70 def getUserTimezone(self): |
| 71 """Return user timezone defined in 'timezone' property of user class. | 71 """Return user timezone defined in 'timezone' property of user class. |
| 72 If no such property exists return 0 | 72 If no such property exists return 0 |
| 73 """ | 73 """ |
| 74 userid = self.getuid() | 74 userid = self.getuid() |
| 75 timezone = None | |
| 75 try: | 76 try: |
| 76 timezone = int(self.user.get(userid, 'timezone')) | 77 tz = self.user.get(userid, 'timezone') |
| 77 except (KeyError, ValueError, TypeError): | 78 date.get_timezone(tz) |
| 78 # If there is no class 'user' or current user doesn't have timezone | 79 timezone = tz |
| 79 # property or that property is not numeric assume he/she lives in | 80 except KeyError: |
| 80 # Greenwich :) | 81 pass |
| 81 timezone = getattr(self.config, 'DEFAULT_TIMEZONE', 0) | 82 # If there is no class 'user' or current user doesn't have timezone |
| 83 # property or that property is not set assume he/she lives in | |
| 84 # the timezone set in the tracker config. | |
| 85 if timezone is None: | |
| 86 timezone = self.config['TIMEZONE'] | |
| 82 return timezone | 87 return timezone |
| 83 | 88 |
| 84 def confirm_registration(self, otk): | 89 def confirm_registration(self, otk): |
| 85 props = self.getOTKManager().getall(otk) | 90 props = self.getOTKManager().getall(otk) |
| 86 for propname, proptype in self.user.getprops().items(): | 91 for propname, proptype in self.user.getprops().items(): |
