[d-feet: 6/7] DFeetApp: add --address
- From: Thomas Bechtold <toabctl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [d-feet: 6/7] DFeetApp: add --address
- Date: Wed, 15 Apr 2020 09:54:03 +0000 (UTC)
commit b14c926569ad40d5201787b64f5537eda578c92c
Author: Marc-André Lureau <marcandre lureau redhat com>
Date: Thu Mar 26 23:17:16 2020 +0100
DFeetApp: add --address
This will allow to open D-Feet directly to a given address from the
CLI.
Signed-off-by: Marc-André Lureau <marcandre lureau redhat com>
src/dfeet/application.py | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/src/dfeet/application.py b/src/dfeet/application.py
index 7f4f44a..5d88e00 100644
--- a/src/dfeet/application.py
+++ b/src/dfeet/application.py
@@ -33,6 +33,8 @@ class DFeetApp(Gtk.Application):
flags=Gio.ApplicationFlags.FLAGS_NONE)
self.add_main_option_entries([
make_option("--version", description=_("Show version number and exit")),
+ make_option("--address", arg=GLib.OptionArg.STRING, arg_description="ADDRESS",
+ description=_("Open the specified bus address")),
])
def do_handle_local_options(self, options):
@@ -45,6 +47,10 @@ class DFeetApp(Gtk.Application):
# Note that the function in C activate() becomes do_activate() in Python
def do_activate(self):
self._main_win = DFeetWindow(self, self.version, self.data_dir)
+ if self.options.contains("address"):
+ address = self.options.lookup_value("address").get_string()
+ if not self._main_win.connect_to(address):
+ self.quit()
# Note that the function in C startup() becomes do_startup() in Python
def do_startup(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]