cofdb_submit/main.py
def on_click_add(self, event):
        """Add framework to list and add CIF file to cifs/ folder."""
        from ase.io import write
        info = self.info_dict
        if not all(v for k,v in info.items() if k not in ['modifications']):
            self.btn_add_cif.button_type = 'danger'
            return

        self.btn_add_cif.button_type = 'primary'
        line = '{id},{source},"{name}","{elements}","{mod}"\n'.format(
            id=info['cof_id'], source=info['source'], name=info['name'], elements = info['elements'],
            mod=info['modifications'])
        print(line)
        with open(FRAMEWORKS_FILE, 'a+') as handle:
           handle.write(line)

        cif_path = os.path.join(CIFS_FOLDER, info['cof_id'] + '.cif')

        print("Writing {}".format(cif_path))
        write(cif_path, self.atoms)

        # Using manage_crystal to use the standard formatting
        from manage_crystal.utils import parse_and_write
        parse_and_write(cif_path, cif_path)

        self.btn_add_cif.button_type = 'success'
Add framework to list and add CIF file to cifs/ folder.
Add framework to list and add CIF file to cifs/ folder.
Add framework to list and add CIF file to cifs / folder .
def on_click_add(self, event):
        from ase.io import write
        info = self.info_dict
        if not all(v for k,v in info.items() if k not in ['modifications']):
            self.btn_add_cif.button_type = 'danger'
            return
        self.btn_add_cif.button_type = 'primary'
        line = '{id},{source},"{name}","{elements}","{mod}"\n'.format(
            id=info['cof_id'], source=info['source'], name=info['name'], elements = info['elements'],
            mod=info['modifications'])
        print(line)
        with open(FRAMEWORKS_FILE, 'a+') as handle:
           handle.write(line)
        cif_path = os.path.join(CIFS_FOLDER, info['cof_id'] + '.cif')
        print("Writing {}".format(cif_path))
        write(cif_path, self.atoms)
        from manage_crystal.utils import parse_and_write
        parse_and_write(cif_path, cif_path)
        self.btn_add_cif.button_type = 'success'
def on_click_add ( self , event ) : from ase . io import write info = self . info_dict if not all ( v for k , v in info . items ( ) if k not in [ 'modifications' ] ) : self . btn_add_cif . button_type = 'danger' return self . btn_add_cif . button_type = 'primary' line = '{id},{source},"{name}","{elements}","{mod}"\n' . format ( id = info [ 'cof_id' ] , source = info [ 'source' ] , name = info [ 'name' ] , elements = info [ 'elements' ] , mod = info [ 'modifications' ] ) print ( line ) with open ( FRAMEWORKS_FILE , 'a+' ) as handle : handle . write ( line ) cif_path = os . path . join ( CIFS_FOLDER , info [ 'cof_id' ] + '.cif' ) print ( "Writing {}" . format ( cif_path ) ) write ( cif_path , self . atoms ) from manage_crystal . utils import parse_and_write parse_and_write ( cif_path , cif_path ) self . btn_add_cif . button_type = 'success'
Add framework to list and add CIF file to cifs/ folder.
Add framework to list and add CIF file to cifs / folder .
"""Add framework to list and add CIF file to cifs/ folder.""" # Using manage_crystal to use the standard formatting
self
event