localpdb/PDBDownloader.py
def update_versioning_log(self, modified_dict):
        """
        Updates the versioning.log file that keeps the major modifications of PDB entries.
        @param modified_dict: Revision data (dictionary from the self.fetch_major_revisions)
        @return: True if update succeeded, False otherwise
        """
        logs_fn = f'{self.db_path}/data/versioning.log'
        try:
            with open(logs_fn) as f:
                ver_history = json.loads(f.read())
            for pdb_id, rev_ver in modified_dict.items():
                if pdb_id in ver_history.keys():
                    ver_history[pdb_id].append(rev_ver)
                else:
                    ver_history[pdb_id] = [rev_ver]
        except FileNotFoundError:
            ver_history = {}
        with open(logs_fn, 'w') as f:
            f.write(json.dumps(ver_history, indent=4))
        return True

        Updates the versioning.log file that keeps the major modifications of PDB entries.
        @param modified_dict: Revision data (dictionary from the self.fetch_major_revisions)
        @return: True if update succeeded, False otherwise
        
Updates the versioning.log file that keeps the major modifications of PDB entries.
Updates the versioning . log file that keeps the major modifications of PDB entries .
def update_versioning_log(self, modified_dict):
        logs_fn = f'{self.db_path}/data/versioning.log'
        try:
            with open(logs_fn) as f:
                ver_history = json.loads(f.read())
            for pdb_id, rev_ver in modified_dict.items():
                if pdb_id in ver_history.keys():
                    ver_history[pdb_id].append(rev_ver)
                else:
                    ver_history[pdb_id] = [rev_ver]
        except FileNotFoundError:
            ver_history = {}
        with open(logs_fn, 'w') as f:
            f.write(json.dumps(ver_history, indent=4))
        return True
def update_versioning_log ( self , modified_dict ) : logs_fn = f'{self.db_path}/data/versioning.log' try : with open ( logs_fn ) as f : ver_history = json . loads ( f . read ( ) ) for pdb_id , rev_ver in modified_dict . items ( ) : if pdb_id in ver_history . keys ( ) : ver_history [ pdb_id ] . append ( rev_ver ) else : ver_history [ pdb_id ] = [ rev_ver ] except FileNotFoundError : ver_history = { } with open ( logs_fn , 'w' ) as f : f . write ( json . dumps ( ver_history , indent = 4 ) ) return True
Updates the versioning.log file that keeps the major modifications of PDB entries.
Updates the versioning . log file that keeps the major modifications of PDB entries .
"""
        Updates the versioning.log file that keeps the major modifications of PDB entries.
        @param modified_dict: Revision data (dictionary from the self.fetch_major_revisions)
        @return: True if update succeeded, False otherwise
        """
True if update succeeded, False otherwise
True if update succeeded False otherwise
self
modified_dict
Revision data (dictionary from the self.fetch_major_revisions)
Revision data ( dictionary from the self . fetch_major_revisions )