usgsdownload/usgs.py
def get_remote_file_size(self, url):
        """Gets the filesize of a remote file """
        try:
            req = urllib.request.urlopen(url)
            return int(req.getheader('Content-Length').strip())
        except urllib.error.HTTPError as error:
            logger.error('Error retrieving size of the remote file %s' % error)
            print('Error retrieving size of the remote file %s' % error)
            self.connect_earthexplorer()
            self.get_remote_file_size(url)
def get_remote_file_size(self, url):
        try:
            req = urllib.request.urlopen(url)
            return int(req.getheader('Content-Length').strip())
        except urllib.error.HTTPError as error:
            logger.error('Error retrieving size of the remote file %s' % error)
            print('Error retrieving size of the remote file %s' % error)
            self.connect_earthexplorer()
            self.get_remote_file_size(url)
def get_remote_file_size ( self , url ) : try : req = urllib . request . urlopen ( url ) return int ( req . getheader ( 'Content-Length' ) . strip ( ) ) except urllib . error . HTTPError as error : logger . error ( 'Error retrieving size of the remote file %s' % error ) print ( 'Error retrieving size of the remote file %s' % error ) self . connect_earthexplorer ( ) self . get_remote_file_size ( url )
Gets the filesize of a remote file
Gets the filesize of a remote file