Changeset 44
- Timestamp:
- 04/11/13 16:55:05 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/bletchley/blobtools.py
r42 r44 21 21 import base64 22 22 import binascii 23 import traceback 23 24 import fractions 24 25 import operator … … 48 49 49 50 def _percentDecode(binary, plus=False): 50 ret_val = b''51 51 if plus: 52 52 binary = binary.replace(b'+', b' ') … … 54 54 return b'' 55 55 chunks = binary.split(b'%') 56 if binary[0] == 0x25: 57 chunks = chunks[1:] 58 59 for chunk in chunks: 56 57 ret_val = chunks[0] 58 for chunk in chunks[1:]: 60 59 if len(chunk) < 2: 61 60 return None … … 63 62 ret_val += bytes([int(chunk[0:2], 16)]) + chunk[2:] 64 63 except: 65 print(repr(chunk)) 64 #traceback.print_exc() 65 #print(repr(chunk), repr(binary)) 66 66 return None 67 67
Note: See TracChangeset
for help on using the changeset viewer.