本文整理匯總了Python中GLIUtility.validate_uri方法的典型用法代碼示例。如果您正苦於以下問題:Python GLIUtility.validate_uri方法的具體用法?Python GLIUtility.validate_uri怎麽用?Python GLIUtility.validate_uri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GLIUtility
的用法示例。
在下文中一共展示了GLIUtility.validate_uri方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: deactivate
# 需要導入模塊: import GLIUtility [as 別名]
# 或者: from GLIUtility import validate_uri [as 別名]
def deactivate(self):
if not self.check_dynamic.get_active():
if not self.entry_stage_tarball_uri.get_text():
msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="You did not enter a stage tarball URI. You cannot complete an installation until you set this value. Continue?")
resp = msgdlg.run()
msgdlg.destroy()
if resp == gtk.RESPONSE_NO:
return False
elif not GLIUtility.validate_uri(self.entry_stage_tarball_uri.get_text()):
msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="The stage tarball URI you entered does not exist. You cannot complete an installation until this value is a valid. Continue?")
resp = msgdlg.run()
msgdlg.destroy()
if resp == gtk.RESPONSE_NO:
return False
elif self.active_selection == 3 and self.check_grp.get_active() and self.has_systempkgs:
msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="When doing a GRP install, it is recommended to use the Dynamic option instead of selecting your own tarball. Continue?")
resp = msgdlg.run()
msgdlg.destroy()
if resp == gtk.RESPONSE_NO:
return False
self.controller.install_profile.set_install_stage(None, self.active_selection, None)
if self.active_selection == 3:
self.controller.install_profile.set_grp_install(None, self.check_grp.get_active(), None)
self.controller.install_profile.set_dynamic_stage3(None, self.check_dynamic.get_active(), None)
else:
self.controller.install_profile.set_grp_install(None, False, None)
try: self.controller.install_profile.set_stage_tarball_uri(None, self.entry_stage_tarball_uri.get_text(), None)
except: pass
return True
示例2: deactivate
# 需要導入模塊: import GLIUtility [as 別名]
# 或者: from GLIUtility import validate_uri [as 別名]
def deactivate(self):
if self.active_selection == "snapshot":
if not self.entry_portage_snapshot_uri.get_text():
msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="You did not enter a portage snapshot URI. Continue?")
resp = msgdlg.run()
msgdlg.destroy()
if resp == gtk.RESPONSE_NO:
return False
elif not GLIUtility.validate_uri(self.entry_portage_snapshot_uri.get_text()):
msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="The portage snapshot URI you entered does not exist. Continue?")
resp = msgdlg.run()
msgdlg.destroy()
if resp == gtk.RESPONSE_NO:
return False
self.controller.install_profile.set_portage_tree_sync_type(None, self.active_selection, None)
try: self.controller.install_profile.set_portage_tree_snapshot_uri(None, self.entry_portage_snapshot_uri.get_text(), None)
except: pass
return True