From c04b6aeb87dd5422ab22d097e223f98f14802ebf Mon Sep 17 00:00:00 2001 From: Matt Rose Date: Fri, 28 Aug 2020 16:51:37 -0400 Subject: [PATCH] move cmdline option conversion to dbus format to optionparse --- terminator | 4 ++-- terminatorlib/optionparse.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/terminator b/terminator index 449a2f3a..24936496 100755 --- a/terminator +++ b/terminator @@ -66,7 +66,7 @@ if __name__ == '__main__': dbg ("%s starting up, version %s" % (APP_NAME, APP_VERSION)) - OPTIONS = terminatorlib.optionparse.parse_options() + OPTIONS,dbus_options = terminatorlib.optionparse.parse_options() TERMINATOR = Terminator() TERMINATOR.set_origcwd(ORIGCWD) @@ -102,7 +102,7 @@ if __name__ == '__main__': if val == True: val = 'True' optionslist[opt] = val and '%s'%val or '' - optionslist = dbus.Dictionary(optionslist, signature='ss') + optionslist = dbus.Dictionary(dbus_options, signature='ss') if OPTIONS.new_tab: dbg('Requesting a new tab') ipc.new_tab_cmdline(optionslist) diff --git a/terminatorlib/optionparse.py b/terminatorlib/optionparse.py index 7bff44d2..63a6f625 100644 --- a/terminatorlib/optionparse.py +++ b/terminatorlib/optionparse.py @@ -149,7 +149,16 @@ icon for the window (by file or name)')) configobj.options_set(options) + optionslist = {} + for opt, val in list(options.__dict__.items()): + if type(val) == type([]): + val = ' '.join(val) + if val == True: + val = 'True' + optionslist[opt] = val and '%s'%val or '' + # optionslist = dbus.Dictionary(optionslist, signature='ss') if util.DEBUG == True: dbg('OptionParse::parse_options: command line options: %s' % options) - return(options) + + return(options,optionslist)