eerimoq / bincopy

Mangling of various file formats that conveys binary information (Motorola S-Record, Intel HEX, TI-TXT, Verilog VMEM, ELF and binary files).
MIT License
109 stars 38 forks source link

Extended fill method with max_words parameter #17

Closed jrast closed 4 years ago

jrast commented 4 years ago

Extended the fill method with a max_words parameter which can be used to define the maximal empty space which should be filled. Holes wich are larger than the given size are not touched.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.003%) to 97.764% when pulling a35d817ea85b9388b1176b44e72e7126222b683a on jrast:patch-1 into 11b8ee54f6ead6978c15766f259c68ae80746a65 on eerimoq:master.

jrast commented 4 years ago

If you are interested in this addition, I will add some tests.

I required this functionality because I had had a srecord file which was quite fragmented and in wanted to merge all segments which had only a little gap inbetween.

eerimoq commented 4 years ago

I like the change. Sounds useful for other users as well. Let me know when it's ready for a review.

jrast commented 4 years ago

I added some testcases for this. From my side the PR is ready to be merged.

Note: I found out that fill seems to be broken if the word_size is changed from 8 bit to 16 bit. But this is a different issue.

eerimoq commented 4 years ago

I fixed the word size problem. Everything is released and available on PyPI. Version 16.2.0.