From 535766f376c90195cb94fad51aad11d3c98eb432 Mon Sep 17 00:00:00 2001 From: Rustam Zaitov Date: Mon, 28 Oct 2013 02:45:30 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D0=BA=D0=BE=D0=BF=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/ManualTests/copy_test.py | 2 +- scripts/commands/CopyCommand.py | 14 +++++++++++++- scripts/run_manual_tests.py | 5 +++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/scripts/ManualTests/copy_test.py b/scripts/ManualTests/copy_test.py index 3fb73c2..68aba34 100644 --- a/scripts/ManualTests/copy_test.py +++ b/scripts/ManualTests/copy_test.py @@ -2,7 +2,7 @@ from CommandBuilders.CopyCommandBuilder import CopyCommandBuilder from ManualTests.path_provider import PathProvider line1 = "copy 'BuildSample/BuildSample.sln' to 'BuildSample/BuildSample.txt'" -line2 = "copy 'BuildSample/BuildSample.sln' to '~/tmp/BuildSample.sln'" +line2 = "copy 'BuildSample/BuildSample.sln' to '~/Downloads/BuildSample.sln'" baseDir = '../' path_provider = PathProvider(baseDir) diff --git a/scripts/commands/CopyCommand.py b/scripts/commands/CopyCommand.py index c57b7ab..30d01be 100644 --- a/scripts/commands/CopyCommand.py +++ b/scripts/commands/CopyCommand.py @@ -1,4 +1,5 @@ import shutil +import os class CopyCommand: def __init__(self, pathProvider, copyArguments): @@ -9,5 +10,16 @@ class CopyCommand: self.__copyArguments = copyArguments def execute(self): - shutil.copy(self.__copyArguments.source, self.__copyArguments.target) + source = self.__expandPath(self.__copyArguments.source) + target = self.__expandPath(self.__copyArguments.target) + + shutil.copy(source, target) + + def __expandPath(self, path): + path = os.path.expanduser(path) + if not os.path.isabs(path): + path = self.__pathProvider.resolveAbsPath(path) + + return path + diff --git a/scripts/run_manual_tests.py b/scripts/run_manual_tests.py index 117f43b..dab7faf 100644 --- a/scripts/run_manual_tests.py +++ b/scripts/run_manual_tests.py @@ -1,2 +1,3 @@ -import ManualTests.csproj_test -import ManualTests.info_plist_test \ No newline at end of file +#import ManualTests.csproj_test +#import ManualTests.info_plist_test +import ManualTests.copy_test \ No newline at end of file