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


Python QFileInfo.isReadable方法代码示例

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


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

示例1: createRequest

# 需要导入模块: from PyQt5.QtCore import QFileInfo [as 别名]
# 或者: from PyQt5.QtCore.QFileInfo import isReadable [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

示例2: detect_python_path

# 需要导入模块: from PyQt5.QtCore import QFileInfo [as 别名]
# 或者: from PyQt5.QtCore.QFileInfo import isReadable [as 别名]
def detect_python_path():
    if (IS_WINDOWS and PYTHON_PATH_CONFIGURED_BY_USER) or not IS_WINDOWS:
        return []

    suggested = []
    try:
        drives = [QDir.toNativeSeparators(d.absolutePath())
                  for d in QDir.drives()]
        dirs = []
        for drive in drives:
            info = QFileInfo(drive)
            if info.isReadable():
                dirs += [os.path.join(drive, folder)
                         for folder in os.listdir(drive)]
        for folder in dirs:
            file_path = os.path.join(folder, "python.exe")
            if ("Python" in folder) and os.path.exists(file_path):
                suggested.append(file_path)
    except:
        print("Detection couldnt be executed")

    return suggested
开发者ID:Salmista-94,项目名称:Ninja_PyQt5,代码行数:24,代码来源:settings.py


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