Skip to content

Commit

Permalink
black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
xmendez committed Aug 30, 2020
1 parent 28fc009 commit 0404ed0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/wfuzz/facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_config_file(self):

config = os.path.join(get_config_dir(check=False), config_file)
legacy_config = os.path.join(get_home(check=False), config_file)

if os.path.exists(config):
return config
elif os.path.exists(legacy_config):
Expand Down
10 changes: 8 additions & 2 deletions src/wfuzz/helpers/file_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ def get_filter_help_file():

return filter_help_text


def create_dir(dir_path):
if not os.path.exists(dir_path):
os.makedirs(dir_path)
os.makedirs(dir_path)


def get_home(check=False, directory=None):
path = os.path.join(os.path.expanduser("~"), ".wfuzz")
Expand All @@ -33,13 +35,17 @@ def get_home(check=False, directory=None):

return os.path.join(path, directory) if directory else path


def get_config_dir(check=False):
config_dir = os.environ.get('XDG_CONFIG_HOME') or os.path.join(os.path.expanduser("~"), ".config")
config_dir = os.environ.get("XDG_CONFIG_HOME") or os.path.join(
os.path.expanduser("~"), ".config"
)
wfuzz_config_dir = os.path.join(config_dir, "wfuzz")
if check:
create_dir(wfuzz_config_dir)
return wfuzz_config_dir


def get_path(directory=None):
abspath = os.path.abspath(__file__)
ret = os.path.dirname(abspath)
Expand Down

0 comments on commit 0404ed0

Please sign in to comment.