From b69d7f17d3ba744a8ce7f4013a7a2c49c4f2a29d Mon Sep 17 00:00:00 2001 From: ulif <uli@gnufix.de> Date: Fri, 29 May 2015 14:52:48 +0200 Subject: [PATCH] Activate the new option. --- diceware/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/diceware/__init__.py b/diceware/__init__.py index 01cd566..91975cb 100644 --- a/diceware/__init__.py +++ b/diceware/__init__.py @@ -177,6 +177,9 @@ def get_passphrase(options=None): The passphrase returned will contain `options.specials` special chars. + For the passphrase generation we will use the random source + registered under the name `options.randomsource`. + If `options.capitalize` is ``True``, all words will be capitalized. If `options.infile`, a file descriptor, is given, it will be used @@ -188,7 +191,8 @@ def get_passphrase(options=None): if options.infile is None: options.infile = open(get_wordlist_path("en"), 'r') word_list = get_wordlist(options.infile) - rnd = SystemRandom() + rnd_source = get_random_sources()[options.randomsource] + rnd = rnd_source(options) words = [rnd.choice(word_list) for x in range(options.num)] if options.capitalize: words = [x.capitalize() for x in words] -- GitLab