Skip to content

Commit

Permalink
files restructured to be module-friendly.
Browse files Browse the repository at this point in the history
  • Loading branch information
yoiwa committed Oct 2, 2018
1 parent 68f6c2d commit 8aa0231
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions make-password
@@ -0,0 +1,3 @@
#!/usr/bin/env python3
import password_generator
password_generator.main()
1 change: 1 addition & 0 deletions password_generator/__init__.py
@@ -0,0 +1 @@
from .password_generator import *
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -508,13 +508,18 @@ class Wordlist:
"basicenglish": BasicEnglish
}

base_path = None
@classmethod
def load_wordlist(self, target):
if target in self.mapping:
target = self.mapping[target]
if target in self.corpus:
return self.corpus[target]
fname = "corpus/" + target + ".corpus"

if not self.base_path:
from pathlib import Path
self.base_path = Path(sys.modules[self.__module__].__file__).parent / 'corpus'
fname = str(self.base_path / (target + ".corpus"))
no_apostroph = False
try:
with open(fname, 'r') as f:
Expand Down

0 comments on commit 8aa0231

Please sign in to comment.