config: Use sectname/optname argument names.
This commit is contained in:
parent
f2e68685d2
commit
fa9d9b62b1
@ -337,8 +337,8 @@ class ConfigManager(QObject):
|
|||||||
@cmdutils.register(name='set', instance='config',
|
@cmdutils.register(name='set', instance='config',
|
||||||
completion=[Completion.section, Completion.option,
|
completion=[Completion.section, Completion.option,
|
||||||
Completion.value])
|
Completion.value])
|
||||||
def set_command(self, section, # pylint: disable=redefined-outer-name
|
def set_command(self, sectname: {'name': 'section'},
|
||||||
option, value, temp=False):
|
optname: {'name': 'option'}, value, temp=False):
|
||||||
"""Set an option.
|
"""Set an option.
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -346,14 +346,14 @@ class ConfigManager(QObject):
|
|||||||
Wrapper for self.set() to output exceptions in the status bar.
|
Wrapper for self.set() to output exceptions in the status bar.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
section: The section where the option is in.
|
sectname: The section where the option is in.
|
||||||
option: The name of the option.
|
optname: The name of the option.
|
||||||
value: The value to set.
|
value: The value to set.
|
||||||
temp: Set value temporarily.
|
temp: Set value temporarily.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
layer = 'temp' if temp else 'conf'
|
layer = 'temp' if temp else 'conf'
|
||||||
self.set(layer, section, option, value)
|
self.set(layer, sectname, optname, value)
|
||||||
except (NoOptionError, NoSectionError, configtypes.ValidationError,
|
except (NoOptionError, NoSectionError, configtypes.ValidationError,
|
||||||
ValueError) as e:
|
ValueError) as e:
|
||||||
raise cmdexc.CommandError("set: {} - {}".format(
|
raise cmdexc.CommandError("set: {} - {}".format(
|
||||||
|
Loading…
Reference in New Issue
Block a user