boş fonk'a babay, copy sorununu şimdilik workarounla. actionsAPI api bozmadan ilk boş fırsatta gözden geçirilecek/refactor edilecek...

This commit is contained in:
S.Çağlar Onur
2006-04-18 22:09:05 +00:00
parent 5c05fa29ae
commit fb7c5ac984
2 changed files with 4 additions and 8 deletions
-5
View File
@@ -55,11 +55,6 @@ def doexe(sourceFile, destinationDirectory):
''' example call: pisitools.doexe("kde-3.4.sh", "/etc/X11/Sessions")''' ''' example call: pisitools.doexe("kde-3.4.sh", "/etc/X11/Sessions")'''
executable_insinto(join_path(get.installDIR(), destinationDirectory), sourceFile) executable_insinto(join_path(get.installDIR(), destinationDirectory), sourceFile)
def dohard(sourceFile, destinationFile):
'''creates hard link between sourceFile and destinationFile'''
#FIXME: How can i use hard-links in Python?
ctx.ui.warning('*** Hard links not implemented yet')
def dohtml(*sourceFiles): def dohtml(*sourceFiles):
'''inserts the files in the list of files into /usr/share/doc/PACKAGE/html''' '''inserts the files in the list of files into /usr/share/doc/PACKAGE/html'''
+4 -3
View File
@@ -122,6 +122,7 @@ def move(source, destination):
else: else:
error(_('ActionsAPI [move]: File %s doesn\'t exists.') % (filePath)) error(_('ActionsAPI [move]: File %s doesn\'t exists.') % (filePath))
# FIXME: instead of passing a sym parameter, split copy and copytree into 4 different function
def copy(source, destination, sym = True): def copy(source, destination, sym = True):
'''recursively copy a "source" file or directory to "destination"''' '''recursively copy a "source" file or directory to "destination"'''
for filePath in glob.glob(source): for filePath in glob.glob(source):
@@ -138,10 +139,10 @@ def copy(source, destination, sym = True):
os.remove(destination) os.remove(destination)
os.symlink(os.readlink(filePath), destination) os.symlink(os.readlink(filePath), destination)
elif isLink(filePath) and not sym: elif isLink(filePath) and not sym:
if isDirectory(os.readlink(filePath)): if isDirectory(filePath):
copytree(os.readlink(filePath), destination) copytree(filePath, destination)
else: else:
shutil.copy(os.readlink(filePath), destination) shutil.copy(filePath, destination)
elif isDirectory(filePath): elif isDirectory(filePath):
copytree(filePath, destination, sym) copytree(filePath, destination, sym)
else: else: