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
2fa565fc
Commit
2fa565fc
authored
Mar 06, 2014
by
devttys0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in module kwarg processing that ignored default kwarg key values.
parent
e289cf73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
module.py
src/binwalk/core/module.py
+3
-3
No files found.
src/binwalk/core/module.py
View file @
2fa565fc
...
...
@@ -45,7 +45,7 @@ class Option(object):
self
.
type
=
str
self
.
dtype
=
str
.
__name__
def
convert
(
self
,
value
):
def
convert
(
self
,
value
,
default_value
):
if
self
.
type
and
(
self
.
type
.
__name__
==
self
.
dtype
):
# Be sure to specify a base of 0 for int() so that the base is auto-detected
if
self
.
type
==
int
:
...
...
@@ -53,7 +53,7 @@ class Option(object):
else
:
return
self
.
type
(
value
)
else
:
return
value
return
default_
value
class
Kwarg
(
object
):
'''
...
...
@@ -753,7 +753,7 @@ class Modules(object):
last_priority
[
name
]
=
module_option
.
priority
try
:
kwargs
[
name
]
=
module_option
.
convert
(
args
[
module_option
.
long
])
kwargs
[
name
]
=
module_option
.
convert
(
args
[
module_option
.
long
]
,
default_value
)
except
KeyboardInterrupt
as
e
:
raise
e
except
Exception
as
e
:
...
...
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