本文整理汇总了Python中PyQt5.QtCore.QFileInfo.date方法的典型用法代码示例。如果您正苦于以下问题:Python QFileInfo.date方法的具体用法?Python QFileInfo.date怎么用?Python QFileInfo.date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.QFileInfo
的用法示例。
在下文中一共展示了QFileInfo.date方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkPluginUpdatesAvailable
# 需要导入模块: from PyQt5.QtCore import QFileInfo [as 别名]
# 或者: from PyQt5.QtCore.QFileInfo import date [as 别名]
def checkPluginUpdatesAvailable(self):
"""
Public method to check the availability of updates of plug-ins.
"""
period = Preferences.getPluginManager("UpdatesCheckInterval")
if period == 0:
return
elif period in [1, 2, 3]:
lastModified = QFileInfo(self.pluginRepositoryFile).lastModified()
if lastModified.isValid() and lastModified.date().isValid():
lastModifiedDate = lastModified.date()
now = QDate.currentDate()
if period == 1 and lastModifiedDate.day() == now.day():
# daily
return
elif period == 2 and lastModifiedDate.daysTo(now) < 7:
# weekly
return
elif period == 3 and \
(lastModifiedDate.daysTo(now) <
lastModifiedDate.daysInMonth()):
# monthly
return
self.__updateAvailable = False
request = QNetworkRequest(
QUrl(Preferences.getUI("PluginRepositoryUrl6")))
request.setAttribute(QNetworkRequest.CacheLoadControlAttribute,
QNetworkRequest.AlwaysNetwork)
reply = self.__networkManager.get(request)
reply.finished.connect(self.__downloadRepositoryFileDone)
self.__replies.append(reply)