eric6/Utilities/binplistlib.py

changeset 7639
422fd05e9c91
parent 7360
9190402e4505
equal deleted inserted replaced
7638:176145438b1e 7639:422fd05e9c91
52 </pre> 52 </pre>
53 """ 53 """
54 54
55 55
56 # 56 #
57 # Ported from the Python 2 biplist.py script. 57 # Ported from the biplist.py script.
58 # 58 #
59 # Original License: 59 # Original License:
60 # 60 #
61 # Copyright (c) 2010, Andrew Wooster 61 # Copyright (c) 2010, Andrew Wooster
62 # All rights reserved. 62 # All rights reserved.
936 output += pack('!d', float(timestamp)) 936 output += pack('!d', float(timestamp))
937 elif isinstance(obj, Data): 937 elif isinstance(obj, Data):
938 output += proc_variable_length(0b0100, len(obj)) 938 output += proc_variable_length(0b0100, len(obj))
939 output += obj 939 output += obj
940 elif isinstance(obj, str): 940 elif isinstance(obj, str):
941 # Python 3 uses unicode strings only
942 length = obj.encode('utf_16_be') 941 length = obj.encode('utf_16_be')
943 output += proc_variable_length(0b0110, len(length) / 2) 942 output += proc_variable_length(0b0110, len(length) / 2)
944 output += length 943 output += length
945 elif isinstance(obj, HashableWrapper): 944 elif isinstance(obj, HashableWrapper):
946 obj = obj.value 945 obj = obj.value

eric ide

mercurial