Ejemplo n.º 1
0
def ls1(all, **kwargs):
    """
    lists running simulations in the current project
    """

    server = VIRLServer()

    sim_dict = server.list_simulations()
    if not all:
        # only sims for this project
        dirpath = find_virl()
        foldername = os.path.basename(dirpath)
        for k in list(sim_dict):
            if not k.startswith(foldername):
                sim_dict.pop(k)

    sim_list_table(sim_dict)
Ejemplo n.º 2
0
def sid():
    """
    gets sim id for local environment
    """

    server = VIRLServer()

    sim_dict = server.list_simulations()
    dirpath = os.getcwd()
    foldername = os.path.basename(dirpath)
    for k in list(sim_dict):
        if not k.startswith(foldername):
            sim_dict.pop(k)
    # can only accurately determine sim id if there is
    # only one sim running with our project name
    if len(sim_dict) == 1:
        click.echo(list(sim_dict)[0])