-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add width attribute #8
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss this in the issues before merging :)
dc4ec66
to
1d82f23
Compare
Please Review :) |
e2ff084
to
8a64212
Compare
|
||
def final(self): | ||
self.hexrow += 3*(16 - self.rowlen) * ' ' | ||
self.asciirow += (16 - self.rowlen) * ' ' | ||
self._newrow() | ||
return self.body | ||
|
||
def reformat(self, body, n=16): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't need to be this complicated. Just find the number 16
from Render.py and make it not hardcoded. For example replace all occurencies of 16
with self.bytewidth
and set that variable when constructing the Render
object. This way there's no need to compile the regular expressions, find strings and do all the reformatting that takes a lot of time (you mentioned this was an issue?). As a side effect the format (addresses, ascii conversion etc.) will match the original
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I tried the approach you are suggesting first but then the code runs slowly on my machine. I don't know if it's a problem with my machine or not. Please tell me if by changing those lines the code runs the same in your machine. I would be happy to implement that since it's easier :)
Please review |
a16cb80
to
2b62b0f
Compare
Adds width attribute which allows user to specify number of bytes printed per line
Adds width attribute which allows user to
specify number of bytes printed per line
Closes #3