Use instance method for _load_config (#4112)
This commit is contained in:
parent
cb4b7e3db0
commit
efd57870d0
|
|
@ -32,24 +32,21 @@ class LocaleConfiguration:
|
|||
output += '{}: {}'.format(tr('Locale encoding'), self.sys_enc)
|
||||
return output
|
||||
|
||||
@classmethod
|
||||
def _load_config(cls, config: 'LocaleConfiguration', args: dict[str, str]) -> 'LocaleConfiguration':
|
||||
def _load_config(self, args: dict[str, str]) -> None:
|
||||
if 'sys_lang' in args:
|
||||
config.sys_lang = args['sys_lang']
|
||||
self.sys_lang = args['sys_lang']
|
||||
if 'sys_enc' in args:
|
||||
config.sys_enc = args['sys_enc']
|
||||
self.sys_enc = args['sys_enc']
|
||||
if 'kb_layout' in args:
|
||||
config.kb_layout = args['kb_layout']
|
||||
|
||||
return config
|
||||
self.kb_layout = args['kb_layout']
|
||||
|
||||
@classmethod
|
||||
def parse_arg(cls, args: dict[str, Any]) -> 'LocaleConfiguration':
|
||||
default = cls.default()
|
||||
|
||||
if 'locale_config' in args:
|
||||
default = cls._load_config(default, args['locale_config'])
|
||||
default._load_config(args['locale_config'])
|
||||
else:
|
||||
default = cls._load_config(default, args)
|
||||
default._load_config(args)
|
||||
|
||||
return default
|
||||
|
|
|
|||
Loading…
Reference in New Issue