src/pybel/repository.py
def upload_separate(repository: BELRepository, host: str, user: str, password: str, sleep: int, private: bool):
        """Upload all to BEL Commons."""
        it = tqdm(repository.get_graphs().items())
        for name, graph in it:
            res = to_bel_commons(graph, host=host, user=user, password=password, public=not private)
            res_json = res.json()
            task_id = res_json.get('task_id')
            if task_id is not None:
                it.write(f'task:{task_id} - {name}')
                it.write(f'see: {host.rstrip("/")}/api/task/{task_id}')
                time.sleep(sleep)
            else:
                it.write(f'problem with {name}: {res_json}')
Upload all to BEL Commons.
Upload all to BEL Commons.
Upload all to BEL Commons .
def upload_separate(repository: BELRepository, host: str, user: str, password: str, sleep: int, private: bool):
        it = tqdm(repository.get_graphs().items())
        for name, graph in it:
            res = to_bel_commons(graph, host=host, user=user, password=password, public=not private)
            res_json = res.json()
            task_id = res_json.get('task_id')
            if task_id is not None:
                it.write(f'task:{task_id} - {name}')
                it.write(f'see: {host.rstrip("/")}/api/task/{task_id}')
                time.sleep(sleep)
            else:
                it.write(f'problem with {name}: {res_json}')
def upload_separate ( repository : BELRepository , host : str , user : str , password : str , sleep : int , private : bool ) : it = tqdm ( repository . get_graphs ( ) . items ( ) ) for name , graph in it : res = to_bel_commons ( graph , host = host , user = user , password = password , public = not private ) res_json = res . json ( ) task_id = res_json . get ( 'task_id' ) if task_id is not None : it . write ( f'task:{task_id} - {name}' ) it . write ( f'see: {host.rstrip("/")}/api/task/{task_id}' ) time . sleep ( sleep ) else : it . write ( f'problem with {name}: {res_json}' )
Upload all to BEL Commons.
Upload all to BEL Commons .
"""Upload all to BEL Commons."""
repository
BELRepository
host
str
user
str
password
str
sleep
int
private
bool