Skip to content
Snippets Groups Projects
Commit b51cadeb authored by ulif's avatar ulif
Browse files

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).
parent e7eda287
No related branches found
No related tags found
No related merge requests found
......@@ -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'),
......
......@@ -32,7 +32,7 @@ OPTIONS_DEFAULTS = dict(
specials=0,
delimiter="",
randomsource="system",
wordlist="en_8k",
wordlist="en",
)
......
......@@ -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>
......@@ -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
......
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment