From 4e785dca72e19b47697b3bf56b97f89677902f84 Mon Sep 17 00:00:00 2001 From: David Trail Date: Fri, 30 Sep 2016 14:13:35 +0100 Subject: [PATCH] Allow use of own wordlist --- shreddit.py | 2 +- shreddit.yml.example | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/shreddit.py b/shreddit.py index fee463c..373acf1 100755 --- a/shreddit.py +++ b/shreddit.py @@ -87,7 +87,7 @@ def get_sentence(): except ImportError: # Module unavailable, use the default phrase pass -os_wordlist = '/usr/share/dict/words' +os_wordlist = config.get('wordlist', '/usr/share/dict/words') if os.name == 'posix' and os.path.isfile(os_wordlist): # Generate a random string of words from our system's dictionary fh = open(os_wordlist) diff --git a/shreddit.yml.example b/shreddit.yml.example index 81de823..49e5f7a 100644 --- a/shreddit.yml.example +++ b/shreddit.yml.example @@ -72,4 +72,7 @@ replacement_format: random # See: https://docs.python.org/3/library/logging.html#logging-levels debug: DEBUG +# Define your own wordlist to use as substitution text +wordlist: False + # vim: syntax=yaml ts=2