parameters: (self)
docstring: Download the latest tzdata from ftp.iana.org
docstring_summary: Download the latest tzdata from ftp.iana.org
docstring_tokens: Download the latest tzdata from ftp . iana . org
function: 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)
function_tokens: 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 )