From: Steven Tobin Date: Fri, 7 May 2021 20:37:25 +0000 (+0100) Subject: better handling of default / no wordfile specified X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=3656b948327f20431e80bfc5801c1baf08bfafe3;p=redacted-XKCD-password-generator.git better handling of default / no wordfile specified --- diff --git a/xkcdpass/xkcd_password.py b/xkcdpass/xkcd_password.py index 71dda79..8951b30 100755 --- a/xkcdpass/xkcd_password.py +++ b/xkcdpass/xkcd_password.py @@ -128,6 +128,8 @@ def generate_wordlist(wordfile=None, regexp = re.compile("^{0}{{{1},{2}}}$".format(valid_chars, min_length, max_length)) + if wordfile is None: + wordfile = DEFAULT_WORDFILE for wf in wordfile.split(','): wf = locate_wordfile(wf) # read words from file into wordlist