merge_machine/admin.py
def list_projects(self, project_type, project_access='all'):
        '''Return a list of project metadatas.
        
        Parameters
        ----------
        project_type: str (either "normalize" or "link")
        project_access: str (either "all", "public", or "private")
            Whether to list all projects or only those that are public or 
            non-public (private)
            
        Returns
        -------
        list_of_metadatas: list of dict
            Metadata for the selected project type and access permission.        
        '''
        _check_project_type(project_type)
        _check_project_access(project_access)
        
        list_of_ids = self.list_dirs(project_type)
        list_of_metadatas = []
        
        for id_ in list_of_ids:            
            
            try:
                if project_type == 'link':
                    proj = ESLinker(id_)
                else:
                    proj = ESNormalizer(id_)
                could_load = True
            except:
                could_load = False
                print('Could not load {0}: {1}'.format(project_type, id_))

            if could_load:
                if project_access != 'all':
                    if proj.metadata.get('public', False) == (project_access == 'public'):
                        list_of_metadatas.append(proj.metadata)                
                else:
                    list_of_metadatas.append(proj.metadata)
        return list_of_metadatas
Return a list of project metadatas.
        
        Parameters
        ----------
        project_type: str (either "normalize" or "link")
        project_access: str (either "all", "public", or "private")
            Whether to list all projects or only those that are public or 
            non-public (private)
            
        Returns
        -------
        list_of_metadatas: list of dict
            Metadata for the selected project type and access permission.        
        
Return a list of project metadatas.
Parameters



Returns

list of dict
Metadata for the selected project type and access permission.
Return a list of project metadatas . Parameters Returns list of dict Metadata for the selected project type and access permission .
def list_projects(self, project_type, project_access='all'):
        _check_project_type(project_type)
        _check_project_access(project_access)
        list_of_ids = self.list_dirs(project_type)
        list_of_metadatas = []
        for id_ in list_of_ids:            
            try:
                if project_type == 'link':
                    proj = ESLinker(id_)
                else:
                    proj = ESNormalizer(id_)
                could_load = True
            except:
                could_load = False
                print('Could not load {0}: {1}'.format(project_type, id_))
            if could_load:
                if project_access != 'all':
                    if proj.metadata.get('public', False) == (project_access == 'public'):
                        list_of_metadatas.append(proj.metadata)                
                else:
                    list_of_metadatas.append(proj.metadata)
        return list_of_metadatas
def list_projects ( self , project_type , project_access = 'all' ) : _check_project_type ( project_type ) _check_project_access ( project_access ) list_of_ids = self . list_dirs ( project_type ) list_of_metadatas = [ ] for id_ in list_of_ids : try : if project_type == 'link' : proj = ESLinker ( id_ ) else : proj = ESNormalizer ( id_ ) could_load = True except : could_load = False print ( 'Could not load {0}: {1}' . format ( project_type , id_ ) ) if could_load : if project_access != 'all' : if proj . metadata . get ( 'public' , False ) == ( project_access == 'public' ) : list_of_metadatas . append ( proj . metadata ) else : list_of_metadatas . append ( proj . metadata ) return list_of_metadatas
Return a list of project metadatas.
Return a list of project metadatas .
'''Return a list of project metadatas.
        
        Parameters
        ----------
        project_type: str (either "normalize" or "link")
        project_access: str (either "all", "public", or "private")
            Whether to list all projects or only those that are public or 
            non-public (private)
            
        Returns
        -------
        list_of_metadatas: list of dict
            Metadata for the selected project type and access permission.        
        '''
self
project_type
project_access