Skip to content

Commit

Permalink
implement #95
Browse files Browse the repository at this point in the history
  • Loading branch information
petri committed Nov 28, 2020
1 parent 25894f9 commit da01d1a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tnefparse 1.4.0 (unreleased)
- drop Python 3.5 support (jugmac00)
- add Python 3.9 support (jugmac00)
- introduce using type annotations (jugmac00)
- remove deprecated parseFile & raw_mapi functions

tnefparse 1.3.1 (2020-09-30)
=============================
Expand Down
38 changes: 0 additions & 38 deletions tnefparse/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,41 +67,3 @@ def bytes_to_int(byte_arr):

def checksum(data):
return sum(bytearray(data)) & 0xFFFF


def raw_mapi(dataLen, data):
"debug raw MAPI data when decoding MAPI types"
warnings.warn("raw_mapi will be deprecated after 1.3", DeprecationWarning)
loop = 0
logger.debug("Raw MAPI Data:")
while loop <= dataLen:
if (loop + 16) < dataLen:
logger.debug(
"%2.2x%2.2x %2.2x%2.2x %2.2x%2.2x %2.2x%2.2x %2.2x%2.2x %2.2x%2.2x %2.2x%2.2x %2.2x%2.2x",
ord(data[loop]),
ord(data[loop + 1]),
ord(data[loop + 2]),
ord(data[loop + 3]),
ord(data[loop + 4]),
ord(data[loop + 5]),
ord(data[loop + 6]),
ord(data[loop + 7]),
ord(data[loop + 8]),
ord(data[loop + 9]),
ord(data[loop + 10]),
ord(data[loop + 11]),
ord(data[loop + 12]),
ord(data[loop + 13]),
ord(data[loop + 14]),
ord(data[loop + 15]),
)
loop += 16
loop -= 16
q, r = divmod(dataLen, 16)
strList = []
for i in range(r):
subq, subr = divmod(i, 2)
if i != 0 and subr == 0:
strList.append(' ')
strList.append('%2.2x' % ord(data[loop + i]))
logger.debug(''.join(strList))

0 comments on commit da01d1a

Please sign in to comment.