better handling of default / no wordfile specified
authorSteven Tobin <redacted>
Fri, 7 May 2021 20:37:25 +0000 (21:37 +0100)
committerSteven Tobin <redacted>
Fri, 7 May 2021 20:37:39 +0000 (21:37 +0100)
xkcdpass/xkcd_password.py

index 71dda798c147e6624041830b22ea1b1deb9b833e..8951b309b3eab4822f83215382c0af601580df50 100755 (executable)
@@ -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
git clone https://git.99rst.org/PROJECT