From 6a762181af4d0ba9e879a3090a56ccd4def77f1e Mon Sep 17 00:00:00 2001 From: Rustam Zaitov Date: Mon, 28 Oct 2013 02:26:22 +0400 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D0=BF=D0=BE=D1=81=D1=82=D1=80=D0=BE=D0=B8?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D1=8C=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4?= =?UTF-8?q?=D1=8B=20=D0=BF=D0=BE=20=D1=81=D1=82=D1=80=D0=BE=D0=BA=D0=B5=20?= =?UTF-8?q?=D1=82=D0=B5=D0=BA=D1=81=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/CommandBuilders/CopyCommandBuilder.py | 23 +++++++++++++++++++ scripts/CommandBuilders/__init__.py | 1 + 2 files changed, 24 insertions(+) create mode 100644 scripts/CommandBuilders/CopyCommandBuilder.py create mode 100644 scripts/CommandBuilders/__init__.py 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'