def show_commands():
     """Print the possible commands for the experiments
     """
     print_bold("Available commands:")
     all_commands = commands + default_commands + [show_commands]
     if AUTO_COMPLETION:
         all_commands += [activate_autocompletion]
     names = [command.__name__ for command in all_commands]
     for name in names:
         print("\t" + str(name))
def show_tests(*args):
    """Show available tests for the experiment
    """
    if TESTS == []:
        print_bold("No tests available")
    else:
        print_bold("Available tests:")
        for test_case in TESTS:
            if ((args == () or test_case.__name__ in args)):
                print("\t" + str(test_case.__name__) + ":\t" +
                      test_case.__doc__.replace("\n", "").replace("    ", " "))
Beispiel #3
0
 def show_commands():
     """Print the available commands
     """
     cmds = commands
     if default is not None and default not in cmds:
         cmds = [default] + commands
     print_bold("Available commands:")
     all_commands = cmds + default_commands + [show_commands]
     if AUTO_COMPLETION:
         all_commands += [activate_autocompletion]
     names = [command.__name__ for command in all_commands]
     for name in names:
         print("\t" + str(name))
 def show_commands():
     """Print the available commands
     """
     cmds = commands
     if default is not None and default not in cmds:
         cmds = [default] + commands
     print_bold("Available commands:")
     all_commands = cmds + default_commands + [show_commands]
     if AUTO_COMPLETION:
         all_commands += [activate_autocompletion]
     names = [command.__name__ for command in all_commands]
     for name in names:
         print("\t" + str(name))
Beispiel #5
0
def show_tests(*args):
    """Show available tests for the experiment
    """
    if TESTS == []:
        print_bold("No tests available")
    else:
        print_bold("Available tests:")
        for test_case in TESTS:
            if ((args == () or
                 test_case.__name__ in args)):
                print("\t"
                      + str(test_case.__name__)
                      + ":\t"
                      + test_case.__doc__.replace(
                          "\n", "").replace("    ", " "))
def show_state(*arguments):
    """Shows the contents of the state loaded by the configuration or from
    the file specified as an argument.
    """
    if len(arguments) == 0:
        state_file = conf['pyexperiment.state_filename']
    else:
        state_file = arguments[0]
    print_bold("Load state from file '%s'", state_file)
    try:
        state.load(state_file, lazy=False, raise_error=True)
    except IOError as err:
        print(err)
    else:
        if len(state) > 0:
            state.show()
        else:
            print("State empty")
Beispiel #7
0
def show_state(*arguments):
    """Shows the contents of the state loaded by the configuration or from
    the file specified as an argument.
    """
    if len(arguments) == 0:
        state_file = conf['pyexperiment.state_filename']
    else:
        state_file = arguments[0]
    print_bold("Load state from file '%s'",
               state_file)
    try:
        state.load(state_file, lazy=False, raise_error=True)
    except IOError as err:
        print(err)
    else:
        if len(state) > 0:
            state.show()
        else:
            print("State empty")