file -> filePath..
This commit is contained in:
@@ -150,11 +150,11 @@ def domove(sourceFile, destination, destinationFile = ''):
|
|||||||
''' example call: pisitools.domove("/usr/bin/", "/usr/sbin")'''
|
''' example call: pisitools.domove("/usr/bin/", "/usr/sbin")'''
|
||||||
makedirs(join_path(get.installDIR(), destination))
|
makedirs(join_path(get.installDIR(), destination))
|
||||||
|
|
||||||
for file in glob.glob(join_path(get.installDIR(), sourceFile)):
|
for filePath in glob.glob(join_path(get.installDIR(), sourceFile)):
|
||||||
if not destinationFile:
|
if not destinationFile:
|
||||||
move(file, join_path(get.installDIR(), join_path(destination, os.path.basename(file))))
|
move(filePath, join_path(get.installDIR(), join_path(destination, os.path.basename(filePath))))
|
||||||
else:
|
else:
|
||||||
move(file, join_path(get.installDIR(), join_path(destination, destinationFile)))
|
move(filePath, join_path(get.installDIR(), join_path(destination, destinationFile)))
|
||||||
|
|
||||||
def rename(sourceFile, destinationFile):
|
def rename(sourceFile, destinationFile):
|
||||||
''' renames sourceFile as destinationFile'''
|
''' renames sourceFile as destinationFile'''
|
||||||
@@ -208,9 +208,9 @@ def insinto(destinationDirectory, sourceFile, destinationFile = ''):
|
|||||||
makedirs(join_path(get.installDIR(), destinationDirectory))
|
makedirs(join_path(get.installDIR(), destinationDirectory))
|
||||||
|
|
||||||
if not destinationFile:
|
if not destinationFile:
|
||||||
for file in glob.glob(sourceFile):
|
for filePath in glob.glob(sourceFile):
|
||||||
if can_access_file(file):
|
if can_access_file(filePath):
|
||||||
copy(file, join_path(get.installDIR(), join_path(destinationDirectory, os.path.basename(file))))
|
copy(filePath, join_path(get.installDIR(), join_path(destinationDirectory, os.path.basename(filePath))))
|
||||||
else:
|
else:
|
||||||
copy(sourceFile, join_path(get.installDIR(), join_path(destinationDirectory, destinationFile)))
|
copy(sourceFile, join_path(get.installDIR(), join_path(destinationDirectory, destinationFile)))
|
||||||
|
|
||||||
@@ -231,8 +231,8 @@ def newman(sourceFile, destinationFile):
|
|||||||
|
|
||||||
def remove(sourceFile):
|
def remove(sourceFile):
|
||||||
'''removes sourceFile'''
|
'''removes sourceFile'''
|
||||||
for file in glob.glob(join_path(get.installDIR(), sourceFile)):
|
for filePath in glob.glob(join_path(get.installDIR(), sourceFile)):
|
||||||
unlink(file)
|
unlink(filePath)
|
||||||
|
|
||||||
def removeDir(destinationDirectory):
|
def removeDir(destinationDirectory):
|
||||||
'''removes destinationDirectory and its subtrees'''
|
'''removes destinationDirectory and its subtrees'''
|
||||||
|
|||||||
Reference in New Issue
Block a user