当前位置: 首页>>代码示例>>Python>>正文


Python FileUtils.isExist方法代码示例

本文整理汇总了Python中FileUtils.isExist方法的典型用法代码示例。如果您正苦于以下问题:Python FileUtils.isExist方法的具体用法?Python FileUtils.isExist怎么用?Python FileUtils.isExist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileUtils的用法示例。


在下文中一共展示了FileUtils.isExist方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setSourceToSearch

# 需要导入模块: import FileUtils [as 别名]
# 或者: from FileUtils import isExist [as 别名]
 def setSourceToSearch(self, _isReload=True, _isLoadFromCache=False):
     try:
         if self.sourceToSearch is None or _isReload:
             sourceToSearch = ""
             self.isMultipleSource = False
             pathToSearchs = str(self.lePathToSeach.text())
             if fu.isExist(pathToSearchs) is False and pathToSearchs.find(";") != -1:
                 self.isMultipleSource = True
             for pathToSearch in uni.getListFromListString(pathToSearchs, ";"):
                 if pathToSearch in self.sourceToSearchCache and _isLoadFromCache:
                     sourceToSearch += self.sourceToSearchCache[pathToSearch]
                 else:
                     pathToSearch = fu.checkSource(pathToSearch)
                     if pathToSearch is not None:
                         if fu.isReadableFileOrDir(pathToSearch):
                             if fu.isFile(pathToSearch) and fu.isBinary(pathToSearch) is False:
                                 sts = fu.readFromFile(pathToSearch) + "\n"
                                 sourceToSearch += sts
                                 self.sourceToSearchCache[pathToSearch] = sts
                             elif fu.isDir(pathToSearch):
                                 sts = fu.getFileTree(pathToSearch, -1, "return", "plainText", "fileList") + "\n"
                                 sourceToSearch += sts
                                 self.sourceToSearchCache[pathToSearch] = sts
             self.sourceToSearch = sourceToSearch
             if sourceToSearch != "":
                 return True
             return False
         else:
             return True
     except:
         ReportBug.ReportBug()
开发者ID:supermurat,项目名称:hamsi-manager,代码行数:33,代码来源:Searcher.py

示例2: generateReadOnlyEmbeddedD

# 需要导入模块: import FileUtils [as 别名]
# 或者: from FileUtils import isExist [as 别名]
def generateReadOnlyEmbeddedD(_isNoAlertIfSuccessfully=True):
    stopReadOnlyEmbeddedDB()
    if fu.isExist(fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok"):
        fu.removeFileOrDir(fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok")
    fu.copyFileOrDir(uni.getKDE4HomePath() + "/share/apps/amarok/mysqle/amarok",
                     fu.pathOfSettingsDirectory + "/Amarok/mysqle/amarok")
    if _isNoAlertIfSuccessfully is False:
        Dialogs.show(translate("EmbeddedDBCore", "Generated Embedded Server"),
                     translate("EmbeddedDBCore", "Embedded Amarok database server generated."))
    return True
开发者ID:supermurat,项目名称:hamsi-manager,代码行数:12,代码来源:__init__.py


注:本文中的FileUtils.isExist方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。