~ubuntu-branches/ubuntu/natty/python-tz/natty-proposed

« back to all changes in this revision

Viewing changes to pytz/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2010-01-27 18:33:59 UTC
  • mfrom: (1.1.17 upstream) (2.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20100127183359-7vxnxgzl5ysokzue
Tags: 2010b-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
'''
10
10
 
11
11
# The Olson database is updated several times a year.
12
 
OLSON_VERSION = '2009u'
 
12
OLSON_VERSION = '2010b'
13
13
VERSION = OLSON_VERSION
14
14
# Version format for a patch release - only one so far.
15
15
#VERSION = OLSON_VERSION + '.2'
50
50
    Uses the pkg_resources module if available and no standard file
51
51
    found at the calculated location.
52
52
    """
53
 
    # Patched in Debian, use the system zoninfo from the tzdata package
54
53
    name_parts = name.lstrip('/').split('/')
55
54
    for part in name_parts:
56
55
        if part == os.path.pardir or os.path.sep in part:
57
56
            raise ValueError('Bad path segment: %r' % part)
58
 
    filename = os.path.join('/usr/share/zoneinfo', *name_parts)
 
57
    filename = os.path.join(os.path.dirname(__file__),
 
58
                            'zoneinfo', *name_parts)
 
59
    if not os.path.exists(filename) and resource_stream is not None:
 
60
        # http://bugs.launchpad.net/bugs/383171 - we avoid using this
 
61
        # unless absolutely necessary to help when a broken version of
 
62
        # pkg_resources is installed.
 
63
        return resource_stream(__name__, 'zoneinfo/' + name)
59
64
    return open(filename, 'rb')
60
65
 
61
66
 
593
598
 'America/Manaus',
594
599
 'America/Marigot',
595
600
 'America/Martinique',
 
601
 'America/Matamoros',
596
602
 'America/Mazatlan',
597
603
 'America/Mendoza',
598
604
 'America/Menominee',
611
617
 'America/Noronha',
612
618
 'America/North_Dakota/Center',
613
619
 'America/North_Dakota/New_Salem',
 
620
 'America/Ojinaga',
614
621
 'America/Panama',
615
622
 'America/Pangnirtung',
616
623
 'America/Paramaribo',
627
634
 'America/Resolute',
628
635
 'America/Rio_Branco',
629
636
 'America/Rosario',
 
637
 'America/Santa_Isabel',
630
638
 'America/Santarem',
631
639
 'America/Santiago',
632
640
 'America/Santo_Domingo',
1143
1151
 'America/Managua',
1144
1152
 'America/Manaus',
1145
1153
 'America/Martinique',
 
1154
 'America/Matamoros',
1146
1155
 'America/Mazatlan',
1147
1156
 'America/Menominee',
1148
1157
 'America/Merida',
1160
1169
 'America/Noronha',
1161
1170
 'America/North_Dakota/Center',
1162
1171
 'America/North_Dakota/New_Salem',
 
1172
 'America/Ojinaga',
1163
1173
 'America/Panama',
1164
1174
 'America/Pangnirtung',
1165
1175
 'America/Paramaribo',
1174
1184
 'America/Regina',
1175
1185
 'America/Resolute',
1176
1186
 'America/Rio_Branco',
 
1187
 'America/Santa_Isabel',
1177
1188
 'America/Santarem',
1178
1189
 'America/Santiago',
1179
1190
 'America/Santo_Domingo',
1303
1314
 'Australia/Melbourne',
1304
1315
 'Australia/Perth',
1305
1316
 'Australia/Sydney',
 
1317
 'Canada/Atlantic',
 
1318
 'Canada/Central',
 
1319
 'Canada/Eastern',
 
1320
 'Canada/Mountain',
 
1321
 'Canada/Newfoundland',
 
1322
 'Canada/Pacific',
1306
1323
 'Europe/Amsterdam',
1307
1324
 'Europe/Andorra',
1308
1325
 'Europe/Athens',