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


Python QFileInfo.isDir方法代码示例

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


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

示例1: onActivated

# 需要导入模块: from PyQt5.QtCore import QFileInfo [as 别名]
# 或者: from PyQt5.QtCore.QFileInfo import isDir [as 别名]
    def onActivated(self, index):
        path = self.model().filePath(index)
        fileInfo = QFileInfo(path)
        if (fileInfo.isDir()):
            prefs = preferences.Preferences.instance()
            prefs.setMapsDirectory(fileInfo.canonicalFilePath())
            return

        self.mMainWindow.openFile(path)
开发者ID:theall,项目名称:Python-Tiled,代码行数:11,代码来源:mapsdock.py

示例2: createRequest

# 需要导入模块: from PyQt5.QtCore import QFileInfo [as 别名]
# 或者: from PyQt5.QtCore.QFileInfo import isDir [as 别名]
 def createRequest(self, op, request, outgoingData=None):
     """
     Public method to create a request.
     
     @param op the operation to be performed
         (QNetworkAccessManager.Operation)
     @param request reference to the request object (QNetworkRequest)
     @param outgoingData reference to an IODevice containing data to be sent
         (QIODevice)
     @return reference to the created reply object (QNetworkReply)
     """
     if op == QNetworkAccessManager.GetOperation:
         fileInfo = QFileInfo(request.url().toLocalFile())
         if not fileInfo.isDir() or \
            not fileInfo.isReadable() or \
            not fileInfo.exists():
             return None
         from .FileReply import FileReply
         return FileReply(request.url(), self.parent())
     else:
         return None
开发者ID:Darriall,项目名称:eric,代码行数:23,代码来源:FileAccessHandler.py

示例3: __loadFlashCookiesFromPath

# 需要导入模块: from PyQt5.QtCore import QFileInfo [as 别名]
# 或者: from PyQt5.QtCore.QFileInfo import isDir [as 别名]
 def __loadFlashCookiesFromPath(self, path):
     """
     Private slot to load the Flash cookies from a path.
     
     @param path Flash cookies path
     @type str
     """
     if path.endswith("#AppContainer"):
         # specific to IE and Windows
         return
     
     path = path.replace("\\", "/")
     solDir = QDir(path)
     entryList = solDir.entryList()
     for entry in entryList:
         if entry == "." or entry == "..":
             continue
         entryInfo = QFileInfo(path + "/" + entry)
         if entryInfo.isDir():
             self.__loadFlashCookiesFromPath(entryInfo.filePath())
         else:
             self.__insertFlashCookie(entryInfo.filePath())
开发者ID:testmana2,项目名称:test,代码行数:24,代码来源:FlashCookieManager.py


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