From c908e666de0b9fddaa216ec00e5008cc35fd5f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Wed, 3 Aug 2005 20:26:53 +0000 Subject: [PATCH] =?UTF-8?q?domove=203.=20parametre=20ile=20dosya=20isim=20?= =?UTF-8?q?de=C4=9Fi=C5=9Ftirdi=C4=9Fi=20durumlar=C4=B1=20kontrol=20ediyor?= =?UTF-8?q?...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/actionsapi/pisitools.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pisi/actionsapi/pisitools.py b/pisi/actionsapi/pisitools.py index 24ce82d3..529872b0 100644 --- a/pisi/actionsapi/pisitools.py +++ b/pisi/actionsapi/pisitools.py @@ -147,13 +147,18 @@ def domo_(*sourceFiles): '''inserts the mo files in the list of files into /usr/share/locale/LOCALE/LC_MESSAGES''' pass -def domove(source, destination): +def domove(sourceFile, destination, destinationFile = ''): '''moves sourceFile/Direcroty into destinationFile/Directory''' ''' example call: pisitools.domove("/usr/bin/bash", "/bin/bash")''' ''' example call: pisitools.domove("/usr/bin/", "/usr/sbin")''' - makedirs(get.installDIR() + os.path.dirname(destination)) - shutil.move(get.installDIR() + source, get.installDIR() + destination) + makedirs(get.installDIR() + destination) + + for file in glob.glob(get.installDIR() + sourceFile): + if not destinationFile: + shutil.move(file, get.installDIR() + os.path.join(destination, os.path.basename(file))) + else: + shutil.move(file, get.installDIR() + os.path.join(destination, destinationFile)) def dopython(): '''FIXME: What the hell is this?'''