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-depend
binwalk
Commits
2051757c
Commit
2051757c
authored
8 years ago
by
Craig Heffner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to use XDG base directory specification
parent
a442dc7e
master
…
v2.3.4
v2.3.3
v2.3.2
v2.3.1
v2.3.0
v2.2.0
python27
No related merge requests found
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:
...
@@ -20,7 +20,7 @@ class Settings:
VERSION
=
"2.1.2b"
VERSION
=
"2.1.2b"
# Sub directories
# Sub directories
BINWALK_USER_DIR
=
"
.
binwalk"
BINWALK_USER_DIR
=
"binwalk"
BINWALK_MAGIC_DIR
=
"magic"
BINWALK_MAGIC_DIR
=
"magic"
BINWALK_CONFIG_DIR
=
"config"
BINWALK_CONFIG_DIR
=
"config"
BINWALK_PLUGINS_DIR
=
"plugins"
BINWALK_PLUGINS_DIR
=
"plugins"
...
@@ -35,7 +35,7 @@ class Settings:
...
@@ -35,7 +35,7 @@ class Settings:
Class constructor. Enumerates file paths and populates self.paths.
Class constructor. Enumerates file paths and populates self.paths.
'''
'''
# Path to the user binwalk directory
# 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
# Path to the system wide binwalk directory
self
.
system_dir
=
common
.
get_module_path
()
self
.
system_dir
=
common
.
get_module_path
()
...
@@ -107,6 +107,16 @@ class Settings:
...
@@ -107,6 +107,16 @@ class Settings:
return
fpath
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
):
def
_get_user_dir
(
self
):
'''
'''
Get the user's home directory.
Get the user's home directory.
...
...
This diff is collapsed.
Click to expand it.
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