(self)
Download the latest tzdata from ftp.iana.org
Download the latest tzdata from ftp.iana.org
Download the latest tzdata from ftp . iana . org
def download_tzdata(self):
        """Download the latest tzdata from ftp.iana.org"""
        tzdata_download_path = tempfile.mktemp(".tar.gz", prefix="zones")
        sys.stderr.write("Downloading tzdata-latest.tar.gz from"
                         " ftp.iana.org to %s\n" % tzdata_download_path)
        ftp = ftplib.FTP("ftp.iana.org")
        ftp.login()
        ftp.retrbinary("RETR /tz/tzdata-latest.tar.gz", open(tzdata_download_path, "wb").write)
        ftp.quit()

        self.tzdata_path = tempfile.mkdtemp(prefix="zones")
        sys.stderr.write("Extracting %s to %s\n" % (tzdata_download_path, self.tzdata_path))
        tarfile.open(tzdata_download_path).extractall(path=self.tzdata_path)
        os.unlink(tzdata_download_path)
def download_tzdata ( self ) : tzdata_download_path = tempfile . mktemp ( ".tar.gz" , prefix = "zones" ) sys . stderr . write ( "Downloading tzdata-latest.tar.gz from" " ftp.iana.org to %s\n" % tzdata_download_path ) ftp = ftplib . FTP ( "ftp.iana.org" ) ftp . login ( ) ftp . retrbinary ( "RETR /tz/tzdata-latest.tar.gz" , open ( tzdata_download_path , "wb" ) . write ) ftp . quit ( ) self . tzdata_path = tempfile . mkdtemp ( prefix = "zones" ) sys . stderr . write ( "Extracting %s to %s\n" % ( tzdata_download_path , self . tzdata_path ) ) tarfile . open ( tzdata_download_path ) . extractall ( path = self . tzdata_path ) os . unlink ( tzdata_download_path )