def _create_dbus_connection(activate=False): interface = _create_dbus_connection_gtg(_IFACE_NAME2, _OBJECT_NAME2, _SERVICE_NAME2, activate) if interface is None: pretty.print_error(__name__, 'Cannot connect to GTG via DBus') if activate: raise NotAvailableError(_("Getting Things GNOME")) return interface
def _get_notes_interactive(): """ Return the dbus proxy object, activate if necessary, raise an OperationError if not available. """ obj = _get_notes_interface(activate=True) if obj is None: raise NotAvailableError(__kupfer_settings__["notes_application"]) return obj
def activate(self, leaf): gfile = Gio.File.new_for_uri(leaf.object["location"]) try: path = gfile.get_path() except Exception as exc: # On utf-8 decode error # FIXME: Unrepresentable path raise OperationError(exc) if path: result = FileLeaf(path) if result.is_valid(): return result raise NotAvailableError(str(leaf))
def error_handler(exc): pretty.print_debug(__name__, exc) ctx.register_late_error(NotAvailableError(__kupfer_settings__["notes_application"]))
def _reply_error(exc): self.output_debug(exc) ctx.register_late_error(NotAvailableError(_("Thunar")))