2016-11-05 07:54:36 +01:00
|
|
|
import argparse
|
|
|
|
|
2016-12-03 20:38:54 +01:00
|
|
|
MODULE_HELP = ""
|
2016-11-05 14:26:02 +01:00
|
|
|
|
2016-11-05 07:54:36 +01:00
|
|
|
class Config(object):
|
2016-12-03 20:38:54 +01:00
|
|
|
def __init__(self, args = []):
|
|
|
|
parser = self._create_parser()
|
|
|
|
self._args = parser.parse_args(args)
|
2016-11-05 08:11:08 +01:00
|
|
|
|
|
|
|
def modules(self):
|
2016-12-03 20:38:54 +01:00
|
|
|
return map(lambda x: { "name": x, "module": x }, self._args.modules)
|
2016-11-05 07:54:36 +01:00
|
|
|
|
2016-12-03 20:38:54 +01:00
|
|
|
def _create_parser(self):
|
2016-11-05 08:11:08 +01:00
|
|
|
parser = argparse.ArgumentParser(description="display system data in the i3bar")
|
2016-12-03 20:38:54 +01:00
|
|
|
parser.add_argument("-m", "--modules", nargs="+", default = [],
|
|
|
|
help = MODULE_HELP)
|
2016-11-05 08:11:08 +01:00
|
|
|
return parser
|
|
|
|
|
2016-11-05 07:54:36 +01:00
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|