From e5370d42a83f3c1c5b104ce739eeb69248e6edd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Tue, 9 Aug 2005 14:51:46 +0000 Subject: [PATCH] =?UTF-8?q?copy=20ve=20move'a=20glob=20deste=C4=9Fi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/actionsapi/shelltools.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pisi/actionsapi/shelltools.py b/pisi/actionsapi/shelltools.py index 233ae9e3..a99eb849 100644 --- a/pisi/actionsapi/shelltools.py +++ b/pisi/actionsapi/shelltools.py @@ -53,11 +53,13 @@ def unlinkDir(sourceDirectory): def move(sourceFile, destinationFile): '''recursively move a sourceFile or directory to destinationFile''' - shutil.move(sourceFile, destinationFile) + for file in glob.glob(sourceFile): + shutil.move(file, destinationFile) def copy(sourceFile, destinationFile): '''recursively copy a sourceFile or directory to destinationFile''' - shutil.copy(sourceFile, destinationFile) + for file in glob.glob(sourceFile): + shutil.copy(file, destinationFile) def touch(sourceFile): for file in glob.glob(sourceFile): @@ -94,10 +96,9 @@ def system(command): def exists_binary(bin): # determine if path has binary - from os.path import exists, join path = os.environ['PATH'].split(':') for directory in path: - if exists( join(directory, bin) ): + if os.path.exists(os.path.join(directory, bin) ): return True return False