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")'''
|
''' 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'''
|
||||||
|
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user