def get_uri_from_clipboard(): clipboard = gtk.Clipboard(selection="PRIMARY") if clipboard.wait_is_text_available(): uri = clipboard.wait_for_text() if uri and utils.is_supported_uri(uri): return uri return None
def __uri_entry_changed(self, entry): uri = entry.get_text() if len(uri) > 0 and utils.is_supported_uri(uri): self.add_button.set_sensitive(True) else: self.add_button.set_sensitive(False)