From 52f15c84a68a7bc368ba2629d43c9031ffcaf0da Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 14 Jun 2017 19:34:36 +0200 Subject: [PATCH] Get rid of config sections --- qutebrowser/config/config.py | 6 ------ qutebrowser/config/newconfig.py | 12 ------------ qutebrowser/config/parsers/keyconf.py | 7 ++++--- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index a51fda016..8afb35813 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -63,12 +63,6 @@ def get(*args, **kwargs): return objreg.get('config').get(*args, **kwargs) -def section(sect): - """Get a config section from the global config.""" - config = objreg.get('config') - return newconfig.SectionStub(config, sect) - - def _init_main_config(parent=None): """Initialize the main config. diff --git a/qutebrowser/config/newconfig.py b/qutebrowser/config/newconfig.py index efe00d0d2..475ac69a9 100644 --- a/qutebrowser/config/newconfig.py +++ b/qutebrowser/config/newconfig.py @@ -33,18 +33,6 @@ instance = None _change_filters = [] -class SectionStub: - - # FIXME get rid of this once we get rid of sections - - def __init__(self, conf, name): - self._conf = conf - self._name = name - - def __getitem__(self, item): - return self._conf.get(self._name, item) - - class change_filter: # pylint: disable=invalid-name """Decorator to filter calls based on a config section/option matching. diff --git a/qutebrowser/config/parsers/keyconf.py b/qutebrowser/config/parsers/keyconf.py index 53f23d7c0..216715ddb 100644 --- a/qutebrowser/config/parsers/keyconf.py +++ b/qutebrowser/config/parsers/keyconf.py @@ -363,11 +363,12 @@ class KeyConfigParser(QObject): line)) commands = [c.split(maxsplit=1)[0].strip() for c in commands] for cmd in commands: - aliases = config.section('aliases') + # FIXME:conf + # aliases = config.section('aliases') if cmd in cmdutils.cmd_dict: cmdname = cmd - elif cmd in aliases: - cmdname = aliases[cmd].split(maxsplit=1)[0].strip() + # elif cmd in aliases: + # cmdname = aliases[cmd].split(maxsplit=1)[0].strip() else: raise KeyConfigError("Invalid command '{}'!".format(cmd)) cmd_obj = cmdutils.cmd_dict[cmdname]