git.99rst.org
/
redacted-XKCD-password-generator.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
5a802e1
)
refactor choose_words to list comprehension
author
Justin Findlay
<redacted>
Thu, 15 Sep 2016 18:43:30 +0000
(12:43 -0600)
committer
Justin Findlay
<redacted>
Thu, 15 Sep 2016 18:43:30 +0000
(12:43 -0600)
xkcdpass/xkcd_password.py
patch
|
blob
|
history
diff --git
a/xkcdpass/xkcd_password.py
b/xkcdpass/xkcd_password.py
index 32efa1ce43249d96a41d62a1db38e8d4ba9d9da8..008a35df1b3dd63a63802cb175fbcb21d7f01310 100755
(executable)
--- a/
xkcdpass/xkcd_password.py
+++ b/
xkcdpass/xkcd_password.py
@@
-186,10
+186,11
@@
def find_acrostic(acrostic, worddict):
def choose_words(wordlist, numwords):
- s = []
- for i in xrange(numwords):
- s.append(rng().choice(wordlist))
- return s
+ """
+ Choose numwords randomly from wordlist
+ """
+
+ return [rng().choice(wordlist) for i in xrange(numwords)]
def generate_xkcdpassword(wordlist,
git clone https://git.99rst.org/PROJECT