summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Rathgeber <florian.rathgeber@gmail.com>2014-03-23 13:18:57 +0000
committerFlorian Rathgeber <florian.rathgeber@gmail.com>2014-03-23 13:18:57 +0000
commit022aa8a89e023731b5b71dca8779e0d14ddeb13a (patch)
tree089d181c6b504d3f84546527f67bcf00a30781ce
parentdd06247127fd415c424177a35ec89b46423b460f (diff)
downloadpep8-022aa8a89e023731b5b71dca8779e0d14ddeb13a.tar.gz
StyleGuide accepts optional keyword argument arglist
If given, arglist is passed on to process_options. This allows specifying a non-empty argument list when using pep8 as a library where command line arguments are not parsed.
-rwxr-xr-xpep8.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pep8.py b/pep8.py
index e38ab26..0a2737a 100755
--- a/pep8.py
+++ b/pep8.py
@@ -1571,11 +1571,12 @@ class StyleGuide(object):
def __init__(self, *args, **kwargs):
# build options from the command line
self.checker_class = kwargs.pop('checker_class', Checker)
+ arglist = kwargs.pop('arglist', None)
parse_argv = kwargs.pop('parse_argv', False)
config_file = kwargs.pop('config_file', None)
parser = kwargs.pop('parser', None)
options, self.paths = process_options(
- parse_argv=parse_argv, config_file=config_file, parser=parser)
+ arglist, parse_argv, config_file, parser)
if args or kwargs:
# build options from dict
options_dict = dict(*args, **kwargs)