Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
binwalk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-gitdep
binwalk
Commits
2051757c
Commit
2051757c
authored
Jun 21, 2016
by
Craig Heffner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to use XDG base directory specification
parent
a442dc7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
settings.py
src/binwalk/core/settings.py
+12
-2
No files found.
src/binwalk/core/settings.py
View file @
2051757c
...
...
@@ -20,7 +20,7 @@ class Settings:
VERSION
=
"2.1.2b"
# Sub directories
BINWALK_USER_DIR
=
"
.
binwalk"
BINWALK_USER_DIR
=
"binwalk"
BINWALK_MAGIC_DIR
=
"magic"
BINWALK_CONFIG_DIR
=
"config"
BINWALK_PLUGINS_DIR
=
"plugins"
...
...
@@ -35,7 +35,7 @@ class Settings:
Class constructor. Enumerates file paths and populates self.paths.
'''
# Path to the user binwalk directory
self
.
user_dir
=
self
.
_get_user_dir
()
self
.
user_dir
=
self
.
_get_user_
config_
dir
()
# Path to the system wide binwalk directory
self
.
system_dir
=
common
.
get_module_path
()
...
...
@@ -107,6 +107,16 @@ class Settings:
return
fpath
def
_get_user_config_dir
(
self
):
try
:
xdg_path
=
os
.
getenv
(
'XDG_CONFIG_HOME'
)
if
xdg_path
is
not
None
:
return
xdg_path
except
Exception
:
pass
return
os
.
path
.
join
(
self
.
_get_user_dir
(),
'.config'
)
def
_get_user_dir
(
self
):
'''
Get the user's home directory.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment