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


Python MunkiItems.updatesRequireRestart方法代码示例

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


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

示例1: confirmUpdatesAndInstall

# 需要导入模块: import MunkiItems [as 别名]
# 或者: from MunkiItems import updatesRequireRestart [as 别名]
 def confirmUpdatesAndInstall(self):
     '''Make sure it's OK to proceed with installing if logout or restart is required'''
     if self.alertedToMultipleUsers():
         return
     elif MunkiItems.updatesRequireRestart():
         alert = NSAlert.alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_(
             NSLocalizedString(u"Restart Required", u"Restart Required title"),
             NSLocalizedString(u"Log out and update", u"Log out and Update button text"),
             NSLocalizedString(u"Cancel", u"Cancel button title/short action text"),
             nil,
             u"%@", NSLocalizedString(
                 (u"A restart is required after updating. Please be patient "
                 "as there may be a short delay at the login window. Log "
                 "out and update now?"), u"Restart Required detail"))
         alert.beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_(
             self.window, self,
             self.logoutAlertDidEnd_returnCode_contextInfo_, nil)
     elif MunkiItems.updatesRequireLogout() or munki.installRequiresLogout():
         alert = NSAlert.alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_(
             NSLocalizedString(u"Logout Required", u"Logout Required title"),
             NSLocalizedString(u"Log out and update", u"Log out and Update button text"),
             NSLocalizedString(u"Cancel", u"Cancel button title/short action text"),
             nil,
             u"%@", NSLocalizedString(
                 (u"A logout is required before updating. Please be patient "
                 "as there may be a short delay at the login window. Log "
                 "out and update now?"), u"Logout Required detail"))
         alert.beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_(
             self.window, self,
                 self.logoutAlertDidEnd_returnCode_contextInfo_, nil)
     else:
         # we shouldn't have been invoked if neither a restart or logout was required
         msclog.debug_log(
                     'confirmUpdatesAndInstall was called but no restart or logout was needed')
开发者ID:LTSAdmin,项目名称:munki,代码行数:36,代码来源:AlertController.py

示例2: kickOffInstallSession

# 需要导入模块: import MunkiItems [as 别名]
# 或者: from MunkiItems import updatesRequireRestart [as 别名]
 def kickOffInstallSession(self):
     '''start an update install/removal session'''
     # check for need to logout, restart, firmware warnings
     # warn about blocking applications, etc...
     # then start an update session
     if MunkiItems.updatesRequireRestart() or MunkiItems.updatesRequireLogout():
         # switch to updates view
         self.loadUpdatesPage_(self)
         # warn about need to logout or restart
         self.alert_controller.confirmUpdatesAndInstall()
     else:
         if self.alert_controller.alertedToBlockingAppsRunning():
             self.loadUpdatesPage_(self)
             return
         if self.alert_controller.alertedToRunningOnBatteryAndCancelled():
             self.loadUpdatesPage_(self)
             return
         self.managedsoftwareupdate_task = None
         msclog.log("user", "install_without_logout")
         self._update_in_progress = True
         self.displayUpdateCount()
         self.setStatusViewTitle_(NSLocalizedString(u"Updating...", u"Updating message"))
         result = munki.justUpdate()
         if result:
             msclog.debug_log("Error starting install session: %s" % result)
             self.munkiStatusSessionEnded_(2)
         else:
             self.managedsoftwareupdate_task = "installwithnologout"
             NSApp.delegate().statusController.startMunkiStatusSession()
             self.markPendingItemsAsInstalling()
开发者ID:altyus,项目名称:munki,代码行数:32,代码来源:MSCMainWindowController.py

示例3: handlePossibleAuthRestart

# 需要导入模块: import MunkiItems [as 别名]
# 或者: from MunkiItems import updatesRequireRestart [as 别名]
 def handlePossibleAuthRestart(self):
     '''Ask for and store a password for auth restart if needed/possible'''
     username = NSUserName()
     if (MunkiItems.updatesRequireRestart() and
             authrestart.verify_user(username) and
             not authrestart.verify_recovery_key_present()):
         # FV is on and user is in list of FV users, so they can
         # authrestart, and we do not have a stored FV recovery
         # key/password. So we should prompt the user for a password
         # we can use for fdesetup authrestart
         NSApp.delegate(
             ).passwordAlertController.promptForPasswordForAuthRestart()
开发者ID:alexander-riss,项目名称:munki,代码行数:14,代码来源:AlertController.py


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