plugin.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:enigma2 作者: OpenLD 项目源码 文件源码
def CheckDate(self):
        # Check if image is not to old for update (max 30days)
        self.CheckDateDone = True
        tmpdate = getEnigmaVersionString()
        imageDate = date(int(tmpdate[0:4]), int(tmpdate[5:7]), int(tmpdate[8:10]))
        datedelay = imageDate +  timedelta(days=30)
        message = _("Your image is out of date!\n\n"
                "After such a long time, there is a risk that your %s %s will not\n"
                "boot after online-update, or will show disfunction in running Image.\n\n"
                "A new flash will increase the stability\n\n"
                "An online update is done at your own risk !!\n\n\n"
                "Do you still want to update?") % (getMachineBrand(), getMachineName())

        if datedelay > date.today():
            self.updating = True
            self.activityTimer.start(100, False)
            self.ipkg.startCmd(IpkgComponent.CMD_UPGRADE_LIST)
        else:
            print"[SOFTWAREMANAGER] Your image is to old (%s), you need to flash new !!" %getEnigmaVersionString()
            self.session.openWithCallback(self.checkDateCallback, MessageBox, message, default = False)
            return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号