本文整理汇总了Python中GLIUtility.parse_uri方法的典型用法代码示例。如果您正苦于以下问题:Python GLIUtility.parse_uri方法的具体用法?Python GLIUtility.parse_uri怎么用?Python GLIUtility.parse_uri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLIUtility
的用法示例。
在下文中一共展示了GLIUtility.parse_uri方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_from_uri
# 需要导入模块: import GLIUtility [as 别名]
# 或者: from GLIUtility import parse_uri [as 别名]
def update_from_uri(self):
if self.uri:
self.uriparts = GLIUtility.parse_uri(self.uri)
if not self.uriparts:
msgdlg = gtk.MessageDialog(parent=self, type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK, message_format=_("The URI you had previously entered was malformed and couldn't be parsed."))
msgdlg.run()
msgdlg.destroy()
self.uri = "file:///"
self.uriparts = GLIUtility.parse_uri(self.uri)
else:
for i, tmpuritype in enumerate(self.uritypes):
if self.uriparts[0] == tmpuritype:
self.uritype.set_active(i)
if self.uriparts[3]: self.host_entry.set_text(self.uriparts[3])
if self.uriparts[1]: self.username_entry.set_text(self.uriparts[1])
if self.uriparts[2]: self.password_entry.set_text(self.uriparts[2])
if self.uriparts[4]: self.port_entry.set_text(self.uriparts[4])
else:
self.uri = "file:///"
self.uriparts = GLIUtility.parse_uri(self.uri)
self.refresh_file_list()
示例2: refresh_clicked
# 需要导入模块: import GLIUtility [as 别名]
# 或者: from GLIUtility import parse_uri [as 别名]
def refresh_clicked(self, button):
if self.uritype.get_active() == 0:
self.uri = "file://"
else:
self.host_entry.set_sensitive(True)
self.port_entry.set_sensitive(True)
self.username_entry.set_sensitive(True)
self.password_entry.set_sensitive(True)
self.uri = self.uritypes[self.uritype.get_active()] + "://"
if self.username_entry.get_text():
self.uri += self.username_entry.get_text()
if self.password_entry.get_text():
self.uri += ":" + self.password_entry.get_text()
self.uri += "@"
self.uri += self.host_entry.get_text()
if self.port_entry.get_text():
self.uri += ":" + self.port_entry.get_text()
self.uri += (self.path_entry.get_text() or "/")
self.uriparts = GLIUtility.parse_uri(self.uri)
self.refresh_file_list()