Browse Source

[desktop] Upgrade pytz to 2014.10

Erick Tryzelaar 10 năm trước cách đây
mục cha
commit
fe821ca
100 tập tin đã thay đổi với 0 bổ sung4066 xóa
  1. 0 5
      desktop/core/ext-py/pytz-2013.9/MANIFEST.in
  2. 0 578
      desktop/core/ext-py/pytz-2013.9/PKG-INFO
  3. 0 558
      desktop/core/ext-py/pytz-2013.9/README.txt
  4. 0 1508
      desktop/core/ext-py/pytz-2013.9/pytz/__init__.py
  5. 0 36
      desktop/core/ext-py/pytz-2013.9/pytz/tests/test_docs.py
  6. 0 818
      desktop/core/ext-py/pytz-2013.9/pytz/tests/test_tzinfo.py
  7. 0 563
      desktop/core/ext-py/pytz-2013.9/pytz/tzinfo.py
  8. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Abidjan
  9. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Accra
  10. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Addis_Ababa
  11. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Algiers
  12. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Asmara
  13. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Asmera
  14. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Bamako
  15. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Bangui
  16. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Banjul
  17. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Bissau
  18. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Blantyre
  19. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Brazzaville
  20. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Bujumbura
  21. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Cairo
  22. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Casablanca
  23. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Ceuta
  24. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Conakry
  25. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Dakar
  26. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Dar_es_Salaam
  27. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Djibouti
  28. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Douala
  29. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/El_Aaiun
  30. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Freetown
  31. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Gaborone
  32. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Harare
  33. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Johannesburg
  34. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Juba
  35. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Kampala
  36. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Khartoum
  37. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Kigali
  38. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Kinshasa
  39. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Lagos
  40. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Libreville
  41. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Lome
  42. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Luanda
  43. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Lubumbashi
  44. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Lusaka
  45. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Malabo
  46. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Maputo
  47. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Maseru
  48. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Mbabane
  49. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Mogadishu
  50. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Monrovia
  51. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Nairobi
  52. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Ndjamena
  53. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Niamey
  54. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Nouakchott
  55. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Ouagadougou
  56. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Porto-Novo
  57. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Sao_Tome
  58. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Timbuktu
  59. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Tripoli
  60. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Tunis
  61. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Windhoek
  62. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Adak
  63. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Anguilla
  64. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Antigua
  65. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Araguaina
  66. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/Buenos_Aires
  67. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/ComodRivadavia
  68. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/Cordoba
  69. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/Jujuy
  70. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/Rio_Gallegos
  71. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/Salta
  72. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/San_Luis
  73. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/Ushuaia
  74. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Aruba
  75. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Asuncion
  76. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Atikokan
  77. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Atka
  78. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Bahia
  79. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Bahia_Banderas
  80. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Barbados
  81. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Belem
  82. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Belize
  83. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Blanc-Sablon
  84. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Boa_Vista
  85. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Bogota
  86. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Buenos_Aires
  87. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Campo_Grande
  88. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Cancun
  89. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Caracas
  90. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Cayenne
  91. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Cayman
  92. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Chicago
  93. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Chihuahua
  94. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Coral_Harbour
  95. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Costa_Rica
  96. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Creston
  97. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Cuiaba
  98. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Curacao
  99. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Danmarkshavn
  100. BIN
      desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Dawson_Creek

+ 0 - 5
desktop/core/ext-py/pytz-2013.9/MANIFEST.in

@@ -1,5 +0,0 @@
-include *.txt setup.py
-recursive-include pytz *.py
-recursive-include pytz *.pot
-graft pytz/zoneinfo
-exclude test_zdump.py

+ 0 - 578
desktop/core/ext-py/pytz-2013.9/PKG-INFO

@@ -1,578 +0,0 @@
-Metadata-Version: 1.1
-Name: pytz
-Version: 2013.9
-Summary: World timezone definitions, modern and historical
-Home-page: http://pythonhosted.org/pytz
-Author: Stuart Bishop
-Author-email: stuart@stuartbishop.net
-License: MIT
-Download-URL: http://pypi.python.org/pypi/pytz
-Description: pytz - World Timezone Definitions for Python
-        ============================================
-        
-        :Author: Stuart Bishop <stuart@stuartbishop.net>
-        
-        Introduction
-        ~~~~~~~~~~~~
-        
-        pytz brings the Olson tz database into Python. This library allows
-        accurate and cross platform timezone calculations using Python 2.4
-        or higher. It also solves the issue of ambiguous times at the end
-        of daylight savings, which you can read more about in the Python
-        Library Reference (``datetime.tzinfo``).
-        
-        Almost all of the Olson timezones are supported.
-        
-        .. note::
-        
-            This library differs from the documented Python API for
-            tzinfo implementations; if you want to create local wallclock
-            times you need to use the ``localize()`` method documented in this
-            document. In addition, if you perform date arithmetic on local
-            times that cross DST boundaries, the result may be in an incorrect
-            timezone (ie. subtract 1 minute from 2002-10-27 1:00 EST and you get
-            2002-10-27 0:59 EST instead of the correct 2002-10-27 1:59 EDT). A
-            ``normalize()`` method is provided to correct this. Unfortunately these
-            issues cannot be resolved without modifying the Python datetime
-            implementation (see PEP-431).
-        
-        
-        Installation
-        ~~~~~~~~~~~~
-        
-        This package can either be installed from a .egg file using setuptools,
-        or from the tarball using the standard Python distutils.
-        
-        If you are installing from a tarball, run the following command as an
-        administrative user::
-        
-            python setup.py install
-        
-        If you are installing using setuptools, you don't even need to download
-        anything as the latest version will be downloaded for you
-        from the Python package index::
-        
-            easy_install --upgrade pytz
-        
-        If you already have the .egg file, you can use that too::
-        
-            easy_install pytz-2008g-py2.6.egg
-        
-        
-        Example & Usage
-        ~~~~~~~~~~~~~~~
-        
-        Localized times and date arithmetic
-        -----------------------------------
-        
-        >>> from datetime import datetime, timedelta
-        >>> from pytz import timezone
-        >>> import pytz
-        >>> utc = pytz.utc
-        >>> utc.zone
-        'UTC'
-        >>> eastern = timezone('US/Eastern')
-        >>> eastern.zone
-        'US/Eastern'
-        >>> amsterdam = timezone('Europe/Amsterdam')
-        >>> fmt = '%Y-%m-%d %H:%M:%S %Z%z'
-        
-        This library only supports two ways of building a localized time. The
-        first is to use the ``localize()`` method provided by the pytz library.
-        This is used to localize a naive datetime (datetime with no timezone
-        information):
-        
-        >>> loc_dt = eastern.localize(datetime(2002, 10, 27, 6, 0, 0))
-        >>> print(loc_dt.strftime(fmt))
-        2002-10-27 06:00:00 EST-0500
-        
-        The second way of building a localized time is by converting an existing
-        localized time using the standard ``astimezone()`` method:
-        
-        >>> ams_dt = loc_dt.astimezone(amsterdam)
-        >>> ams_dt.strftime(fmt)
-        '2002-10-27 12:00:00 CET+0100'
-        
-        Unfortunately using the tzinfo argument of the standard datetime
-        constructors ''does not work'' with pytz for many timezones.
-        
-        >>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=amsterdam).strftime(fmt)
-        '2002-10-27 12:00:00 AMT+0020'
-        
-        It is safe for timezones without daylight savings trasitions though, such
-        as UTC:
-        
-        >>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=pytz.utc).strftime(fmt)
-        '2002-10-27 12:00:00 UTC+0000'
-        
-        The preferred way of dealing with times is to always work in UTC,
-        converting to localtime only when generating output to be read
-        by humans.
-        
-        >>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc)
-        >>> loc_dt = utc_dt.astimezone(eastern)
-        >>> loc_dt.strftime(fmt)
-        '2002-10-27 01:00:00 EST-0500'
-        
-        This library also allows you to do date arithmetic using local
-        times, although it is more complicated than working in UTC as you
-        need to use the ``normalize()`` method to handle daylight savings time
-        and other timezone transitions. In this example, ``loc_dt`` is set
-        to the instant when daylight savings time ends in the US/Eastern
-        timezone.
-        
-        >>> before = loc_dt - timedelta(minutes=10)
-        >>> before.strftime(fmt)
-        '2002-10-27 00:50:00 EST-0500'
-        >>> eastern.normalize(before).strftime(fmt)
-        '2002-10-27 01:50:00 EDT-0400'
-        >>> after = eastern.normalize(before + timedelta(minutes=20))
-        >>> after.strftime(fmt)
-        '2002-10-27 01:10:00 EST-0500'
-        
-        Creating local times is also tricky, and the reason why working with
-        local times is not recommended. Unfortunately, you cannot just pass
-        a ``tzinfo`` argument when constructing a datetime (see the next
-        section for more details)
-        
-        >>> dt = datetime(2002, 10, 27, 1, 30, 0)
-        >>> dt1 = eastern.localize(dt, is_dst=True)
-        >>> dt1.strftime(fmt)
-        '2002-10-27 01:30:00 EDT-0400'
-        >>> dt2 = eastern.localize(dt, is_dst=False)
-        >>> dt2.strftime(fmt)
-        '2002-10-27 01:30:00 EST-0500'
-        
-        Converting between timezones also needs special attention. We also need
-        to use the ``normalize()`` method to ensure the conversion is correct.
-        
-        >>> utc_dt = utc.localize(datetime.utcfromtimestamp(1143408899))
-        >>> utc_dt.strftime(fmt)
-        '2006-03-26 21:34:59 UTC+0000'
-        >>> au_tz = timezone('Australia/Sydney')
-        >>> au_dt = au_tz.normalize(utc_dt.astimezone(au_tz))
-        >>> au_dt.strftime(fmt)
-        '2006-03-27 08:34:59 EST+1100'
-        >>> utc_dt2 = utc.normalize(au_dt.astimezone(utc))
-        >>> utc_dt2.strftime(fmt)
-        '2006-03-26 21:34:59 UTC+0000'
-        
-        You can take shortcuts when dealing with the UTC side of timezone
-        conversions. ``normalize()`` and ``localize()`` are not really
-        necessary when there are no daylight savings time transitions to
-        deal with.
-        
-        >>> utc_dt = datetime.utcfromtimestamp(1143408899).replace(tzinfo=utc)
-        >>> utc_dt.strftime(fmt)
-        '2006-03-26 21:34:59 UTC+0000'
-        >>> au_tz = timezone('Australia/Sydney')
-        >>> au_dt = au_tz.normalize(utc_dt.astimezone(au_tz))
-        >>> au_dt.strftime(fmt)
-        '2006-03-27 08:34:59 EST+1100'
-        >>> utc_dt2 = au_dt.astimezone(utc)
-        >>> utc_dt2.strftime(fmt)
-        '2006-03-26 21:34:59 UTC+0000'
-        
-        
-        ``tzinfo`` API
-        --------------
-        
-        The ``tzinfo`` instances returned by the ``timezone()`` function have
-        been extended to cope with ambiguous times by adding an ``is_dst``
-        parameter to the ``utcoffset()``, ``dst()`` && ``tzname()`` methods.
-        
-        >>> tz = timezone('America/St_Johns')
-        
-        >>> normal = datetime(2009, 9, 1)
-        >>> ambiguous = datetime(2009, 10, 31, 23, 30)
-        
-        The ``is_dst`` parameter is ignored for most timestamps. It is only used
-        during DST transition ambiguous periods to resulve that ambiguity.
-        
-        >>> tz.utcoffset(normal, is_dst=True)
-        datetime.timedelta(-1, 77400)
-        >>> tz.dst(normal, is_dst=True)
-        datetime.timedelta(0, 3600)
-        >>> tz.tzname(normal, is_dst=True)
-        'NDT'
-        
-        >>> tz.utcoffset(ambiguous, is_dst=True)
-        datetime.timedelta(-1, 77400)
-        >>> tz.dst(ambiguous, is_dst=True)
-        datetime.timedelta(0, 3600)
-        >>> tz.tzname(ambiguous, is_dst=True)
-        'NDT'
-        
-        >>> tz.utcoffset(normal, is_dst=False)
-        datetime.timedelta(-1, 77400)
-        >>> tz.dst(normal, is_dst=False)
-        datetime.timedelta(0, 3600)
-        >>> tz.tzname(normal, is_dst=False)
-        'NDT'
-        
-        >>> tz.utcoffset(ambiguous, is_dst=False)
-        datetime.timedelta(-1, 73800)
-        >>> tz.dst(ambiguous, is_dst=False)
-        datetime.timedelta(0)
-        >>> tz.tzname(ambiguous, is_dst=False)
-        'NST'
-        
-        If ``is_dst`` is not specified, ambiguous timestamps will raise
-        an ``pytz.exceptions.AmbiguousTimeError`` exception.
-        
-        >>> tz.utcoffset(normal)
-        datetime.timedelta(-1, 77400)
-        >>> tz.dst(normal)
-        datetime.timedelta(0, 3600)
-        >>> tz.tzname(normal)
-        'NDT'
-        
-        >>> import pytz.exceptions
-        >>> try:
-        ...     tz.utcoffset(ambiguous)
-        ... except pytz.exceptions.AmbiguousTimeError:
-        ...     print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous)
-        pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00
-        >>> try:
-        ...     tz.dst(ambiguous)
-        ... except pytz.exceptions.AmbiguousTimeError:
-        ...     print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous)
-        pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00
-        >>> try:
-        ...     tz.tzname(ambiguous)
-        ... except pytz.exceptions.AmbiguousTimeError:
-        ...     print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous)
-        pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00
-        
-        
-        Problems with Localtime
-        ~~~~~~~~~~~~~~~~~~~~~~~
-        
-        The major problem we have to deal with is that certain datetimes
-        may occur twice in a year. For example, in the US/Eastern timezone
-        on the last Sunday morning in October, the following sequence
-        happens:
-        
-            - 01:00 EDT occurs
-            - 1 hour later, instead of 2:00am the clock is turned back 1 hour
-              and 01:00 happens again (this time 01:00 EST)
-        
-        In fact, every instant between 01:00 and 02:00 occurs twice. This means
-        that if you try and create a time in the 'US/Eastern' timezone using
-        the standard datetime syntax, there is no way to specify if you meant
-        before of after the end-of-daylight-savings-time transition.
-        
-        >>> loc_dt = datetime(2002, 10, 27, 1, 30, 00, tzinfo=eastern)
-        >>> loc_dt.strftime(fmt)
-        '2002-10-27 01:30:00 EST-0500'
-        
-        As you can see, the system has chosen one for you and there is a 50%
-        chance of it being out by one hour. For some applications, this does
-        not matter. However, if you are trying to schedule meetings with people
-        in different timezones or analyze log files it is not acceptable. 
-        
-        The best and simplest solution is to stick with using UTC.  The pytz
-        package encourages using UTC for internal timezone representation by
-        including a special UTC implementation based on the standard Python
-        reference implementation in the Python documentation.
-        
-        The UTC timezone unpickles to be the same instance, and pickles to a
-        smaller size than other pytz tzinfo instances.  The UTC implementation
-        can be obtained as pytz.utc, pytz.UTC, or pytz.timezone('UTC').
-        
-        >>> import pickle, pytz
-        >>> dt = datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc)
-        >>> naive = dt.replace(tzinfo=None)
-        >>> p = pickle.dumps(dt, 1)
-        >>> naive_p = pickle.dumps(naive, 1)
-        >>> len(p) - len(naive_p)
-        17
-        >>> new = pickle.loads(p)
-        >>> new == dt
-        True
-        >>> new is dt
-        False
-        >>> new.tzinfo is dt.tzinfo
-        True
-        >>> pytz.utc is pytz.UTC is pytz.timezone('UTC')
-        True
-        
-        Note that this instance is not the same instance (or implementation) as
-        other timezones with the same meaning (GMT, Greenwich, Universal, etc.).
-        
-        >>> utc is pytz.timezone('GMT')
-        False
-        
-        If you insist on working with local times, this library provides a
-        facility for constructing them unambiguously:
-        
-        >>> loc_dt = datetime(2002, 10, 27, 1, 30, 00)
-        >>> est_dt = eastern.localize(loc_dt, is_dst=True)
-        >>> edt_dt = eastern.localize(loc_dt, is_dst=False)
-        >>> print(est_dt.strftime(fmt) + ' / ' + edt_dt.strftime(fmt))
-        2002-10-27 01:30:00 EDT-0400 / 2002-10-27 01:30:00 EST-0500
-        
-        If you pass None as the is_dst flag to localize(), pytz will refuse to
-        guess and raise exceptions if you try to build ambiguous or non-existent
-        times.
-        
-        For example, 1:30am on 27th Oct 2002 happened twice in the US/Eastern
-        timezone when the clocks where put back at the end of Daylight Savings
-        Time:
-        
-        >>> dt = datetime(2002, 10, 27, 1, 30, 00)
-        >>> try:
-        ...     eastern.localize(dt, is_dst=None)
-        ... except pytz.exceptions.AmbiguousTimeError:
-        ...     print('pytz.exceptions.AmbiguousTimeError: %s' % dt)
-        pytz.exceptions.AmbiguousTimeError: 2002-10-27 01:30:00
-        
-        Similarly, 2:30am on 7th April 2002 never happened at all in the
-        US/Eastern timezone, as the clocks where put forward at 2:00am skipping
-        the entire hour:
-        
-        >>> dt = datetime(2002, 4, 7, 2, 30, 00)
-        >>> try:
-        ...     eastern.localize(dt, is_dst=None)
-        ... except pytz.exceptions.NonExistentTimeError:
-        ...     print('pytz.exceptions.NonExistentTimeError: %s' % dt)
-        pytz.exceptions.NonExistentTimeError: 2002-04-07 02:30:00
-        
-        Both of these exceptions share a common base class to make error handling
-        easier:
-        
-        >>> isinstance(pytz.AmbiguousTimeError(), pytz.InvalidTimeError)
-        True
-        >>> isinstance(pytz.NonExistentTimeError(), pytz.InvalidTimeError)
-        True
-        
-        Although ``localize()`` handles many cases, it is still not possible
-        to handle all. In cases where countries change their timezone definitions,
-        cases like the end-of-daylight-savings-time occur with no way of resolving
-        the ambiguity. For example, in 1915 Warsaw switched from Warsaw time to
-        Central European time. So at the stroke of midnight on August 5th 1915
-        the clocks were wound back 24 minutes creating an ambiguous time period
-        that cannot be specified without referring to the timezone abbreviation
-        or the actual UTC offset. In this case midnight happened twice, neither
-        time during a daylight savings time period:
-        
-        >>> warsaw = pytz.timezone('Europe/Warsaw')
-        >>> loc_dt1 = warsaw.localize(datetime(1915, 8, 4, 23, 59, 59), is_dst=False)
-        >>> loc_dt1.strftime(fmt)
-        '1915-08-04 23:59:59 WMT+0124'
-        >>> loc_dt2 = warsaw.localize(datetime(1915, 8, 5, 00, 00, 00), is_dst=False)
-        >>> loc_dt2.strftime(fmt)
-        '1915-08-05 00:00:00 CET+0100'
-        >>> str(loc_dt2 - loc_dt1)
-        '0:24:01'
-        
-        The only way of creating a time during the missing 24 minutes is
-        converting from another timezone - because neither of the timezones
-        involved where in daylight savings mode the API simply provides no way
-        to express it:
-        
-        >>> utc_dt = datetime(1915, 8, 4, 22, 36, tzinfo=pytz.utc)
-        >>> utc_dt.astimezone(warsaw).strftime(fmt)
-        '1915-08-04 23:36:00 CET+0100'
-        
-        The standard Python way of handling all these ambiguities is not to
-        handle them, such as demonstrated in this example using the US/Eastern
-        timezone definition from the Python documentation (Note that this
-        implementation only works for dates between 1987 and 2006 - it is
-        included for tests only!):
-        
-        >>> from pytz.reference import Eastern # pytz.reference only for tests
-        >>> dt = datetime(2002, 10, 27, 0, 30, tzinfo=Eastern)
-        >>> str(dt)
-        '2002-10-27 00:30:00-04:00'
-        >>> str(dt + timedelta(hours=1))
-        '2002-10-27 01:30:00-05:00'
-        >>> str(dt + timedelta(hours=2))
-        '2002-10-27 02:30:00-05:00'
-        >>> str(dt + timedelta(hours=3))
-        '2002-10-27 03:30:00-05:00'
-        
-        Notice the first two results? At first glance you might think they are
-        correct, but taking the UTC offset into account you find that they are
-        actually two hours appart instead of the 1 hour we asked for.
-        
-        >>> from pytz.reference import UTC # pytz.reference only for tests
-        >>> str(dt.astimezone(UTC))
-        '2002-10-27 04:30:00+00:00'
-        >>> str((dt + timedelta(hours=1)).astimezone(UTC))
-        '2002-10-27 06:30:00+00:00'
-        
-        
-        Country Information
-        ~~~~~~~~~~~~~~~~~~~
-        
-        A mechanism is provided to access the timezones commonly in use
-        for a particular country, looked up using the ISO 3166 country code.
-        It returns a list of strings that can be used to retrieve the relevant
-        tzinfo instance using ``pytz.timezone()``:
-        
-        >>> print(' '.join(pytz.country_timezones['nz']))
-        Pacific/Auckland Pacific/Chatham
-        
-        The Olson database comes with a ISO 3166 country code to English country
-        name mapping that pytz exposes as a dictionary:
-        
-        >>> print(pytz.country_names['nz'])
-        New Zealand
-        
-        
-        What is UTC
-        ~~~~~~~~~~~
-        
-        'UTC' is Universal Time, also known as Greenwich Mean Time or GMT
-        in the United Kingdom. All other timezones are given as offsets from
-        UTC. No daylight savings time occurs in UTC, making it a useful timezone
-        to perform date arithmetic without worrying about the confusion and
-        ambiguities caused by daylight savings time transitions, your country
-        changing its timezone, or mobile computers that move roam through
-        multiple timezones.
-        
-        
-        Helpers
-        ~~~~~~~
-        
-        There are two lists of timezones provided.
-        
-        ``all_timezones`` is the exhaustive list of the timezone names that can
-        be used.
-        
-        >>> from pytz import all_timezones
-        >>> len(all_timezones) >= 500
-        True
-        >>> 'Etc/Greenwich' in all_timezones
-        True
-        
-        ``common_timezones`` is a list of useful, current timezones. It doesn't
-        contain deprecated zones or historical zones, except for a few I've
-        deemed in common usage, such as US/Eastern (open a bug report if you
-        think other timezones are deserving of being included here). It is also
-        a sequence of strings.
-        
-        >>> from pytz import common_timezones
-        >>> len(common_timezones) < len(all_timezones)
-        True
-        >>> 'Etc/Greenwich' in common_timezones
-        False
-        >>> 'Australia/Melbourne' in common_timezones
-        True
-        >>> 'US/Eastern' in common_timezones
-        True
-        >>> 'Canada/Eastern' in common_timezones
-        True
-        >>> 'US/Pacific-New' in all_timezones
-        True
-        >>> 'US/Pacific-New' in common_timezones
-        False
-        
-        Both ``common_timezones`` and ``all_timezones`` are alphabetically
-        sorted:
-        
-        >>> common_timezones_dupe = common_timezones[:]
-        >>> common_timezones_dupe.sort()
-        >>> common_timezones == common_timezones_dupe
-        True
-        >>> all_timezones_dupe = all_timezones[:]
-        >>> all_timezones_dupe.sort()
-        >>> all_timezones == all_timezones_dupe
-        True
-        
-        ``all_timezones`` and ``common_timezones`` are also available as sets.
-        
-        >>> from pytz import all_timezones_set, common_timezones_set
-        >>> 'US/Eastern' in all_timezones_set
-        True
-        >>> 'US/Eastern' in common_timezones_set
-        True
-        >>> 'Australia/Victoria' in common_timezones_set
-        False
-        
-        You can also retrieve lists of timezones used by particular countries
-        using the ``country_timezones()`` function. It requires an ISO-3166
-        two letter country code.
-        
-        >>> from pytz import country_timezones
-        >>> print(' '.join(country_timezones('ch')))
-        Europe/Zurich
-        >>> print(' '.join(country_timezones('CH')))
-        Europe/Zurich
-        
-        
-        License
-        ~~~~~~~
-        
-        MIT license.
-        
-        This code is also available as part of Zope 3 under the Zope Public
-        License,  Version 2.1 (ZPL).
-        
-        I'm happy to relicense this code if necessary for inclusion in other
-        open source projects.
-        
-        
-        Latest Versions
-        ~~~~~~~~~~~~~~~
-        
-        This package will be updated after releases of the Olson timezone
-        database.  The latest version can be downloaded from the `Python Package
-        Index <http://pypi.python.org/pypi/pytz/>`_.  The code that is used
-        to generate this distribution is hosted on launchpad.net and available
-        using the `Bazaar version control system <http://bazaar-vcs.org>`_
-        using::
-        
-            bzr branch lp:pytz
-        
-        Announcements of new releases are made on
-        `Launchpad <https://launchpad.net/pytz>`_, and the
-        `Atom feed <http://feeds.launchpad.net/pytz/announcements.atom>`_
-        hosted there.
-        
-        
-        Bugs, Feature Requests & Patches
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-        
-        Bugs can be reported using `Launchpad <https://bugs.launchpad.net/pytz>`_.
-        
-        
-        Issues & Limitations
-        ~~~~~~~~~~~~~~~~~~~~
-        
-        - Offsets from UTC are rounded to the nearest whole minute, so timezones
-          such as Europe/Amsterdam pre 1937 will be up to 30 seconds out. This
-          is a limitation of the Python datetime library.
-        
-        - If you think a timezone definition is incorrect, I probably can't fix
-          it. pytz is a direct translation of the Olson timezone database, and
-          changes to the timezone definitions need to be made to this source.
-          If you find errors they should be reported to the time zone mailing
-          list, linked from http://www.iana.org/time-zones.
-        
-        
-        Further Reading
-        ~~~~~~~~~~~~~~~
-        
-        More info than you want to know about timezones:
-        http://www.twinsun.com/tz/tz-link.htm
-        
-        
-        Contact
-        ~~~~~~~
-        
-        Stuart Bishop <stuart@stuartbishop.net>
-        
-        
-        
-Keywords: timezone,tzinfo,datetime,olson,time
-Platform: Independant
-Classifier: Development Status :: 6 - Mature
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Natural Language :: English
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 3
-Classifier: Topic :: Software Development :: Libraries :: Python Modules

+ 0 - 558
desktop/core/ext-py/pytz-2013.9/README.txt

@@ -1,558 +0,0 @@
-pytz - World Timezone Definitions for Python
-============================================
-
-:Author: Stuart Bishop <stuart@stuartbishop.net>
-
-Introduction
-~~~~~~~~~~~~
-
-pytz brings the Olson tz database into Python. This library allows
-accurate and cross platform timezone calculations using Python 2.4
-or higher. It also solves the issue of ambiguous times at the end
-of daylight savings, which you can read more about in the Python
-Library Reference (``datetime.tzinfo``).
-
-Almost all of the Olson timezones are supported.
-
-.. note::
-
-    This library differs from the documented Python API for
-    tzinfo implementations; if you want to create local wallclock
-    times you need to use the ``localize()`` method documented in this
-    document. In addition, if you perform date arithmetic on local
-    times that cross DST boundaries, the result may be in an incorrect
-    timezone (ie. subtract 1 minute from 2002-10-27 1:00 EST and you get
-    2002-10-27 0:59 EST instead of the correct 2002-10-27 1:59 EDT). A
-    ``normalize()`` method is provided to correct this. Unfortunately these
-    issues cannot be resolved without modifying the Python datetime
-    implementation (see PEP-431).
-
-
-Installation
-~~~~~~~~~~~~
-
-This package can either be installed from a .egg file using setuptools,
-or from the tarball using the standard Python distutils.
-
-If you are installing from a tarball, run the following command as an
-administrative user::
-
-    python setup.py install
-
-If you are installing using setuptools, you don't even need to download
-anything as the latest version will be downloaded for you
-from the Python package index::
-
-    easy_install --upgrade pytz
-
-If you already have the .egg file, you can use that too::
-
-    easy_install pytz-2008g-py2.6.egg
-
-
-Example & Usage
-~~~~~~~~~~~~~~~
-
-Localized times and date arithmetic
------------------------------------
-
->>> from datetime import datetime, timedelta
->>> from pytz import timezone
->>> import pytz
->>> utc = pytz.utc
->>> utc.zone
-'UTC'
->>> eastern = timezone('US/Eastern')
->>> eastern.zone
-'US/Eastern'
->>> amsterdam = timezone('Europe/Amsterdam')
->>> fmt = '%Y-%m-%d %H:%M:%S %Z%z'
-
-This library only supports two ways of building a localized time. The
-first is to use the ``localize()`` method provided by the pytz library.
-This is used to localize a naive datetime (datetime with no timezone
-information):
-
->>> loc_dt = eastern.localize(datetime(2002, 10, 27, 6, 0, 0))
->>> print(loc_dt.strftime(fmt))
-2002-10-27 06:00:00 EST-0500
-
-The second way of building a localized time is by converting an existing
-localized time using the standard ``astimezone()`` method:
-
->>> ams_dt = loc_dt.astimezone(amsterdam)
->>> ams_dt.strftime(fmt)
-'2002-10-27 12:00:00 CET+0100'
-
-Unfortunately using the tzinfo argument of the standard datetime
-constructors ''does not work'' with pytz for many timezones.
-
->>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=amsterdam).strftime(fmt)
-'2002-10-27 12:00:00 AMT+0020'
-
-It is safe for timezones without daylight savings trasitions though, such
-as UTC:
-
->>> datetime(2002, 10, 27, 12, 0, 0, tzinfo=pytz.utc).strftime(fmt)
-'2002-10-27 12:00:00 UTC+0000'
-
-The preferred way of dealing with times is to always work in UTC,
-converting to localtime only when generating output to be read
-by humans.
-
->>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc)
->>> loc_dt = utc_dt.astimezone(eastern)
->>> loc_dt.strftime(fmt)
-'2002-10-27 01:00:00 EST-0500'
-
-This library also allows you to do date arithmetic using local
-times, although it is more complicated than working in UTC as you
-need to use the ``normalize()`` method to handle daylight savings time
-and other timezone transitions. In this example, ``loc_dt`` is set
-to the instant when daylight savings time ends in the US/Eastern
-timezone.
-
->>> before = loc_dt - timedelta(minutes=10)
->>> before.strftime(fmt)
-'2002-10-27 00:50:00 EST-0500'
->>> eastern.normalize(before).strftime(fmt)
-'2002-10-27 01:50:00 EDT-0400'
->>> after = eastern.normalize(before + timedelta(minutes=20))
->>> after.strftime(fmt)
-'2002-10-27 01:10:00 EST-0500'
-
-Creating local times is also tricky, and the reason why working with
-local times is not recommended. Unfortunately, you cannot just pass
-a ``tzinfo`` argument when constructing a datetime (see the next
-section for more details)
-
->>> dt = datetime(2002, 10, 27, 1, 30, 0)
->>> dt1 = eastern.localize(dt, is_dst=True)
->>> dt1.strftime(fmt)
-'2002-10-27 01:30:00 EDT-0400'
->>> dt2 = eastern.localize(dt, is_dst=False)
->>> dt2.strftime(fmt)
-'2002-10-27 01:30:00 EST-0500'
-
-Converting between timezones also needs special attention. We also need
-to use the ``normalize()`` method to ensure the conversion is correct.
-
->>> utc_dt = utc.localize(datetime.utcfromtimestamp(1143408899))
->>> utc_dt.strftime(fmt)
-'2006-03-26 21:34:59 UTC+0000'
->>> au_tz = timezone('Australia/Sydney')
->>> au_dt = au_tz.normalize(utc_dt.astimezone(au_tz))
->>> au_dt.strftime(fmt)
-'2006-03-27 08:34:59 EST+1100'
->>> utc_dt2 = utc.normalize(au_dt.astimezone(utc))
->>> utc_dt2.strftime(fmt)
-'2006-03-26 21:34:59 UTC+0000'
-
-You can take shortcuts when dealing with the UTC side of timezone
-conversions. ``normalize()`` and ``localize()`` are not really
-necessary when there are no daylight savings time transitions to
-deal with.
-
->>> utc_dt = datetime.utcfromtimestamp(1143408899).replace(tzinfo=utc)
->>> utc_dt.strftime(fmt)
-'2006-03-26 21:34:59 UTC+0000'
->>> au_tz = timezone('Australia/Sydney')
->>> au_dt = au_tz.normalize(utc_dt.astimezone(au_tz))
->>> au_dt.strftime(fmt)
-'2006-03-27 08:34:59 EST+1100'
->>> utc_dt2 = au_dt.astimezone(utc)
->>> utc_dt2.strftime(fmt)
-'2006-03-26 21:34:59 UTC+0000'
-
-
-``tzinfo`` API
---------------
-
-The ``tzinfo`` instances returned by the ``timezone()`` function have
-been extended to cope with ambiguous times by adding an ``is_dst``
-parameter to the ``utcoffset()``, ``dst()`` && ``tzname()`` methods.
-
->>> tz = timezone('America/St_Johns')
-
->>> normal = datetime(2009, 9, 1)
->>> ambiguous = datetime(2009, 10, 31, 23, 30)
-
-The ``is_dst`` parameter is ignored for most timestamps. It is only used
-during DST transition ambiguous periods to resulve that ambiguity.
-
->>> tz.utcoffset(normal, is_dst=True)
-datetime.timedelta(-1, 77400)
->>> tz.dst(normal, is_dst=True)
-datetime.timedelta(0, 3600)
->>> tz.tzname(normal, is_dst=True)
-'NDT'
-
->>> tz.utcoffset(ambiguous, is_dst=True)
-datetime.timedelta(-1, 77400)
->>> tz.dst(ambiguous, is_dst=True)
-datetime.timedelta(0, 3600)
->>> tz.tzname(ambiguous, is_dst=True)
-'NDT'
-
->>> tz.utcoffset(normal, is_dst=False)
-datetime.timedelta(-1, 77400)
->>> tz.dst(normal, is_dst=False)
-datetime.timedelta(0, 3600)
->>> tz.tzname(normal, is_dst=False)
-'NDT'
-
->>> tz.utcoffset(ambiguous, is_dst=False)
-datetime.timedelta(-1, 73800)
->>> tz.dst(ambiguous, is_dst=False)
-datetime.timedelta(0)
->>> tz.tzname(ambiguous, is_dst=False)
-'NST'
-
-If ``is_dst`` is not specified, ambiguous timestamps will raise
-an ``pytz.exceptions.AmbiguousTimeError`` exception.
-
->>> tz.utcoffset(normal)
-datetime.timedelta(-1, 77400)
->>> tz.dst(normal)
-datetime.timedelta(0, 3600)
->>> tz.tzname(normal)
-'NDT'
-
->>> import pytz.exceptions
->>> try:
-...     tz.utcoffset(ambiguous)
-... except pytz.exceptions.AmbiguousTimeError:
-...     print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous)
-pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00
->>> try:
-...     tz.dst(ambiguous)
-... except pytz.exceptions.AmbiguousTimeError:
-...     print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous)
-pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00
->>> try:
-...     tz.tzname(ambiguous)
-... except pytz.exceptions.AmbiguousTimeError:
-...     print('pytz.exceptions.AmbiguousTimeError: %s' % ambiguous)
-pytz.exceptions.AmbiguousTimeError: 2009-10-31 23:30:00
-
-
-Problems with Localtime
-~~~~~~~~~~~~~~~~~~~~~~~
-
-The major problem we have to deal with is that certain datetimes
-may occur twice in a year. For example, in the US/Eastern timezone
-on the last Sunday morning in October, the following sequence
-happens:
-
-    - 01:00 EDT occurs
-    - 1 hour later, instead of 2:00am the clock is turned back 1 hour
-      and 01:00 happens again (this time 01:00 EST)
-
-In fact, every instant between 01:00 and 02:00 occurs twice. This means
-that if you try and create a time in the 'US/Eastern' timezone using
-the standard datetime syntax, there is no way to specify if you meant
-before of after the end-of-daylight-savings-time transition.
-
->>> loc_dt = datetime(2002, 10, 27, 1, 30, 00, tzinfo=eastern)
->>> loc_dt.strftime(fmt)
-'2002-10-27 01:30:00 EST-0500'
-
-As you can see, the system has chosen one for you and there is a 50%
-chance of it being out by one hour. For some applications, this does
-not matter. However, if you are trying to schedule meetings with people
-in different timezones or analyze log files it is not acceptable. 
-
-The best and simplest solution is to stick with using UTC.  The pytz
-package encourages using UTC for internal timezone representation by
-including a special UTC implementation based on the standard Python
-reference implementation in the Python documentation.
-
-The UTC timezone unpickles to be the same instance, and pickles to a
-smaller size than other pytz tzinfo instances.  The UTC implementation
-can be obtained as pytz.utc, pytz.UTC, or pytz.timezone('UTC').
-
->>> import pickle, pytz
->>> dt = datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc)
->>> naive = dt.replace(tzinfo=None)
->>> p = pickle.dumps(dt, 1)
->>> naive_p = pickle.dumps(naive, 1)
->>> len(p) - len(naive_p)
-17
->>> new = pickle.loads(p)
->>> new == dt
-True
->>> new is dt
-False
->>> new.tzinfo is dt.tzinfo
-True
->>> pytz.utc is pytz.UTC is pytz.timezone('UTC')
-True
-
-Note that this instance is not the same instance (or implementation) as
-other timezones with the same meaning (GMT, Greenwich, Universal, etc.).
-
->>> utc is pytz.timezone('GMT')
-False
-
-If you insist on working with local times, this library provides a
-facility for constructing them unambiguously:
-
->>> loc_dt = datetime(2002, 10, 27, 1, 30, 00)
->>> est_dt = eastern.localize(loc_dt, is_dst=True)
->>> edt_dt = eastern.localize(loc_dt, is_dst=False)
->>> print(est_dt.strftime(fmt) + ' / ' + edt_dt.strftime(fmt))
-2002-10-27 01:30:00 EDT-0400 / 2002-10-27 01:30:00 EST-0500
-
-If you pass None as the is_dst flag to localize(), pytz will refuse to
-guess and raise exceptions if you try to build ambiguous or non-existent
-times.
-
-For example, 1:30am on 27th Oct 2002 happened twice in the US/Eastern
-timezone when the clocks where put back at the end of Daylight Savings
-Time:
-
->>> dt = datetime(2002, 10, 27, 1, 30, 00)
->>> try:
-...     eastern.localize(dt, is_dst=None)
-... except pytz.exceptions.AmbiguousTimeError:
-...     print('pytz.exceptions.AmbiguousTimeError: %s' % dt)
-pytz.exceptions.AmbiguousTimeError: 2002-10-27 01:30:00
-
-Similarly, 2:30am on 7th April 2002 never happened at all in the
-US/Eastern timezone, as the clocks where put forward at 2:00am skipping
-the entire hour:
-
->>> dt = datetime(2002, 4, 7, 2, 30, 00)
->>> try:
-...     eastern.localize(dt, is_dst=None)
-... except pytz.exceptions.NonExistentTimeError:
-...     print('pytz.exceptions.NonExistentTimeError: %s' % dt)
-pytz.exceptions.NonExistentTimeError: 2002-04-07 02:30:00
-
-Both of these exceptions share a common base class to make error handling
-easier:
-
->>> isinstance(pytz.AmbiguousTimeError(), pytz.InvalidTimeError)
-True
->>> isinstance(pytz.NonExistentTimeError(), pytz.InvalidTimeError)
-True
-
-Although ``localize()`` handles many cases, it is still not possible
-to handle all. In cases where countries change their timezone definitions,
-cases like the end-of-daylight-savings-time occur with no way of resolving
-the ambiguity. For example, in 1915 Warsaw switched from Warsaw time to
-Central European time. So at the stroke of midnight on August 5th 1915
-the clocks were wound back 24 minutes creating an ambiguous time period
-that cannot be specified without referring to the timezone abbreviation
-or the actual UTC offset. In this case midnight happened twice, neither
-time during a daylight savings time period:
-
->>> warsaw = pytz.timezone('Europe/Warsaw')
->>> loc_dt1 = warsaw.localize(datetime(1915, 8, 4, 23, 59, 59), is_dst=False)
->>> loc_dt1.strftime(fmt)
-'1915-08-04 23:59:59 WMT+0124'
->>> loc_dt2 = warsaw.localize(datetime(1915, 8, 5, 00, 00, 00), is_dst=False)
->>> loc_dt2.strftime(fmt)
-'1915-08-05 00:00:00 CET+0100'
->>> str(loc_dt2 - loc_dt1)
-'0:24:01'
-
-The only way of creating a time during the missing 24 minutes is
-converting from another timezone - because neither of the timezones
-involved where in daylight savings mode the API simply provides no way
-to express it:
-
->>> utc_dt = datetime(1915, 8, 4, 22, 36, tzinfo=pytz.utc)
->>> utc_dt.astimezone(warsaw).strftime(fmt)
-'1915-08-04 23:36:00 CET+0100'
-
-The standard Python way of handling all these ambiguities is not to
-handle them, such as demonstrated in this example using the US/Eastern
-timezone definition from the Python documentation (Note that this
-implementation only works for dates between 1987 and 2006 - it is
-included for tests only!):
-
->>> from pytz.reference import Eastern # pytz.reference only for tests
->>> dt = datetime(2002, 10, 27, 0, 30, tzinfo=Eastern)
->>> str(dt)
-'2002-10-27 00:30:00-04:00'
->>> str(dt + timedelta(hours=1))
-'2002-10-27 01:30:00-05:00'
->>> str(dt + timedelta(hours=2))
-'2002-10-27 02:30:00-05:00'
->>> str(dt + timedelta(hours=3))
-'2002-10-27 03:30:00-05:00'
-
-Notice the first two results? At first glance you might think they are
-correct, but taking the UTC offset into account you find that they are
-actually two hours appart instead of the 1 hour we asked for.
-
->>> from pytz.reference import UTC # pytz.reference only for tests
->>> str(dt.astimezone(UTC))
-'2002-10-27 04:30:00+00:00'
->>> str((dt + timedelta(hours=1)).astimezone(UTC))
-'2002-10-27 06:30:00+00:00'
-
-
-Country Information
-~~~~~~~~~~~~~~~~~~~
-
-A mechanism is provided to access the timezones commonly in use
-for a particular country, looked up using the ISO 3166 country code.
-It returns a list of strings that can be used to retrieve the relevant
-tzinfo instance using ``pytz.timezone()``:
-
->>> print(' '.join(pytz.country_timezones['nz']))
-Pacific/Auckland Pacific/Chatham
-
-The Olson database comes with a ISO 3166 country code to English country
-name mapping that pytz exposes as a dictionary:
-
->>> print(pytz.country_names['nz'])
-New Zealand
-
-
-What is UTC
-~~~~~~~~~~~
-
-'UTC' is Universal Time, also known as Greenwich Mean Time or GMT
-in the United Kingdom. All other timezones are given as offsets from
-UTC. No daylight savings time occurs in UTC, making it a useful timezone
-to perform date arithmetic without worrying about the confusion and
-ambiguities caused by daylight savings time transitions, your country
-changing its timezone, or mobile computers that move roam through
-multiple timezones.
-
-
-Helpers
-~~~~~~~
-
-There are two lists of timezones provided.
-
-``all_timezones`` is the exhaustive list of the timezone names that can
-be used.
-
->>> from pytz import all_timezones
->>> len(all_timezones) >= 500
-True
->>> 'Etc/Greenwich' in all_timezones
-True
-
-``common_timezones`` is a list of useful, current timezones. It doesn't
-contain deprecated zones or historical zones, except for a few I've
-deemed in common usage, such as US/Eastern (open a bug report if you
-think other timezones are deserving of being included here). It is also
-a sequence of strings.
-
->>> from pytz import common_timezones
->>> len(common_timezones) < len(all_timezones)
-True
->>> 'Etc/Greenwich' in common_timezones
-False
->>> 'Australia/Melbourne' in common_timezones
-True
->>> 'US/Eastern' in common_timezones
-True
->>> 'Canada/Eastern' in common_timezones
-True
->>> 'US/Pacific-New' in all_timezones
-True
->>> 'US/Pacific-New' in common_timezones
-False
-
-Both ``common_timezones`` and ``all_timezones`` are alphabetically
-sorted:
-
->>> common_timezones_dupe = common_timezones[:]
->>> common_timezones_dupe.sort()
->>> common_timezones == common_timezones_dupe
-True
->>> all_timezones_dupe = all_timezones[:]
->>> all_timezones_dupe.sort()
->>> all_timezones == all_timezones_dupe
-True
-
-``all_timezones`` and ``common_timezones`` are also available as sets.
-
->>> from pytz import all_timezones_set, common_timezones_set
->>> 'US/Eastern' in all_timezones_set
-True
->>> 'US/Eastern' in common_timezones_set
-True
->>> 'Australia/Victoria' in common_timezones_set
-False
-
-You can also retrieve lists of timezones used by particular countries
-using the ``country_timezones()`` function. It requires an ISO-3166
-two letter country code.
-
->>> from pytz import country_timezones
->>> print(' '.join(country_timezones('ch')))
-Europe/Zurich
->>> print(' '.join(country_timezones('CH')))
-Europe/Zurich
-
-
-License
-~~~~~~~
-
-MIT license.
-
-This code is also available as part of Zope 3 under the Zope Public
-License,  Version 2.1 (ZPL).
-
-I'm happy to relicense this code if necessary for inclusion in other
-open source projects.
-
-
-Latest Versions
-~~~~~~~~~~~~~~~
-
-This package will be updated after releases of the Olson timezone
-database.  The latest version can be downloaded from the `Python Package
-Index <http://pypi.python.org/pypi/pytz/>`_.  The code that is used
-to generate this distribution is hosted on launchpad.net and available
-using the `Bazaar version control system <http://bazaar-vcs.org>`_
-using::
-
-    bzr branch lp:pytz
-
-Announcements of new releases are made on
-`Launchpad <https://launchpad.net/pytz>`_, and the
-`Atom feed <http://feeds.launchpad.net/pytz/announcements.atom>`_
-hosted there.
-
-
-Bugs, Feature Requests & Patches
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Bugs can be reported using `Launchpad <https://bugs.launchpad.net/pytz>`_.
-
-
-Issues & Limitations
-~~~~~~~~~~~~~~~~~~~~
-
-- Offsets from UTC are rounded to the nearest whole minute, so timezones
-  such as Europe/Amsterdam pre 1937 will be up to 30 seconds out. This
-  is a limitation of the Python datetime library.
-
-- If you think a timezone definition is incorrect, I probably can't fix
-  it. pytz is a direct translation of the Olson timezone database, and
-  changes to the timezone definitions need to be made to this source.
-  If you find errors they should be reported to the time zone mailing
-  list, linked from http://www.iana.org/time-zones.
-
-
-Further Reading
-~~~~~~~~~~~~~~~
-
-More info than you want to know about timezones:
-http://www.twinsun.com/tz/tz-link.htm
-
-
-Contact
-~~~~~~~
-
-Stuart Bishop <stuart@stuartbishop.net>
-
-

+ 0 - 1508
desktop/core/ext-py/pytz-2013.9/pytz/__init__.py

@@ -1,1508 +0,0 @@
-'''
-datetime.tzinfo timezone definitions generated from the
-Olson timezone database:
-
-    ftp://elsie.nci.nih.gov/pub/tz*.tar.gz
-
-See the datetime section of the Python Library Reference for information
-on how to use these modules.
-'''
-
-# The Olson database is updated several times a year.
-OLSON_VERSION = '2013i'
-VERSION = '2013.9'  # Switching to pip compatible version numbering.
-__version__ = VERSION
-
-OLSEN_VERSION = OLSON_VERSION # Old releases had this misspelling
-
-__all__ = [
-    'timezone', 'utc', 'country_timezones', 'country_names',
-    'AmbiguousTimeError', 'InvalidTimeError',
-    'NonExistentTimeError', 'UnknownTimeZoneError',
-    'all_timezones', 'all_timezones_set',
-    'common_timezones', 'common_timezones_set',
-    ]
-
-import sys, datetime, os.path, gettext
-
-try:
-    from pkg_resources import resource_stream
-except ImportError:
-    resource_stream = None
-
-from pytz.exceptions import AmbiguousTimeError
-from pytz.exceptions import InvalidTimeError
-from pytz.exceptions import NonExistentTimeError
-from pytz.exceptions import UnknownTimeZoneError
-from pytz.lazy import LazyDict, LazyList, LazySet
-from pytz.tzinfo import unpickler
-from pytz.tzfile import build_tzinfo, _byte_string
-
-
-try:
-    unicode
-
-except NameError: # Python 3.x
-
-    # Python 3.x doesn't have unicode(), making writing code
-    # for Python 2.3 and Python 3.x a pain.
-    unicode = str
-
-    def ascii(s):
-        r"""
-        >>> ascii('Hello')
-        'Hello'
-        >>> ascii('\N{TRADE MARK SIGN}') #doctest: +IGNORE_EXCEPTION_DETAIL
-        Traceback (most recent call last):
-            ...
-        UnicodeEncodeError: ...
-        """
-        s.encode('US-ASCII') # Raise an exception if not ASCII
-        return s # But return the original string - not a byte string.
-
-else: # Python 2.x
-
-    def ascii(s):
-        r"""
-        >>> ascii('Hello')
-        'Hello'
-        >>> ascii(u'Hello')
-        'Hello'
-        >>> ascii(u'\N{TRADE MARK SIGN}') #doctest: +IGNORE_EXCEPTION_DETAIL
-        Traceback (most recent call last):
-            ...
-        UnicodeEncodeError: ...
-        """
-        return s.encode('US-ASCII')
-
-
-def open_resource(name):
-    """Open a resource from the zoneinfo subdir for reading.
-
-    Uses the pkg_resources module if available and no standard file
-    found at the calculated location.
-    """
-    name_parts = name.lstrip('/').split('/')
-    for part in name_parts:
-        if part == os.path.pardir or os.path.sep in part:
-            raise ValueError('Bad path segment: %r' % part)
-    filename = os.path.join(os.path.dirname(__file__),
-                            'zoneinfo', *name_parts)
-    if not os.path.exists(filename) and resource_stream is not None:
-        # http://bugs.launchpad.net/bugs/383171 - we avoid using this
-        # unless absolutely necessary to help when a broken version of
-        # pkg_resources is installed.
-        return resource_stream(__name__, 'zoneinfo/' + name)
-    return open(filename, 'rb')
-
-
-def resource_exists(name):
-    """Return true if the given resource exists"""
-    try:
-        open_resource(name).close()
-        return True
-    except IOError:
-        return False
-
-
-# Enable this when we get some translations?
-# We want an i18n API that is useful to programs using Python's gettext
-# module, as well as the Zope3 i18n package. Perhaps we should just provide
-# the POT file and translations, and leave it up to callers to make use
-# of them.
-# 
-# t = gettext.translation(
-#         'pytz', os.path.join(os.path.dirname(__file__), 'locales'),
-#         fallback=True
-#         )
-# def _(timezone_name):
-#     """Translate a timezone name using the current locale, returning Unicode"""
-#     return t.ugettext(timezone_name)
-
-
-_tzinfo_cache = {}
-
-def timezone(zone):
-    r''' Return a datetime.tzinfo implementation for the given timezone 
-
-    >>> from datetime import datetime, timedelta
-    >>> utc = timezone('UTC')
-    >>> eastern = timezone('US/Eastern')
-    >>> eastern.zone
-    'US/Eastern'
-    >>> timezone(unicode('US/Eastern')) is eastern
-    True
-    >>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc)
-    >>> loc_dt = utc_dt.astimezone(eastern)
-    >>> fmt = '%Y-%m-%d %H:%M:%S %Z (%z)'
-    >>> loc_dt.strftime(fmt)
-    '2002-10-27 01:00:00 EST (-0500)'
-    >>> (loc_dt - timedelta(minutes=10)).strftime(fmt)
-    '2002-10-27 00:50:00 EST (-0500)'
-    >>> eastern.normalize(loc_dt - timedelta(minutes=10)).strftime(fmt)
-    '2002-10-27 01:50:00 EDT (-0400)'
-    >>> (loc_dt + timedelta(minutes=10)).strftime(fmt)
-    '2002-10-27 01:10:00 EST (-0500)'
-
-    Raises UnknownTimeZoneError if passed an unknown zone.
-
-    >>> try:
-    ...     timezone('Asia/Shangri-La')
-    ... except UnknownTimeZoneError:
-    ...     print('Unknown')
-    Unknown
-
-    >>> try:
-    ...     timezone(unicode('\N{TRADE MARK SIGN}'))
-    ... except UnknownTimeZoneError:
-    ...     print('Unknown')
-    Unknown
-
-    '''
-    if zone.upper() == 'UTC':
-        return utc
-
-    try:
-        zone = ascii(zone)
-    except UnicodeEncodeError:
-        # All valid timezones are ASCII
-        raise UnknownTimeZoneError(zone)
-
-    zone = _unmunge_zone(zone)
-    if zone not in _tzinfo_cache:
-        if zone in all_timezones_set:
-            fp = open_resource(zone)
-            try:
-                _tzinfo_cache[zone] = build_tzinfo(zone, fp)
-            finally:
-                fp.close()
-        else:
-            raise UnknownTimeZoneError(zone)
-
-    return _tzinfo_cache[zone]
-
-
-def _unmunge_zone(zone):
-    """Undo the time zone name munging done by older versions of pytz."""
-    return zone.replace('_plus_', '+').replace('_minus_', '-')
-
-
-ZERO = datetime.timedelta(0)
-HOUR = datetime.timedelta(hours=1)
-
-
-class UTC(datetime.tzinfo):
-    """UTC
-
-    Optimized UTC implementation. It unpickles using the single module global
-    instance defined beneath this class declaration.
-    """
-    zone = "UTC"
-
-    _utcoffset = ZERO
-    _dst = ZERO
-    _tzname = zone
-
-    def fromutc(self, dt):
-        if dt.tzinfo is None:
-            return self.localize(dt)
-        return super(utc.__class__, self).fromutc(dt)
-
-    def utcoffset(self, dt):
-        return ZERO
-
-    def tzname(self, dt):
-        return "UTC"
-
-    def dst(self, dt):
-        return ZERO
-
-    def __reduce__(self):
-        return _UTC, ()
-
-    def localize(self, dt, is_dst=False):
-        '''Convert naive time to local time'''
-        if dt.tzinfo is not None:
-            raise ValueError('Not naive datetime (tzinfo is already set)')
-        return dt.replace(tzinfo=self)
-
-    def normalize(self, dt, is_dst=False):
-        '''Correct the timezone information on the given datetime'''
-        if dt.tzinfo is self:
-            return dt
-        if dt.tzinfo is None:
-            raise ValueError('Naive time - no tzinfo set')
-        return dt.astimezone(self)
-
-    def __repr__(self):
-        return "<UTC>"
-
-    def __str__(self):
-        return "UTC"
-
-
-UTC = utc = UTC() # UTC is a singleton
-
-
-def _UTC():
-    """Factory function for utc unpickling.
-
-    Makes sure that unpickling a utc instance always returns the same 
-    module global.
-
-    These examples belong in the UTC class above, but it is obscured; or in
-    the README.txt, but we are not depending on Python 2.4 so integrating
-    the README.txt examples with the unit tests is not trivial.
-
-    >>> import datetime, pickle
-    >>> dt = datetime.datetime(2005, 3, 1, 14, 13, 21, tzinfo=utc)
-    >>> naive = dt.replace(tzinfo=None)
-    >>> p = pickle.dumps(dt, 1)
-    >>> naive_p = pickle.dumps(naive, 1)
-    >>> len(p) - len(naive_p)
-    17
-    >>> new = pickle.loads(p)
-    >>> new == dt
-    True
-    >>> new is dt
-    False
-    >>> new.tzinfo is dt.tzinfo
-    True
-    >>> utc is UTC is timezone('UTC')
-    True
-    >>> utc is timezone('GMT')
-    False
-    """
-    return utc
-_UTC.__safe_for_unpickling__ = True
-
-
-def _p(*args):
-    """Factory function for unpickling pytz tzinfo instances.
-
-    Just a wrapper around tzinfo.unpickler to save a few bytes in each pickle
-    by shortening the path.
-    """
-    return unpickler(*args)
-_p.__safe_for_unpickling__ = True
-
-
-
-class _CountryTimezoneDict(LazyDict):
-    """Map ISO 3166 country code to a list of timezone names commonly used
-    in that country.
-
-    iso3166_code is the two letter code used to identify the country.
-
-    >>> def print_list(list_of_strings):
-    ...     'We use a helper so doctests work under Python 2.3 -> 3.x'
-    ...     for s in list_of_strings:
-    ...         print(s)
-
-    >>> print_list(country_timezones['nz'])
-    Pacific/Auckland
-    Pacific/Chatham
-    >>> print_list(country_timezones['ch'])
-    Europe/Zurich
-    >>> print_list(country_timezones['CH'])
-    Europe/Zurich
-    >>> print_list(country_timezones[unicode('ch')])
-    Europe/Zurich
-    >>> print_list(country_timezones['XXX'])
-    Traceback (most recent call last):
-    ...
-    KeyError: 'XXX'
-
-    Previously, this information was exposed as a function rather than a
-    dictionary. This is still supported::
-
-    >>> print_list(country_timezones('nz'))
-    Pacific/Auckland
-    Pacific/Chatham
-    """
-    def __call__(self, iso3166_code):
-        """Backwards compatibility."""
-        return self[iso3166_code]
-
-    def _fill(self):
-        data = {}
-        zone_tab = open_resource('zone.tab')
-        try:
-            for line in zone_tab:
-                line = line.decode('US-ASCII')
-                if line.startswith('#'):
-                    continue
-                code, coordinates, zone = line.split(None, 4)[:3]
-                if zone not in all_timezones_set:
-                    continue
-                try:
-                    data[code].append(zone)
-                except KeyError:
-                    data[code] = [zone]
-            self.data = data
-        finally:
-            zone_tab.close()
-
-country_timezones = _CountryTimezoneDict()
-
-
-class _CountryNameDict(LazyDict):
-    '''Dictionary proving ISO3166 code -> English name.
-
-    >>> print(country_names['au'])
-    Australia
-    '''
-    def _fill(self):
-        data = {}
-        zone_tab = open_resource('iso3166.tab')
-        try:
-            for line in zone_tab.readlines():
-                line = line.decode('US-ASCII')
-                if line.startswith('#'):
-                    continue
-                code, name = line.split(None, 1)
-                data[code] = name.strip()
-            self.data = data
-        finally:
-            zone_tab.close()
-
-country_names = _CountryNameDict()
-
-
-# Time-zone info based solely on fixed offsets
-
-class _FixedOffset(datetime.tzinfo):
-
-    zone = None # to match the standard pytz API
-
-    def __init__(self, minutes):
-        if abs(minutes) >= 1440:
-            raise ValueError("absolute offset is too large", minutes)
-        self._minutes = minutes
-        self._offset = datetime.timedelta(minutes=minutes)
-
-    def utcoffset(self, dt):
-        return self._offset
-
-    def __reduce__(self):
-        return FixedOffset, (self._minutes, )
-
-    def dst(self, dt):
-        return ZERO
-
-    def tzname(self, dt):
-        return None
-
-    def __repr__(self):
-        return 'pytz.FixedOffset(%d)' % self._minutes
-
-    def localize(self, dt, is_dst=False):
-        '''Convert naive time to local time'''
-        if dt.tzinfo is not None:
-            raise ValueError('Not naive datetime (tzinfo is already set)')
-        return dt.replace(tzinfo=self)
-
-    def normalize(self, dt, is_dst=False):
-        '''Correct the timezone information on the given datetime'''
-        if dt.tzinfo is None:
-            raise ValueError('Naive time - no tzinfo set')
-        return dt.replace(tzinfo=self)
-
-
-def FixedOffset(offset, _tzinfos = {}):
-    """return a fixed-offset timezone based off a number of minutes.
-
-        >>> one = FixedOffset(-330)
-        >>> one
-        pytz.FixedOffset(-330)
-        >>> one.utcoffset(datetime.datetime.now())
-        datetime.timedelta(-1, 66600)
-        >>> one.dst(datetime.datetime.now())
-        datetime.timedelta(0)
-
-        >>> two = FixedOffset(1380)
-        >>> two
-        pytz.FixedOffset(1380)
-        >>> two.utcoffset(datetime.datetime.now())
-        datetime.timedelta(0, 82800)
-        >>> two.dst(datetime.datetime.now())
-        datetime.timedelta(0)
-
-    The datetime.timedelta must be between the range of -1 and 1 day,
-    non-inclusive.
-
-        >>> FixedOffset(1440)
-        Traceback (most recent call last):
-        ...
-        ValueError: ('absolute offset is too large', 1440)
-
-        >>> FixedOffset(-1440)
-        Traceback (most recent call last):
-        ...
-        ValueError: ('absolute offset is too large', -1440)
-
-    An offset of 0 is special-cased to return UTC.
-
-        >>> FixedOffset(0) is UTC
-        True
-
-    There should always be only one instance of a FixedOffset per timedelta.
-    This should be true for multiple creation calls.
-
-        >>> FixedOffset(-330) is one
-        True
-        >>> FixedOffset(1380) is two
-        True
-
-    It should also be true for pickling.
-
-        >>> import pickle
-        >>> pickle.loads(pickle.dumps(one)) is one
-        True
-        >>> pickle.loads(pickle.dumps(two)) is two
-        True
-    """
-    if offset == 0:
-        return UTC
-
-    info = _tzinfos.get(offset)
-    if info is None:
-        # We haven't seen this one before. we need to save it.
-
-        # Use setdefault to avoid a race condition and make sure we have
-        # only one
-        info = _tzinfos.setdefault(offset, _FixedOffset(offset))
-
-    return info
-
-FixedOffset.__safe_for_unpickling__ = True
-
-
-def _test():
-    import doctest, os, sys
-    sys.path.insert(0, os.pardir)
-    import pytz
-    return doctest.testmod(pytz)
-
-if __name__ == '__main__':
-    _test()
-
-all_timezones = \
-['Africa/Abidjan',
- 'Africa/Accra',
- 'Africa/Addis_Ababa',
- 'Africa/Algiers',
- 'Africa/Asmara',
- 'Africa/Asmera',
- 'Africa/Bamako',
- 'Africa/Bangui',
- 'Africa/Banjul',
- 'Africa/Bissau',
- 'Africa/Blantyre',
- 'Africa/Brazzaville',
- 'Africa/Bujumbura',
- 'Africa/Cairo',
- 'Africa/Casablanca',
- 'Africa/Ceuta',
- 'Africa/Conakry',
- 'Africa/Dakar',
- 'Africa/Dar_es_Salaam',
- 'Africa/Djibouti',
- 'Africa/Douala',
- 'Africa/El_Aaiun',
- 'Africa/Freetown',
- 'Africa/Gaborone',
- 'Africa/Harare',
- 'Africa/Johannesburg',
- 'Africa/Juba',
- 'Africa/Kampala',
- 'Africa/Khartoum',
- 'Africa/Kigali',
- 'Africa/Kinshasa',
- 'Africa/Lagos',
- 'Africa/Libreville',
- 'Africa/Lome',
- 'Africa/Luanda',
- 'Africa/Lubumbashi',
- 'Africa/Lusaka',
- 'Africa/Malabo',
- 'Africa/Maputo',
- 'Africa/Maseru',
- 'Africa/Mbabane',
- 'Africa/Mogadishu',
- 'Africa/Monrovia',
- 'Africa/Nairobi',
- 'Africa/Ndjamena',
- 'Africa/Niamey',
- 'Africa/Nouakchott',
- 'Africa/Ouagadougou',
- 'Africa/Porto-Novo',
- 'Africa/Sao_Tome',
- 'Africa/Timbuktu',
- 'Africa/Tripoli',
- 'Africa/Tunis',
- 'Africa/Windhoek',
- 'America/Adak',
- 'America/Anchorage',
- 'America/Anguilla',
- 'America/Antigua',
- 'America/Araguaina',
- 'America/Argentina/Buenos_Aires',
- 'America/Argentina/Catamarca',
- 'America/Argentina/ComodRivadavia',
- 'America/Argentina/Cordoba',
- 'America/Argentina/Jujuy',
- 'America/Argentina/La_Rioja',
- 'America/Argentina/Mendoza',
- 'America/Argentina/Rio_Gallegos',
- 'America/Argentina/Salta',
- 'America/Argentina/San_Juan',
- 'America/Argentina/San_Luis',
- 'America/Argentina/Tucuman',
- 'America/Argentina/Ushuaia',
- 'America/Aruba',
- 'America/Asuncion',
- 'America/Atikokan',
- 'America/Atka',
- 'America/Bahia',
- 'America/Bahia_Banderas',
- 'America/Barbados',
- 'America/Belem',
- 'America/Belize',
- 'America/Blanc-Sablon',
- 'America/Boa_Vista',
- 'America/Bogota',
- 'America/Boise',
- 'America/Buenos_Aires',
- 'America/Cambridge_Bay',
- 'America/Campo_Grande',
- 'America/Cancun',
- 'America/Caracas',
- 'America/Catamarca',
- 'America/Cayenne',
- 'America/Cayman',
- 'America/Chicago',
- 'America/Chihuahua',
- 'America/Coral_Harbour',
- 'America/Cordoba',
- 'America/Costa_Rica',
- 'America/Creston',
- 'America/Cuiaba',
- 'America/Curacao',
- 'America/Danmarkshavn',
- 'America/Dawson',
- 'America/Dawson_Creek',
- 'America/Denver',
- 'America/Detroit',
- 'America/Dominica',
- 'America/Edmonton',
- 'America/Eirunepe',
- 'America/El_Salvador',
- 'America/Ensenada',
- 'America/Fort_Wayne',
- 'America/Fortaleza',
- 'America/Glace_Bay',
- 'America/Godthab',
- 'America/Goose_Bay',
- 'America/Grand_Turk',
- 'America/Grenada',
- 'America/Guadeloupe',
- 'America/Guatemala',
- 'America/Guayaquil',
- 'America/Guyana',
- 'America/Halifax',
- 'America/Havana',
- 'America/Hermosillo',
- 'America/Indiana/Indianapolis',
- 'America/Indiana/Knox',
- 'America/Indiana/Marengo',
- 'America/Indiana/Petersburg',
- 'America/Indiana/Tell_City',
- 'America/Indiana/Vevay',
- 'America/Indiana/Vincennes',
- 'America/Indiana/Winamac',
- 'America/Indianapolis',
- 'America/Inuvik',
- 'America/Iqaluit',
- 'America/Jamaica',
- 'America/Jujuy',
- 'America/Juneau',
- 'America/Kentucky/Louisville',
- 'America/Kentucky/Monticello',
- 'America/Knox_IN',
- 'America/Kralendijk',
- 'America/La_Paz',
- 'America/Lima',
- 'America/Los_Angeles',
- 'America/Louisville',
- 'America/Lower_Princes',
- 'America/Maceio',
- 'America/Managua',
- 'America/Manaus',
- 'America/Marigot',
- 'America/Martinique',
- 'America/Matamoros',
- 'America/Mazatlan',
- 'America/Mendoza',
- 'America/Menominee',
- 'America/Merida',
- 'America/Metlakatla',
- 'America/Mexico_City',
- 'America/Miquelon',
- 'America/Moncton',
- 'America/Monterrey',
- 'America/Montevideo',
- 'America/Montreal',
- 'America/Montserrat',
- 'America/Nassau',
- 'America/New_York',
- 'America/Nipigon',
- 'America/Nome',
- 'America/Noronha',
- 'America/North_Dakota/Beulah',
- 'America/North_Dakota/Center',
- 'America/North_Dakota/New_Salem',
- 'America/Ojinaga',
- 'America/Panama',
- 'America/Pangnirtung',
- 'America/Paramaribo',
- 'America/Phoenix',
- 'America/Port-au-Prince',
- 'America/Port_of_Spain',
- 'America/Porto_Acre',
- 'America/Porto_Velho',
- 'America/Puerto_Rico',
- 'America/Rainy_River',
- 'America/Rankin_Inlet',
- 'America/Recife',
- 'America/Regina',
- 'America/Resolute',
- 'America/Rio_Branco',
- 'America/Rosario',
- 'America/Santa_Isabel',
- 'America/Santarem',
- 'America/Santiago',
- 'America/Santo_Domingo',
- 'America/Sao_Paulo',
- 'America/Scoresbysund',
- 'America/Shiprock',
- 'America/Sitka',
- 'America/St_Barthelemy',
- 'America/St_Johns',
- 'America/St_Kitts',
- 'America/St_Lucia',
- 'America/St_Thomas',
- 'America/St_Vincent',
- 'America/Swift_Current',
- 'America/Tegucigalpa',
- 'America/Thule',
- 'America/Thunder_Bay',
- 'America/Tijuana',
- 'America/Toronto',
- 'America/Tortola',
- 'America/Vancouver',
- 'America/Virgin',
- 'America/Whitehorse',
- 'America/Winnipeg',
- 'America/Yakutat',
- 'America/Yellowknife',
- 'Antarctica/Casey',
- 'Antarctica/Davis',
- 'Antarctica/DumontDUrville',
- 'Antarctica/Macquarie',
- 'Antarctica/Mawson',
- 'Antarctica/McMurdo',
- 'Antarctica/Palmer',
- 'Antarctica/Rothera',
- 'Antarctica/South_Pole',
- 'Antarctica/Syowa',
- 'Antarctica/Vostok',
- 'Arctic/Longyearbyen',
- 'Asia/Aden',
- 'Asia/Almaty',
- 'Asia/Amman',
- 'Asia/Anadyr',
- 'Asia/Aqtau',
- 'Asia/Aqtobe',
- 'Asia/Ashgabat',
- 'Asia/Ashkhabad',
- 'Asia/Baghdad',
- 'Asia/Bahrain',
- 'Asia/Baku',
- 'Asia/Bangkok',
- 'Asia/Beirut',
- 'Asia/Bishkek',
- 'Asia/Brunei',
- 'Asia/Calcutta',
- 'Asia/Choibalsan',
- 'Asia/Chongqing',
- 'Asia/Chungking',
- 'Asia/Colombo',
- 'Asia/Dacca',
- 'Asia/Damascus',
- 'Asia/Dhaka',
- 'Asia/Dili',
- 'Asia/Dubai',
- 'Asia/Dushanbe',
- 'Asia/Gaza',
- 'Asia/Harbin',
- 'Asia/Hebron',
- 'Asia/Ho_Chi_Minh',
- 'Asia/Hong_Kong',
- 'Asia/Hovd',
- 'Asia/Irkutsk',
- 'Asia/Istanbul',
- 'Asia/Jakarta',
- 'Asia/Jayapura',
- 'Asia/Jerusalem',
- 'Asia/Kabul',
- 'Asia/Kamchatka',
- 'Asia/Karachi',
- 'Asia/Kashgar',
- 'Asia/Kathmandu',
- 'Asia/Katmandu',
- 'Asia/Khandyga',
- 'Asia/Kolkata',
- 'Asia/Krasnoyarsk',
- 'Asia/Kuala_Lumpur',
- 'Asia/Kuching',
- 'Asia/Kuwait',
- 'Asia/Macao',
- 'Asia/Macau',
- 'Asia/Magadan',
- 'Asia/Makassar',
- 'Asia/Manila',
- 'Asia/Muscat',
- 'Asia/Nicosia',
- 'Asia/Novokuznetsk',
- 'Asia/Novosibirsk',
- 'Asia/Omsk',
- 'Asia/Oral',
- 'Asia/Phnom_Penh',
- 'Asia/Pontianak',
- 'Asia/Pyongyang',
- 'Asia/Qatar',
- 'Asia/Qyzylorda',
- 'Asia/Rangoon',
- 'Asia/Riyadh',
- 'Asia/Saigon',
- 'Asia/Sakhalin',
- 'Asia/Samarkand',
- 'Asia/Seoul',
- 'Asia/Shanghai',
- 'Asia/Singapore',
- 'Asia/Taipei',
- 'Asia/Tashkent',
- 'Asia/Tbilisi',
- 'Asia/Tehran',
- 'Asia/Tel_Aviv',
- 'Asia/Thimbu',
- 'Asia/Thimphu',
- 'Asia/Tokyo',
- 'Asia/Ujung_Pandang',
- 'Asia/Ulaanbaatar',
- 'Asia/Ulan_Bator',
- 'Asia/Urumqi',
- 'Asia/Ust-Nera',
- 'Asia/Vientiane',
- 'Asia/Vladivostok',
- 'Asia/Yakutsk',
- 'Asia/Yekaterinburg',
- 'Asia/Yerevan',
- 'Atlantic/Azores',
- 'Atlantic/Bermuda',
- 'Atlantic/Canary',
- 'Atlantic/Cape_Verde',
- 'Atlantic/Faeroe',
- 'Atlantic/Faroe',
- 'Atlantic/Jan_Mayen',
- 'Atlantic/Madeira',
- 'Atlantic/Reykjavik',
- 'Atlantic/South_Georgia',
- 'Atlantic/St_Helena',
- 'Atlantic/Stanley',
- 'Australia/ACT',
- 'Australia/Adelaide',
- 'Australia/Brisbane',
- 'Australia/Broken_Hill',
- 'Australia/Canberra',
- 'Australia/Currie',
- 'Australia/Darwin',
- 'Australia/Eucla',
- 'Australia/Hobart',
- 'Australia/LHI',
- 'Australia/Lindeman',
- 'Australia/Lord_Howe',
- 'Australia/Melbourne',
- 'Australia/NSW',
- 'Australia/North',
- 'Australia/Perth',
- 'Australia/Queensland',
- 'Australia/South',
- 'Australia/Sydney',
- 'Australia/Tasmania',
- 'Australia/Victoria',
- 'Australia/West',
- 'Australia/Yancowinna',
- 'Brazil/Acre',
- 'Brazil/DeNoronha',
- 'Brazil/East',
- 'Brazil/West',
- 'CET',
- 'CST6CDT',
- 'Canada/Atlantic',
- 'Canada/Central',
- 'Canada/East-Saskatchewan',
- 'Canada/Eastern',
- 'Canada/Mountain',
- 'Canada/Newfoundland',
- 'Canada/Pacific',
- 'Canada/Saskatchewan',
- 'Canada/Yukon',
- 'Chile/Continental',
- 'Chile/EasterIsland',
- 'Cuba',
- 'EET',
- 'EST',
- 'EST5EDT',
- 'Egypt',
- 'Eire',
- 'Etc/GMT',
- 'Etc/GMT+0',
- 'Etc/GMT+1',
- 'Etc/GMT+10',
- 'Etc/GMT+11',
- 'Etc/GMT+12',
- 'Etc/GMT+2',
- 'Etc/GMT+3',
- 'Etc/GMT+4',
- 'Etc/GMT+5',
- 'Etc/GMT+6',
- 'Etc/GMT+7',
- 'Etc/GMT+8',
- 'Etc/GMT+9',
- 'Etc/GMT-0',
- 'Etc/GMT-1',
- 'Etc/GMT-10',
- 'Etc/GMT-11',
- 'Etc/GMT-12',
- 'Etc/GMT-13',
- 'Etc/GMT-14',
- 'Etc/GMT-2',
- 'Etc/GMT-3',
- 'Etc/GMT-4',
- 'Etc/GMT-5',
- 'Etc/GMT-6',
- 'Etc/GMT-7',
- 'Etc/GMT-8',
- 'Etc/GMT-9',
- 'Etc/GMT0',
- 'Etc/Greenwich',
- 'Etc/UCT',
- 'Etc/UTC',
- 'Etc/Universal',
- 'Etc/Zulu',
- 'Europe/Amsterdam',
- 'Europe/Andorra',
- 'Europe/Athens',
- 'Europe/Belfast',
- 'Europe/Belgrade',
- 'Europe/Berlin',
- 'Europe/Bratislava',
- 'Europe/Brussels',
- 'Europe/Bucharest',
- 'Europe/Budapest',
- 'Europe/Busingen',
- 'Europe/Chisinau',
- 'Europe/Copenhagen',
- 'Europe/Dublin',
- 'Europe/Gibraltar',
- 'Europe/Guernsey',
- 'Europe/Helsinki',
- 'Europe/Isle_of_Man',
- 'Europe/Istanbul',
- 'Europe/Jersey',
- 'Europe/Kaliningrad',
- 'Europe/Kiev',
- 'Europe/Lisbon',
- 'Europe/Ljubljana',
- 'Europe/London',
- 'Europe/Luxembourg',
- 'Europe/Madrid',
- 'Europe/Malta',
- 'Europe/Mariehamn',
- 'Europe/Minsk',
- 'Europe/Monaco',
- 'Europe/Moscow',
- 'Europe/Nicosia',
- 'Europe/Oslo',
- 'Europe/Paris',
- 'Europe/Podgorica',
- 'Europe/Prague',
- 'Europe/Riga',
- 'Europe/Rome',
- 'Europe/Samara',
- 'Europe/San_Marino',
- 'Europe/Sarajevo',
- 'Europe/Simferopol',
- 'Europe/Skopje',
- 'Europe/Sofia',
- 'Europe/Stockholm',
- 'Europe/Tallinn',
- 'Europe/Tirane',
- 'Europe/Tiraspol',
- 'Europe/Uzhgorod',
- 'Europe/Vaduz',
- 'Europe/Vatican',
- 'Europe/Vienna',
- 'Europe/Vilnius',
- 'Europe/Volgograd',
- 'Europe/Warsaw',
- 'Europe/Zagreb',
- 'Europe/Zaporozhye',
- 'Europe/Zurich',
- 'GB',
- 'GB-Eire',
- 'GMT',
- 'GMT+0',
- 'GMT-0',
- 'GMT0',
- 'Greenwich',
- 'HST',
- 'Hongkong',
- 'Iceland',
- 'Indian/Antananarivo',
- 'Indian/Chagos',
- 'Indian/Christmas',
- 'Indian/Cocos',
- 'Indian/Comoro',
- 'Indian/Kerguelen',
- 'Indian/Mahe',
- 'Indian/Maldives',
- 'Indian/Mauritius',
- 'Indian/Mayotte',
- 'Indian/Reunion',
- 'Iran',
- 'Israel',
- 'Jamaica',
- 'Japan',
- 'Kwajalein',
- 'Libya',
- 'MET',
- 'MST',
- 'MST7MDT',
- 'Mexico/BajaNorte',
- 'Mexico/BajaSur',
- 'Mexico/General',
- 'NZ',
- 'NZ-CHAT',
- 'Navajo',
- 'PRC',
- 'PST8PDT',
- 'Pacific/Apia',
- 'Pacific/Auckland',
- 'Pacific/Chatham',
- 'Pacific/Chuuk',
- 'Pacific/Easter',
- 'Pacific/Efate',
- 'Pacific/Enderbury',
- 'Pacific/Fakaofo',
- 'Pacific/Fiji',
- 'Pacific/Funafuti',
- 'Pacific/Galapagos',
- 'Pacific/Gambier',
- 'Pacific/Guadalcanal',
- 'Pacific/Guam',
- 'Pacific/Honolulu',
- 'Pacific/Johnston',
- 'Pacific/Kiritimati',
- 'Pacific/Kosrae',
- 'Pacific/Kwajalein',
- 'Pacific/Majuro',
- 'Pacific/Marquesas',
- 'Pacific/Midway',
- 'Pacific/Nauru',
- 'Pacific/Niue',
- 'Pacific/Norfolk',
- 'Pacific/Noumea',
- 'Pacific/Pago_Pago',
- 'Pacific/Palau',
- 'Pacific/Pitcairn',
- 'Pacific/Pohnpei',
- 'Pacific/Ponape',
- 'Pacific/Port_Moresby',
- 'Pacific/Rarotonga',
- 'Pacific/Saipan',
- 'Pacific/Samoa',
- 'Pacific/Tahiti',
- 'Pacific/Tarawa',
- 'Pacific/Tongatapu',
- 'Pacific/Truk',
- 'Pacific/Wake',
- 'Pacific/Wallis',
- 'Pacific/Yap',
- 'Poland',
- 'Portugal',
- 'ROC',
- 'ROK',
- 'Singapore',
- 'Turkey',
- 'UCT',
- 'US/Alaska',
- 'US/Aleutian',
- 'US/Arizona',
- 'US/Central',
- 'US/East-Indiana',
- 'US/Eastern',
- 'US/Hawaii',
- 'US/Indiana-Starke',
- 'US/Michigan',
- 'US/Mountain',
- 'US/Pacific',
- 'US/Pacific-New',
- 'US/Samoa',
- 'UTC',
- 'Universal',
- 'W-SU',
- 'WET',
- 'Zulu']
-all_timezones = LazyList(
-        tz for tz in all_timezones if resource_exists(tz))
-        
-all_timezones_set = LazySet(all_timezones)
-common_timezones = \
-['Africa/Abidjan',
- 'Africa/Accra',
- 'Africa/Addis_Ababa',
- 'Africa/Algiers',
- 'Africa/Asmara',
- 'Africa/Bamako',
- 'Africa/Bangui',
- 'Africa/Banjul',
- 'Africa/Bissau',
- 'Africa/Blantyre',
- 'Africa/Brazzaville',
- 'Africa/Bujumbura',
- 'Africa/Cairo',
- 'Africa/Casablanca',
- 'Africa/Ceuta',
- 'Africa/Conakry',
- 'Africa/Dakar',
- 'Africa/Dar_es_Salaam',
- 'Africa/Djibouti',
- 'Africa/Douala',
- 'Africa/El_Aaiun',
- 'Africa/Freetown',
- 'Africa/Gaborone',
- 'Africa/Harare',
- 'Africa/Johannesburg',
- 'Africa/Juba',
- 'Africa/Kampala',
- 'Africa/Khartoum',
- 'Africa/Kigali',
- 'Africa/Kinshasa',
- 'Africa/Lagos',
- 'Africa/Libreville',
- 'Africa/Lome',
- 'Africa/Luanda',
- 'Africa/Lubumbashi',
- 'Africa/Lusaka',
- 'Africa/Malabo',
- 'Africa/Maputo',
- 'Africa/Maseru',
- 'Africa/Mbabane',
- 'Africa/Mogadishu',
- 'Africa/Monrovia',
- 'Africa/Nairobi',
- 'Africa/Ndjamena',
- 'Africa/Niamey',
- 'Africa/Nouakchott',
- 'Africa/Ouagadougou',
- 'Africa/Porto-Novo',
- 'Africa/Sao_Tome',
- 'Africa/Tripoli',
- 'Africa/Tunis',
- 'Africa/Windhoek',
- 'America/Adak',
- 'America/Anchorage',
- 'America/Anguilla',
- 'America/Antigua',
- 'America/Araguaina',
- 'America/Argentina/Buenos_Aires',
- 'America/Argentina/Catamarca',
- 'America/Argentina/Cordoba',
- 'America/Argentina/Jujuy',
- 'America/Argentina/La_Rioja',
- 'America/Argentina/Mendoza',
- 'America/Argentina/Rio_Gallegos',
- 'America/Argentina/Salta',
- 'America/Argentina/San_Juan',
- 'America/Argentina/San_Luis',
- 'America/Argentina/Tucuman',
- 'America/Argentina/Ushuaia',
- 'America/Aruba',
- 'America/Asuncion',
- 'America/Atikokan',
- 'America/Bahia',
- 'America/Bahia_Banderas',
- 'America/Barbados',
- 'America/Belem',
- 'America/Belize',
- 'America/Blanc-Sablon',
- 'America/Boa_Vista',
- 'America/Bogota',
- 'America/Boise',
- 'America/Cambridge_Bay',
- 'America/Campo_Grande',
- 'America/Cancun',
- 'America/Caracas',
- 'America/Cayenne',
- 'America/Cayman',
- 'America/Chicago',
- 'America/Chihuahua',
- 'America/Costa_Rica',
- 'America/Creston',
- 'America/Cuiaba',
- 'America/Curacao',
- 'America/Danmarkshavn',
- 'America/Dawson',
- 'America/Dawson_Creek',
- 'America/Denver',
- 'America/Detroit',
- 'America/Dominica',
- 'America/Edmonton',
- 'America/Eirunepe',
- 'America/El_Salvador',
- 'America/Fortaleza',
- 'America/Glace_Bay',
- 'America/Godthab',
- 'America/Goose_Bay',
- 'America/Grand_Turk',
- 'America/Grenada',
- 'America/Guadeloupe',
- 'America/Guatemala',
- 'America/Guayaquil',
- 'America/Guyana',
- 'America/Halifax',
- 'America/Havana',
- 'America/Hermosillo',
- 'America/Indiana/Indianapolis',
- 'America/Indiana/Knox',
- 'America/Indiana/Marengo',
- 'America/Indiana/Petersburg',
- 'America/Indiana/Tell_City',
- 'America/Indiana/Vevay',
- 'America/Indiana/Vincennes',
- 'America/Indiana/Winamac',
- 'America/Inuvik',
- 'America/Iqaluit',
- 'America/Jamaica',
- 'America/Juneau',
- 'America/Kentucky/Louisville',
- 'America/Kentucky/Monticello',
- 'America/Kralendijk',
- 'America/La_Paz',
- 'America/Lima',
- 'America/Los_Angeles',
- 'America/Lower_Princes',
- 'America/Maceio',
- 'America/Managua',
- 'America/Manaus',
- 'America/Marigot',
- 'America/Martinique',
- 'America/Matamoros',
- 'America/Mazatlan',
- 'America/Menominee',
- 'America/Merida',
- 'America/Metlakatla',
- 'America/Mexico_City',
- 'America/Miquelon',
- 'America/Moncton',
- 'America/Monterrey',
- 'America/Montevideo',
- 'America/Montreal',
- 'America/Montserrat',
- 'America/Nassau',
- 'America/New_York',
- 'America/Nipigon',
- 'America/Nome',
- 'America/Noronha',
- 'America/North_Dakota/Beulah',
- 'America/North_Dakota/Center',
- 'America/North_Dakota/New_Salem',
- 'America/Ojinaga',
- 'America/Panama',
- 'America/Pangnirtung',
- 'America/Paramaribo',
- 'America/Phoenix',
- 'America/Port-au-Prince',
- 'America/Port_of_Spain',
- 'America/Porto_Velho',
- 'America/Puerto_Rico',
- 'America/Rainy_River',
- 'America/Rankin_Inlet',
- 'America/Recife',
- 'America/Regina',
- 'America/Resolute',
- 'America/Rio_Branco',
- 'America/Santa_Isabel',
- 'America/Santarem',
- 'America/Santiago',
- 'America/Santo_Domingo',
- 'America/Sao_Paulo',
- 'America/Scoresbysund',
- 'America/Sitka',
- 'America/St_Barthelemy',
- 'America/St_Johns',
- 'America/St_Kitts',
- 'America/St_Lucia',
- 'America/St_Thomas',
- 'America/St_Vincent',
- 'America/Swift_Current',
- 'America/Tegucigalpa',
- 'America/Thule',
- 'America/Thunder_Bay',
- 'America/Tijuana',
- 'America/Toronto',
- 'America/Tortola',
- 'America/Vancouver',
- 'America/Whitehorse',
- 'America/Winnipeg',
- 'America/Yakutat',
- 'America/Yellowknife',
- 'Antarctica/Casey',
- 'Antarctica/Davis',
- 'Antarctica/DumontDUrville',
- 'Antarctica/Macquarie',
- 'Antarctica/Mawson',
- 'Antarctica/McMurdo',
- 'Antarctica/Palmer',
- 'Antarctica/Rothera',
- 'Antarctica/Syowa',
- 'Antarctica/Vostok',
- 'Arctic/Longyearbyen',
- 'Asia/Aden',
- 'Asia/Almaty',
- 'Asia/Amman',
- 'Asia/Anadyr',
- 'Asia/Aqtau',
- 'Asia/Aqtobe',
- 'Asia/Ashgabat',
- 'Asia/Baghdad',
- 'Asia/Bahrain',
- 'Asia/Baku',
- 'Asia/Bangkok',
- 'Asia/Beirut',
- 'Asia/Bishkek',
- 'Asia/Brunei',
- 'Asia/Choibalsan',
- 'Asia/Chongqing',
- 'Asia/Colombo',
- 'Asia/Damascus',
- 'Asia/Dhaka',
- 'Asia/Dili',
- 'Asia/Dubai',
- 'Asia/Dushanbe',
- 'Asia/Gaza',
- 'Asia/Harbin',
- 'Asia/Hebron',
- 'Asia/Ho_Chi_Minh',
- 'Asia/Hong_Kong',
- 'Asia/Hovd',
- 'Asia/Irkutsk',
- 'Asia/Jakarta',
- 'Asia/Jayapura',
- 'Asia/Jerusalem',
- 'Asia/Kabul',
- 'Asia/Kamchatka',
- 'Asia/Karachi',
- 'Asia/Kashgar',
- 'Asia/Kathmandu',
- 'Asia/Khandyga',
- 'Asia/Kolkata',
- 'Asia/Krasnoyarsk',
- 'Asia/Kuala_Lumpur',
- 'Asia/Kuching',
- 'Asia/Kuwait',
- 'Asia/Macau',
- 'Asia/Magadan',
- 'Asia/Makassar',
- 'Asia/Manila',
- 'Asia/Muscat',
- 'Asia/Nicosia',
- 'Asia/Novokuznetsk',
- 'Asia/Novosibirsk',
- 'Asia/Omsk',
- 'Asia/Oral',
- 'Asia/Phnom_Penh',
- 'Asia/Pontianak',
- 'Asia/Pyongyang',
- 'Asia/Qatar',
- 'Asia/Qyzylorda',
- 'Asia/Rangoon',
- 'Asia/Riyadh',
- 'Asia/Sakhalin',
- 'Asia/Samarkand',
- 'Asia/Seoul',
- 'Asia/Shanghai',
- 'Asia/Singapore',
- 'Asia/Taipei',
- 'Asia/Tashkent',
- 'Asia/Tbilisi',
- 'Asia/Tehran',
- 'Asia/Thimphu',
- 'Asia/Tokyo',
- 'Asia/Ulaanbaatar',
- 'Asia/Urumqi',
- 'Asia/Ust-Nera',
- 'Asia/Vientiane',
- 'Asia/Vladivostok',
- 'Asia/Yakutsk',
- 'Asia/Yekaterinburg',
- 'Asia/Yerevan',
- 'Atlantic/Azores',
- 'Atlantic/Bermuda',
- 'Atlantic/Canary',
- 'Atlantic/Cape_Verde',
- 'Atlantic/Faroe',
- 'Atlantic/Madeira',
- 'Atlantic/Reykjavik',
- 'Atlantic/South_Georgia',
- 'Atlantic/St_Helena',
- 'Atlantic/Stanley',
- 'Australia/Adelaide',
- 'Australia/Brisbane',
- 'Australia/Broken_Hill',
- 'Australia/Currie',
- 'Australia/Darwin',
- 'Australia/Eucla',
- 'Australia/Hobart',
- 'Australia/Lindeman',
- 'Australia/Lord_Howe',
- 'Australia/Melbourne',
- 'Australia/Perth',
- 'Australia/Sydney',
- 'Canada/Atlantic',
- 'Canada/Central',
- 'Canada/Eastern',
- 'Canada/Mountain',
- 'Canada/Newfoundland',
- 'Canada/Pacific',
- 'Europe/Amsterdam',
- 'Europe/Andorra',
- 'Europe/Athens',
- 'Europe/Belgrade',
- 'Europe/Berlin',
- 'Europe/Bratislava',
- 'Europe/Brussels',
- 'Europe/Bucharest',
- 'Europe/Budapest',
- 'Europe/Busingen',
- 'Europe/Chisinau',
- 'Europe/Copenhagen',
- 'Europe/Dublin',
- 'Europe/Gibraltar',
- 'Europe/Guernsey',
- 'Europe/Helsinki',
- 'Europe/Isle_of_Man',
- 'Europe/Istanbul',
- 'Europe/Jersey',
- 'Europe/Kaliningrad',
- 'Europe/Kiev',
- 'Europe/Lisbon',
- 'Europe/Ljubljana',
- 'Europe/London',
- 'Europe/Luxembourg',
- 'Europe/Madrid',
- 'Europe/Malta',
- 'Europe/Mariehamn',
- 'Europe/Minsk',
- 'Europe/Monaco',
- 'Europe/Moscow',
- 'Europe/Oslo',
- 'Europe/Paris',
- 'Europe/Podgorica',
- 'Europe/Prague',
- 'Europe/Riga',
- 'Europe/Rome',
- 'Europe/Samara',
- 'Europe/San_Marino',
- 'Europe/Sarajevo',
- 'Europe/Simferopol',
- 'Europe/Skopje',
- 'Europe/Sofia',
- 'Europe/Stockholm',
- 'Europe/Tallinn',
- 'Europe/Tirane',
- 'Europe/Uzhgorod',
- 'Europe/Vaduz',
- 'Europe/Vatican',
- 'Europe/Vienna',
- 'Europe/Vilnius',
- 'Europe/Volgograd',
- 'Europe/Warsaw',
- 'Europe/Zagreb',
- 'Europe/Zaporozhye',
- 'Europe/Zurich',
- 'GMT',
- 'Indian/Antananarivo',
- 'Indian/Chagos',
- 'Indian/Christmas',
- 'Indian/Cocos',
- 'Indian/Comoro',
- 'Indian/Kerguelen',
- 'Indian/Mahe',
- 'Indian/Maldives',
- 'Indian/Mauritius',
- 'Indian/Mayotte',
- 'Indian/Reunion',
- 'Pacific/Apia',
- 'Pacific/Auckland',
- 'Pacific/Chatham',
- 'Pacific/Chuuk',
- 'Pacific/Easter',
- 'Pacific/Efate',
- 'Pacific/Enderbury',
- 'Pacific/Fakaofo',
- 'Pacific/Fiji',
- 'Pacific/Funafuti',
- 'Pacific/Galapagos',
- 'Pacific/Gambier',
- 'Pacific/Guadalcanal',
- 'Pacific/Guam',
- 'Pacific/Honolulu',
- 'Pacific/Johnston',
- 'Pacific/Kiritimati',
- 'Pacific/Kosrae',
- 'Pacific/Kwajalein',
- 'Pacific/Majuro',
- 'Pacific/Marquesas',
- 'Pacific/Midway',
- 'Pacific/Nauru',
- 'Pacific/Niue',
- 'Pacific/Norfolk',
- 'Pacific/Noumea',
- 'Pacific/Pago_Pago',
- 'Pacific/Palau',
- 'Pacific/Pitcairn',
- 'Pacific/Pohnpei',
- 'Pacific/Port_Moresby',
- 'Pacific/Rarotonga',
- 'Pacific/Saipan',
- 'Pacific/Tahiti',
- 'Pacific/Tarawa',
- 'Pacific/Tongatapu',
- 'Pacific/Wake',
- 'Pacific/Wallis',
- 'US/Alaska',
- 'US/Arizona',
- 'US/Central',
- 'US/Eastern',
- 'US/Hawaii',
- 'US/Mountain',
- 'US/Pacific',
- 'UTC']
-common_timezones = LazyList(
-            tz for tz in common_timezones if tz in all_timezones)
-        
-common_timezones_set = LazySet(common_timezones)

+ 0 - 36
desktop/core/ext-py/pytz-2013.9/pytz/tests/test_docs.py

@@ -1,36 +0,0 @@
-# -*- coding: ascii -*-
-
-from doctest import DocTestSuite
-import unittest, os, os.path, sys
-import warnings
-
-# We test the documentation this way instead of using DocFileSuite so
-# we can run the tests under Python 2.3
-def test_README():
-    pass
-
-this_dir = os.path.dirname(__file__)
-locs = [
-    os.path.join(this_dir, os.pardir, 'README.txt'),
-    os.path.join(this_dir, os.pardir, os.pardir, 'README.txt'),
-    ]
-for loc in locs:
-    if os.path.exists(loc):
-        test_README.__doc__ = open(loc).read()
-        break
-if test_README.__doc__ is None:
-    raise RuntimeError('README.txt not found')
-
-
-def test_suite():
-    "For the Z3 test runner"
-    return DocTestSuite()
-
-
-if __name__ == '__main__':
-    sys.path.insert(0, os.path.abspath(os.path.join(
-        this_dir, os.pardir, os.pardir
-        )))
-    unittest.main(defaultTest='test_suite')
-
-

+ 0 - 818
desktop/core/ext-py/pytz-2013.9/pytz/tests/test_tzinfo.py

@@ -1,818 +0,0 @@
-# -*- coding: ascii -*-
-
-import sys, os, os.path
-import unittest, doctest
-try:
-    import cPickle as pickle
-except ImportError:
-    import pickle
-from datetime import datetime, time, timedelta, tzinfo
-import warnings
-
-if __name__ == '__main__':
-    # Only munge path if invoked as a script. Testrunners should have setup
-    # the paths already
-    sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, os.pardir)))
-
-import pytz
-from pytz import reference
-from pytz.tzfile import _byte_string
-from pytz.tzinfo import DstTzInfo, StaticTzInfo
-
-# I test for expected version to ensure the correct version of pytz is
-# actually being tested.
-EXPECTED_VERSION='2013.9'
-EXPECTED_OLSON_VERSION='2013i'
-
-fmt = '%Y-%m-%d %H:%M:%S %Z%z'
-
-NOTIME = timedelta(0)
-
-# GMT is a tzinfo.StaticTzInfo--the class we primarily want to test--while
-# UTC is reference implementation.  They both have the same timezone meaning.
-UTC = pytz.timezone('UTC')
-GMT = pytz.timezone('GMT')
-assert isinstance(GMT, StaticTzInfo), 'GMT is no longer a StaticTzInfo'
-
-def prettydt(dt):
-    """datetime as a string using a known format.
-
-    We don't use strftime as it doesn't handle years earlier than 1900
-    per http://bugs.python.org/issue1777412
-    """
-    if dt.utcoffset() >= timedelta(0):
-        offset = '+%s' % (dt.utcoffset(),)
-    else:
-        offset = '-%s' % (-1 * dt.utcoffset(),)
-    return '%04d-%02d-%02d %02d:%02d:%02d %s %s' % (
-        dt.year, dt.month, dt.day,
-        dt.hour, dt.minute, dt.second,
-        dt.tzname(), offset)
-
-
-try:
-    unicode
-except NameError:
-    # Python 3.x doesn't have unicode(), making writing code
-    # for Python 2.3 and Python 3.x a pain.
-    unicode = str
-
-
-class BasicTest(unittest.TestCase):
-
-    def testVersion(self):
-        # Ensuring the correct version of pytz has been loaded
-        self.assertEqual(EXPECTED_VERSION, pytz.__version__,
-                'Incorrect pytz version loaded. Import path is stuffed '
-                'or this test needs updating. (Wanted %s, got %s)'
-                % (EXPECTED_VERSION, pytz.__version__))
-
-        self.assertEqual(EXPECTED_OLSON_VERSION, pytz.OLSON_VERSION,
-                'Incorrect pytz version loaded. Import path is stuffed '
-                'or this test needs updating. (Wanted %s, got %s)'
-                % (EXPECTED_VERSION, pytz.__version__))
-
-    def testGMT(self):
-        now = datetime.now(tz=GMT)
-        self.assertTrue(now.utcoffset() == NOTIME)
-        self.assertTrue(now.dst() == NOTIME)
-        self.assertTrue(now.timetuple() == now.utctimetuple())
-        self.assertTrue(now==now.replace(tzinfo=UTC))
-
-    def testReferenceUTC(self):
-        now = datetime.now(tz=UTC)
-        self.assertTrue(now.utcoffset() == NOTIME)
-        self.assertTrue(now.dst() == NOTIME)
-        self.assertTrue(now.timetuple() == now.utctimetuple())
-
-    def testUnknownOffsets(self):
-        # This tzinfo behavior is required to make
-        # datetime.time.{utcoffset, dst, tzname} work as documented.
-
-        dst_tz = pytz.timezone('US/Eastern')
-
-        # This information is not known when we don't have a date,
-        # so return None per API.
-        self.assertTrue(dst_tz.utcoffset(None) is None)
-        self.assertTrue(dst_tz.dst(None) is None)
-        # We don't know the abbreviation, but this is still a valid
-        # tzname per the Python documentation.
-        self.assertEqual(dst_tz.tzname(None), 'US/Eastern')
-
-    def clearCache(self):
-        pytz._tzinfo_cache.clear()
-
-    def testUnicodeTimezone(self):
-        # We need to ensure that cold lookups work for both Unicode
-        # and traditional strings, and that the desired singleton is
-        # returned.
-        self.clearCache()
-        eastern = pytz.timezone(unicode('US/Eastern'))
-        self.assertTrue(eastern is pytz.timezone('US/Eastern'))
-
-        self.clearCache()
-        eastern = pytz.timezone('US/Eastern')
-        self.assertTrue(eastern is pytz.timezone(unicode('US/Eastern')))
-
-
-class PicklingTest(unittest.TestCase):
-
-    def _roundtrip_tzinfo(self, tz):
-        p = pickle.dumps(tz)
-        unpickled_tz = pickle.loads(p)
-        self.assertTrue(tz is unpickled_tz, '%s did not roundtrip' % tz.zone)
-
-    def _roundtrip_datetime(self, dt):
-        # Ensure that the tzinfo attached to a datetime instance
-        # is identical to the one returned. This is important for
-        # DST timezones, as some state is stored in the tzinfo.
-        tz = dt.tzinfo
-        p = pickle.dumps(dt)
-        unpickled_dt = pickle.loads(p)
-        unpickled_tz = unpickled_dt.tzinfo
-        self.assertTrue(tz is unpickled_tz, '%s did not roundtrip' % tz.zone)
-
-    def testDst(self):
-        tz = pytz.timezone('Europe/Amsterdam')
-        dt = datetime(2004, 2, 1, 0, 0, 0)
-
-        for localized_tz in tz._tzinfos.values():
-            self._roundtrip_tzinfo(localized_tz)
-            self._roundtrip_datetime(dt.replace(tzinfo=localized_tz))
-
-    def testRoundtrip(self):
-        dt = datetime(2004, 2, 1, 0, 0, 0)
-        for zone in pytz.all_timezones:
-            tz = pytz.timezone(zone)
-            self._roundtrip_tzinfo(tz)
-
-    def testDatabaseFixes(self):
-        # Hack the pickle to make it refer to a timezone abbreviation
-        # that does not match anything. The unpickler should be able
-        # to repair this case
-        tz = pytz.timezone('Australia/Melbourne')
-        p = pickle.dumps(tz)
-        tzname = tz._tzname
-        hacked_p = p.replace(_byte_string(tzname), _byte_string('???'))
-        self.assertNotEqual(p, hacked_p)
-        unpickled_tz = pickle.loads(hacked_p)
-        self.assertTrue(tz is unpickled_tz)
-
-        # Simulate a database correction. In this case, the incorrect
-        # data will continue to be used.
-        p = pickle.dumps(tz)
-        new_utcoffset = tz._utcoffset.seconds + 42
-
-        # Python 3 introduced a new pickle protocol where numbers are stored in
-        # hexadecimal representation. Here we extract the pickle
-        # representation of the number for the current Python version.
-        old_pickle_pattern = pickle.dumps(tz._utcoffset.seconds)[3:-1]
-        new_pickle_pattern = pickle.dumps(new_utcoffset)[3:-1]
-        hacked_p = p.replace(old_pickle_pattern, new_pickle_pattern)
-
-        self.assertNotEqual(p, hacked_p)
-        unpickled_tz = pickle.loads(hacked_p)
-        self.assertEqual(unpickled_tz._utcoffset.seconds, new_utcoffset)
-        self.assertTrue(tz is not unpickled_tz)
-
-    def testOldPickles(self):
-        # Ensure that applications serializing pytz instances as pickles
-        # have no troubles upgrading to a new pytz release. These pickles
-        # where created with pytz2006j
-        east1 = pickle.loads(_byte_string(
-            "cpytz\n_p\np1\n(S'US/Eastern'\np2\nI-18000\n"
-            "I0\nS'EST'\np3\ntRp4\n."
-            ))
-        east2 = pytz.timezone('US/Eastern')
-        self.assertTrue(east1 is east2)
-
-        # Confirm changes in name munging between 2006j and 2007c cause
-        # no problems.
-        pap1 = pickle.loads(_byte_string(
-            "cpytz\n_p\np1\n(S'America/Port_minus_au_minus_Prince'"
-            "\np2\nI-17340\nI0\nS'PPMT'\np3\ntRp4\n."))
-        pap2 = pytz.timezone('America/Port-au-Prince')
-        self.assertTrue(pap1 is pap2)
-
-        gmt1 = pickle.loads(_byte_string(
-            "cpytz\n_p\np1\n(S'Etc/GMT_plus_10'\np2\ntRp3\n."))
-        gmt2 = pytz.timezone('Etc/GMT+10')
-        self.assertTrue(gmt1 is gmt2)
-
-
-class USEasternDSTStartTestCase(unittest.TestCase):
-    tzinfo = pytz.timezone('US/Eastern')
-
-    # 24 hours before DST changeover
-    transition_time = datetime(2002, 4, 7, 7, 0, 0, tzinfo=UTC)
-
-    # Increase for 'flexible' DST transitions due to 1 minute granularity
-    # of Python's datetime library
-    instant = timedelta(seconds=1)
-
-    # before transition
-    before = {
-        'tzname': 'EST',
-        'utcoffset': timedelta(hours = -5),
-        'dst': timedelta(hours = 0),
-        }
-
-    # after transition
-    after = {
-        'tzname': 'EDT',
-        'utcoffset': timedelta(hours = -4),
-        'dst': timedelta(hours = 1),
-        }
-
-    def _test_tzname(self, utc_dt, wanted):
-        tzname = wanted['tzname']
-        dt = utc_dt.astimezone(self.tzinfo)
-        self.assertEqual(dt.tzname(), tzname,
-            'Expected %s as tzname for %s. Got %s' % (
-                tzname, str(utc_dt), dt.tzname()
-                )
-            )
-
-    def _test_utcoffset(self, utc_dt, wanted):
-        utcoffset = wanted['utcoffset']
-        dt = utc_dt.astimezone(self.tzinfo)
-        self.assertEqual(
-                dt.utcoffset(), wanted['utcoffset'],
-                'Expected %s as utcoffset for %s. Got %s' % (
-                    utcoffset, utc_dt, dt.utcoffset()
-                    )
-                )
-
-    def _test_dst(self, utc_dt, wanted):
-        dst = wanted['dst']
-        dt = utc_dt.astimezone(self.tzinfo)
-        self.assertEqual(dt.dst(),dst,
-            'Expected %s as dst for %s. Got %s' % (
-                dst, utc_dt, dt.dst()
-                )
-            )
-
-    def test_arithmetic(self):
-        utc_dt = self.transition_time
-
-        for days in range(-420, 720, 20):
-            delta = timedelta(days=days)
-
-            # Make sure we can get back where we started
-            dt = utc_dt.astimezone(self.tzinfo)
-            dt2 = dt + delta
-            dt2 = dt2 - delta
-            self.assertEqual(dt, dt2)
-
-            # Make sure arithmetic crossing DST boundaries ends
-            # up in the correct timezone after normalization
-            utc_plus_delta = (utc_dt + delta).astimezone(self.tzinfo)
-            local_plus_delta = self.tzinfo.normalize(dt + delta)
-            self.assertEqual(
-                    prettydt(utc_plus_delta),
-                    prettydt(local_plus_delta),
-                    'Incorrect result for delta==%d days.  Wanted %r. Got %r'%(
-                        days,
-                        prettydt(utc_plus_delta),
-                        prettydt(local_plus_delta),
-                        )
-                    )
-
-    def _test_all(self, utc_dt, wanted):
-        self._test_utcoffset(utc_dt, wanted)
-        self._test_tzname(utc_dt, wanted)
-        self._test_dst(utc_dt, wanted)
-
-    def testDayBefore(self):
-        self._test_all(
-                self.transition_time - timedelta(days=1), self.before
-                )
-
-    def testTwoHoursBefore(self):
-        self._test_all(
-                self.transition_time - timedelta(hours=2), self.before
-                )
-
-    def testHourBefore(self):
-        self._test_all(
-                self.transition_time - timedelta(hours=1), self.before
-                )
-
-    def testInstantBefore(self):
-        self._test_all(
-                self.transition_time - self.instant, self.before
-                )
-
-    def testTransition(self):
-        self._test_all(
-                self.transition_time, self.after
-                )
-
-    def testInstantAfter(self):
-        self._test_all(
-                self.transition_time + self.instant, self.after
-                )
-
-    def testHourAfter(self):
-        self._test_all(
-                self.transition_time + timedelta(hours=1), self.after
-                )
-
-    def testTwoHoursAfter(self):
-        self._test_all(
-                self.transition_time + timedelta(hours=1), self.after
-                )
-
-    def testDayAfter(self):
-        self._test_all(
-                self.transition_time + timedelta(days=1), self.after
-                )
-
-
-class USEasternDSTEndTestCase(USEasternDSTStartTestCase):
-    tzinfo = pytz.timezone('US/Eastern')
-    transition_time = datetime(2002, 10, 27, 6, 0, 0, tzinfo=UTC)
-    before = {
-        'tzname': 'EDT',
-        'utcoffset': timedelta(hours = -4),
-        'dst': timedelta(hours = 1),
-        }
-    after = {
-        'tzname': 'EST',
-        'utcoffset': timedelta(hours = -5),
-        'dst': timedelta(hours = 0),
-        }
-
-
-class USEasternEPTStartTestCase(USEasternDSTStartTestCase):
-    transition_time = datetime(1945, 8, 14, 23, 0, 0, tzinfo=UTC)
-    before = {
-        'tzname': 'EWT',
-        'utcoffset': timedelta(hours = -4),
-        'dst': timedelta(hours = 1),
-        }
-    after = {
-        'tzname': 'EPT',
-        'utcoffset': timedelta(hours = -4),
-        'dst': timedelta(hours = 1),
-        }
-
-
-class USEasternEPTEndTestCase(USEasternDSTStartTestCase):
-    transition_time = datetime(1945, 9, 30, 6, 0, 0, tzinfo=UTC)
-    before = {
-        'tzname': 'EPT',
-        'utcoffset': timedelta(hours = -4),
-        'dst': timedelta(hours = 1),
-        }
-    after = {
-        'tzname': 'EST',
-        'utcoffset': timedelta(hours = -5),
-        'dst': timedelta(hours = 0),
-        }
-
-
-class WarsawWMTEndTestCase(USEasternDSTStartTestCase):
-    # In 1915, Warsaw changed from Warsaw to Central European time.
-    # This involved the clocks being set backwards, causing a end-of-DST
-    # like situation without DST being involved.
-    tzinfo = pytz.timezone('Europe/Warsaw')
-    transition_time = datetime(1915, 8, 4, 22, 36, 0, tzinfo=UTC)
-    before = {
-        'tzname': 'WMT',
-        'utcoffset': timedelta(hours=1, minutes=24),
-        'dst': timedelta(0),
-        }
-    after = {
-        'tzname': 'CET',
-        'utcoffset': timedelta(hours=1),
-        'dst': timedelta(0),
-        }
-
-
-class VilniusWMTEndTestCase(USEasternDSTStartTestCase):
-    # At the end of 1916, Vilnius changed timezones putting its clock
-    # forward by 11 minutes 35 seconds. Neither timezone was in DST mode.
-    tzinfo = pytz.timezone('Europe/Vilnius')
-    instant = timedelta(seconds=31)
-    transition_time = datetime(1916, 12, 31, 22, 36, 00, tzinfo=UTC)
-    before = {
-        'tzname': 'WMT',
-        'utcoffset': timedelta(hours=1, minutes=24),
-        'dst': timedelta(0),
-        }
-    after = {
-        'tzname': 'KMT',
-        'utcoffset': timedelta(hours=1, minutes=36), # Really 1:35:36
-        'dst': timedelta(0),
-        }
-
-
-class VilniusCESTStartTestCase(USEasternDSTStartTestCase):
-    # In 1941, Vilnius changed from MSG to CEST, switching to summer
-    # time while simultaneously reducing its UTC offset by two hours,
-    # causing the clocks to go backwards for this summer time
-    # switchover.
-    tzinfo = pytz.timezone('Europe/Vilnius')
-    transition_time = datetime(1941, 6, 23, 21, 00, 00, tzinfo=UTC)
-    before = {
-        'tzname': 'MSK',
-        'utcoffset': timedelta(hours=3),
-        'dst': timedelta(0),
-        }
-    after = {
-        'tzname': 'CEST',
-        'utcoffset': timedelta(hours=2),
-        'dst': timedelta(hours=1),
-        }
-
-
-class LondonHistoryStartTestCase(USEasternDSTStartTestCase):
-    # The first known timezone transition in London was in 1847 when
-    # clocks where synchronized to GMT. However, we currently only
-    # understand v1 format tzfile(5) files which does handle years
-    # this far in the past, so our earliest known transition is in
-    # 1916.
-    tzinfo = pytz.timezone('Europe/London')
-    # transition_time = datetime(1847, 12, 1, 1, 15, 00, tzinfo=UTC)
-    # before = {
-    #     'tzname': 'LMT',
-    #     'utcoffset': timedelta(minutes=-75),
-    #     'dst': timedelta(0),
-    #     }
-    # after = {
-    #     'tzname': 'GMT',
-    #     'utcoffset': timedelta(0),
-    #     'dst': timedelta(0),
-    #     }
-    transition_time = datetime(1916, 5, 21, 2, 00, 00, tzinfo=UTC)
-    before = {
-        'tzname': 'GMT',
-        'utcoffset': timedelta(0),
-        'dst': timedelta(0),
-        }
-    after = {
-        'tzname': 'BST',
-        'utcoffset': timedelta(hours=1),
-        'dst': timedelta(hours=1),
-        }
-
-
-class LondonHistoryEndTestCase(USEasternDSTStartTestCase):
-    # Timezone switchovers are projected into the future, even
-    # though no official statements exist or could be believed even
-    # if they did exist. We currently only check the last known
-    # transition in 2037, as we are still using v1 format tzfile(5)
-    # files.
-    tzinfo = pytz.timezone('Europe/London')
-    # transition_time = datetime(2499, 10, 25, 1, 0, 0, tzinfo=UTC)
-    transition_time = datetime(2037, 10, 25, 1, 0, 0, tzinfo=UTC)
-    before = {
-        'tzname': 'BST',
-        'utcoffset': timedelta(hours=1),
-        'dst': timedelta(hours=1),
-        }
-    after = {
-        'tzname': 'GMT',
-        'utcoffset': timedelta(0),
-        'dst': timedelta(0),
-        }
-
-
-class NoumeaHistoryStartTestCase(USEasternDSTStartTestCase):
-    # Noumea adopted a whole hour offset in 1912. Previously
-    # it was 11 hours, 5 minutes and 48 seconds off UTC. However,
-    # due to limitations of the Python datetime library, we need
-    # to round that to 11 hours 6 minutes.
-    tzinfo = pytz.timezone('Pacific/Noumea')
-    transition_time = datetime(1912, 1, 12, 12, 54, 12, tzinfo=UTC)
-    before = {
-        'tzname': 'LMT',
-        'utcoffset': timedelta(hours=11, minutes=6),
-        'dst': timedelta(0),
-        }
-    after = {
-        'tzname': 'NCT',
-        'utcoffset': timedelta(hours=11),
-        'dst': timedelta(0),
-        }
-
-
-class NoumeaDSTEndTestCase(USEasternDSTStartTestCase):
-    # Noumea dropped DST in 1997.
-    tzinfo = pytz.timezone('Pacific/Noumea')
-    transition_time = datetime(1997, 3, 1, 15, 00, 00, tzinfo=UTC)
-    before = {
-        'tzname': 'NCST',
-        'utcoffset': timedelta(hours=12),
-        'dst': timedelta(hours=1),
-        }
-    after = {
-        'tzname': 'NCT',
-        'utcoffset': timedelta(hours=11),
-        'dst': timedelta(0),
-        }
-
-
-class NoumeaNoMoreDSTTestCase(NoumeaDSTEndTestCase):
-    # Noumea dropped DST in 1997. Here we test that it stops occuring.
-    transition_time = (
-        NoumeaDSTEndTestCase.transition_time + timedelta(days=365*10))
-    before = NoumeaDSTEndTestCase.after
-    after = NoumeaDSTEndTestCase.after
-
-
-class TahitiTestCase(USEasternDSTStartTestCase):
-    # Tahiti has had a single transition in its history.
-    tzinfo = pytz.timezone('Pacific/Tahiti')
-    transition_time = datetime(1912, 10, 1, 9, 58, 16, tzinfo=UTC)
-    before = {
-        'tzname': 'LMT',
-        'utcoffset': timedelta(hours=-9, minutes=-58),
-        'dst': timedelta(0),
-        }
-    after = {
-        'tzname': 'TAHT',
-        'utcoffset': timedelta(hours=-10),
-        'dst': timedelta(0),
-        }
-
-
-class SamoaInternationalDateLineChange(USEasternDSTStartTestCase):
-    # At the end of 2011, Samoa will switch from being east of the
-    # international dateline to the west. There will be no Dec 30th
-    # 2011 and it will switch from UTC-10 to UTC+14.
-    tzinfo = pytz.timezone('Pacific/Apia')
-    transition_time = datetime(2011, 12, 30, 10, 0, 0, tzinfo=UTC)
-    before = {
-        'tzname': 'WSDT',
-        'utcoffset': timedelta(hours=-10),
-        'dst': timedelta(hours=1),
-        }
-    after = {
-        'tzname': 'WSDT',
-        'utcoffset': timedelta(hours=14),
-        'dst': timedelta(hours=1),
-        }
-
-
-class ReferenceUSEasternDSTStartTestCase(USEasternDSTStartTestCase):
-    tzinfo = reference.Eastern
-    def test_arithmetic(self):
-        # Reference implementation cannot handle this
-        pass
-
-
-class ReferenceUSEasternDSTEndTestCase(USEasternDSTEndTestCase):
-    tzinfo = reference.Eastern
-
-    def testHourBefore(self):
-        # Python's datetime library has a bug, where the hour before
-        # a daylight savings transition is one hour out. For example,
-        # at the end of US/Eastern daylight savings time, 01:00 EST
-        # occurs twice (once at 05:00 UTC and once at 06:00 UTC),
-        # whereas the first should actually be 01:00 EDT.
-        # Note that this bug is by design - by accepting this ambiguity
-        # for one hour one hour per year, an is_dst flag on datetime.time
-        # became unnecessary.
-        self._test_all(
-                self.transition_time - timedelta(hours=1), self.after
-                )
-
-    def testInstantBefore(self):
-        self._test_all(
-                self.transition_time - timedelta(seconds=1), self.after
-                )
-
-    def test_arithmetic(self):
-        # Reference implementation cannot handle this
-        pass
-
-
-class LocalTestCase(unittest.TestCase):
-    def testLocalize(self):
-        loc_tz = pytz.timezone('Europe/Amsterdam')
-
-        loc_time = loc_tz.localize(datetime(1930, 5, 10, 0, 0, 0))
-        # Actually +00:19:32, but Python datetime rounds this
-        self.assertEqual(loc_time.strftime('%Z%z'), 'AMT+0020')
-
-        loc_time = loc_tz.localize(datetime(1930, 5, 20, 0, 0, 0))
-        # Actually +00:19:32, but Python datetime rounds this
-        self.assertEqual(loc_time.strftime('%Z%z'), 'NST+0120')
-
-        loc_time = loc_tz.localize(datetime(1940, 5, 10, 0, 0, 0))
-        self.assertEqual(loc_time.strftime('%Z%z'), 'NET+0020')
-
-        loc_time = loc_tz.localize(datetime(1940, 5, 20, 0, 0, 0))
-        self.assertEqual(loc_time.strftime('%Z%z'), 'CEST+0200')
-
-        loc_time = loc_tz.localize(datetime(2004, 2, 1, 0, 0, 0))
-        self.assertEqual(loc_time.strftime('%Z%z'), 'CET+0100')
-
-        loc_time = loc_tz.localize(datetime(2004, 4, 1, 0, 0, 0))
-        self.assertEqual(loc_time.strftime('%Z%z'), 'CEST+0200')
-
-        tz = pytz.timezone('Europe/Amsterdam')
-        loc_time = loc_tz.localize(datetime(1943, 3, 29, 1, 59, 59))
-        self.assertEqual(loc_time.strftime('%Z%z'), 'CET+0100')
-
-
-        # Switch to US
-        loc_tz = pytz.timezone('US/Eastern')
-
-        # End of DST ambiguity check
-        loc_time = loc_tz.localize(datetime(1918, 10, 27, 1, 59, 59), is_dst=1)
-        self.assertEqual(loc_time.strftime('%Z%z'), 'EDT-0400')
-
-        loc_time = loc_tz.localize(datetime(1918, 10, 27, 1, 59, 59), is_dst=0)
-        self.assertEqual(loc_time.strftime('%Z%z'), 'EST-0500')
-
-        self.assertRaises(pytz.AmbiguousTimeError,
-            loc_tz.localize, datetime(1918, 10, 27, 1, 59, 59), is_dst=None
-            )
-
-        # Start of DST non-existent times
-        loc_time = loc_tz.localize(datetime(1918, 3, 31, 2, 0, 0), is_dst=0)
-        self.assertEqual(loc_time.strftime('%Z%z'), 'EST-0500')
-
-        loc_time = loc_tz.localize(datetime(1918, 3, 31, 2, 0, 0), is_dst=1)
-        self.assertEqual(loc_time.strftime('%Z%z'), 'EDT-0400')
-
-        self.assertRaises(pytz.NonExistentTimeError,
-            loc_tz.localize, datetime(1918, 3, 31, 2, 0, 0), is_dst=None
-            )
-
-        # Weird changes - war time and peace time both is_dst==True
-
-        loc_time = loc_tz.localize(datetime(1942, 2, 9, 3, 0, 0))
-        self.assertEqual(loc_time.strftime('%Z%z'), 'EWT-0400')
-
-        loc_time = loc_tz.localize(datetime(1945, 8, 14, 19, 0, 0))
-        self.assertEqual(loc_time.strftime('%Z%z'), 'EPT-0400')
-
-        loc_time = loc_tz.localize(datetime(1945, 9, 30, 1, 0, 0), is_dst=1)
-        self.assertEqual(loc_time.strftime('%Z%z'), 'EPT-0400')
-
-        loc_time = loc_tz.localize(datetime(1945, 9, 30, 1, 0, 0), is_dst=0)
-        self.assertEqual(loc_time.strftime('%Z%z'), 'EST-0500')
-
-    def testNormalize(self):
-        tz = pytz.timezone('US/Eastern')
-        dt = datetime(2004, 4, 4, 7, 0, 0, tzinfo=UTC).astimezone(tz)
-        dt2 = dt - timedelta(minutes=10)
-        self.assertEqual(
-                dt2.strftime('%Y-%m-%d %H:%M:%S %Z%z'),
-                '2004-04-04 02:50:00 EDT-0400'
-                )
-
-        dt2 = tz.normalize(dt2)
-        self.assertEqual(
-                dt2.strftime('%Y-%m-%d %H:%M:%S %Z%z'),
-                '2004-04-04 01:50:00 EST-0500'
-                )
-
-    def testPartialMinuteOffsets(self):
-        # utcoffset in Amsterdam was not a whole minute until 1937
-        # However, we fudge this by rounding them, as the Python
-        # datetime library 
-        tz = pytz.timezone('Europe/Amsterdam')
-        utc_dt = datetime(1914, 1, 1, 13, 40, 28, tzinfo=UTC) # correct
-        utc_dt = utc_dt.replace(second=0) # But we need to fudge it
-        loc_dt = utc_dt.astimezone(tz)
-        self.assertEqual(
-                loc_dt.strftime('%Y-%m-%d %H:%M:%S %Z%z'),
-                '1914-01-01 14:00:00 AMT+0020'
-                )
-
-        # And get back...
-        utc_dt = loc_dt.astimezone(UTC)
-        self.assertEqual(
-                utc_dt.strftime('%Y-%m-%d %H:%M:%S %Z%z'),
-                '1914-01-01 13:40:00 UTC+0000'
-                )
-
-    def no_testCreateLocaltime(self):
-        # It would be nice if this worked, but it doesn't.
-        tz = pytz.timezone('Europe/Amsterdam')
-        dt = datetime(2004, 10, 31, 2, 0, 0, tzinfo=tz)
-        self.assertEqual(
-                dt.strftime(fmt),
-                '2004-10-31 02:00:00 CET+0100'
-                )
-
-
-class CommonTimezonesTestCase(unittest.TestCase):
-    def test_bratislava(self):
-        # Bratislava is the default timezone for Slovakia, but our
-        # heuristics where not adding it to common_timezones. Ideally,
-        # common_timezones should be populated from zone.tab at runtime,
-        # but I'm hesitant to pay the startup cost as loading the list
-        # on demand whilst remaining backwards compatible seems
-        # difficult.
-        self.assertTrue('Europe/Bratislava' in pytz.common_timezones)
-        self.assertTrue('Europe/Bratislava' in pytz.common_timezones_set)
-
-    def test_us_eastern(self):
-        self.assertTrue('US/Eastern' in pytz.common_timezones)
-        self.assertTrue('US/Eastern' in pytz.common_timezones_set)
-
-    def test_belfast(self):
-        # Belfast uses London time.
-        self.assertTrue('Europe/Belfast' in pytz.all_timezones_set)
-        self.assertFalse('Europe/Belfast' in pytz.common_timezones)
-        self.assertFalse('Europe/Belfast' in pytz.common_timezones_set)
-
-
-class BaseTzInfoTestCase:
-    '''Ensure UTC, StaticTzInfo and DstTzInfo work consistently.
-
-    These tests are run for each type of tzinfo.
-    '''
-    tz = None  # override
-    tz_class = None  # override
-
-    def test_expectedclass(self):
-        self.assertTrue(isinstance(self.tz, self.tz_class))
-
-    def test_fromutc(self):
-        # naive datetime.
-        dt1 = datetime(2011, 10, 31)
-
-        # localized datetime, same timezone.
-        dt2 = self.tz.localize(dt1)
-
-        # Both should give the same results. Note that the standard
-        # Python tzinfo.fromutc() only supports the second.
-        for dt in [dt1, dt2]:
-            loc_dt = self.tz.fromutc(dt)
-            loc_dt2 = pytz.utc.localize(dt1).astimezone(self.tz)
-            self.assertEqual(loc_dt, loc_dt2)
-
-        # localized datetime, different timezone.
-        new_tz = pytz.timezone('Europe/Paris')
-        self.assertTrue(self.tz is not new_tz)
-        dt3 = new_tz.localize(dt1)
-        self.assertRaises(ValueError, self.tz.fromutc, dt3)
-
-    def test_normalize(self):
-        other_tz = pytz.timezone('Europe/Paris')
-        self.assertTrue(self.tz is not other_tz)
-
-        dt = datetime(2012, 3, 26, 12, 0)
-        other_dt = other_tz.localize(dt)
-
-        local_dt = self.tz.normalize(other_dt)
-
-        self.assertTrue(local_dt.tzinfo is not other_dt.tzinfo)
-        self.assertNotEqual(
-            local_dt.replace(tzinfo=None), other_dt.replace(tzinfo=None))
-
-    def test_astimezone(self):
-        other_tz = pytz.timezone('Europe/Paris')
-        self.assertTrue(self.tz is not other_tz)
-
-        dt = datetime(2012, 3, 26, 12, 0)
-        other_dt = other_tz.localize(dt)
-
-        local_dt = other_dt.astimezone(self.tz)
-
-        self.assertTrue(local_dt.tzinfo is not other_dt.tzinfo)
-        self.assertNotEqual(
-            local_dt.replace(tzinfo=None), other_dt.replace(tzinfo=None))
-
-
-class OptimizedUTCTestCase(unittest.TestCase, BaseTzInfoTestCase):
-    tz = pytz.utc
-    tz_class = tz.__class__
-
-
-class LegacyUTCTestCase(unittest.TestCase, BaseTzInfoTestCase):
-    # Deprecated timezone, but useful for comparison tests.
-    tz = pytz.timezone('Etc/UTC')
-    tz_class = StaticTzInfo
-
-
-class StaticTzInfoTestCase(unittest.TestCase, BaseTzInfoTestCase):
-    tz = pytz.timezone('GMT')
-    tz_class = StaticTzInfo
-
-
-class DstTzInfoTestCase(unittest.TestCase, BaseTzInfoTestCase):
-    tz = pytz.timezone('Australia/Melbourne')
-    tz_class = DstTzInfo
-
-
-def test_suite():
-    suite = unittest.TestSuite()
-    suite.addTest(doctest.DocTestSuite('pytz'))
-    suite.addTest(doctest.DocTestSuite('pytz.tzinfo'))
-    import test_tzinfo
-    suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(test_tzinfo))
-    return suite
-
-
-if __name__ == '__main__':
-    warnings.simplefilter("error") # Warnings should be fatal in tests.
-    unittest.main(defaultTest='test_suite')
-

+ 0 - 563
desktop/core/ext-py/pytz-2013.9/pytz/tzinfo.py

@@ -1,563 +0,0 @@
-'''Base classes and helpers for building zone specific tzinfo classes'''
-
-from datetime import datetime, timedelta, tzinfo
-from bisect import bisect_right
-try:
-    set
-except NameError:
-    from sets import Set as set
-
-import pytz
-from pytz.exceptions import AmbiguousTimeError, NonExistentTimeError
-
-__all__ = []
-
-_timedelta_cache = {}
-def memorized_timedelta(seconds):
-    '''Create only one instance of each distinct timedelta'''
-    try:
-        return _timedelta_cache[seconds]
-    except KeyError:
-        delta = timedelta(seconds=seconds)
-        _timedelta_cache[seconds] = delta
-        return delta
-
-_epoch = datetime.utcfromtimestamp(0)
-_datetime_cache = {0: _epoch}
-def memorized_datetime(seconds):
-    '''Create only one instance of each distinct datetime'''
-    try:
-        return _datetime_cache[seconds]
-    except KeyError:
-        # NB. We can't just do datetime.utcfromtimestamp(seconds) as this
-        # fails with negative values under Windows (Bug #90096)
-        dt = _epoch + timedelta(seconds=seconds)
-        _datetime_cache[seconds] = dt
-        return dt
-
-_ttinfo_cache = {}
-def memorized_ttinfo(*args):
-    '''Create only one instance of each distinct tuple'''
-    try:
-        return _ttinfo_cache[args]
-    except KeyError:
-        ttinfo = (
-                memorized_timedelta(args[0]),
-                memorized_timedelta(args[1]),
-                args[2]
-                )
-        _ttinfo_cache[args] = ttinfo
-        return ttinfo
-
-_notime = memorized_timedelta(0)
-
-def _to_seconds(td):
-    '''Convert a timedelta to seconds'''
-    return td.seconds + td.days * 24 * 60 * 60
-
-
-class BaseTzInfo(tzinfo):
-    # Overridden in subclass
-    _utcoffset = None
-    _tzname = None
-    zone = None
-
-    def __str__(self):
-        return self.zone
-
-
-class StaticTzInfo(BaseTzInfo):
-    '''A timezone that has a constant offset from UTC
-
-    These timezones are rare, as most locations have changed their
-    offset at some point in their history
-    '''
-    def fromutc(self, dt):
-        '''See datetime.tzinfo.fromutc'''
-        if dt.tzinfo is not None and dt.tzinfo is not self:
-            raise ValueError('fromutc: dt.tzinfo is not self')
-        return (dt + self._utcoffset).replace(tzinfo=self)
-
-    def utcoffset(self, dt, is_dst=None):
-        '''See datetime.tzinfo.utcoffset
-
-        is_dst is ignored for StaticTzInfo, and exists only to
-        retain compatibility with DstTzInfo.
-        '''
-        return self._utcoffset
-
-    def dst(self, dt, is_dst=None):
-        '''See datetime.tzinfo.dst
-
-        is_dst is ignored for StaticTzInfo, and exists only to
-        retain compatibility with DstTzInfo.
-        '''
-        return _notime
-
-    def tzname(self, dt, is_dst=None):
-        '''See datetime.tzinfo.tzname
-
-        is_dst is ignored for StaticTzInfo, and exists only to
-        retain compatibility with DstTzInfo.
-        '''
-        return self._tzname
-
-    def localize(self, dt, is_dst=False):
-        '''Convert naive time to local time'''
-        if dt.tzinfo is not None:
-            raise ValueError('Not naive datetime (tzinfo is already set)')
-        return dt.replace(tzinfo=self)
-
-    def normalize(self, dt, is_dst=False):
-        '''Correct the timezone information on the given datetime.
-
-        This is normally a no-op, as StaticTzInfo timezones never have
-        ambiguous cases to correct:
-
-        >>> from pytz import timezone
-        >>> gmt = timezone('GMT')
-        >>> isinstance(gmt, StaticTzInfo)
-        True
-        >>> dt = datetime(2011, 5, 8, 1, 2, 3, tzinfo=gmt)
-        >>> gmt.normalize(dt) is dt
-        True
-
-        The supported method of converting between timezones is to use
-        datetime.astimezone(). Currently normalize() also works:
-
-        >>> la = timezone('America/Los_Angeles')
-        >>> dt = la.localize(datetime(2011, 5, 7, 1, 2, 3))
-        >>> fmt = '%Y-%m-%d %H:%M:%S %Z (%z)'
-        >>> gmt.normalize(dt).strftime(fmt)
-        '2011-05-07 08:02:03 GMT (+0000)'
-        '''
-        if dt.tzinfo is self:
-            return dt
-        if dt.tzinfo is None:
-            raise ValueError('Naive time - no tzinfo set')
-        return dt.astimezone(self)
-
-    def __repr__(self):
-        return '<StaticTzInfo %r>' % (self.zone,)
-
-    def __reduce__(self):
-        # Special pickle to zone remains a singleton and to cope with
-        # database changes. 
-        return pytz._p, (self.zone,)
-
-
-class DstTzInfo(BaseTzInfo):
-    '''A timezone that has a variable offset from UTC
-
-    The offset might change if daylight savings time comes into effect,
-    or at a point in history when the region decides to change their
-    timezone definition.
-    '''
-    # Overridden in subclass
-    _utc_transition_times = None # Sorted list of DST transition times in UTC
-    _transition_info = None # [(utcoffset, dstoffset, tzname)] corresponding
-                            # to _utc_transition_times entries
-    zone = None
-
-    # Set in __init__
-    _tzinfos = None
-    _dst = None # DST offset
-
-    def __init__(self, _inf=None, _tzinfos=None):
-        if _inf:
-            self._tzinfos = _tzinfos
-            self._utcoffset, self._dst, self._tzname = _inf
-        else:
-            _tzinfos = {}
-            self._tzinfos = _tzinfos
-            self._utcoffset, self._dst, self._tzname = self._transition_info[0]
-            _tzinfos[self._transition_info[0]] = self
-            for inf in self._transition_info[1:]:
-                if inf not in _tzinfos:
-                    _tzinfos[inf] = self.__class__(inf, _tzinfos)
-
-    def fromutc(self, dt):
-        '''See datetime.tzinfo.fromutc'''
-        if (dt.tzinfo is not None
-            and getattr(dt.tzinfo, '_tzinfos', None) is not self._tzinfos):
-            raise ValueError('fromutc: dt.tzinfo is not self')
-        dt = dt.replace(tzinfo=None)
-        idx = max(0, bisect_right(self._utc_transition_times, dt) - 1)
-        inf = self._transition_info[idx]
-        return (dt + inf[0]).replace(tzinfo=self._tzinfos[inf])
-
-    def normalize(self, dt):
-        '''Correct the timezone information on the given datetime
-
-        If date arithmetic crosses DST boundaries, the tzinfo
-        is not magically adjusted. This method normalizes the
-        tzinfo to the correct one.
-
-        To test, first we need to do some setup
-
-        >>> from pytz import timezone
-        >>> utc = timezone('UTC')
-        >>> eastern = timezone('US/Eastern')
-        >>> fmt = '%Y-%m-%d %H:%M:%S %Z (%z)'
-
-        We next create a datetime right on an end-of-DST transition point,
-        the instant when the wallclocks are wound back one hour.
-
-        >>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc)
-        >>> loc_dt = utc_dt.astimezone(eastern)
-        >>> loc_dt.strftime(fmt)
-        '2002-10-27 01:00:00 EST (-0500)'
-
-        Now, if we subtract a few minutes from it, note that the timezone
-        information has not changed.
-
-        >>> before = loc_dt - timedelta(minutes=10)
-        >>> before.strftime(fmt)
-        '2002-10-27 00:50:00 EST (-0500)'
-
-        But we can fix that by calling the normalize method
-
-        >>> before = eastern.normalize(before)
-        >>> before.strftime(fmt)
-        '2002-10-27 01:50:00 EDT (-0400)'
-
-        The supported method of converting between timezones is to use
-        datetime.astimezone(). Currently, normalize() also works:
-
-        >>> th = timezone('Asia/Bangkok')
-        >>> am = timezone('Europe/Amsterdam')
-        >>> dt = th.localize(datetime(2011, 5, 7, 1, 2, 3))
-        >>> fmt = '%Y-%m-%d %H:%M:%S %Z (%z)'
-        >>> am.normalize(dt).strftime(fmt)
-        '2011-05-06 20:02:03 CEST (+0200)'
-        '''
-        if dt.tzinfo is None:
-            raise ValueError('Naive time - no tzinfo set')
-
-        # Convert dt in localtime to UTC
-        offset = dt.tzinfo._utcoffset
-        dt = dt.replace(tzinfo=None)
-        dt = dt - offset
-        # convert it back, and return it
-        return self.fromutc(dt)
-
-    def localize(self, dt, is_dst=False):
-        '''Convert naive time to local time.
-
-        This method should be used to construct localtimes, rather
-        than passing a tzinfo argument to a datetime constructor.
-
-        is_dst is used to determine the correct timezone in the ambigous
-        period at the end of daylight savings time.
-
-        >>> from pytz import timezone
-        >>> fmt = '%Y-%m-%d %H:%M:%S %Z (%z)'
-        >>> amdam = timezone('Europe/Amsterdam')
-        >>> dt  = datetime(2004, 10, 31, 2, 0, 0)
-        >>> loc_dt1 = amdam.localize(dt, is_dst=True)
-        >>> loc_dt2 = amdam.localize(dt, is_dst=False)
-        >>> loc_dt1.strftime(fmt)
-        '2004-10-31 02:00:00 CEST (+0200)'
-        >>> loc_dt2.strftime(fmt)
-        '2004-10-31 02:00:00 CET (+0100)'
-        >>> str(loc_dt2 - loc_dt1)
-        '1:00:00'
-
-        Use is_dst=None to raise an AmbiguousTimeError for ambiguous
-        times at the end of daylight savings
-
-        >>> try:
-        ...     loc_dt1 = amdam.localize(dt, is_dst=None)
-        ... except AmbiguousTimeError:
-        ...     print('Ambiguous')
-        Ambiguous
-
-        is_dst defaults to False
-
-        >>> amdam.localize(dt) == amdam.localize(dt, False)
-        True
-
-        is_dst is also used to determine the correct timezone in the
-        wallclock times jumped over at the start of daylight savings time.
-
-        >>> pacific = timezone('US/Pacific')
-        >>> dt = datetime(2008, 3, 9, 2, 0, 0)
-        >>> ploc_dt1 = pacific.localize(dt, is_dst=True)
-        >>> ploc_dt2 = pacific.localize(dt, is_dst=False)
-        >>> ploc_dt1.strftime(fmt)
-        '2008-03-09 02:00:00 PDT (-0700)'
-        >>> ploc_dt2.strftime(fmt)
-        '2008-03-09 02:00:00 PST (-0800)'
-        >>> str(ploc_dt2 - ploc_dt1)
-        '1:00:00'
-
-        Use is_dst=None to raise a NonExistentTimeError for these skipped
-        times.
-
-        >>> try:
-        ...     loc_dt1 = pacific.localize(dt, is_dst=None)
-        ... except NonExistentTimeError:
-        ...     print('Non-existent')
-        Non-existent
-        '''
-        if dt.tzinfo is not None:
-            raise ValueError('Not naive datetime (tzinfo is already set)')
-
-        # Find the two best possibilities.
-        possible_loc_dt = set()
-        for delta in [timedelta(days=-1), timedelta(days=1)]:
-            loc_dt = dt + delta
-            idx = max(0, bisect_right(
-                self._utc_transition_times, loc_dt) - 1)
-            inf = self._transition_info[idx]
-            tzinfo = self._tzinfos[inf]
-            loc_dt = tzinfo.normalize(dt.replace(tzinfo=tzinfo))
-            if loc_dt.replace(tzinfo=None) == dt:
-                possible_loc_dt.add(loc_dt)
-
-        if len(possible_loc_dt) == 1:
-            return possible_loc_dt.pop()
-
-        # If there are no possibly correct timezones, we are attempting
-        # to convert a time that never happened - the time period jumped
-        # during the start-of-DST transition period.
-        if len(possible_loc_dt) == 0:
-            # If we refuse to guess, raise an exception.
-            if is_dst is None:
-                raise NonExistentTimeError(dt)
-
-            # If we are forcing the pre-DST side of the DST transition, we
-            # obtain the correct timezone by winding the clock forward a few
-            # hours.
-            elif is_dst:
-                return self.localize(
-                    dt + timedelta(hours=6), is_dst=True) - timedelta(hours=6)
-
-            # If we are forcing the post-DST side of the DST transition, we
-            # obtain the correct timezone by winding the clock back.
-            else:
-                return self.localize(
-                    dt - timedelta(hours=6), is_dst=False) + timedelta(hours=6)
-
-
-        # If we get this far, we have multiple possible timezones - this
-        # is an ambiguous case occuring during the end-of-DST transition.
-
-        # If told to be strict, raise an exception since we have an
-        # ambiguous case
-        if is_dst is None:
-            raise AmbiguousTimeError(dt)
-
-        # Filter out the possiblilities that don't match the requested
-        # is_dst
-        filtered_possible_loc_dt = [
-            p for p in possible_loc_dt
-                if bool(p.tzinfo._dst) == is_dst
-            ]
-
-        # Hopefully we only have one possibility left. Return it.
-        if len(filtered_possible_loc_dt) == 1:
-            return filtered_possible_loc_dt[0]
-
-        if len(filtered_possible_loc_dt) == 0:
-            filtered_possible_loc_dt = list(possible_loc_dt)
-
-        # If we get this far, we have in a wierd timezone transition
-        # where the clocks have been wound back but is_dst is the same
-        # in both (eg. Europe/Warsaw 1915 when they switched to CET).
-        # At this point, we just have to guess unless we allow more
-        # hints to be passed in (such as the UTC offset or abbreviation),
-        # but that is just getting silly.
-        #
-        # Choose the earliest (by UTC) applicable timezone.
-        sorting_keys = {}
-        for local_dt in filtered_possible_loc_dt:
-            key = local_dt.replace(tzinfo=None) - local_dt.tzinfo._utcoffset
-            sorting_keys[key] = local_dt
-        first_key = sorted(sorting_keys)[0]
-        return sorting_keys[first_key]
-
-    def utcoffset(self, dt, is_dst=None):
-        '''See datetime.tzinfo.utcoffset
-
-        The is_dst parameter may be used to remove ambiguity during DST
-        transitions.
-
-        >>> from pytz import timezone
-        >>> tz = timezone('America/St_Johns')
-        >>> ambiguous = datetime(2009, 10, 31, 23, 30)
-
-        >>> tz.utcoffset(ambiguous, is_dst=False)
-        datetime.timedelta(-1, 73800)
-
-        >>> tz.utcoffset(ambiguous, is_dst=True)
-        datetime.timedelta(-1, 77400)
-
-        >>> try:
-        ...     tz.utcoffset(ambiguous)
-        ... except AmbiguousTimeError:
-        ...     print('Ambiguous')
-        Ambiguous
-
-        '''
-        if dt is None:
-            return None
-        elif dt.tzinfo is not self:
-            dt = self.localize(dt, is_dst)
-            return dt.tzinfo._utcoffset
-        else:
-            return self._utcoffset
-
-    def dst(self, dt, is_dst=None):
-        '''See datetime.tzinfo.dst
-
-        The is_dst parameter may be used to remove ambiguity during DST
-        transitions.
-
-        >>> from pytz import timezone
-        >>> tz = timezone('America/St_Johns')
-
-        >>> normal = datetime(2009, 9, 1)
-
-        >>> tz.dst(normal)
-        datetime.timedelta(0, 3600)
-        >>> tz.dst(normal, is_dst=False)
-        datetime.timedelta(0, 3600)
-        >>> tz.dst(normal, is_dst=True)
-        datetime.timedelta(0, 3600)
-
-        >>> ambiguous = datetime(2009, 10, 31, 23, 30)
-
-        >>> tz.dst(ambiguous, is_dst=False)
-        datetime.timedelta(0)
-        >>> tz.dst(ambiguous, is_dst=True)
-        datetime.timedelta(0, 3600)
-        >>> try:
-        ...     tz.dst(ambiguous)
-        ... except AmbiguousTimeError:
-        ...     print('Ambiguous')
-        Ambiguous
-
-        '''
-        if dt is None:
-            return None
-        elif dt.tzinfo is not self:
-            dt = self.localize(dt, is_dst)
-            return dt.tzinfo._dst
-        else:
-            return self._dst
-
-    def tzname(self, dt, is_dst=None):
-        '''See datetime.tzinfo.tzname
-
-        The is_dst parameter may be used to remove ambiguity during DST
-        transitions.
-
-        >>> from pytz import timezone
-        >>> tz = timezone('America/St_Johns')
-
-        >>> normal = datetime(2009, 9, 1)
-
-        >>> tz.tzname(normal)
-        'NDT'
-        >>> tz.tzname(normal, is_dst=False)
-        'NDT'
-        >>> tz.tzname(normal, is_dst=True)
-        'NDT'
-
-        >>> ambiguous = datetime(2009, 10, 31, 23, 30)
-
-        >>> tz.tzname(ambiguous, is_dst=False)
-        'NST'
-        >>> tz.tzname(ambiguous, is_dst=True)
-        'NDT'
-        >>> try:
-        ...     tz.tzname(ambiguous)
-        ... except AmbiguousTimeError:
-        ...     print('Ambiguous')
-        Ambiguous
-        '''
-        if dt is None:
-            return self.zone
-        elif dt.tzinfo is not self:
-            dt = self.localize(dt, is_dst)
-            return dt.tzinfo._tzname
-        else:
-            return self._tzname
-
-    def __repr__(self):
-        if self._dst:
-            dst = 'DST'
-        else:
-            dst = 'STD'
-        if self._utcoffset > _notime:
-            return '<DstTzInfo %r %s+%s %s>' % (
-                    self.zone, self._tzname, self._utcoffset, dst
-                )
-        else:
-            return '<DstTzInfo %r %s%s %s>' % (
-                    self.zone, self._tzname, self._utcoffset, dst
-                )
-
-    def __reduce__(self):
-        # Special pickle to zone remains a singleton and to cope with
-        # database changes.
-        return pytz._p, (
-                self.zone,
-                _to_seconds(self._utcoffset),
-                _to_seconds(self._dst),
-                self._tzname
-                )
-
-
-
-def unpickler(zone, utcoffset=None, dstoffset=None, tzname=None):
-    """Factory function for unpickling pytz tzinfo instances.
-
-    This is shared for both StaticTzInfo and DstTzInfo instances, because
-    database changes could cause a zones implementation to switch between
-    these two base classes and we can't break pickles on a pytz version
-    upgrade.
-    """
-    # Raises a KeyError if zone no longer exists, which should never happen
-    # and would be a bug.
-    tz = pytz.timezone(zone)
-
-    # A StaticTzInfo - just return it
-    if utcoffset is None:
-        return tz
-
-    # This pickle was created from a DstTzInfo. We need to
-    # determine which of the list of tzinfo instances for this zone
-    # to use in order to restore the state of any datetime instances using
-    # it correctly.
-    utcoffset = memorized_timedelta(utcoffset)
-    dstoffset = memorized_timedelta(dstoffset)
-    try:
-        return tz._tzinfos[(utcoffset, dstoffset, tzname)]
-    except KeyError:
-        # The particular state requested in this timezone no longer exists.
-        # This indicates a corrupt pickle, or the timezone database has been
-        # corrected violently enough to make this particular
-        # (utcoffset,dstoffset) no longer exist in the zone, or the
-        # abbreviation has been changed.
-        pass
-
-    # See if we can find an entry differing only by tzname. Abbreviations
-    # get changed from the initial guess by the database maintainers to
-    # match reality when this information is discovered.
-    for localized_tz in tz._tzinfos.values():
-        if (localized_tz._utcoffset == utcoffset
-                and localized_tz._dst == dstoffset):
-            return localized_tz
-
-    # This (utcoffset, dstoffset) information has been removed from the
-    # zone. Add it back. This might occur when the database maintainers have
-    # corrected incorrect information. datetime instances using this
-    # incorrect information will continue to do so, exactly as they were
-    # before being pickled. This is purely an overly paranoid safety net - I
-    # doubt this will ever been needed in real life.
-    inf = (utcoffset, dstoffset, tzname)
-    tz._tzinfos[inf] = tz.__class__(inf, tz._tzinfos)
-    return tz._tzinfos[inf]
-

BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Abidjan


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Accra


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Addis_Ababa


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Algiers


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Asmara


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Asmera


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Bamako


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Bangui


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Banjul


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Bissau


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Blantyre


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Brazzaville


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Bujumbura


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Cairo


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Casablanca


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Ceuta


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Conakry


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Dakar


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Dar_es_Salaam


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Djibouti


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Douala


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/El_Aaiun


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Freetown


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Gaborone


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Harare


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Johannesburg


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Juba


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Kampala


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Khartoum


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Kigali


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Kinshasa


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Lagos


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Libreville


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Lome


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Luanda


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Lubumbashi


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Lusaka


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Malabo


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Maputo


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Maseru


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Mbabane


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Mogadishu


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Monrovia


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Nairobi


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Ndjamena


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Niamey


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Nouakchott


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Ouagadougou


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Porto-Novo


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Sao_Tome


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Timbuktu


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Tripoli


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Tunis


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/Africa/Windhoek


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Adak


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Anguilla


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Antigua


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Araguaina


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/Buenos_Aires


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/ComodRivadavia


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/Cordoba


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/Jujuy


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/Rio_Gallegos


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/Salta


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/San_Luis


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Argentina/Ushuaia


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Aruba


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Asuncion


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Atikokan


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Atka


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Bahia


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Bahia_Banderas


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Barbados


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Belem


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Belize


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Blanc-Sablon


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Boa_Vista


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Bogota


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Buenos_Aires


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Campo_Grande


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Cancun


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Caracas


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Cayenne


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Cayman


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Chicago


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Chihuahua


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Coral_Harbour


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Costa_Rica


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Creston


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Cuiaba


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Curacao


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Danmarkshavn


BIN
desktop/core/ext-py/pytz-2013.9/pytz/zoneinfo/America/Dawson_Creek


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác