diff --git a/scripts/CommandBuilders/CopyCommandBuilder.py b/scripts/CommandBuilders/CopyCommandBuilder.py new file mode 100644 index 0000000..475cdc8 --- /dev/null +++ b/scripts/CommandBuilders/CopyCommandBuilder.py @@ -0,0 +1,23 @@ +from commands.CopyCommand import CopyCommand +from parser.CopyParser.CopyLineParser import CopyLineParser + + +class CopyCommandBuilder: + def __init__(self, pathProvider): + assert pathProvider is not None + + self.__pathProvider = pathProvider + + def isCopy(self, line): + assert line is not None + + return line.startswith('copy') + + def getCommandFor(self, line): + assert line is not None + + parser = CopyLineParser() + cpArg = parser.parseLine(line) + + command = CopyCommand(self.__pathProvider, cpArg) + return command diff --git a/scripts/CommandBuilders/__init__.py b/scripts/CommandBuilders/__init__.py new file mode 100644 index 0000000..cc31abc --- /dev/null +++ b/scripts/CommandBuilders/__init__.py @@ -0,0 +1 @@ +__author__ = 'rzaitov'