Ñò i'dWc @sçdZddkZddklZddklZddklZdZ dZ dZ d Z d Z d Zd eifd „ƒYZeieƒZdeie fdeifdeifdefdeifge_deifd„ƒYZeieƒZdeie fdeifdeifdeifdefdeifge_deifd„ƒYZdeifd„ƒYZeieƒZdeie fd eie fd!eifd"eifd#efd$efd%eifge_eid&ƒZeiZ eie _!eieƒfe _"ei#Z$eie$_!eieƒefe$_"ei%Z&eie&_!eieƒefe&_"ei'Z(eie(_!efe(_"ei)Z*eie*_!efe*_"ei+Z,eie,_!efe,_"ei-Z.eie._!eieieife._"ei/Z0eie0_!eife0_"ed'd(d)d*gƒZ1ed+d,d)d*gƒZ2ed-d.d/d0d1gƒZ3ed2d(d3d)d*d4d5gƒZ4d6„Zd7„Z#d8„Z%d9ed:„Z-d9d;„Z/d<„Z5dS(=s Python package with ctypes wrapper for libzoneinfo. Example usage: import libzoneinfo as zi continent = reduce(lambda x, y: x or y.name=="Europe" and y, zi.get_tz_continents(), None) country = reduce(lambda x, y: x or y.code == "IE" and y, zi.get_tz_countries(continent), None) zone = reduce(lambda x, y: x or y.oname.endswith("Dublin") and y, zi.get_timezones_by_country(country), None) zi.isvalid_tz(zone.oname) zi.get_system_tz() iÿÿÿÿN(t namedtuple(tENOMEM(tstrerrori€i iiiit _TZContinentcBseZRS((t__name__t __module__(((s../libzoneinfo.pyR>st ctnt_namet ctnt_id_desctctnt_display_desct ctnt_nextt ctnt_reservedt _TZCountrycBseZRS((RR(((s../libzoneinfo.pyR Lst ctry_codet ctry_id_desctctry_display_desct ctry_statust ctry_nextt ctry_reservedt_TZCoordc BsneZdeifdeifdeifdeifdeifdeifdeifdeifgZRS(tlat_signt lat_degreet lat_minutet lat_secondt long_signt long_degreet long_minutet long_second(RRtCtc_inttc_uintt_fields_(((s../libzoneinfo.pyR[s       t _TZTimezonecBseZRS((RR(((s../libzoneinfo.pyRhsttz_namettz_onamet tz_id_descttz_display_descttz_coordttz_nextt tz_reserveds/usr/lib/libzoneinfo.sotTZContinentInfotnamet descriptiontl10nt TZCountryInfotcodet TZCoordInfotsigntdegreetminutetsecondtTZTimezoneInfotonametlatitudet longitudecCsÔtƒ}tti|ƒƒ}|djoFtiƒ}|tjotdƒ‚nt|dt|ƒƒ‚nt ƒ}|}xC|o;|i t |i i |i i|i iƒƒ|i i}qƒWt|ƒ|S(sZ get_tz_continents(None) -> list of TZContinentInfo This list is not sorted. iÿÿÿÿs(get_tz_continents(): insufficient memorysget_tz_continents(): %s(t _TZContinentpt_get_tz_continentsRtbyreft get_errnoRt MemoryErrortOSErrorRtlisttappendR'tcontentsRRRR t_free_tz_continents(theadtcountterrtresulttitr((s../libzoneinfo.pytget_tz_continents¥s"       cCs?t|tƒptdƒ‚ntƒ}|i|_|i|_|i|_ d|_ d|_ t ƒ}tti|ƒti|ƒƒ}|djoFtiƒ}|tjotdƒ‚nt|dt|ƒƒ‚ntƒ}|}xC|o;|it|ii|ii|iiƒƒ|ii}qîWt|ƒ|S(s| get_tz_countries(TZContinentInfo) -> list of TZCountryInfo The list is sorted by the localized country names. s#continent must be a TZContinentInfoiÿÿÿÿs'get_tz_countries(): insufficient memorysget_tz_countries(): %sN(t isinstanceR't TypeErrorRR(RR)RR*RtNoneR R t _TZCountrypt_get_tz_countriesRR8R9RR:R;RR<R=R+R>R R RRt_free_tz_countries(t continenttctntR@RARBRCRD((s../libzoneinfo.pytget_tz_countriesÂs2       !      c Csºt|tƒptdƒ‚ntƒ}|i|_|i|_|i|_ d|_ d|_ d}t ƒ}tti|ƒti|ƒƒ}|djoFtiƒ}|tjotdƒ‚nt|dt|ƒƒ‚ntƒ}|}x¸|o°|it|ii|ii|ii|iit|iii |iii!|iii"|iii#ƒt|iii$|iii%|iii&|iii'ƒƒƒ|ii(}qôWt)|ƒ|S(s~ get_timezones_by_country(TZContinentInfo) -> list of TZCountryInfo Returns a list of timezones for the country. s!continent must be a TZCountryInfoiiÿÿÿÿs'get_tz_countries(): insufficient memorysget_tz_countries(): %sN(*RFR+RGR R,R R)R R*RRRHRt _TZTimezonept_get_timezones_by_countryRR8R9RR:R;RR<R=tTZInfoR>R R!R"R#R-R$RRRRRRRRR%t_free_timezones(tcountrytctryRR@RARBRCRD((s../libzoneinfo.pytget_timezones_by_countryèsF       !            t/cCs¥t|tƒptdƒ‚nt|tƒptdƒ‚nt|tƒptdƒ‚n|ttttfjotdƒ‚nt |||ƒ}|djS(sL isvalid_tz(str, str, int) -> bool validate a timezone string. stimezone must be a strsroot must be a strsflag must be ints?flag must be in (VTZ_INSTALL, VTZ_ALL, VTZ_POSIX, VTZ_ZONEINFO)i( RFtstrRGtintt VTZ_INSTALLtVTZ_ALLt VTZ_POSIXt VTZ_ZONEINFOt ValueErrort _isvalid_tz(ttimezonetroottflagRC((s../libzoneinfo.pyt isvalid_tzscCs}t|tƒptdƒ‚nt|ƒ}|pFtiƒ}|tjotdƒ‚nt|dt |ƒƒ‚n|S(sN get_system_tz(str) -> str look up the systems current timezone. sroot must be a strs(get_tz_continents(): insufficient memorysget_tz_continents(): %s( RFRWRGt_get_system_tzRR9RR:R;R(R`RCRB((s../libzoneinfo.pyt get_system_tz/s   cCs[tƒ}xKtƒD]@}tƒ}x$t|ƒD]}t|ƒ|| TZCountryInfo -> [TZInfo] (tdictRERNRU(touterRLtinnerRS((s../libzoneinfo.pyt get_tz_infoAs    (6t__doc__tctypesRt collectionsRterrnoRtosRt _TZBUFLENt _CCBUFLENRYRZR[R\t StructureRtPOINTERR6tc_chartc_char_ptc_void_pRR RIRRRROtCDLLt _LIBZONEINFORER7trestypetargtypesRNRJRURPtfree_tz_continentsR?tfree_tz_countriesRKtfree_timezonesRRRbR^RdRcR'R+R-RQRh(((s../libzoneinfo.pyt.s–                                   & 1