
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
3
6X                 @   s  d Z yddlmZ W n  ek
r4   ddlmZ Y nX ddlmZmZ ddlmZm	Z	 ddl
mZmZmZ ddl
mZmZ dd Zed	Zd
d Zdd ZedkrddlZddlmZ ejjejjedZedeejjedddZedeejjedddZeej dS )z7
$Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $
    )StringIO)datetime	timedelta)unpackcalcsize)StaticTzInfo	DstTzInfomemorized_ttinfo)memorized_datetimememorized_timedeltac             C   s
   | j dS )z5Cast a string or byte string to an ASCII byte string.ASCII)encode)s r   /usr/lib/python3.6/tzfile.py_byte_string   s    r    c             C   s   t | jdS )z0Cast a string or byte string to an ASCII string.r   )strdecode)r   r   r   r   _std_string   s    r   c       !      C   s>  d}t |}t||j|\}}}}}}	}
}dt|	d|
 |d }t |}t||j|}dd |d |	 D }t||	d|	  }|d|	 d }|d }~g }i }d	}x|t|k r.||d  }||kr |jt|}|d	k rt|}t||| ||< |j	|| t
||d  || f |d
7 }qW t|dksLt|d	kr|d	 d	 |d	 d f t| tft| t|d	 d	 |d	 d d}nd	}x|| d r|d7 }qW || ||d	  krtj|d	< n|jd	tj |jd	| g }x&tt|D ]}|||  }|d	 }|d s0d	}nx2t|d ddD ]}|||  }|d sBP qBW |d	 |d	  }|d	ks|dkrxNt|d t|D ]8}|||  }|d s|d	 |d	  }|d	krP qW |d } t|d d d }t|d d d }|j	t|||  qW t| tft| ||d}| S )Nz>4s c 15x 6lz2>%(timecnt)dl %(timecnt)dB %(ttinfo)s %(charcnt)dsZlBB)timecntttinfocharcntc             S   s   g | ]}t |qS r   )r
   ).0Ztransr   r   r   
<listcomp>+   s   z build_tzinfo.<locals>.<listcomp>      r      )zoneZ
_utcoffsetZ_tznamei     <   )r   _utc_transition_timesZ_transition_infor"   r"   r"   i0*  )r   r   readdictlistlenfind_NULLr   appendbooltyper   r   r   mininsertrangeintr	   r   )!r   fpZhead_fmtZ	head_sizemagicformatZ
ttisgmtcntZ
ttisstdcntZleapcntr   Ztypecntr   Zdata_fmtZ	data_sizedataZtransitionsZlindexesZ
ttinfo_rawZtznames_rawr   ZtznamesiZtzname_offsetZnulclsZtransition_infoinfZ	utcoffsetdstjZprev_infZstdinfZtznamer   r   r   build_tzinfo   s     








r9   __main__N)pprintZzoneinfozAustralia/MelbourneZ	AustraliaZ	Melbournerbz
US/EasternZUSZEastern) __doc__Z	cStringIOr   ImportErrorior   r   structr   r   Zpytz.tzinfor   r   r	   r
   r   r   r(   r   r9   __name__Zos.pathosr;   pathjoindirname__file__baseopenZtzr!   r   r   r   r   <module>   s*   e
