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
d657f452
Commit
d657f452
authored
Nov 17, 2013
by
heffnercj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logging now working in python3, except for --csv.
parent
e4a5254d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
prettyprint.py
src/binwalk/prettyprint.py
+4
-3
No files found.
src/binwalk/prettyprint.py
View file @
d657f452
import
io
import
sys
import
sys
import
hashlib
import
hashlib
import
csv
as
pycsv
import
csv
as
pycsv
...
@@ -62,7 +63,7 @@ class PrettyPrint:
...
@@ -62,7 +63,7 @@ class PrettyPrint:
self
.
enable_formatting
(
True
)
self
.
enable_formatting
(
True
)
if
self
.
log
is
not
None
:
if
self
.
log
is
not
None
:
self
.
fp
=
open
(
log
,
"w"
)
self
.
fp
=
io
.
FileIO
(
log
,
"w"
)
if
self
.
log_csv
:
if
self
.
log_csv
:
self
.
enable_csv
()
self
.
enable_csv
()
...
@@ -107,7 +108,7 @@ class PrettyPrint:
...
@@ -107,7 +108,7 @@ class PrettyPrint:
self
.
csv
.
writerow
(
data_parts
)
self
.
csv
.
writerow
(
data_parts
)
else
:
else
:
self
.
fp
.
write
(
data
)
self
.
fp
.
write
(
str2bytes
(
data
)
)
def
_pprint
(
self
,
data
,
nolog
=
False
,
noprint
=
False
):
def
_pprint
(
self
,
data
,
nolog
=
False
,
noprint
=
False
):
'''
'''
...
@@ -222,7 +223,7 @@ class PrettyPrint:
...
@@ -222,7 +223,7 @@ class PrettyPrint:
if
self
.
csv
:
if
self
.
csv
:
nolog
=
True
nolog
=
True
self
.
csv
.
writerow
([
"FILE"
,
"MD5SUM"
,
"TIMESTAMP"
])
self
.
csv
.
writerow
([
b
"FILE"
,
b
"MD5SUM"
,
b
"TIMESTAMP"
])
self
.
csv
.
writerow
([
file_name
,
md5sum
,
timestamp
])
self
.
csv
.
writerow
([
file_name
,
md5sum
,
timestamp
])
self
.
_pprint
(
"
\n
"
)
self
.
_pprint
(
"
\n
"
)
...
...
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