本文整理汇总了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)
示例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
示例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())