-
Notifications
You must be signed in to change notification settings - Fork 238
Sd 269 hp unpacker #213
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
Sd 269 hp unpacker #213
Conversation
Codecov Report
@@ Coverage Diff @@
## master #213 +/- ##
==========================================
+ Coverage 95.71% 95.76% +0.04%
==========================================
Files 339 345 +6
Lines 17512 17699 +187
==========================================
+ Hits 16762 16949 +187
Misses 750 750
Continue to review full report at Codecov.
|
src/plugins/unpacking/hp/code/pjl.py
Outdated
|
|
||
| from common_helper_files import get_binary_from_file | ||
|
|
||
| INTERNAL_DIR = Path(Path(__file__).parent.parent, 'internal') |
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.
Creating multiple Path objects is not necessary. You can also use the / operator:
INTERNAL_DIR = Path(__file__).parent.parent / 'internal'
|
|
||
| def get_pjl_commands(input_data): | ||
| pjl_instructions = [] | ||
| tmp = list(re.finditer(b'@PJL [ =.!,?\w]+', input_data)) |
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.
DeprecationWarning: invalid escape sequence \w
should probably be a raw string rb'...'
|
|
||
|
|
||
| def _get_name_of_upgrade(raw_binary, upgrade_command): | ||
| tmp = re.search(b'\xa8\x01([\w ]+) [\w ]+', raw_binary[upgrade_command['end_offset']:upgrade_command['end_offset'] + NAME_FIELD_MAX]) |
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.
see above
|
|
||
|
|
||
| def _get_type_and_value(raw_command): | ||
| tmp = re.search(b'@PJL ([=\w]+) ?([ =.!,?\w]+)?', raw_command) |
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.
see above
|
tests run successfull: https://ci.die-weidenbachs.de/job/FACT_core_xenial-dev/522/console |
No description provided.