Fix invocation with -s

This commit is contained in:
Florian Bruhin 2017-06-16 17:04:08 +02:00
parent 471755d370
commit 3470e9bf5d
3 changed files with 6 additions and 6 deletions

View File

@ -182,10 +182,10 @@ def _init_icon():
def _process_args(args): def _process_args(args):
"""Open startpage etc. and process commandline args.""" """Open startpage etc. and process commandline args."""
config_obj = objreg.get('config') config_obj = objreg.get('config')
for sect, opt, val in args.temp_settings: for opt, val in args.temp_settings:
try: try:
config_obj.set('temp', sect, opt, val) config_obj.set(opt, val)
except (configexc.Error, configparser.Error) as e: except configexc.Error as e:
message.error("set: {} - {}".format(e.__class__.__name__, e)) message.error("set: {} - {}".format(e.__class__.__name__, e))
if not args.override_restore: if not args.override_restore:

View File

@ -51,9 +51,9 @@ def get_argparser():
parser.add_argument('-V', '--version', help="Show version and quit.", parser.add_argument('-V', '--version', help="Show version and quit.",
action='store_true') action='store_true')
parser.add_argument('-s', '--set', help="Set a temporary setting for " parser.add_argument('-s', '--set', help="Set a temporary setting for "
"this session.", nargs=3, action='append', "this session.", nargs=2, action='append',
dest='temp_settings', default=[], dest='temp_settings', default=[],
metavar=('SECTION', 'OPTION', 'VALUE')) metavar=('OPTION', 'VALUE'))
parser.add_argument('-r', '--restore', help="Restore a named session.", parser.add_argument('-r', '--restore', help="Restore a named session.",
dest='session') dest='session')
parser.add_argument('-R', '--override-restore', help="Don't restore a " parser.add_argument('-R', '--override-restore', help="Don't restore a "

View File

@ -274,7 +274,7 @@ def test_launching_with_python2():
def test_initial_private_browsing(request, quteproc_new): def test_initial_private_browsing(request, quteproc_new):
"""Make sure the initial window is private when the setting is set.""" """Make sure the initial window is private when the setting is set."""
args = (_base_args(request.config) + args = (_base_args(request.config) +
['--temp-basedir', '-s', 'general', 'private-browsing', 'true']) ['--temp-basedir', '-s', 'content.private_browsing', 'true'])
quteproc_new.start(args) quteproc_new.start(args)
quteproc_new.compare_session(""" quteproc_new.compare_session("""