deepfos 1.1.60__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- deepfos/__init__.py +6 -0
- deepfos/_version.py +21 -0
- deepfos/algo/__init__.py +0 -0
- deepfos/algo/graph.py +171 -0
- deepfos/algo/segtree.py +31 -0
- deepfos/api/V1_1/__init__.py +0 -0
- deepfos/api/V1_1/business_model.py +119 -0
- deepfos/api/V1_1/dimension.py +599 -0
- deepfos/api/V1_1/models/__init__.py +0 -0
- deepfos/api/V1_1/models/business_model.py +1033 -0
- deepfos/api/V1_1/models/dimension.py +2768 -0
- deepfos/api/V1_2/__init__.py +0 -0
- deepfos/api/V1_2/dimension.py +285 -0
- deepfos/api/V1_2/models/__init__.py +0 -0
- deepfos/api/V1_2/models/dimension.py +2923 -0
- deepfos/api/__init__.py +0 -0
- deepfos/api/account.py +167 -0
- deepfos/api/accounting_engines.py +147 -0
- deepfos/api/app.py +626 -0
- deepfos/api/approval_process.py +198 -0
- deepfos/api/base.py +983 -0
- deepfos/api/business_model.py +160 -0
- deepfos/api/consolidation.py +129 -0
- deepfos/api/consolidation_process.py +106 -0
- deepfos/api/datatable.py +341 -0
- deepfos/api/deep_pipeline.py +61 -0
- deepfos/api/deepconnector.py +36 -0
- deepfos/api/deepfos_task.py +92 -0
- deepfos/api/deepmodel.py +188 -0
- deepfos/api/dimension.py +486 -0
- deepfos/api/financial_model.py +319 -0
- deepfos/api/journal_model.py +119 -0
- deepfos/api/journal_template.py +132 -0
- deepfos/api/memory_financial_model.py +98 -0
- deepfos/api/models/__init__.py +3 -0
- deepfos/api/models/account.py +483 -0
- deepfos/api/models/accounting_engines.py +756 -0
- deepfos/api/models/app.py +1338 -0
- deepfos/api/models/approval_process.py +1043 -0
- deepfos/api/models/base.py +234 -0
- deepfos/api/models/business_model.py +805 -0
- deepfos/api/models/consolidation.py +711 -0
- deepfos/api/models/consolidation_process.py +248 -0
- deepfos/api/models/datatable_mysql.py +427 -0
- deepfos/api/models/deep_pipeline.py +55 -0
- deepfos/api/models/deepconnector.py +28 -0
- deepfos/api/models/deepfos_task.py +386 -0
- deepfos/api/models/deepmodel.py +308 -0
- deepfos/api/models/dimension.py +1576 -0
- deepfos/api/models/financial_model.py +1796 -0
- deepfos/api/models/journal_model.py +341 -0
- deepfos/api/models/journal_template.py +854 -0
- deepfos/api/models/memory_financial_model.py +478 -0
- deepfos/api/models/platform.py +178 -0
- deepfos/api/models/python.py +221 -0
- deepfos/api/models/reconciliation_engine.py +411 -0
- deepfos/api/models/reconciliation_report.py +161 -0
- deepfos/api/models/role_strategy.py +884 -0
- deepfos/api/models/smartlist.py +237 -0
- deepfos/api/models/space.py +1137 -0
- deepfos/api/models/system.py +1065 -0
- deepfos/api/models/variable.py +463 -0
- deepfos/api/models/workflow.py +946 -0
- deepfos/api/platform.py +199 -0
- deepfos/api/python.py +90 -0
- deepfos/api/reconciliation_engine.py +181 -0
- deepfos/api/reconciliation_report.py +64 -0
- deepfos/api/role_strategy.py +234 -0
- deepfos/api/smartlist.py +69 -0
- deepfos/api/space.py +582 -0
- deepfos/api/system.py +372 -0
- deepfos/api/variable.py +154 -0
- deepfos/api/workflow.py +264 -0
- deepfos/boost/__init__.py +6 -0
- deepfos/boost/py_jstream.py +89 -0
- deepfos/boost/py_pandas.py +20 -0
- deepfos/cache.py +121 -0
- deepfos/config.py +6 -0
- deepfos/core/__init__.py +27 -0
- deepfos/core/cube/__init__.py +10 -0
- deepfos/core/cube/_base.py +462 -0
- deepfos/core/cube/constants.py +21 -0
- deepfos/core/cube/cube.py +408 -0
- deepfos/core/cube/formula.py +707 -0
- deepfos/core/cube/syscube.py +532 -0
- deepfos/core/cube/typing.py +7 -0
- deepfos/core/cube/utils.py +238 -0
- deepfos/core/dimension/__init__.py +11 -0
- deepfos/core/dimension/_base.py +506 -0
- deepfos/core/dimension/dimcreator.py +184 -0
- deepfos/core/dimension/dimension.py +472 -0
- deepfos/core/dimension/dimexpr.py +271 -0
- deepfos/core/dimension/dimmember.py +155 -0
- deepfos/core/dimension/eledimension.py +22 -0
- deepfos/core/dimension/filters.py +99 -0
- deepfos/core/dimension/sysdimension.py +168 -0
- deepfos/core/logictable/__init__.py +5 -0
- deepfos/core/logictable/_cache.py +141 -0
- deepfos/core/logictable/_operator.py +663 -0
- deepfos/core/logictable/nodemixin.py +673 -0
- deepfos/core/logictable/sqlcondition.py +609 -0
- deepfos/core/logictable/tablemodel.py +497 -0
- deepfos/db/__init__.py +36 -0
- deepfos/db/cipher.py +660 -0
- deepfos/db/clickhouse.py +191 -0
- deepfos/db/connector.py +195 -0
- deepfos/db/daclickhouse.py +171 -0
- deepfos/db/dameng.py +101 -0
- deepfos/db/damysql.py +189 -0
- deepfos/db/dbkits.py +358 -0
- deepfos/db/deepengine.py +99 -0
- deepfos/db/deepmodel.py +82 -0
- deepfos/db/deepmodel_kingbase.py +83 -0
- deepfos/db/edb.py +214 -0
- deepfos/db/gauss.py +83 -0
- deepfos/db/kingbase.py +83 -0
- deepfos/db/mysql.py +184 -0
- deepfos/db/oracle.py +131 -0
- deepfos/db/postgresql.py +192 -0
- deepfos/db/sqlserver.py +99 -0
- deepfos/db/utils.py +135 -0
- deepfos/element/__init__.py +89 -0
- deepfos/element/accounting.py +348 -0
- deepfos/element/apvlprocess.py +215 -0
- deepfos/element/base.py +398 -0
- deepfos/element/bizmodel.py +1269 -0
- deepfos/element/datatable.py +2467 -0
- deepfos/element/deep_pipeline.py +186 -0
- deepfos/element/deepconnector.py +59 -0
- deepfos/element/deepmodel.py +1806 -0
- deepfos/element/dimension.py +1254 -0
- deepfos/element/fact_table.py +427 -0
- deepfos/element/finmodel.py +1485 -0
- deepfos/element/journal.py +840 -0
- deepfos/element/journal_template.py +943 -0
- deepfos/element/pyscript.py +412 -0
- deepfos/element/reconciliation.py +553 -0
- deepfos/element/rolestrategy.py +243 -0
- deepfos/element/smartlist.py +457 -0
- deepfos/element/variable.py +756 -0
- deepfos/element/workflow.py +560 -0
- deepfos/exceptions/__init__.py +239 -0
- deepfos/exceptions/hook.py +86 -0
- deepfos/lazy.py +104 -0
- deepfos/lazy_import.py +84 -0
- deepfos/lib/__init__.py +0 -0
- deepfos/lib/_javaobj.py +366 -0
- deepfos/lib/asynchronous.py +879 -0
- deepfos/lib/concurrency.py +107 -0
- deepfos/lib/constant.py +39 -0
- deepfos/lib/decorator.py +310 -0
- deepfos/lib/deepchart.py +778 -0
- deepfos/lib/deepux.py +477 -0
- deepfos/lib/discovery.py +273 -0
- deepfos/lib/edb_lexer.py +789 -0
- deepfos/lib/eureka.py +156 -0
- deepfos/lib/filterparser.py +751 -0
- deepfos/lib/httpcli.py +106 -0
- deepfos/lib/jsonstreamer.py +80 -0
- deepfos/lib/msg.py +394 -0
- deepfos/lib/nacos.py +225 -0
- deepfos/lib/patch.py +92 -0
- deepfos/lib/redis.py +241 -0
- deepfos/lib/serutils.py +181 -0
- deepfos/lib/stopwatch.py +99 -0
- deepfos/lib/subtask.py +572 -0
- deepfos/lib/sysutils.py +703 -0
- deepfos/lib/utils.py +1003 -0
- deepfos/local.py +160 -0
- deepfos/options.py +670 -0
- deepfos/translation.py +237 -0
- deepfos-1.1.60.dist-info/METADATA +33 -0
- deepfos-1.1.60.dist-info/RECORD +175 -0
- deepfos-1.1.60.dist-info/WHEEL +5 -0
- deepfos-1.1.60.dist-info/top_level.txt +1 -0
deepfos/lib/_javaobj.py
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import enum
|
|
2
|
+
import os
|
|
3
|
+
import struct
|
|
4
|
+
from io import BytesIO
|
|
5
|
+
|
|
6
|
+
from loguru import logger
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# Magic bytes of any serialized files
|
|
10
|
+
STREAM_MAGIC = 0xACED
|
|
11
|
+
|
|
12
|
+
# Only protocol version supported by javaobj
|
|
13
|
+
STREAM_VERSION = 0x05
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def is_java_serialized(input_stream: bytes) -> bool:
|
|
17
|
+
"""判断是否为java序列化后的值
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
input_stream: 需判断的值
|
|
21
|
+
|
|
22
|
+
Returns:
|
|
23
|
+
bool
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
input_stream = BytesIO(input_stream)
|
|
27
|
+
|
|
28
|
+
length = struct.calcsize(">HH")
|
|
29
|
+
ba = input_stream.read(length)
|
|
30
|
+
|
|
31
|
+
if len(ba) != length:
|
|
32
|
+
return False
|
|
33
|
+
|
|
34
|
+
(magic, version) = struct.unpack(">HH", ba)
|
|
35
|
+
|
|
36
|
+
if magic != STREAM_MAGIC or version != STREAM_VERSION:
|
|
37
|
+
return False
|
|
38
|
+
|
|
39
|
+
return True
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(data, encoding="UTF-8"):
|
|
43
|
+
"""
|
|
44
|
+
Converts the given parameter to a string.
|
|
45
|
+
Returns the first parameter if it is already an instance of ``str``.
|
|
46
|
+
|
|
47
|
+
Args:
|
|
48
|
+
data: A string
|
|
49
|
+
encoding: The encoding of data
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
The corresponding string
|
|
53
|
+
|
|
54
|
+
"""
|
|
55
|
+
if isinstance(data, str):
|
|
56
|
+
# Nothing to do
|
|
57
|
+
return data
|
|
58
|
+
|
|
59
|
+
return str(data, encoding)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def hexdump(src: bytes, start_offset: int = 0, length: int = 16) -> str:
|
|
63
|
+
"""
|
|
64
|
+
Prepares an hexadecimal dump string
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
src: A string containing binary data
|
|
68
|
+
start_offset: The start offset of the source
|
|
69
|
+
length: Length of a dump line
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
A dump string
|
|
73
|
+
|
|
74
|
+
"""
|
|
75
|
+
hex_filter = "".join(
|
|
76
|
+
(len(repr(chr(x))) == 3) and chr(x) or "." for x in range(256)
|
|
77
|
+
)
|
|
78
|
+
pattern = "{{0:04X}} {{1:<{0}}} {{2}}\n".format(length * 3)
|
|
79
|
+
|
|
80
|
+
# Convert raw data to str (Python 3 compatibility)
|
|
81
|
+
src = to_str(src, "latin-1")
|
|
82
|
+
|
|
83
|
+
result = []
|
|
84
|
+
for i in range(0, len(src), length):
|
|
85
|
+
s = src[i: i + length]
|
|
86
|
+
hexa = " ".join("{0:02X}".format(ord(x)) for x in s)
|
|
87
|
+
printable = s.translate(hex_filter)
|
|
88
|
+
result.append(pattern.format(i + start_offset, hexa, printable))
|
|
89
|
+
return "".join(result)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class StreamCodeDebug:
|
|
93
|
+
"""
|
|
94
|
+
Codes utility methods
|
|
95
|
+
"""
|
|
96
|
+
|
|
97
|
+
@staticmethod
|
|
98
|
+
def op_id(op_id: int) -> str:
|
|
99
|
+
"""
|
|
100
|
+
Returns the name of the given OP Code
|
|
101
|
+
|
|
102
|
+
Args:
|
|
103
|
+
op_id: OP Code
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
Name of the OP Code
|
|
107
|
+
"""
|
|
108
|
+
try:
|
|
109
|
+
return TerminalCode(op_id).name
|
|
110
|
+
except ValueError:
|
|
111
|
+
return "<unknown TC:{0}>".format(op_id)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class TerminalCode(enum.IntEnum):
|
|
115
|
+
"""
|
|
116
|
+
Stream type Codes
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
TC_NULL = 0x70
|
|
120
|
+
TC_STRING = 0x74
|
|
121
|
+
TC_ENDBLOCKDATA = 0x78
|
|
122
|
+
TC_LONGSTRING = 0x7C
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class TypeCode(enum.IntEnum):
|
|
126
|
+
"""
|
|
127
|
+
Type definition chars (typecode)
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
# Primitive types
|
|
131
|
+
TYPE_BYTE = ord("B") # 0x42
|
|
132
|
+
TYPE_CHAR = ord("C") # 0x43
|
|
133
|
+
TYPE_DOUBLE = ord("D") # 0x44
|
|
134
|
+
TYPE_FLOAT = ord("F") # 0x46
|
|
135
|
+
TYPE_INTEGER = ord("I") # 0x49
|
|
136
|
+
TYPE_LONG = ord("J") # 0x4A
|
|
137
|
+
TYPE_SHORT = ord("S") # 0x53
|
|
138
|
+
TYPE_BOOLEAN = ord("Z") # 0x5A
|
|
139
|
+
# Object types
|
|
140
|
+
TYPE_OBJECT = ord("L") # 0x4C
|
|
141
|
+
TYPE_ARRAY = ord("[") # 0x5B
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class JavaString(str):
|
|
145
|
+
"""
|
|
146
|
+
Represents a Java String
|
|
147
|
+
"""
|
|
148
|
+
|
|
149
|
+
def __hash__(self):
|
|
150
|
+
return str.__hash__(self)
|
|
151
|
+
|
|
152
|
+
def __eq__(self, other):
|
|
153
|
+
if not isinstance(other, str):
|
|
154
|
+
return False
|
|
155
|
+
return str.__eq__(self, other)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
class JavaDeSerializeHelper:
|
|
159
|
+
"""
|
|
160
|
+
Deserializes a Java serialization stream
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
def __init__(self, stream: bytes, encoding: str):
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
Args:
|
|
167
|
+
stream: bytes, stream to be deserialized
|
|
168
|
+
encoding: if not utf-8 encoded, provided for specific encoding
|
|
169
|
+
|
|
170
|
+
"""
|
|
171
|
+
# Check stream
|
|
172
|
+
if stream is None:
|
|
173
|
+
raise IOError("No input stream given")
|
|
174
|
+
# Prepare the association Terminal Symbol -> Reading method
|
|
175
|
+
self.opmap = {
|
|
176
|
+
TerminalCode.TC_NULL: self.do_null,
|
|
177
|
+
TerminalCode.TC_STRING: self.do_string,
|
|
178
|
+
TerminalCode.TC_LONGSTRING: self.do_string_long,
|
|
179
|
+
TerminalCode.TC_ENDBLOCKDATA: self.do_null,
|
|
180
|
+
}
|
|
181
|
+
self.object_stream = BytesIO(stream)
|
|
182
|
+
self.encoding = encoding or 'UTF-8'
|
|
183
|
+
self.read_magic_bytes()
|
|
184
|
+
|
|
185
|
+
def read_magic_bytes(self):
|
|
186
|
+
length = struct.calcsize(">HH")
|
|
187
|
+
self.object_stream.read(length)
|
|
188
|
+
|
|
189
|
+
def _read_struct(self, unpack):
|
|
190
|
+
"""
|
|
191
|
+
Reads from the input stream, using struct
|
|
192
|
+
|
|
193
|
+
Args:
|
|
194
|
+
unpack: An unpack format string
|
|
195
|
+
|
|
196
|
+
Returns:
|
|
197
|
+
The result of struct.unpack (tuple)
|
|
198
|
+
|
|
199
|
+
Raises:
|
|
200
|
+
RuntimeError: End of stream reached during unpacking
|
|
201
|
+
|
|
202
|
+
"""
|
|
203
|
+
length = struct.calcsize(unpack)
|
|
204
|
+
ba = self.object_stream.read(length)
|
|
205
|
+
|
|
206
|
+
if len(ba) != length:
|
|
207
|
+
raise RuntimeError(
|
|
208
|
+
"Stream has been ended unexpectedly while unmarshaling."
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
return struct.unpack(unpack, ba)
|
|
212
|
+
|
|
213
|
+
def read_object(self, ignore_remaining_data=False):
|
|
214
|
+
"""
|
|
215
|
+
Reads an object from the input stream
|
|
216
|
+
|
|
217
|
+
Args:
|
|
218
|
+
ignore_remaining_data: If True, don't log an debug when
|
|
219
|
+
unused trailing bytes are remaining
|
|
220
|
+
|
|
221
|
+
Returns:
|
|
222
|
+
The unmarshalled object
|
|
223
|
+
|
|
224
|
+
Raises:
|
|
225
|
+
Exception: Any exception that occurred during unmarshalling
|
|
226
|
+
|
|
227
|
+
"""
|
|
228
|
+
try:
|
|
229
|
+
_, res = self._read_and_exec_opcode()
|
|
230
|
+
|
|
231
|
+
position_bak = self.object_stream.tell()
|
|
232
|
+
the_rest = self.object_stream.read()
|
|
233
|
+
if not ignore_remaining_data and len(the_rest) != 0: # pragma: no cover
|
|
234
|
+
logger.warning(
|
|
235
|
+
"Warning!!!!: Stream still has {0} bytes left. "
|
|
236
|
+
"Enable debug mode of logging to see the hexdump.".format(
|
|
237
|
+
len(the_rest)
|
|
238
|
+
)
|
|
239
|
+
)
|
|
240
|
+
logger.warning("\n{0}".format(hexdump(the_rest)))
|
|
241
|
+
else:
|
|
242
|
+
logger.warning("Java Object unmarshalled successfully!")
|
|
243
|
+
|
|
244
|
+
self.object_stream.seek(position_bak)
|
|
245
|
+
return res
|
|
246
|
+
except Exception:
|
|
247
|
+
self._oops_dump_state(ignore_remaining_data)
|
|
248
|
+
raise
|
|
249
|
+
|
|
250
|
+
def _read_and_exec_opcode(self, expect=None):
|
|
251
|
+
"""
|
|
252
|
+
Reads the next opcode, and executes its handler
|
|
253
|
+
|
|
254
|
+
Args:
|
|
255
|
+
expect: A list of expected opcodes
|
|
256
|
+
|
|
257
|
+
Returns:
|
|
258
|
+
A tuple: (opcode, result of the handler)
|
|
259
|
+
|
|
260
|
+
Raises:
|
|
261
|
+
IOError: Read opcode is not one of the expected ones
|
|
262
|
+
RuntimeError: Unknown opcode
|
|
263
|
+
|
|
264
|
+
"""
|
|
265
|
+
position = self.object_stream.tell()
|
|
266
|
+
(opid,) = self._read_struct(">B")
|
|
267
|
+
|
|
268
|
+
if expect and opid not in expect: # pragma: no cover
|
|
269
|
+
raise IOError(
|
|
270
|
+
"Unexpected opcode 0x{0:X} -- {1} "
|
|
271
|
+
"(at offset 0x{2:X})".format(
|
|
272
|
+
opid, StreamCodeDebug.op_id(opid), position
|
|
273
|
+
)
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
try:
|
|
277
|
+
handler = self.opmap[opid]
|
|
278
|
+
except KeyError:
|
|
279
|
+
raise RuntimeError(
|
|
280
|
+
"Unknown OpCode in the stream: 0x{0:X} "
|
|
281
|
+
"(at offset 0x{1:X})".format(opid, position)
|
|
282
|
+
)
|
|
283
|
+
else:
|
|
284
|
+
return opid, handler()
|
|
285
|
+
|
|
286
|
+
def _read_string(self, length_fmt="H"):
|
|
287
|
+
"""
|
|
288
|
+
Reads a serialized string
|
|
289
|
+
|
|
290
|
+
Args:
|
|
291
|
+
length_fmt: Structure format of the string length (H or Q)
|
|
292
|
+
|
|
293
|
+
Returns:
|
|
294
|
+
The deserialized string
|
|
295
|
+
|
|
296
|
+
Raises:
|
|
297
|
+
RuntimeError: Unexpected end of stream
|
|
298
|
+
|
|
299
|
+
"""
|
|
300
|
+
(length,) = self._read_struct(">{0}".format(length_fmt))
|
|
301
|
+
ba = self.object_stream.read(length)
|
|
302
|
+
return to_str(ba, self.encoding)
|
|
303
|
+
|
|
304
|
+
def do_string(self) -> str:
|
|
305
|
+
"""
|
|
306
|
+
Handles a TC_STRING opcode
|
|
307
|
+
|
|
308
|
+
Returns:
|
|
309
|
+
A String
|
|
310
|
+
|
|
311
|
+
"""
|
|
312
|
+
logger.warning("[string]")
|
|
313
|
+
ba = JavaString(self._read_string())
|
|
314
|
+
return ba
|
|
315
|
+
|
|
316
|
+
def do_string_long(self) -> str:
|
|
317
|
+
"""
|
|
318
|
+
Handles a TC_LONGSTRING opcode
|
|
319
|
+
|
|
320
|
+
Returns:
|
|
321
|
+
A String
|
|
322
|
+
|
|
323
|
+
"""
|
|
324
|
+
logger.warning("[long string]")
|
|
325
|
+
ba = JavaString(self._read_string("Q"))
|
|
326
|
+
return ba
|
|
327
|
+
|
|
328
|
+
@staticmethod
|
|
329
|
+
def do_null() -> None:
|
|
330
|
+
"""
|
|
331
|
+
Handles a TC_NULL opcode
|
|
332
|
+
|
|
333
|
+
Returns:
|
|
334
|
+
Always None
|
|
335
|
+
|
|
336
|
+
"""
|
|
337
|
+
return None
|
|
338
|
+
|
|
339
|
+
def _oops_dump_state(self, ignore_remaining_data=False):
|
|
340
|
+
"""
|
|
341
|
+
Log a deserialization debug
|
|
342
|
+
|
|
343
|
+
Args:
|
|
344
|
+
ignore_remaining_data: If True, don't log an debug when
|
|
345
|
+
unused trailing bytes are remaining
|
|
346
|
+
|
|
347
|
+
"""
|
|
348
|
+
logger.warning("==Oops state dump" + "=" * (30 - 17))
|
|
349
|
+
logger.warning(
|
|
350
|
+
"Stream seeking back at -16 byte "
|
|
351
|
+
"(2nd line is an actual position!):"
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
# Do not use a keyword argument
|
|
355
|
+
self.object_stream.seek(-16, os.SEEK_CUR)
|
|
356
|
+
position = self.object_stream.tell()
|
|
357
|
+
the_rest = self.object_stream.read()
|
|
358
|
+
|
|
359
|
+
if not ignore_remaining_data and len(the_rest) != 0:
|
|
360
|
+
logger.warning(
|
|
361
|
+
"Warning!!!!: Stream still has {0} bytes left:\n{1}".format(
|
|
362
|
+
len(the_rest), hexdump(the_rest, position)
|
|
363
|
+
)
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
logger.warning("=" * 30)
|