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:
@@ -55,11 +55,6 @@ def doexe(sourceFile, destinationDirectory):
|
||||
''' example call: pisitools.doexe("kde-3.4.sh", "/etc/X11/Sessions")'''
|
||||
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):
|
||||
'''inserts the files in the list of files into /usr/share/doc/PACKAGE/html'''
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ def move(source, destination):
|
||||
else:
|
||||
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):
|
||||
'''recursively copy a "source" file or directory to "destination"'''
|
||||
for filePath in glob.glob(source):
|
||||
@@ -138,10 +139,10 @@ def copy(source, destination, sym = True):
|
||||
os.remove(destination)
|
||||
os.symlink(os.readlink(filePath), destination)
|
||||
elif isLink(filePath) and not sym:
|
||||
if isDirectory(os.readlink(filePath)):
|
||||
copytree(os.readlink(filePath), destination)
|
||||
if isDirectory(filePath):
|
||||
copytree(filePath, destination)
|
||||
else:
|
||||
shutil.copy(os.readlink(filePath), destination)
|
||||
shutil.copy(filePath, destination)
|
||||
elif isDirectory(filePath):
|
||||
copytree(filePath, destination, sym)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user