[lint] Add tool to run pylint on all files
pylint all *.py files and fix the errors reported so far.
This commit is contained in:
parent
9a5a6d354a
commit
a7eff64294
3 changed files with 38 additions and 21 deletions
|
@ -1,22 +1,35 @@
|
|||
"""Configuration handling
|
||||
|
||||
This module provides configuration information (loaded modules,
|
||||
module parameters, etc.) to all other components
|
||||
"""
|
||||
|
||||
import argparse
|
||||
|
||||
MODULE_HELP = ""
|
||||
|
||||
def create_parser():
|
||||
"""Create the argument parser"""
|
||||
parser = argparse.ArgumentParser(description="display system data in the i3bar")
|
||||
parser.add_argument("-m", "--modules", nargs="+", default=[],
|
||||
help=MODULE_HELP)
|
||||
return parser
|
||||
|
||||
class Config(object):
|
||||
def __init__(self, args = []):
|
||||
parser = self._create_parser()
|
||||
self._args = parser.parse_args(args)
|
||||
"""Top-level configuration class
|
||||
|
||||
Parses commandline arguments and provides non-module
|
||||
specific configuration information.
|
||||
"""
|
||||
def __init__(self, args=None):
|
||||
parser = create_parser()
|
||||
self._args = parser.parse_args(args if args else [])
|
||||
|
||||
def modules(self):
|
||||
return list(map(lambda x: {
|
||||
"""Return a list of all activated modules"""
|
||||
return [{
|
||||
"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
|
||||
"name": x if not ":" in x else x.split(":")[1],
|
||||
} for x in self._args.modules]
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue