реализовал построитель команды по строке текста

This commit is contained in:
Rustam Zaitov 2013-10-28 02:26:22 +04:00
parent f65703512d
commit 6a762181af
2 changed files with 24 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1 @@
__author__ = 'rzaitov'