localpdb/PDBDownloader.py
def __verify_timestamp(self, fn, version=None):
        """
        Verifies the timestamp of the downloaded file against the PDB version.
        @param fn: filename of the file
        @param version: PDB version
        @return: True if timestamp matches the version, else False
        """
        if version is None:
            version = self.version
        timestamp = datetime.datetime.fromtimestamp((os.path.getmtime(fn)))
        timestamp = f'{timestamp.year}{str(timestamp.month).zfill(2)}{str(timestamp.day).zfill(2)}'
        out = timestamp == str(version)
        if out:
            logger.debug(f'Timestamp of the file: \'{fn}\' matches the PDB version: \'{version}\'')
        else:
            logger.debug(f'Timestamp of the downloaded file: \'{fn}\' does not match the PDB version: \'{version}\'')
            logger.error(f'Downloaded file creation timestamp does not match the PDB version \'{version}\'')
            logger.error('This is expected behavior when downloading data within few hours before the PDB weekly update'
                         ' (Wednesday 00:00 UTC) or occasionally when using the \'pdbe\' mirror.')
            logger.error('Please try using different mirror or postpone the installation / update for few hours.')
        return out

        Verifies the timestamp of the downloaded file against the PDB version.
        @param fn: filename of the file
        @param version: PDB version
        @return: True if timestamp matches the version, else False
        
Verifies the timestamp of the downloaded file against the PDB version.
Verifies the timestamp of the downloaded file against the PDB version .
def __verify_timestamp(self, fn, version=None):
        if version is None:
            version = self.version
        timestamp = datetime.datetime.fromtimestamp((os.path.getmtime(fn)))
        timestamp = f'{timestamp.year}{str(timestamp.month).zfill(2)}{str(timestamp.day).zfill(2)}'
        out = timestamp == str(version)
        if out:
            logger.debug(f'Timestamp of the file: \'{fn}\' matches the PDB version: \'{version}\'')
        else:
            logger.debug(f'Timestamp of the downloaded file: \'{fn}\' does not match the PDB version: \'{version}\'')
            logger.error(f'Downloaded file creation timestamp does not match the PDB version \'{version}\'')
            logger.error('This is expected behavior when downloading data within few hours before the PDB weekly update'
                         ' (Wednesday 00:00 UTC) or occasionally when using the \'pdbe\' mirror.')
            logger.error('Please try using different mirror or postpone the installation / update for few hours.')
        return out
def __verify_timestamp ( self , fn , version = None ) : if version is None : version = self . version timestamp = datetime . datetime . fromtimestamp ( ( os . path . getmtime ( fn ) ) ) timestamp = f'{timestamp.year}{str(timestamp.month).zfill(2)}{str(timestamp.day).zfill(2)}' out = timestamp == str ( version ) if out : logger . debug ( f'Timestamp of the file: \'{fn}\' matches the PDB version: \'{version}\'' ) else : logger . debug ( f'Timestamp of the downloaded file: \'{fn}\' does not match the PDB version: \'{version}\'' ) logger . error ( f'Downloaded file creation timestamp does not match the PDB version \'{version}\'' ) logger . error ( 'This is expected behavior when downloading data within few hours before the PDB weekly update' ' (Wednesday 00:00 UTC) or occasionally when using the \'pdbe\' mirror.' ) logger . error ( 'Please try using different mirror or postpone the installation / update for few hours.' ) return out
Verifies the timestamp of the downloaded file against the PDB version.
Verifies the timestamp of the downloaded file against the PDB version .
"""
        Verifies the timestamp of the downloaded file against the PDB version.
        @param fn: filename of the file
        @param version: PDB version
        @return: True if timestamp matches the version, else False
        """
True if timestamp matches the version, else False
True if timestamp matches the version else False
self
fn
filename of the file
filename of the file
version
None