%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/pytz/
Upload File :
Create Path :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyo

�
���Uc@s�dZdZeZeZeZdddddddd	d
ddd
gZddlZddlZddlZ	ddl
Z
yddlmZWn!e
k
r�ddlmZnXyddlmZWne
k
r�dZnXddlmZddlmZddlmZddlmZddlmZddlmZmZyeWn ek
rneZd�Z n
Xd�Z e	j!d�p�dZ"e"j#e	j$�r�e"d Z"nd�Z%d�Z&iZ'd�Z(d �Z)ej*d!�Z+ej*d"d#�Z,d$ej-fd%��YZ.e.�Z.Z/d&�Z0e1e0_2d'�Z3e1e3_2d(efd)��YZ4d*e4fd+��YZ5e5�Z6d,e4fd-��YZ7e7�Z8d.ej-fd/��YZ9id0�Z:e1e:_2d1�Z;e<d2kr�e;�ngZ=xge	j>e"�D]V\Z?Z@ZAx-dBD]%ZBeBe@kre@e@jCeB�=qqWe=jDd5�eAD��q�We=jE�eFe=�ZGgeHe	jIjJe"d6��D]2ZKeKd7kr�eKd!d8kr�eKjL�d9^q�d:d;d<d=d>d?d@dAd$g	ZMeMjE�eFeM�ZNdS(Cs�
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.
t2012dttimezonetutctcountry_timezonest
country_namestAmbiguousTimeErrortInvalidTimeErrortNonExistentTimeErrortUnknownTimeZoneErrort
all_timezonestall_timezones_settcommon_timezonestcommon_timezones_seti����N(t	DictMixin(tMapping(tresource_stream(R(R(R(R(t	unpickler(tbuild_tzinfot_byte_stringcCs|jd�|S(s�
        >>> ascii('Hello')
        'Hello'
        >>> ascii('\N{TRADE MARK SIGN}') #doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
            ...
        UnicodeEncodeError: ...
        sUS-ASCII(tencode(ts((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pytascii8s	
cCs
|jd�S(s
        >>> ascii('Hello')
        'Hello'
        >>> ascii(u'Hello')
        'Hello'
        >>> ascii(u'\N{TRADE MARK SIGN}') #doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
            ...
        UnicodeEncodeError: ...
        sUS-ASCII(R(R((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRFstTZDIRs/usr/share/zoneinfocCs�|jd�jd�}xE|D]=}|tjjksItjj|krtd|��qqWtjjt|�}t	|d�S(s;Open a resource from the zoneinfo subdir for reading.

    t/sBad path segment: %rtrb(
tlstriptsplittostpathtpardirtsept
ValueErrortjoint_tzinfo_dirtopen(tnamet
name_partstparttfilename((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt
open_resourceWs
$cCs1yt|�j�tSWntk
r,tSXdS(s(Return true if the given resource existsN(R'tclosetTruetIOErrortFalse(R#((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pytresource_existscs

cCs�|j�dkrtSyt|�}Wntk
rEt|��nXt|�}|tkr�|tkr�t|�}zt	||�t|<Wd|j
�Xq�t|��nt|S(sp 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

    tUTCN(tupperRRtUnicodeEncodeErrorRt
_unmunge_zonet
_tzinfo_cacheR
R'RR((tzonetfp((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyR}s%
cCs|jdd�jdd�S(s?Undo the time zone name munging done by older versions of pytz.t_plus_t+t_minus_t-(treplace(R2((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyR0�sithoursiR-cBs}eZdZdZeZeZeZd�Zd�Z	d�Z
d�Zd�Ze
d�Ze
d�Zd	�Zd
�ZRS(s�UTC

    Optimized UTC implementation. It unpickles using the single module global
    instance defined beneath this class declaration.
    R-cCs5|jdkr|j|�Sttj|�j|�S(N(ttzinfotNonetlocalizetsuperRt	__class__tfromutc(tselftdt((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyR?�s
cCstS(N(tZERO(R@RA((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt	utcoffset�scCsdS(NR-((R@RA((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyttzname�scCstS(N(RB(R@RA((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pytdst�scCs
tdfS(N((t_UTC(R@((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt
__reduce__�scCs.|jdk	rtd��n|jd|�S(s Convert naive time to local times*Not naive datetime (tzinfo is already set)R:N(R:R;RR8(R@RAtis_dst((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyR<�scCs>|j|kr|S|jdkr1td��n|j|�S(s6Correct the timezone information on the given datetimesNaive time - no tzinfo setN(R:R;Rt
astimezone(R@RARH((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt	normalize�s
cCsdS(Ns<UTC>((R@((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt__repr__�scCsdS(NR-((R@((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt__str__�s(t__name__t
__module__t__doc__R2RBt
_utcoffsett_dstt_tznameR?RCRDRERGR+R<RJRKRL(((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyR-�s						cCstS(s+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
    (R(((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRF�scGs
t|�S(s�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.
    (R(targs((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt_pst	_LazyDictcBsAeZdZdZd�Zd�Zd�Zd�Zd�Z	RS(s"Dictionary populated on first use.cCs-|jdkr|j�n|j|j�S(N(tdataR;t_fillR.(R@tkey((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt__getitem__%s
cCs)|jdkr|j�n||jkS(N(RVR;RW(R@RX((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt__contains__*s
cCs)|jdkr|j�nt|j�S(N(RVR;RWtiter(R@((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt__iter__/s
cCs)|jdkr|j�nt|j�S(N(RVR;RWtlen(R@((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt__len__4s
cCs)|jdkr|j�n|jj�S(N(RVR;RWtkeys(R@((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyR_9s
N(
RMRNROR;RVRYRZR\R^R_(((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRU"s				t_CountryTimezoneDictcBs eZdZd�Zd�ZRS(s�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
    cCs||S(sBackwards compatibility.((R@tiso3166_code((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt__call___scCs�i}td�}z�x�|D]�}|jd�}|jd�rFqn|jdd�d \}}}|tkrwqny||j|�Wqtk
r�|g||<qXqW||_Wd|j	�XdS(Nszone.tabsUS-ASCIIt#ii(
R'tdecodet
startswithRR;R
tappendtKeyErrorRVR((R@RVtzone_tabtlinetcodetcoordinatesR2((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRWcs 


(RMRNRORbRW(((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyR`?s	t_CountryNameDictcBseZdZd�ZRS(sgDictionary proving ISO3166 code -> English name.

    >>> print(country_names['au'])
    Australia
    cCs�i}td�}zpx`|j�D]R}|jd�}|jd�rLq"n|jdd�\}}|j�||<q"W||_Wd|j�XdS(Nsiso3166.tabsUS-ASCIIRci(	R't	readlinesRdReRR;tstripRVR((R@RVRhRiRjR#((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRWs
(RMRNRORW(((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRlyst_FixedOffsetcBs\eZdZd�Zd�Zd�Zd�Zd�Zd�Z	e
d�Ze
d�ZRS(	cCsFt|�dkr$td|��n||_tjd|�|_dS(Ni�sabsolute offset is too largetminutes(tabsRt_minutestdatetimet	timedeltat_offset(R@Rp((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt__init__�s	cCs|jS(N(Ru(R@RA((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRC�scCst|jffS(N(tFixedOffsetRr(R@((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRG�scCstS(N(RB(R@RA((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRE�scCsdS(N(R;(R@RA((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRD�scCsd|jS(Nspytz.FixedOffset(%d)(Rr(R@((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRK�scCs.|jdk	rtd��n|jd|�S(s Convert naive time to local times*Not naive datetime (tzinfo is already set)R:N(R:R;RR8(R@RARH((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyR<�scCs.|jdkrtd��n|jd|�S(s6Correct the timezone information on the given datetimesNaive time - no tzinfo setR:N(R:R;RR8(R@RARH((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRJ�sN(
RMRNR;R2RvRCRGRERDRKR+R<RJ(((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRo�s						cCsJ|dkrtS|j|�}|dkrF|j|t|��}n|S(s�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
    iN(R-tgetR;t
setdefaultRo(toffsett_tzinfostinfo((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyRw�s5cCsSddl}ddl}ddl}|jjd|j�ddl}|j|�S(Ni����i(tdoctestRtsysRtinsertRtpytzttestmod(R}RR~R�((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt_test�s$t__main__tposixtrightccsV|]L}|dkr|dkrd|krtjjt|�tt�dVqdS(tREADMEtTheoryt.iN(RRR trootR]R!(t.0tfile((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pys	<genexpr>sszone.tabtRcitGMTs	US/Alaskas
US/Arizonas
US/Centrals
US/Easterns	US/HawaiisUS/Mountains
US/Pacific(sposixR�(OROt
OLSON_VERSIONtVERSIONt__version__t
OLSEN_VERSIONt__all__R~Rstos.pathRtgettexttUserDictR
tImportErrortcollectionsRt
pkg_resourcesRR;tpytz.exceptionsRRRRtpytz.tzinfoRtpytz.tzfileRRtunicodet	NameErrortstrRtgetenvR!tendswithRR'R,R1RR0RtRBtHOURR:R-RRFR)t__safe_for_unpickling__RTRUR`RRlRRoRwR�RMR	twalkR�tdirstfilestexcludetindextextendtsorttsetR
R"RR tlRRR(((s>/opt/alt/python27/lib/python2.7/site-packages/pytz/__init__.pyt<module>	s�0




	

			<	2
				7		&B		


/



Zerion Mini Shell 1.0