Changeset a0203b in indico


Ignore:
Timestamp:
02/18/10 15:54:34 (3 years ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, prov-dual-interface, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 00b052b1a13a63c5c79db7f3ad310f643651dc50
Children:
b7c7c8
Parents:
623600
git-author:
Pedro Ferreira <jose.pedro.ferreira@…> (02/18/10 15:52:56)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (02/18/10 15:54:34)
Message:

[FIX] Replaced common_timezones with all_timezones

  • introduces some "non-standard" timezones that were not available;
  • solves most problems created by timezone add/remove from the olson "standards";
  • fixes #204
Location:
indico/MaKaC
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/common/Configuration.py

    r8c65db ra0203b  
    542542        # Dont move outside, we need to call Config.getInstance() from setup.py and if 
    543543            # the system has no pytz module then the import will break 
    544         from pytz import common_timezones as Timezones 
     544        from pytz import all_timezones as Timezones 
    545545        return Timezones 
    546546 
  • indico/MaKaC/common/timerExec.py

    rc6cd5e ra0203b  
    4242from MaKaC.i18n import _ 
    4343from pytz import timezone 
    44 from pytz import common_timezones 
     44from pytz import all_timezones 
    4545 
    4646class toExec: 
     
    326326        if not tz: 
    327327            tz = self.getTimezone() 
    328         if tz not in common_timezones: 
     328        if tz not in all_timezones: 
    329329           tz = 'UTC' 
    330330        return self.getStartDate().astimezone(timezone(tz)) 
     
    340340        if not tz: 
    341341            tz = self.getTimezone() 
    342         if tz not in common_timezones: 
     342        if tz not in all_timezones: 
    343343           tz = 'UTC' 
    344344        return self.getEndDate().astimezone(timezone(tz)) 
     
    380380        if not tz: 
    381381            tz = self.getTimezone() 
    382         if tz not in common_timezones: 
     382        if tz not in all_timezones: 
    383383           tz = 'UTC' 
    384384        if self.getLastDate(): 
     
    666666        if not tz: 
    667667            tz = self.conf.getTimezone() 
    668         if tz not in common_timezones: 
     668        if tz not in all_timezones: 
    669669           tz = 'UTC' 
    670670        if self.timeBefore: 
  • indico/MaKaC/common/timezoneUtils.py

    r626e2c ra0203b  
    1 from pytz import timezone, common_timezones 
     1from pytz import timezone, all_timezones 
    22from datetime import datetime, timedelta 
    33import MaKaC.common.info as info 
     
    5757    if isinstance(tz, basestring): 
    5858        tz = timezone(tz) 
    59     if tz.zone not in common_timezones: 
     59    if tz.zone not in all_timezones: 
    6060        tz = timezone('UTC') 
    6161    return tz.localize(date).astimezone(timezone('UTC')) 
     
    6969    if isinstance(tz, basestring): 
    7070        tz = timezone(tz) 
    71     if tz.zone not in common_timezones: 
     71    if tz.zone not in all_timezones: 
    7272        tz = timezone('UTC') 
    7373    return date.astimezone(tz) 
  • indico/MaKaC/conference.py

    r046026 ra0203b  
    4141 
    4242from pytz import timezone 
    43 from pytz import common_timezones 
     43from pytz import all_timezones 
    4444 
    4545from persistent import Persistent 
     
    681681    def getTimezone(self): 
    682682        try: 
    683            if self._timezone not in common_timezones: 
     683           if self._timezone not in all_timezones: 
    684684               self.setTimezone('UTC') 
    685685           return self._timezone 
     
    29122912        if not tz: 
    29132913            tz = self.getTimezone() 
    2914         if tz not in common_timezones: 
     2914        if tz not in all_timezones: 
    29152915            tz = 'UTC' 
    29162916        return self.getStartDate().astimezone(timezone(tz)) 
     
    30203020        if not tz: 
    30213021            tz = self.getTimezone() 
    3022         if tz not in common_timezones: 
     3022        if tz not in all_timezones: 
    30233023            tz = 'UTC' 
    30243024        return self.getEndDate().astimezone(timezone(tz)) 
     
    59035903        if not tz: 
    59045904            tz = self.getConference().getTimezone() 
    5905         if tz not in common_timezones: 
     5905        if tz not in all_timezones: 
    59065906            tz = 'UTC' 
    59075907        return self.startDate.astimezone(timezone(tz)) 
     
    71827182        if not tz: 
    71837183            tz = self.getConference().getTimezone() 
    7184         if tz not in common_timezones: 
     7184        if tz not in all_timezones: 
    71857185            tz = 'UTC' 
    71867186        return self.startDate.astimezone(timezone(tz)) 
     
    71957195        if not tz: 
    71967196            tz = self.getConference().getTimezone() 
    7197         if tz not in common_timezones: 
     7197        if tz not in all_timezones: 
    71987198            tz = 'UTC' 
    71997199        if self.getEndDate(): 
     
    85938593        if not tz: 
    85948594            tz = self.getConference().getTimezone() 
    8595         if tz not in common_timezones: 
     8595        if tz not in all_timezones: 
    85968596            tz = 'UTC' 
    85978597        return self.getStartDate().astimezone(timezone(tz)) 
     
    86058605        if not tz: 
    86068606            tz = self.getConference().getTimezone() 
    8607         if tz not in common_timezones: 
     8607        if tz not in all_timezones: 
    86088608            tz = 'UTC' 
    86098609        if self.getEndDate(): 
  • indico/MaKaC/registration.py

    r046026 ra0203b  
    2323from datetime import datetime,timedelta 
    2424from pytz import timezone 
    25 from pytz import common_timezones 
     25from pytz import all_timezones 
    2626from MaKaC.common.timezoneUtils import nowutc 
    2727from persistent import Persistent 
     
    33333333        if not tz: 
    33343334            tz = self.getConference().getTimezone() 
    3335         if tz not in common_timezones: 
     3335        if tz not in all_timezones: 
    33363336            tz = 'UTC' 
    33373337        return self.getRegistrationDate().astimezone(timezone(tz)) 
  • indico/MaKaC/user.py

    r9033fd ra0203b  
    4747 
    4848#import ldap 
    49 from pytz import common_timezones 
     49from pytz import all_timezones 
    5050import httplib 
    5151import urllib 
     
    979979        tz = info.HelperMaKaCInfo.getMaKaCInfoInstance().getTimezone() 
    980980        try: 
    981             if self.timezone in common_timezones: 
     981            if self.timezone in all_timezones: 
    982982                return self.timezone 
    983983            else: 
  • indico/MaKaC/webinterface/timetable.py

    r9033fd ra0203b  
    1 # -*- coding: utf-8 -*- 
     1# -*- coding: utf-8 -*- 
    22## 
    33## $Id: timetable.py,v 1.24 2009/05/14 18:05:56 jose Exp $ 
     
    2626import pytz 
    2727from pytz import timezone 
    28 from pytz import common_timezones 
     28from pytz import all_timezones 
    2929from MaKaC.errors import MaKaCError 
    3030 
     
    10221022        if not tz: 
    10231023            tz = self.getTimezone() 
    1024         if tz not in common_timezones: 
     1024        if tz not in all_timezones: 
    10251025           tz = 'UTC' 
    10261026        return self.getStartDate().astimezone(timezone(tz)) 
     
    10291029        if not tz: 
    10301030            tz = self.getTimezone() 
    1031         if tz not in common_timezones: 
     1031        if tz not in all_timezones: 
    10321032           tz = 'UTC' 
    10331033        return self.getStartDate().astimezone(timezone(tz)) 
     
    10601060        if not tz: 
    10611061            tz = self.getTimezone() 
    1062         if tz not in common_timezones: 
     1062        if tz not in all_timezones: 
    10631063           tz = 'UTC' 
    10641064        return self.getStartDate().astimezone(timezone(tz)) 
     
    10671067        if not tz: 
    10681068            tz = self.getTimezone() 
    1069         if tz not in common_timezones: 
     1069        if tz not in all_timezones: 
    10701070           tz = 'UTC' 
    10711071        return self.getStartDate().astimezone(timezone(tz)) 
Note: See TracChangeset for help on using the changeset viewer.