本文整理汇总了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