bumblebee-status/bumblebee/config.py
Tobi-wan Kenobi 9a5a6d354a [core/config] Add module aliases
Allow the user to provide aliases when loading a module multiple times
so that the modules can be differentiated (e.g. for passing parameters
to a module).

see #23
2016-12-03 20:54:57 +01:00

22 lines
667 B
Python

import argparse
MODULE_HELP = ""
class Config(object):
def __init__(self, args = []):
parser = self._create_parser()
self._args = parser.parse_args(args)
def modules(self):
return list(map(lambda x: {
"module": x.split(":")[0],
"name": x if not ":" in x else x.split(":")[1]
}, self._args.modules))
def _create_parser(self):
parser = argparse.ArgumentParser(description="display system data in the i3bar")
parser.add_argument("-m", "--modules", nargs="+", default = [],
help = MODULE_HELP)
return parser
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4