From: Steven Tobin Date: Fri, 7 May 2021 20:29:52 +0000 (+0100) Subject: revert change to wordfile arg for back compat X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=8f210317762913844fe6322a9d19c6da6adc0c03;p=redacted-XKCD-password-generator.git revert change to wordfile arg for back compat --- diff --git a/xkcdpass/xkcd_password.py b/xkcdpass/xkcd_password.py index 22daafc..5d191b4 100755 --- a/xkcdpass/xkcd_password.py +++ b/xkcdpass/xkcd_password.py @@ -110,7 +110,7 @@ def locate_wordfile(wordfile=None): return wfile -def generate_wordlist(wordfiles=None, +def generate_wordlist(wordfile=None, min_length=5, max_length=9, valid_chars='.'): @@ -128,10 +128,10 @@ def generate_wordlist(wordfiles=None, regexp = re.compile("^{0}{{{1},{2}}}$".format(valid_chars, min_length, max_length)) - for wordfile in wordfiles.split(','): - wordfile = locate_wordfile(wordfile) + for wf in wordfile.split(','): + wf = locate_wordfile(wf) # read words from file into wordlist - with open(wordfile, encoding='utf-8') as wlf: + with open(wf, encoding='utf-8') as wlf: for line in wlf: thisword = line.strip() if regexp.match(thisword) is not None: @@ -532,7 +532,7 @@ def main(argv=None): validate_options(parser, options) my_wordlist = generate_wordlist( - wordfiles=options.wordfile, + wordfile=options.wordfile, min_length=options.min_length, max_length=options.max_length, valid_chars=options.valid_chars)