OwlCyberSecurity - MANAGER
Edit File: timezones.pyc
� �t�ac @ s� d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z e � Z d d d d g Z d e f d � � YZ d e f d � � YZ i Z i Z g Z d � Z d � Z d � Z d � Z d d � Z d S( i����N( t Logger( t FilePath( t FilesystemLock( t config( t TimezoneDatabaset TimezoneExceptiont TimezoneCachet readTZt listTZsc B s e Z RS( ( t __name__t __module__( ( ( s* /opt/cpanel-ccs/twistedcaldav/timezones.pyR 3 s c B s� e Z d Z d Z d Z e d � � Z e d � � Z e d � � Z e e d � � Z e d � � Z d e f d � � YZ e d � � Z e d � � Z e d � � Z RS( t Unknowns IANA Timezone Registry: c C sT y d d l } Wn- t k r? t j j t j j t � d � SX| j d d � Sd S( Ni����t zoneinfot twistedcaldav( t pkg_resourcest ImportErrort ost patht joint dirnamet __file__t resource_filename( R ( ( s* /opt/cpanel-ccs/twistedcaldav/timezones.pyt _getPackageDBPath= s c C sT y d d l } Wn- t k r? t j j t j j t � d � SX| j d d � Sd S( Ni����s tzextras.txtR ( R R R R R R R R ( R ( ( s* /opt/cpanel-ccs/twistedcaldav/timezones.pyt _getTZExtrasPathF s c C s� t j d k r� t j j r9 t j j r9 t j j t _ q� t j sX t j j t j � rj t j � t _ q� t j j t j d � t _ n t j S( NR ( R t dirNamet NoneR t TimezoneServicet Enabledt BasePatht UsePackageTimezonesR R t existst DataRootR R ( ( ( s* /opt/cpanel-ccs/twistedcaldav/timezones.pyt getDBPathO s c C sT | r d t _ n d t _ t j � t j t j � � t _ t j t j � � d S( sm Create a timezone database from the files pointed to by the config. The empty option is used only for testing and will point the DB at an empty directory - i.e., no standard timezones are used. @param empty: set to C{True} when doing certain tests that do not want the standard timezone database used. @type empty: C{bool} t N( R R R t validatePatht getTZVersionR t versionR t createTimezoneDatabase( t empty( ( s* /opt/cpanel-ccs/twistedcaldav/timezones.pyt create[ s c C sQ y8 t t j j | d � � � } | j � j � SWd QXWn t k rL d SXd S( Ns version.txtR! ( t openR R R t readt stript IOError( t dbpatht f( ( s* /opt/cpanel-ccs/twistedcaldav/timezones.pyR# l s t FilteredFilePathc B s e Z d Z d � Z RS( sc A FilePath that does a directory copy ignoring dot-prefixed files or directories. c C s� | j � r� | j � s% | j � n x� | j � D]S } | j � d d k r2 | j | j � � } t j | j � } | j | � q2 q2 Wn | j � r� | j | � n d S( Ni t .( t isdirR t createDirectoryt childrent basenamet childR R. R t copyFilteredDirectoryTot isfilet copyTo( t selft destinationR4 t destChild( ( s* /opt/cpanel-ccs/twistedcaldav/timezones.pyR5 y s ( R R t __doc__R5 ( ( ( s* /opt/cpanel-ccs/twistedcaldav/timezones.pyR. t s c C s� t t j � � } | j � s. t j d � nj t j t j � � } t j | j � } | sh | | k r� | j � t j d � n t j d d | j �d S( Nt Copyingt Updatings Valid timezones at {p}t p( R R R R t copyPackageR# R R t removet logt info( R, t pkgversiont dbversion( ( s* /opt/cpanel-ccs/twistedcaldav/timezones.pyR"