tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
K\¬Qc@sdZddlZddlZddlZddlmZddlmZddlmZ    ddl
m Z yddl mZWnddlmZnXgZd„Zd    efd
„ƒYZd efd „ƒYZeƒZeƒad Ziad„Zdd„Zdd„ZdS(sŒStrptime-related classes and functions.
 
CLASSES:
    LocaleTime -- Discovers and stores locale-specific time information
    TimeRE -- Creates regexes for pattern matching a string of text containing
                time information
 
FUNCTIONS:
    _getlang -- Figure out what language is being used for the locale
    strptime -- Calculates the time struct represented by the passed-in string
 
iÿÿÿÿN(tcompile(t
IGNORECASE(tescape(tdate(t allocate_lockcCstjtjƒS(N(tlocalet    getlocaletLC_TIME(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt_getlangst
LocaleTimecBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z    RS(skStores and handles locale-specific information related to time.
 
    ATTRIBUTES:
        f_weekday -- full weekday names (7-item list)
        a_weekday -- abbreviated weekday names (7-item list)
        f_month -- full month names (13-item list; dummy value in [0], which
                    is added by code)
        a_month -- abbreviated month names (13-item list, dummy value in
                    [0], which is added by code)
        am_pm -- AM/PM representation (2-item list)
        LC_date_time -- format string for date/time representation (string)
        LC_date -- format string for date representation (string)
        LC_time -- format string for time representation (string)
        timezone -- daylight- and non-daylight-savings timezone representation
                    (2-item list of sets)
        lang -- Language used by instance (2-item tuple)
    cCsctƒ|_|jƒ|jƒ|jƒ|jƒ|jƒtƒ|jkr_tdƒ‚ndS(s¹Set all attributes.
 
        Order of methods called matters for dependency reasons.
 
        The locale language is set at the offset and then checked again before
        exiting.  This is to make sure that the attributes were not set with a
        mix of information from more than one locale.  This would most likely
        happen when using threads where one thread calls a locale-dependent
        function while another thread changes the locale while the function in
        the other thread is still running.  Proper coding would call for
        locks to prevent changing the locale while locale-dependent code is
        running.  The check here is done in case someone does not think about
        doing this.
 
        Only other possible issue is if someone changed the timezone and did
        not call tz.tzset .  That is an issue for the programmer, though,
        since changing the timezone is worthless without that call.
 
        s$locale changed during initializationN(Rtlangt_LocaleTime__calc_weekdayt_LocaleTime__calc_montht_LocaleTime__calc_am_pmt_LocaleTime__calc_timezonet_LocaleTime__calc_date_timet
ValueError(tself((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt__init__2s 
 
 
 
 
cCs6t|ƒ}|r%|jddƒn |jdƒ|S(Nit(tlisttinserttappend(Rtseqtfront((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt__padOs
  cCsngtdƒD]}tj|jƒ^q }gtdƒD]}tj|jƒ^q9}||_||_dS(Ni(trangetcalendartday_abbrtlowertday_namet    a_weekdayt    f_weekday(RtiRR ((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt__calc_weekdayXs,,    cCsngtdƒD]}tj|jƒ^q }gtdƒD]}tj|jƒ^q9}||_||_dS(Ni (RRt
month_abbrRt
month_nameta_monthtf_month(RR!R%R&((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt __calc_month`s,,    c Csmg}xWd D]O}tjddd|dddd    d
f    ƒ}|jtjd |ƒjƒƒq W||_dS( NiiiÏiii,i7iiLis%p(ii(ttimet struct_timeRtstrftimeRtam_pm(RR+thourt
time_tuple((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt __calc_am_pmgs
 *#c Csõtjd0ƒ}dddg}tjd
|ƒjƒ|d    <tjd |ƒjƒ|d <tjd |ƒjƒ|d<d1|jddf|jddf|jddf|jddf|j    d dfd2d3d4d5d6d7d8d9d:d;d<g}|j
g|j D]}|D]}|d*f^qqüƒx¥d=d>d?fD]”\}}||}x/|D]'\}    }
|    rO|j |    |
ƒ}qOqOWtjd@ƒ}d,tj||ƒkrªd-} nd.} |j d/| ƒ||<q2W|d    |_ |d |_|d|_dS(ANiÏiiii,i7iiLis%cs%xis%Xt%s%%s%As%Bs%as%bs%pt1999s%Yt99s%yt22s%Ht44s%Mt55s%St76s%jt17s%dt03s%mt3t2s%wt10s%Is%Zit00s%Ws%Ut11(    iÏiiii,i7iiLi(R/s%%(R0s%Y(R1s%y(R2s%H(R3s%M(R4s%S(R5s%j(R6s%d(R7s%m(R8s%m(R9s%w(R:s%I(is%c(is%x(is%X(    iÏiiiiiiii(R(R)tNoneR*RR R&RR%R+textendttimezonetreplacet LC_date_timetLC_datetLC_time( RR-t    date_timetreplacement_pairst    tz_valuesttztoffsett    directivetcurrent_formattoldtnewtU_W((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt__calc_date_timess6                
      cCsˆytjƒWntk
r!nXtddtjdjƒgƒ}tjrlttjdjƒgƒ}n    tƒ}||f|_dS(Ntutctgmtii(R(ttzsettAttributeErrort    frozensetttznameRtdaylightR?(Rt    no_savingt
has_saving((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt__calc_timezone s "        (
t__name__t
__module__t__doc__Rt_LocaleTime__padR R R RR(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyR    s                            -tTimeREcBs5eZdZdd„Zd„Zd„Zd„ZRS(s4Handle conversion from format directives to regexes.cCsÃ|r||_n tƒ|_tt|ƒ}|jidd6dd6dd6dd6d    d
6d d 6d d6dd6dd6dd6dd6dd6|j|jjdƒd6|j|jjdƒd6|j|jjddƒd6|j|jj    ddƒd6|j|jj
dƒd6|jd„|jj Dƒd ƒd 6d!d!6ƒ|j d"|j dƒjdd"ƒƒ|j d#|j|jjƒƒ|j d$|j|jjƒƒ|j d%|j|jjƒƒd&S('s^Create keys/values.
 
        Order of execution is important for dependency reasons.
 
        s)(?P<d>3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])tds(?P<f>[0-9]{1,6})tfs(?P<H>2[0-3]|[0-1]\d|\d)tHs(?P<I>1[0-2]|0[1-9]|[1-9])tIsG(?P<j>36[0-6]|3[0-5]\d|[1-2]\d\d|0[1-9]\d|00[1-9]|[1-9]\d|0[1-9]|[1-9])tjs(?P<m>1[0-2]|0[1-9]|[1-9])tms(?P<M>[0-5]\d|\d)tMs(?P<S>6[0-1]|[0-5]\d|\d)tSs(?P<U>5[0-3]|[0-4]\d|\d)tUs (?P<w>[0-6])tws (?P<y>\d\d)tys(?P<Y>\d\d\d\d)tYtAtaitBtbtpcss"|]}|D] }|Vq qdS(N((t.0ttz_namesRG((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pys    <genexpr>ÔstZR/tWtctxtXN(t locale_timeR    tsuperR]Rt_TimeRE__seqToRER RR&R%R+R?t __setitem__t __getitem__R@tpatternRARBRC(RRvtbase((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyR³s:      
 %cCsnt|dtdtƒ}x"|D]}|dkrPqqWdSdjd„|Dƒƒ}d||f}d|S(sdConvert a list to a regex string for matching a directive.
 
        Want possible matching values to be from longest to shortest.  This
        prevents the possibility of a match occuring for a value that also
        a substring of a larger value that should have matched (e.g., 'abc'
        matching when 'abcdef' should have been the match).
 
        tkeytreverseRt|css|]}t|ƒVqdS(N(t    re_escape(Rotstuff((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pys    <genexpr>ìss    (?P<%s>%ss%s)(tsortedtlentTruetjoin(Rt
to_convertRItvaluetregex((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt    __seqToREÝs      cCs§d}tdƒ}|jd|ƒ}tdƒ}|jd|ƒ}xTd|kr˜|jdƒd}d|||d |||f}||d}qEWd||fS(    s£Return regex pattern for the format string.
 
        Need to make sure that any characters that might be interpreted as
        regex syntax are escaped.
 
        Rs([\\.^$*+?\(\){}\[\]|])s\\\1s\s+R/is%s%s%ss%s%s(t
re_compiletsubtindex(Rtformattprocessed_formatt regex_charstwhitespace_replacementtdirective_index((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyR{ðs   cCst|j|ƒtƒS(s2Return a compiled re object for the format string.(RŠR{R(RR((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyRsN(RYRZR[R=RRxR{R(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyR]°s
 *        icCs…t|ddƒjƒ}|s=|dd}|dd}nd|d}|dkrcd||S|d|d}d||SdS(sÎCalculate the Julian day based on the year, week of the year, and day of
    the week, with week_start_day representing whether the week of the year
    assumes the week starts on Sunday or Monday (6 or 0).iiiN(t datetime_datetweekday(tyeart week_of_yeart day_of_weektweek_starts_Mont first_weekdayt week_0_lengtht days_to_week((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt_calc_julian_from_U_or_Ws  s%a %b %d %H:%M:%S %YcCsðtþtƒtjjkr2tƒatjƒnttƒt    krQtjƒntj}tj
|ƒ}|sytj |ƒ}Wnnt k
rÒ}|j d}|dkr¶d}n~td||fƒ‚n!tk
ròtd|ƒ‚nX|t|<nWdQX|j|ƒ}|s4td||fƒ‚nt|ƒ|jƒkritd||jƒƒ‚nd}d    }}    d}
} } } d
}d
}d
}d
}}|jƒ}x¯|jƒD]¡}|d krt|d ƒ}|d krû|d 7}qa|d7}qÀ|dkr't|dƒ}qÀ|dkrFt|dƒ}qÀ|dkrq|jj|djƒƒ}qÀ|dkrœ|jj|djƒƒ}qÀ|dkr»t|dƒ}    qÀ|dkrÚt|dƒ}
qÀ|dkrqt|dƒ}
|j
ddƒjƒ}|d|jdfkr?|
dkrnd}
qnqa||jd    kra|
dkrn|
d7}
qnqaqÀ|dkrt|dƒ} qÀ|dkr¯t|dƒ} qÀ|dkrì|d}|ddt|ƒ7}t|ƒ} qÀ|dkr|jj|djƒƒ}qÀ|dkrB|jj|djƒƒ}qÀ|d kr€t|d ƒ}|dkrsd}qa|d    8}qÀ|d!krŸt|d!ƒ}qÀ|d*krÙt||ƒ}|d"krÐd}qad}qÀ|d$krÀ|d$jƒ}xit|jƒD]U\}}||krtj dtj d    krPtj!rP|d+krPPqZ|}PqqWqÀqÀWt"}|dkrž|d'krž|    d(kržd)}t#}n|dkr³d}n|d
kr|d
kr|d
kr|dkrét#nt"}t$||||ƒ}n|d
krHt%|||    ƒj&ƒt%|d    d    ƒj&ƒd    }nDt%j'|d    t%|d    d    ƒj&ƒƒ}|j(}|j)}|j*}    |d
kr³t%|||    ƒj+ƒ}n|rÂd}ntj,|||    |
| | |||f    ƒ| fS(,sEReturn a time struct based on the input string and the format string.is\R/s&'%s' is a bad directive in format '%s'sstray %% in format '%s'Ns%time data %r does not match format %rsunconverted data remains: %siiÿÿÿÿRhiDiÐilRiRcRlRmR^R`RaRnRi RdReR_t0iRjRkRgRbRfRrRqRORPiiip(RfRr(sutcsgmt(-t _cache_lockRt _TimeRE_cacheRvR
R]t _regex_cachetclearRƒt_CACHE_MAX_SIZEtgetRtKeyErrortargsRt
IndexErrortmatchtendR=t    groupdicttiterkeystintR&RŒRR%R+R Rt    enumerateR?R(RTRUtFalseR„R›R’t    toordinalt fromordinalR”tmonthtdayR“R)(t data_stringRRvt format_regexterrt bad_directivetfoundR”R¯R°R,tminutetsecondtfractionRGR•tweek_of_year_startR“tjuliant
found_dictt    group_keytampmtst
found_zoneR‡RFt leap_year_fixR—tdatetime_result((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt    _strptime'sî                 
 
 
                      $         $   5)                     cCst||ƒdS(Ni(RÂ(R±R((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt_strptime_timeÒs(R[R(RRtreRRŠRRR€tdatetimeRR’tthreadRt_thread_allocate_lockt dummy_threadt__all__RtobjectR    tdictR]RRžR¡RŸR›RÂRÃ(((sQ/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_strptime.pyt<module> s,       ‘[             «