Exemple #1
0
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
Exemple #2
0
 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)