From b51cadeb483c61703284ec9f23a3461ad9b295d9 Mon Sep 17 00:00:00 2001 From: ulif <uli@gnufix.de> Date: Mon, 16 Nov 2015 13:54:47 +0100 Subject: [PATCH] Rename default wordlist from "en_8k" to "en". Normally, it would be more concise to use the more declarative name. "en_8k" tells, how many terms we find in this wordlist. But as the wordlist names are used in the CLI and users will normally simply look for a wordlist in their language, it can help to keep the name of the "default" list for each language short. We pick the 8K lists for "default" (and not the "original" 6^5 lists), because we assume that normally people will use diceware without dice. Also most other sources of randomness will most probably work on a 2^x basis rather than in 6^x (and therefore have better use for 8k lists over other ones). --- diceware/__init__.py | 4 ++-- diceware/config.py | 2 +- .../wordlists/{wordlist_en_8k.txt => wordlist_en.txt} | 0 tests/exp_help_output.txt | 6 +++--- tests/test_diceware.py | 2 +- tests/test_wordlist.py | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-) rename diceware/wordlists/{wordlist_en_8k.txt => wordlist_en.txt} (100%) diff --git a/diceware/__init__.py b/diceware/__init__.py index d5f24a6..d9addd2 100644 --- a/diceware/__init__.py +++ b/diceware/__init__.py @@ -110,12 +110,12 @@ def handle_options(args): "Get randomness from this source. Possible values: `%s'. " "Default: system" % "', `".join(sorted(random_sources)))) parser.add_argument( - '-w', '--wordlist', default='en_8k', choices=wordlist_names, + '-w', '--wordlist', default='en', choices=wordlist_names, metavar="NAME", help=( "Use words from this wordlist. Possible values: `%s'. " "Wordlists are stored in the folder displayed below. " - "Default: en_8k" % "', `".join(wordlist_names))) + "Default: en" % "', `".join(wordlist_names))) parser.add_argument( 'infile', nargs='?', metavar='INFILE', default=None, type=argparse.FileType('r'), diff --git a/diceware/config.py b/diceware/config.py index de3a363..a11a06b 100644 --- a/diceware/config.py +++ b/diceware/config.py @@ -32,7 +32,7 @@ OPTIONS_DEFAULTS = dict( specials=0, delimiter="", randomsource="system", - wordlist="en_8k", + wordlist="en", ) diff --git a/diceware/wordlists/wordlist_en_8k.txt b/diceware/wordlists/wordlist_en.txt similarity index 100% rename from diceware/wordlists/wordlist_en_8k.txt rename to diceware/wordlists/wordlist_en.txt diff --git a/tests/exp_help_output.txt b/tests/exp_help_output.txt index dadef71..5ea4de8 100644 --- a/tests/exp_help_output.txt +++ b/tests/exp_help_output.txt @@ -20,9 +20,9 @@ optional arguments: Get randomness from this source. Possible values: `realdice', `system'. Default: system -w NAME, --wordlist NAME - Use words from this wordlist. Possible values: - `en_8k', `en_orig'. Wordlists are stored in the folder - displayed below. Default: en_8k + Use words from this wordlist. Possible values: `en', + `en_orig'. Wordlists are stored in the folder + displayed below. Default: en --version output version information and exit. Wordlists are stored in <WORDLISTS-DIR> diff --git a/tests/test_diceware.py b/tests/test_diceware.py index 8a2bca6..117d4d0 100644 --- a/tests/test_diceware.py +++ b/tests/test_diceware.py @@ -133,7 +133,7 @@ class TestDicewareModule(object): assert options.version is False assert options.delimiter == "" assert options.randomsource == "system" - assert options.wordlist == "en_8k" + assert options.wordlist == "en" def test_handle_options_infile(self, tmpdir): # we can give an infile diff --git a/tests/test_wordlist.py b/tests/test_wordlist.py index 99161ae..0489def 100644 --- a/tests/test_wordlist.py +++ b/tests/test_wordlist.py @@ -55,7 +55,7 @@ class TestWordlistModule(object): assert regexp.match("wordlist_foo.txt") is not None assert regexp.match("wordlist_foo_bar.asc") is not None assert regexp.match("wordlist_name-withdots.txt.asc") is not None - assert regexp.match("wordlist_en_8k.txt") is not None + assert regexp.match("wordlist_en.txt") is not None assert regexp.match("wordlist_en_orig.asc") is not None # We can get the internal wordlist name assert regexp.match("wordlist_foo.txt").groups()[0] == "foo" @@ -116,9 +116,9 @@ class TestWordlistModule(object): def test_get_wordlist_names(self, wordlists_dir): # we can get wordlist names also if directory is empty. - wlist_path = wordlists_dir.join('wordlist_my_en_8k.txt') + wlist_path = wordlists_dir.join('wordlist_my_en.txt') wlist_path.write("some\nirrelevant\nwords") - assert get_wordlist_names() == ['my_en_8k'] + assert get_wordlist_names() == ['my_en'] def test_get_wordlist_names_files_only(self, wordlists_dir): # non-files are ignored when looking for wordlist names @@ -223,7 +223,7 @@ class TestWordList(object): def test_wordlist_en_8k(self): # we can get a list of words out of english 8k wordlist. - en_src = os.path.join(WORDLISTS_DIR, 'wordlist_en_8k.txt') + en_src = os.path.join(WORDLISTS_DIR, 'wordlist_en.txt') w_list = WordList(en_src) long_list = list(w_list) assert long_list[0] == "a" -- GitLab