本文整理汇总了Python中FileUtils.newFolder方法的典型用法代码示例。如果您正苦于以下问题:Python FileUtils.newFolder方法的具体用法?Python FileUtils.newFolder怎么用?Python FileUtils.newFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtils
的用法示例。
在下文中一共展示了FileUtils.newFolder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: copyFiles
# 需要导入模块: import FileUtils [as 别名]
# 或者: from FileUtils import newFolder [as 别名]
def copyFiles(configData):
if False == configData.has_key(s_copyFileKey):
ColorPrint.errorPrint("没有定义复制文件")
return
copyFilesConfig = configData[s_copyFileKey]
for _, value in enumerate(copyFilesConfig):
targetFolder = getFileTargetFolder(value)
source = value[s_sourceKey]
isNew = isNewFromConfig(value)
isFilter = isFilterFormConfig(value)
if s_jsonTrue == isFilter:
continue
if not os.path.exists(g_projectPath + targetFolder):
FileUtils.newFolder(g_projectPath + targetFolder)
if s_jsonTrue == isNew:
FileUtils.deleteFile(g_projectPath + targetFolder + source)
FileUtils.copyFile(s_sourcePath + source , g_projectPath + targetFolder + source)
ColorPrint.colorPrint("Copy " + s_sourcePath + source)
elif not os.path.isfile(g_projectPath + targetFolder + source):
FileUtils.copyFile(s_sourcePath + source , g_projectPath + targetFolder + source)
ColorPrint.colorPrint("Copy " + s_sourcePath + source)
示例2: copyFolder
# 需要导入模块: import FileUtils [as 别名]
# 或者: from FileUtils import newFolder [as 别名]
def copyFolder(configData):
if False == configData.has_key(s_copyFolderKey):
ColorPrint.errorPrint("没有定义复制文件夹")
return
copyFolderData = configData[s_copyFolderKey]
for _, value in enumerate(copyFolderData):
targetFolder = getFolderTargetFolder(value)
source = value[s_sourceKey]
isNew = isNewFromConfig(value)
isFilter = isFilterFormConfig(value)
if s_jsonTrue == isFilter:
continue
if s_jsonTrue == isNew:
FileUtils.newFolder(g_projectPath + targetFolder)
ColorPrint.errorPrint("NewFolder " + g_projectPath + targetFolder)
ColorPrint.colorPrint("Copy " + s_sourcePath + source)
FileUtils.copyFolder(s_sourcePath + source, g_projectPath + targetFolder)