# Path: marathoner/commands/base.py
# class BaseCommand(object):
#     syntax = ''
#     help = ''
# 
#     def __init__(self, project, executor):
#         self.project = project
#         self.executor = executor
#         self.contest = project.contest
# 
#     def is_match(self, command):
#         '''Given is the text that user typed into command line, return True
#         if this command should execute.
#         '''
#         raise NotImplementedError()
# 
#     def handle(self, command):
#         '''Given is the text that user typed into command line, execute the
#         command.
#         '''


import re
from six import print_
from six.moves import xrange
from marathoner.commands.base import BaseCommand




class Command(BaseCommand):
    syntax = '<seed1> <seed2> [<vis params>]'
    help = 'run batch of tests from interval [seed1, seed2]'

    cmd_re = re.compile(r'^\s*(\d+)\s+(\d+)(?:\s+([^\d\s].*))?\s*$', re.IGNORECASE)
    def is_match(self, command):
        return self.cmd_re.match(command)

    def handle(self, command):
        match = self.cmd_re.match(command)
        seed1 = int(match.group(1))
        seed2 = int(match.group(2))
        vis_params = match.group(3) or ''

        if seed1 < 1:

# Path: marathoner/commands/base.py
# class BaseCommand(object):
#     syntax = ''
#     help = ''
# 
#     def __init__(self, project, executor):
#         self.project = project
#         self.executor = executor
#         self.contest = project.contest
# 
#     def is_match(self, command):
#         '''Given is the text that user typed into command line, return True
#         if this command should execute.
#         '''
#         raise NotImplementedError()
# 
#     def handle(self, command):
#         '''Given is the text that user typed into command line, execute the
#         command.
#         '''


# Path: marathoner/commands/multi_test.py
import re
from six import print_
from six.moves import xrange
from marathoner.commands.base import BaseCommand





class Command(BaseCommand):
    syntax = '<seed1> <seed2> [<vis params>]'
    help = 'run batch of tests from interval [seed1, seed2]'

    cmd_re = re.compile(r'^\s*(\d+)\s+(\d+)(?:\s+([^\d\s].*))?\s*$', re.IGNORECASE)
    def is_match(self, command):
        return self.cmd_re.match(command)

    def handle(self, command):
        match = self.cmd_re.match(command)
        seed1 = int(match.group(1))
        seed2 = int(match.group(2))
        vis_params = match.group(3) or ''

        if seed1 < 1:

            print_('Error: seed1 has to be at least 1.')