Add packaged support for provided wordlists
authorLowe Thiderman <redacted>
Thu, 29 May 2014 12:40:31 +0000 (14:40 +0200)
committerLowe Thiderman <redacted>
Thu, 29 May 2014 12:40:31 +0000 (14:40 +0200)
xkcdpass/xkcd_password.py

index bf2a2bc4bfc798e3b820e46914de477aaafbb0d4..c9e0899138af8d53979bc7453afb839244361e1c 100755 (executable)
@@ -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)
git clone https://git.99rst.org/PROJECT