Exemple #1
0
 def run(options):
     if options.filename is None:
         return init_home_file(settings.MISSION, settings.INTERPRETER)
     if '.' in options.filename:
         mission, interpreter = tools.set_mi(options.mission, options.interpreter)
         return init_path_file(options.filename, mission, interpreter)
     # --------------------mission-slug, ----interpreter-name
     mission, interpreter = tools.set_mi(options.filename, options.mission)
     return init_home_file(mission, interpreter)
Exemple #2
0
 def run(options, command=command):
     mission, interpreter = tools.set_mi(options.mission, options.interpreter)
     execute_referee(command, mission, interpreter,
                     without_container=options.without_container,
                     interface_child=options.interface_child,
                     interface_only=options.interface_only,
                     referee_only=options.referee_only)
Exemple #3
0
def init_home_file(slug, interpreter):
    folder = Folder(slug)
    if not os.path.exists(folder.init_file_path(interpreter)):
        available_list = folder.init_available_list()
        if not available_list:
            logging.warning('Do not support any language. Initials is empty.')
            return
        default = available_list[0]
        str_propose = '[{}]/{}'.format(default, '/'.join(available_list[1:]))
        answer = raw_input(('Mission "{}" doesn\'t support {}.' +
                            ' Please choose one out of available {}:').format(slug, interpreter,
                                                                              str_propose))
        answer = answer.strip()
        if not answer:
            answer = default

        _, interpreter = set_mi(interpreter=answer, do_raise=False)
        return init_home_file(slug, interpreter)

    write_solution(slug, interpreter, folder.solution_path())