From: Lowe Thiderman Date: Thu, 29 May 2014 12:40:31 +0000 (+0200) Subject: Add packaged support for provided wordlists X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=2f8bc17deb1a41c58fb2b44d39e3e0c4b7523f58;p=redacted-XKCD-password-generator.git Add packaged support for provided wordlists --- diff --git a/xkcdpass/xkcd_password.py b/xkcdpass/xkcd_password.py index bf2a2bc..c9e0899 100755 --- a/xkcdpass/xkcd_password.py +++ b/xkcdpass/xkcd_password.py @@ -82,6 +82,11 @@ def validate_options(parser, options, args): " and " + options.wordfile) if options.wordfile is not None: + static_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), + 'static', + '%s.txt' % options.wordfile) + if os.path.exists(static_file): + options.wordfile = static_file if not os.path.exists(os.path.abspath(options.wordfile)): sys.stderr.write("Could not open the specified word file.\n") sys.exit(1)