karrio-freightcom 2025.5.6__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.
- karrio/mappers/freightcom/__init__.py +3 -0
- karrio/mappers/freightcom/mapper.py +55 -0
- karrio/mappers/freightcom/proxy.py +38 -0
- karrio/mappers/freightcom/settings.py +19 -0
- karrio/plugins/freightcom/__init__.py +19 -0
- karrio/providers/freightcom/__init__.py +6 -0
- karrio/providers/freightcom/error.py +40 -0
- karrio/providers/freightcom/quote.py +179 -0
- karrio/providers/freightcom/shipping.py +294 -0
- karrio/providers/freightcom/units.py +153 -0
- karrio/providers/freightcom/utils.py +39 -0
- karrio/providers/freightcom/void_shipment.py +50 -0
- karrio/schemas/freightcom/__init__.py +0 -0
- karrio/schemas/freightcom/error.py +1859 -0
- karrio/schemas/freightcom/quote_reply.py +2555 -0
- karrio/schemas/freightcom/quote_request.py +4522 -0
- karrio/schemas/freightcom/shipment_cancel_reply.py +2063 -0
- karrio/schemas/freightcom/shipment_cancel_request.py +1915 -0
- karrio/schemas/freightcom/shipping_reply.py +4236 -0
- karrio/schemas/freightcom/shipping_request.py +5953 -0
- karrio_freightcom-2025.5.6.dist-info/METADATA +44 -0
- karrio_freightcom-2025.5.6.dist-info/RECORD +25 -0
- karrio_freightcom-2025.5.6.dist-info/WHEEL +5 -0
- karrio_freightcom-2025.5.6.dist-info/entry_points.txt +2 -0
- karrio_freightcom-2025.5.6.dist-info/top_level.txt +3 -0
|
@@ -0,0 +1,4522 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# Generated Fri Oct 21 12:33:20 2022 by generateDS.py version 2.41.1.
|
|
6
|
+
# Python 3.10.8 (v3.10.8:aaaf517424, Oct 11 2022, 10:14:40) [Clang 13.0.0 (clang-1300.0.29.30)]
|
|
7
|
+
#
|
|
8
|
+
# Command line options:
|
|
9
|
+
# ('--no-namespace-defs', '')
|
|
10
|
+
# ('-o', './karrio.schemas.freightcom/quote_request.py')
|
|
11
|
+
#
|
|
12
|
+
# Command line arguments:
|
|
13
|
+
# ./vendor/schemas/quote_request.xsd
|
|
14
|
+
#
|
|
15
|
+
# Command line:
|
|
16
|
+
# /Users/danielk/Documents/karrio/karrio/.venv/karrio/bin/generateDS --no-namespace-defs -o "./karrio.schemas.freightcom/quote_request.py" ./vendor/schemas/quote_request.xsd
|
|
17
|
+
#
|
|
18
|
+
# Current working directory (os.getcwd()):
|
|
19
|
+
# freightcom
|
|
20
|
+
#
|
|
21
|
+
|
|
22
|
+
import sys
|
|
23
|
+
|
|
24
|
+
try:
|
|
25
|
+
ModulenotfoundExp_ = ModuleNotFoundError
|
|
26
|
+
except NameError:
|
|
27
|
+
ModulenotfoundExp_ = ImportError
|
|
28
|
+
from six.moves import zip_longest
|
|
29
|
+
import os
|
|
30
|
+
import re as re_
|
|
31
|
+
import base64
|
|
32
|
+
import datetime as datetime_
|
|
33
|
+
import decimal as decimal_
|
|
34
|
+
from lxml import etree as etree_
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
Validate_simpletypes_ = True
|
|
38
|
+
SaveElementTreeNode = True
|
|
39
|
+
TagNamePrefix = ""
|
|
40
|
+
if sys.version_info.major == 2:
|
|
41
|
+
BaseStrType_ = basestring
|
|
42
|
+
else:
|
|
43
|
+
BaseStrType_ = str
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def parsexml_(infile, parser=None, **kwargs):
|
|
47
|
+
if parser is None:
|
|
48
|
+
# Use the lxml ElementTree compatible parser so that, e.g.,
|
|
49
|
+
# we ignore comments.
|
|
50
|
+
try:
|
|
51
|
+
parser = etree_.ETCompatXMLParser()
|
|
52
|
+
except AttributeError:
|
|
53
|
+
# fallback to xml.etree
|
|
54
|
+
parser = etree_.XMLParser()
|
|
55
|
+
try:
|
|
56
|
+
if isinstance(infile, os.PathLike):
|
|
57
|
+
infile = os.path.join(infile)
|
|
58
|
+
except AttributeError:
|
|
59
|
+
pass
|
|
60
|
+
doc = etree_.parse(infile, parser=parser, **kwargs)
|
|
61
|
+
return doc
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def parsexmlstring_(instring, parser=None, **kwargs):
|
|
65
|
+
if parser is None:
|
|
66
|
+
# Use the lxml ElementTree compatible parser so that, e.g.,
|
|
67
|
+
# we ignore comments.
|
|
68
|
+
try:
|
|
69
|
+
parser = etree_.ETCompatXMLParser()
|
|
70
|
+
except AttributeError:
|
|
71
|
+
# fallback to xml.etree
|
|
72
|
+
parser = etree_.XMLParser()
|
|
73
|
+
element = etree_.fromstring(instring, parser=parser, **kwargs)
|
|
74
|
+
return element
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
#
|
|
78
|
+
# Namespace prefix definition table (and other attributes, too)
|
|
79
|
+
#
|
|
80
|
+
# The module generatedsnamespaces, if it is importable, must contain
|
|
81
|
+
# a dictionary named GeneratedsNamespaceDefs. This Python dictionary
|
|
82
|
+
# should map element type names (strings) to XML schema namespace prefix
|
|
83
|
+
# definitions. The export method for any class for which there is
|
|
84
|
+
# a namespace prefix definition, will export that definition in the
|
|
85
|
+
# XML representation of that element. See the export method of
|
|
86
|
+
# any generated element type class for an example of the use of this
|
|
87
|
+
# table.
|
|
88
|
+
# A sample table is:
|
|
89
|
+
#
|
|
90
|
+
# # File: generatedsnamespaces.py
|
|
91
|
+
#
|
|
92
|
+
# GenerateDSNamespaceDefs = {
|
|
93
|
+
# "ElementtypeA": "http://www.xxx.com/namespaceA",
|
|
94
|
+
# "ElementtypeB": "http://www.xxx.com/namespaceB",
|
|
95
|
+
# }
|
|
96
|
+
#
|
|
97
|
+
# Additionally, the generatedsnamespaces module can contain a python
|
|
98
|
+
# dictionary named GenerateDSNamespaceTypePrefixes that associates element
|
|
99
|
+
# types with the namespace prefixes that are to be added to the
|
|
100
|
+
# "xsi:type" attribute value. See the _exportAttributes method of
|
|
101
|
+
# any generated element type and the generation of "xsi:type" for an
|
|
102
|
+
# example of the use of this table.
|
|
103
|
+
# An example table:
|
|
104
|
+
#
|
|
105
|
+
# # File: generatedsnamespaces.py
|
|
106
|
+
#
|
|
107
|
+
# GenerateDSNamespaceTypePrefixes = {
|
|
108
|
+
# "ElementtypeC": "aaa:",
|
|
109
|
+
# "ElementtypeD": "bbb:",
|
|
110
|
+
# }
|
|
111
|
+
#
|
|
112
|
+
|
|
113
|
+
try:
|
|
114
|
+
from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_
|
|
115
|
+
except ModulenotfoundExp_:
|
|
116
|
+
GenerateDSNamespaceDefs_ = {}
|
|
117
|
+
try:
|
|
118
|
+
from generatedsnamespaces import (
|
|
119
|
+
GenerateDSNamespaceTypePrefixes as GenerateDSNamespaceTypePrefixes_,
|
|
120
|
+
)
|
|
121
|
+
except ModulenotfoundExp_:
|
|
122
|
+
GenerateDSNamespaceTypePrefixes_ = {}
|
|
123
|
+
|
|
124
|
+
#
|
|
125
|
+
# You can replace the following class definition by defining an
|
|
126
|
+
# importable module named "generatedscollector" containing a class
|
|
127
|
+
# named "GdsCollector". See the default class definition below for
|
|
128
|
+
# clues about the possible content of that class.
|
|
129
|
+
#
|
|
130
|
+
try:
|
|
131
|
+
from generatedscollector import GdsCollector as GdsCollector_
|
|
132
|
+
except ModulenotfoundExp_:
|
|
133
|
+
|
|
134
|
+
class GdsCollector_(object):
|
|
135
|
+
def __init__(self, messages=None):
|
|
136
|
+
if messages is None:
|
|
137
|
+
self.messages = []
|
|
138
|
+
else:
|
|
139
|
+
self.messages = messages
|
|
140
|
+
|
|
141
|
+
def add_message(self, msg):
|
|
142
|
+
self.messages.append(msg)
|
|
143
|
+
|
|
144
|
+
def get_messages(self):
|
|
145
|
+
return self.messages
|
|
146
|
+
|
|
147
|
+
def clear_messages(self):
|
|
148
|
+
self.messages = []
|
|
149
|
+
|
|
150
|
+
def print_messages(self):
|
|
151
|
+
for msg in self.messages:
|
|
152
|
+
print("Warning: {}".format(msg))
|
|
153
|
+
|
|
154
|
+
def write_messages(self, outstream):
|
|
155
|
+
for msg in self.messages:
|
|
156
|
+
outstream.write("Warning: {}\n".format(msg))
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
#
|
|
160
|
+
# The super-class for enum types
|
|
161
|
+
#
|
|
162
|
+
|
|
163
|
+
try:
|
|
164
|
+
from enum import Enum
|
|
165
|
+
except ModulenotfoundExp_:
|
|
166
|
+
Enum = object
|
|
167
|
+
|
|
168
|
+
#
|
|
169
|
+
# The root super-class for element type classes
|
|
170
|
+
#
|
|
171
|
+
# Calls to the methods in these classes are generated by generateDS.py.
|
|
172
|
+
# You can replace these methods by re-implementing the following class
|
|
173
|
+
# in a module named generatedssuper.py.
|
|
174
|
+
|
|
175
|
+
try:
|
|
176
|
+
from generatedssuper import GeneratedsSuper
|
|
177
|
+
except ModulenotfoundExp_ as exp:
|
|
178
|
+
try:
|
|
179
|
+
from generatedssupersuper import GeneratedsSuperSuper
|
|
180
|
+
except ModulenotfoundExp_ as exp:
|
|
181
|
+
|
|
182
|
+
class GeneratedsSuperSuper(object):
|
|
183
|
+
pass
|
|
184
|
+
|
|
185
|
+
class GeneratedsSuper(GeneratedsSuperSuper):
|
|
186
|
+
__hash__ = object.__hash__
|
|
187
|
+
tzoff_pattern = re_.compile(r"(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$")
|
|
188
|
+
|
|
189
|
+
class _FixedOffsetTZ(datetime_.tzinfo):
|
|
190
|
+
def __init__(self, offset, name):
|
|
191
|
+
self.__offset = datetime_.timedelta(minutes=offset)
|
|
192
|
+
self.__name = name
|
|
193
|
+
|
|
194
|
+
def utcoffset(self, dt):
|
|
195
|
+
return self.__offset
|
|
196
|
+
|
|
197
|
+
def tzname(self, dt):
|
|
198
|
+
return self.__name
|
|
199
|
+
|
|
200
|
+
def dst(self, dt):
|
|
201
|
+
return None
|
|
202
|
+
|
|
203
|
+
def __str__(self):
|
|
204
|
+
settings = {
|
|
205
|
+
"str_pretty_print": True,
|
|
206
|
+
"str_indent_level": 0,
|
|
207
|
+
"str_namespaceprefix": "",
|
|
208
|
+
"str_name": self.__class__.__name__,
|
|
209
|
+
"str_namespacedefs": "",
|
|
210
|
+
}
|
|
211
|
+
for n in settings:
|
|
212
|
+
if hasattr(self, n):
|
|
213
|
+
settings[n] = getattr(self, n)
|
|
214
|
+
if sys.version_info.major == 2:
|
|
215
|
+
from StringIO import StringIO
|
|
216
|
+
else:
|
|
217
|
+
from io import StringIO
|
|
218
|
+
output = StringIO()
|
|
219
|
+
self.export(
|
|
220
|
+
output,
|
|
221
|
+
settings["str_indent_level"],
|
|
222
|
+
pretty_print=settings["str_pretty_print"],
|
|
223
|
+
namespaceprefix_=settings["str_namespaceprefix"],
|
|
224
|
+
name_=settings["str_name"],
|
|
225
|
+
namespacedef_=settings["str_namespacedefs"],
|
|
226
|
+
)
|
|
227
|
+
strval = output.getvalue()
|
|
228
|
+
output.close()
|
|
229
|
+
return strval
|
|
230
|
+
|
|
231
|
+
def gds_format_string(self, input_data, input_name=""):
|
|
232
|
+
return input_data
|
|
233
|
+
|
|
234
|
+
def gds_parse_string(self, input_data, node=None, input_name=""):
|
|
235
|
+
return input_data
|
|
236
|
+
|
|
237
|
+
def gds_validate_string(self, input_data, node=None, input_name=""):
|
|
238
|
+
if not input_data:
|
|
239
|
+
return ""
|
|
240
|
+
else:
|
|
241
|
+
return input_data
|
|
242
|
+
|
|
243
|
+
def gds_format_base64(self, input_data, input_name=""):
|
|
244
|
+
return base64.b64encode(input_data).decode("ascii")
|
|
245
|
+
|
|
246
|
+
def gds_validate_base64(self, input_data, node=None, input_name=""):
|
|
247
|
+
return input_data
|
|
248
|
+
|
|
249
|
+
def gds_format_integer(self, input_data, input_name=""):
|
|
250
|
+
return "%d" % int(input_data)
|
|
251
|
+
|
|
252
|
+
def gds_parse_integer(self, input_data, node=None, input_name=""):
|
|
253
|
+
try:
|
|
254
|
+
ival = int(input_data)
|
|
255
|
+
except (TypeError, ValueError) as exp:
|
|
256
|
+
raise_parse_error(node, "Requires integer value: %s" % exp)
|
|
257
|
+
return ival
|
|
258
|
+
|
|
259
|
+
def gds_validate_integer(self, input_data, node=None, input_name=""):
|
|
260
|
+
try:
|
|
261
|
+
value = int(input_data)
|
|
262
|
+
except (TypeError, ValueError):
|
|
263
|
+
raise_parse_error(node, "Requires integer value")
|
|
264
|
+
return value
|
|
265
|
+
|
|
266
|
+
def gds_format_integer_list(self, input_data, input_name=""):
|
|
267
|
+
if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
|
|
268
|
+
input_data = [str(s) for s in input_data]
|
|
269
|
+
return "%s" % " ".join(input_data)
|
|
270
|
+
|
|
271
|
+
def gds_validate_integer_list(self, input_data, node=None, input_name=""):
|
|
272
|
+
values = input_data.split()
|
|
273
|
+
for value in values:
|
|
274
|
+
try:
|
|
275
|
+
int(value)
|
|
276
|
+
except (TypeError, ValueError):
|
|
277
|
+
raise_parse_error(node, "Requires sequence of integer values")
|
|
278
|
+
return values
|
|
279
|
+
|
|
280
|
+
def gds_format_float(self, input_data, input_name=""):
|
|
281
|
+
return ("%.15f" % float(input_data)).rstrip("0")
|
|
282
|
+
|
|
283
|
+
def gds_parse_float(self, input_data, node=None, input_name=""):
|
|
284
|
+
try:
|
|
285
|
+
fval_ = float(input_data)
|
|
286
|
+
except (TypeError, ValueError) as exp:
|
|
287
|
+
raise_parse_error(node, "Requires float or double value: %s" % exp)
|
|
288
|
+
return fval_
|
|
289
|
+
|
|
290
|
+
def gds_validate_float(self, input_data, node=None, input_name=""):
|
|
291
|
+
try:
|
|
292
|
+
value = float(input_data)
|
|
293
|
+
except (TypeError, ValueError):
|
|
294
|
+
raise_parse_error(node, "Requires float value")
|
|
295
|
+
return value
|
|
296
|
+
|
|
297
|
+
def gds_format_float_list(self, input_data, input_name=""):
|
|
298
|
+
if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
|
|
299
|
+
input_data = [str(s) for s in input_data]
|
|
300
|
+
return "%s" % " ".join(input_data)
|
|
301
|
+
|
|
302
|
+
def gds_validate_float_list(self, input_data, node=None, input_name=""):
|
|
303
|
+
values = input_data.split()
|
|
304
|
+
for value in values:
|
|
305
|
+
try:
|
|
306
|
+
float(value)
|
|
307
|
+
except (TypeError, ValueError):
|
|
308
|
+
raise_parse_error(node, "Requires sequence of float values")
|
|
309
|
+
return values
|
|
310
|
+
|
|
311
|
+
def gds_format_decimal(self, input_data, input_name=""):
|
|
312
|
+
return_value = "%s" % input_data
|
|
313
|
+
if "." in return_value:
|
|
314
|
+
return_value = return_value.rstrip("0")
|
|
315
|
+
if return_value.endswith("."):
|
|
316
|
+
return_value = return_value.rstrip(".")
|
|
317
|
+
return return_value
|
|
318
|
+
|
|
319
|
+
def gds_parse_decimal(self, input_data, node=None, input_name=""):
|
|
320
|
+
try:
|
|
321
|
+
decimal_value = decimal_.Decimal(input_data)
|
|
322
|
+
except (TypeError, ValueError):
|
|
323
|
+
raise_parse_error(node, "Requires decimal value")
|
|
324
|
+
return decimal_value
|
|
325
|
+
|
|
326
|
+
def gds_validate_decimal(self, input_data, node=None, input_name=""):
|
|
327
|
+
try:
|
|
328
|
+
value = decimal_.Decimal(input_data)
|
|
329
|
+
except (TypeError, ValueError):
|
|
330
|
+
raise_parse_error(node, "Requires decimal value")
|
|
331
|
+
return value
|
|
332
|
+
|
|
333
|
+
def gds_format_decimal_list(self, input_data, input_name=""):
|
|
334
|
+
if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
|
|
335
|
+
input_data = [str(s) for s in input_data]
|
|
336
|
+
return " ".join([self.gds_format_decimal(item) for item in input_data])
|
|
337
|
+
|
|
338
|
+
def gds_validate_decimal_list(self, input_data, node=None, input_name=""):
|
|
339
|
+
values = input_data.split()
|
|
340
|
+
for value in values:
|
|
341
|
+
try:
|
|
342
|
+
decimal_.Decimal(value)
|
|
343
|
+
except (TypeError, ValueError):
|
|
344
|
+
raise_parse_error(node, "Requires sequence of decimal values")
|
|
345
|
+
return values
|
|
346
|
+
|
|
347
|
+
def gds_format_double(self, input_data, input_name=""):
|
|
348
|
+
return "%s" % input_data
|
|
349
|
+
|
|
350
|
+
def gds_parse_double(self, input_data, node=None, input_name=""):
|
|
351
|
+
try:
|
|
352
|
+
fval_ = float(input_data)
|
|
353
|
+
except (TypeError, ValueError) as exp:
|
|
354
|
+
raise_parse_error(node, "Requires double or float value: %s" % exp)
|
|
355
|
+
return fval_
|
|
356
|
+
|
|
357
|
+
def gds_validate_double(self, input_data, node=None, input_name=""):
|
|
358
|
+
try:
|
|
359
|
+
value = float(input_data)
|
|
360
|
+
except (TypeError, ValueError):
|
|
361
|
+
raise_parse_error(node, "Requires double or float value")
|
|
362
|
+
return value
|
|
363
|
+
|
|
364
|
+
def gds_format_double_list(self, input_data, input_name=""):
|
|
365
|
+
if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
|
|
366
|
+
input_data = [str(s) for s in input_data]
|
|
367
|
+
return "%s" % " ".join(input_data)
|
|
368
|
+
|
|
369
|
+
def gds_validate_double_list(self, input_data, node=None, input_name=""):
|
|
370
|
+
values = input_data.split()
|
|
371
|
+
for value in values:
|
|
372
|
+
try:
|
|
373
|
+
float(value)
|
|
374
|
+
except (TypeError, ValueError):
|
|
375
|
+
raise_parse_error(
|
|
376
|
+
node, "Requires sequence of double or float values"
|
|
377
|
+
)
|
|
378
|
+
return values
|
|
379
|
+
|
|
380
|
+
def gds_format_boolean(self, input_data, input_name=""):
|
|
381
|
+
return ("%s" % input_data).lower()
|
|
382
|
+
|
|
383
|
+
def gds_parse_boolean(self, input_data, node=None, input_name=""):
|
|
384
|
+
input_data = input_data.strip()
|
|
385
|
+
if input_data in ("true", "1"):
|
|
386
|
+
bval = True
|
|
387
|
+
elif input_data in ("false", "0"):
|
|
388
|
+
bval = False
|
|
389
|
+
else:
|
|
390
|
+
raise_parse_error(node, "Requires boolean value")
|
|
391
|
+
return bval
|
|
392
|
+
|
|
393
|
+
def gds_validate_boolean(self, input_data, node=None, input_name=""):
|
|
394
|
+
if input_data not in (
|
|
395
|
+
True,
|
|
396
|
+
1,
|
|
397
|
+
False,
|
|
398
|
+
0,
|
|
399
|
+
):
|
|
400
|
+
raise_parse_error(
|
|
401
|
+
node, "Requires boolean value " "(one of True, 1, False, 0)"
|
|
402
|
+
)
|
|
403
|
+
return input_data
|
|
404
|
+
|
|
405
|
+
def gds_format_boolean_list(self, input_data, input_name=""):
|
|
406
|
+
if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
|
|
407
|
+
input_data = [str(s) for s in input_data]
|
|
408
|
+
return "%s" % " ".join(input_data)
|
|
409
|
+
|
|
410
|
+
def gds_validate_boolean_list(self, input_data, node=None, input_name=""):
|
|
411
|
+
values = input_data.split()
|
|
412
|
+
for value in values:
|
|
413
|
+
value = self.gds_parse_boolean(value, node, input_name)
|
|
414
|
+
if value not in (
|
|
415
|
+
True,
|
|
416
|
+
1,
|
|
417
|
+
False,
|
|
418
|
+
0,
|
|
419
|
+
):
|
|
420
|
+
raise_parse_error(
|
|
421
|
+
node,
|
|
422
|
+
"Requires sequence of boolean values "
|
|
423
|
+
"(one of True, 1, False, 0)",
|
|
424
|
+
)
|
|
425
|
+
return values
|
|
426
|
+
|
|
427
|
+
def gds_validate_datetime(self, input_data, node=None, input_name=""):
|
|
428
|
+
return input_data
|
|
429
|
+
|
|
430
|
+
def gds_format_datetime(self, input_data, input_name=""):
|
|
431
|
+
if input_data.microsecond == 0:
|
|
432
|
+
_svalue = "%04d-%02d-%02dT%02d:%02d:%02d" % (
|
|
433
|
+
input_data.year,
|
|
434
|
+
input_data.month,
|
|
435
|
+
input_data.day,
|
|
436
|
+
input_data.hour,
|
|
437
|
+
input_data.minute,
|
|
438
|
+
input_data.second,
|
|
439
|
+
)
|
|
440
|
+
else:
|
|
441
|
+
_svalue = "%04d-%02d-%02dT%02d:%02d:%02d.%s" % (
|
|
442
|
+
input_data.year,
|
|
443
|
+
input_data.month,
|
|
444
|
+
input_data.day,
|
|
445
|
+
input_data.hour,
|
|
446
|
+
input_data.minute,
|
|
447
|
+
input_data.second,
|
|
448
|
+
("%f" % (float(input_data.microsecond) / 1000000))[2:],
|
|
449
|
+
)
|
|
450
|
+
if input_data.tzinfo is not None:
|
|
451
|
+
tzoff = input_data.tzinfo.utcoffset(input_data)
|
|
452
|
+
if tzoff is not None:
|
|
453
|
+
total_seconds = tzoff.seconds + (86400 * tzoff.days)
|
|
454
|
+
if total_seconds == 0:
|
|
455
|
+
_svalue += "Z"
|
|
456
|
+
else:
|
|
457
|
+
if total_seconds < 0:
|
|
458
|
+
_svalue += "-"
|
|
459
|
+
total_seconds *= -1
|
|
460
|
+
else:
|
|
461
|
+
_svalue += "+"
|
|
462
|
+
hours = total_seconds // 3600
|
|
463
|
+
minutes = (total_seconds - (hours * 3600)) // 60
|
|
464
|
+
_svalue += "{0:02d}:{1:02d}".format(hours, minutes)
|
|
465
|
+
return _svalue
|
|
466
|
+
|
|
467
|
+
@classmethod
|
|
468
|
+
def gds_parse_datetime(cls, input_data):
|
|
469
|
+
tz = None
|
|
470
|
+
if input_data[-1] == "Z":
|
|
471
|
+
tz = GeneratedsSuper._FixedOffsetTZ(0, "UTC")
|
|
472
|
+
input_data = input_data[:-1]
|
|
473
|
+
else:
|
|
474
|
+
results = GeneratedsSuper.tzoff_pattern.search(input_data)
|
|
475
|
+
if results is not None:
|
|
476
|
+
tzoff_parts = results.group(2).split(":")
|
|
477
|
+
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
|
|
478
|
+
if results.group(1) == "-":
|
|
479
|
+
tzoff *= -1
|
|
480
|
+
tz = GeneratedsSuper._FixedOffsetTZ(tzoff, results.group(0))
|
|
481
|
+
input_data = input_data[:-6]
|
|
482
|
+
time_parts = input_data.split(".")
|
|
483
|
+
if len(time_parts) > 1:
|
|
484
|
+
micro_seconds = int(float("0." + time_parts[1]) * 1000000)
|
|
485
|
+
input_data = "%s.%s" % (
|
|
486
|
+
time_parts[0],
|
|
487
|
+
"{}".format(micro_seconds).rjust(6, "0"),
|
|
488
|
+
)
|
|
489
|
+
dt = datetime_.datetime.strptime(input_data, "%Y-%m-%dT%H:%M:%S.%f")
|
|
490
|
+
else:
|
|
491
|
+
dt = datetime_.datetime.strptime(input_data, "%Y-%m-%dT%H:%M:%S")
|
|
492
|
+
dt = dt.replace(tzinfo=tz)
|
|
493
|
+
return dt
|
|
494
|
+
|
|
495
|
+
def gds_validate_date(self, input_data, node=None, input_name=""):
|
|
496
|
+
return input_data
|
|
497
|
+
|
|
498
|
+
def gds_format_date(self, input_data, input_name=""):
|
|
499
|
+
_svalue = "%04d-%02d-%02d" % (
|
|
500
|
+
input_data.year,
|
|
501
|
+
input_data.month,
|
|
502
|
+
input_data.day,
|
|
503
|
+
)
|
|
504
|
+
try:
|
|
505
|
+
if input_data.tzinfo is not None:
|
|
506
|
+
tzoff = input_data.tzinfo.utcoffset(input_data)
|
|
507
|
+
if tzoff is not None:
|
|
508
|
+
total_seconds = tzoff.seconds + (86400 * tzoff.days)
|
|
509
|
+
if total_seconds == 0:
|
|
510
|
+
_svalue += "Z"
|
|
511
|
+
else:
|
|
512
|
+
if total_seconds < 0:
|
|
513
|
+
_svalue += "-"
|
|
514
|
+
total_seconds *= -1
|
|
515
|
+
else:
|
|
516
|
+
_svalue += "+"
|
|
517
|
+
hours = total_seconds // 3600
|
|
518
|
+
minutes = (total_seconds - (hours * 3600)) // 60
|
|
519
|
+
_svalue += "{0:02d}:{1:02d}".format(hours, minutes)
|
|
520
|
+
except AttributeError:
|
|
521
|
+
pass
|
|
522
|
+
return _svalue
|
|
523
|
+
|
|
524
|
+
@classmethod
|
|
525
|
+
def gds_parse_date(cls, input_data):
|
|
526
|
+
tz = None
|
|
527
|
+
if input_data[-1] == "Z":
|
|
528
|
+
tz = GeneratedsSuper._FixedOffsetTZ(0, "UTC")
|
|
529
|
+
input_data = input_data[:-1]
|
|
530
|
+
else:
|
|
531
|
+
results = GeneratedsSuper.tzoff_pattern.search(input_data)
|
|
532
|
+
if results is not None:
|
|
533
|
+
tzoff_parts = results.group(2).split(":")
|
|
534
|
+
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
|
|
535
|
+
if results.group(1) == "-":
|
|
536
|
+
tzoff *= -1
|
|
537
|
+
tz = GeneratedsSuper._FixedOffsetTZ(tzoff, results.group(0))
|
|
538
|
+
input_data = input_data[:-6]
|
|
539
|
+
dt = datetime_.datetime.strptime(input_data, "%Y-%m-%d")
|
|
540
|
+
dt = dt.replace(tzinfo=tz)
|
|
541
|
+
return dt.date()
|
|
542
|
+
|
|
543
|
+
def gds_validate_time(self, input_data, node=None, input_name=""):
|
|
544
|
+
return input_data
|
|
545
|
+
|
|
546
|
+
def gds_format_time(self, input_data, input_name=""):
|
|
547
|
+
if input_data.microsecond == 0:
|
|
548
|
+
_svalue = "%02d:%02d:%02d" % (
|
|
549
|
+
input_data.hour,
|
|
550
|
+
input_data.minute,
|
|
551
|
+
input_data.second,
|
|
552
|
+
)
|
|
553
|
+
else:
|
|
554
|
+
_svalue = "%02d:%02d:%02d.%s" % (
|
|
555
|
+
input_data.hour,
|
|
556
|
+
input_data.minute,
|
|
557
|
+
input_data.second,
|
|
558
|
+
("%f" % (float(input_data.microsecond) / 1000000))[2:],
|
|
559
|
+
)
|
|
560
|
+
if input_data.tzinfo is not None:
|
|
561
|
+
tzoff = input_data.tzinfo.utcoffset(input_data)
|
|
562
|
+
if tzoff is not None:
|
|
563
|
+
total_seconds = tzoff.seconds + (86400 * tzoff.days)
|
|
564
|
+
if total_seconds == 0:
|
|
565
|
+
_svalue += "Z"
|
|
566
|
+
else:
|
|
567
|
+
if total_seconds < 0:
|
|
568
|
+
_svalue += "-"
|
|
569
|
+
total_seconds *= -1
|
|
570
|
+
else:
|
|
571
|
+
_svalue += "+"
|
|
572
|
+
hours = total_seconds // 3600
|
|
573
|
+
minutes = (total_seconds - (hours * 3600)) // 60
|
|
574
|
+
_svalue += "{0:02d}:{1:02d}".format(hours, minutes)
|
|
575
|
+
return _svalue
|
|
576
|
+
|
|
577
|
+
def gds_validate_simple_patterns(self, patterns, target):
|
|
578
|
+
# pat is a list of lists of strings/patterns.
|
|
579
|
+
# The target value must match at least one of the patterns
|
|
580
|
+
# in order for the test to succeed.
|
|
581
|
+
found1 = True
|
|
582
|
+
target = str(target)
|
|
583
|
+
for patterns1 in patterns:
|
|
584
|
+
found2 = False
|
|
585
|
+
for patterns2 in patterns1:
|
|
586
|
+
mo = re_.search(patterns2, target)
|
|
587
|
+
if mo is not None and len(mo.group(0)) == len(target):
|
|
588
|
+
found2 = True
|
|
589
|
+
break
|
|
590
|
+
if not found2:
|
|
591
|
+
found1 = False
|
|
592
|
+
break
|
|
593
|
+
return found1
|
|
594
|
+
|
|
595
|
+
@classmethod
|
|
596
|
+
def gds_parse_time(cls, input_data):
|
|
597
|
+
tz = None
|
|
598
|
+
if input_data[-1] == "Z":
|
|
599
|
+
tz = GeneratedsSuper._FixedOffsetTZ(0, "UTC")
|
|
600
|
+
input_data = input_data[:-1]
|
|
601
|
+
else:
|
|
602
|
+
results = GeneratedsSuper.tzoff_pattern.search(input_data)
|
|
603
|
+
if results is not None:
|
|
604
|
+
tzoff_parts = results.group(2).split(":")
|
|
605
|
+
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
|
|
606
|
+
if results.group(1) == "-":
|
|
607
|
+
tzoff *= -1
|
|
608
|
+
tz = GeneratedsSuper._FixedOffsetTZ(tzoff, results.group(0))
|
|
609
|
+
input_data = input_data[:-6]
|
|
610
|
+
if len(input_data.split(".")) > 1:
|
|
611
|
+
dt = datetime_.datetime.strptime(input_data, "%H:%M:%S.%f")
|
|
612
|
+
else:
|
|
613
|
+
dt = datetime_.datetime.strptime(input_data, "%H:%M:%S")
|
|
614
|
+
dt = dt.replace(tzinfo=tz)
|
|
615
|
+
return dt.time()
|
|
616
|
+
|
|
617
|
+
def gds_check_cardinality_(
|
|
618
|
+
self, value, input_name, min_occurs=0, max_occurs=1, required=None
|
|
619
|
+
):
|
|
620
|
+
if value is None:
|
|
621
|
+
length = 0
|
|
622
|
+
elif isinstance(value, list):
|
|
623
|
+
length = len(value)
|
|
624
|
+
else:
|
|
625
|
+
length = 1
|
|
626
|
+
if required is not None:
|
|
627
|
+
if required and length < 1:
|
|
628
|
+
self.gds_collector_.add_message(
|
|
629
|
+
"Required value {}{} is missing".format(
|
|
630
|
+
input_name, self.gds_get_node_lineno_()
|
|
631
|
+
)
|
|
632
|
+
)
|
|
633
|
+
if length < min_occurs:
|
|
634
|
+
self.gds_collector_.add_message(
|
|
635
|
+
"Number of values for {}{} is below "
|
|
636
|
+
"the minimum allowed, "
|
|
637
|
+
"expected at least {}, found {}".format(
|
|
638
|
+
input_name, self.gds_get_node_lineno_(), min_occurs, length
|
|
639
|
+
)
|
|
640
|
+
)
|
|
641
|
+
elif length > max_occurs:
|
|
642
|
+
self.gds_collector_.add_message(
|
|
643
|
+
"Number of values for {}{} is above "
|
|
644
|
+
"the maximum allowed, "
|
|
645
|
+
"expected at most {}, found {}".format(
|
|
646
|
+
input_name, self.gds_get_node_lineno_(), max_occurs, length
|
|
647
|
+
)
|
|
648
|
+
)
|
|
649
|
+
|
|
650
|
+
def gds_validate_builtin_ST_(
|
|
651
|
+
self,
|
|
652
|
+
validator,
|
|
653
|
+
value,
|
|
654
|
+
input_name,
|
|
655
|
+
min_occurs=None,
|
|
656
|
+
max_occurs=None,
|
|
657
|
+
required=None,
|
|
658
|
+
):
|
|
659
|
+
if value is not None:
|
|
660
|
+
try:
|
|
661
|
+
validator(value, input_name=input_name)
|
|
662
|
+
except GDSParseError as parse_error:
|
|
663
|
+
self.gds_collector_.add_message(str(parse_error))
|
|
664
|
+
|
|
665
|
+
def gds_validate_defined_ST_(
|
|
666
|
+
self,
|
|
667
|
+
validator,
|
|
668
|
+
value,
|
|
669
|
+
input_name,
|
|
670
|
+
min_occurs=None,
|
|
671
|
+
max_occurs=None,
|
|
672
|
+
required=None,
|
|
673
|
+
):
|
|
674
|
+
if value is not None:
|
|
675
|
+
try:
|
|
676
|
+
validator(value)
|
|
677
|
+
except GDSParseError as parse_error:
|
|
678
|
+
self.gds_collector_.add_message(str(parse_error))
|
|
679
|
+
|
|
680
|
+
def gds_str_lower(self, instring):
|
|
681
|
+
return instring.lower()
|
|
682
|
+
|
|
683
|
+
def get_path_(self, node):
|
|
684
|
+
path_list = []
|
|
685
|
+
self.get_path_list_(node, path_list)
|
|
686
|
+
path_list.reverse()
|
|
687
|
+
path = "/".join(path_list)
|
|
688
|
+
return path
|
|
689
|
+
|
|
690
|
+
Tag_strip_pattern_ = re_.compile(r"\{.*\}")
|
|
691
|
+
|
|
692
|
+
def get_path_list_(self, node, path_list):
|
|
693
|
+
if node is None:
|
|
694
|
+
return
|
|
695
|
+
tag = GeneratedsSuper.Tag_strip_pattern_.sub("", node.tag)
|
|
696
|
+
if tag:
|
|
697
|
+
path_list.append(tag)
|
|
698
|
+
self.get_path_list_(node.getparent(), path_list)
|
|
699
|
+
|
|
700
|
+
def get_class_obj_(self, node, default_class=None):
|
|
701
|
+
class_obj1 = default_class
|
|
702
|
+
if "xsi" in node.nsmap:
|
|
703
|
+
classname = node.get("{%s}type" % node.nsmap["xsi"])
|
|
704
|
+
if classname is not None:
|
|
705
|
+
names = classname.split(":")
|
|
706
|
+
if len(names) == 2:
|
|
707
|
+
classname = names[1]
|
|
708
|
+
class_obj2 = globals().get(classname)
|
|
709
|
+
if class_obj2 is not None:
|
|
710
|
+
class_obj1 = class_obj2
|
|
711
|
+
return class_obj1
|
|
712
|
+
|
|
713
|
+
def gds_build_any(self, node, type_name=None):
|
|
714
|
+
# provide default value in case option --disable-xml is used.
|
|
715
|
+
content = ""
|
|
716
|
+
content = etree_.tostring(node, encoding="unicode")
|
|
717
|
+
return content
|
|
718
|
+
|
|
719
|
+
@classmethod
|
|
720
|
+
def gds_reverse_node_mapping(cls, mapping):
|
|
721
|
+
return dict(((v, k) for k, v in mapping.items()))
|
|
722
|
+
|
|
723
|
+
@staticmethod
|
|
724
|
+
def gds_encode(instring):
|
|
725
|
+
if sys.version_info.major == 2:
|
|
726
|
+
if ExternalEncoding:
|
|
727
|
+
encoding = ExternalEncoding
|
|
728
|
+
else:
|
|
729
|
+
encoding = "utf-8"
|
|
730
|
+
return instring.encode(encoding)
|
|
731
|
+
else:
|
|
732
|
+
return instring
|
|
733
|
+
|
|
734
|
+
@staticmethod
|
|
735
|
+
def convert_unicode(instring):
|
|
736
|
+
if isinstance(instring, str):
|
|
737
|
+
result = quote_xml(instring)
|
|
738
|
+
elif sys.version_info.major == 2 and isinstance(instring, unicode):
|
|
739
|
+
result = quote_xml(instring).encode("utf8")
|
|
740
|
+
else:
|
|
741
|
+
result = GeneratedsSuper.gds_encode(str(instring))
|
|
742
|
+
return result
|
|
743
|
+
|
|
744
|
+
def __eq__(self, other):
|
|
745
|
+
def excl_select_objs_(obj):
|
|
746
|
+
return obj[0] != "parent_object_" and obj[0] != "gds_collector_"
|
|
747
|
+
|
|
748
|
+
if type(self) != type(other):
|
|
749
|
+
return False
|
|
750
|
+
return all(
|
|
751
|
+
x == y
|
|
752
|
+
for x, y in zip_longest(
|
|
753
|
+
filter(excl_select_objs_, self.__dict__.items()),
|
|
754
|
+
filter(excl_select_objs_, other.__dict__.items()),
|
|
755
|
+
)
|
|
756
|
+
)
|
|
757
|
+
|
|
758
|
+
def __ne__(self, other):
|
|
759
|
+
return not self.__eq__(other)
|
|
760
|
+
|
|
761
|
+
# Django ETL transform hooks.
|
|
762
|
+
def gds_djo_etl_transform(self):
|
|
763
|
+
pass
|
|
764
|
+
|
|
765
|
+
def gds_djo_etl_transform_db_obj(self, dbobj):
|
|
766
|
+
pass
|
|
767
|
+
|
|
768
|
+
# SQLAlchemy ETL transform hooks.
|
|
769
|
+
def gds_sqa_etl_transform(self):
|
|
770
|
+
return 0, None
|
|
771
|
+
|
|
772
|
+
def gds_sqa_etl_transform_db_obj(self, dbobj):
|
|
773
|
+
pass
|
|
774
|
+
|
|
775
|
+
def gds_get_node_lineno_(self):
|
|
776
|
+
if (
|
|
777
|
+
hasattr(self, "gds_elementtree_node_")
|
|
778
|
+
and self.gds_elementtree_node_ is not None
|
|
779
|
+
):
|
|
780
|
+
return " near line {}".format(self.gds_elementtree_node_.sourceline)
|
|
781
|
+
else:
|
|
782
|
+
return ""
|
|
783
|
+
|
|
784
|
+
def getSubclassFromModule_(module, class_):
|
|
785
|
+
"""Get the subclass of a class from a specific module."""
|
|
786
|
+
name = class_.__name__ + "Sub"
|
|
787
|
+
if hasattr(module, name):
|
|
788
|
+
return getattr(module, name)
|
|
789
|
+
else:
|
|
790
|
+
return None
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
#
|
|
794
|
+
# If you have installed IPython you can uncomment and use the following.
|
|
795
|
+
# IPython is available from http://ipython.scipy.org/.
|
|
796
|
+
#
|
|
797
|
+
|
|
798
|
+
## from IPython.Shell import IPShellEmbed
|
|
799
|
+
## args = ''
|
|
800
|
+
## ipshell = IPShellEmbed(args,
|
|
801
|
+
## banner = 'Dropping into IPython',
|
|
802
|
+
## exit_msg = 'Leaving Interpreter, back to program.')
|
|
803
|
+
|
|
804
|
+
# Then use the following line where and when you want to drop into the
|
|
805
|
+
# IPython shell:
|
|
806
|
+
# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')
|
|
807
|
+
|
|
808
|
+
#
|
|
809
|
+
# Globals
|
|
810
|
+
#
|
|
811
|
+
|
|
812
|
+
ExternalEncoding = ""
|
|
813
|
+
# Set this to false in order to deactivate during export, the use of
|
|
814
|
+
# name space prefixes captured from the input document.
|
|
815
|
+
UseCapturedNS_ = True
|
|
816
|
+
CapturedNsmap_ = {}
|
|
817
|
+
Tag_pattern_ = re_.compile(r"({.*})?(.*)")
|
|
818
|
+
String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
|
|
819
|
+
Namespace_extract_pat_ = re_.compile(r"{(.*)}(.*)")
|
|
820
|
+
CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL)
|
|
821
|
+
|
|
822
|
+
# Change this to redirect the generated superclass module to use a
|
|
823
|
+
# specific subclass module.
|
|
824
|
+
CurrentSubclassModule_ = None
|
|
825
|
+
|
|
826
|
+
#
|
|
827
|
+
# Support/utility functions.
|
|
828
|
+
#
|
|
829
|
+
|
|
830
|
+
|
|
831
|
+
def showIndent(outfile, level, pretty_print=True):
|
|
832
|
+
if pretty_print:
|
|
833
|
+
for idx in range(level):
|
|
834
|
+
outfile.write(" ")
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
def quote_xml(inStr):
|
|
838
|
+
"Escape markup chars, but do not modify CDATA sections."
|
|
839
|
+
if not inStr:
|
|
840
|
+
return ""
|
|
841
|
+
s1 = isinstance(inStr, BaseStrType_) and inStr or "%s" % inStr
|
|
842
|
+
s2 = ""
|
|
843
|
+
pos = 0
|
|
844
|
+
matchobjects = CDATA_pattern_.finditer(s1)
|
|
845
|
+
for mo in matchobjects:
|
|
846
|
+
s3 = s1[pos : mo.start()]
|
|
847
|
+
s2 += quote_xml_aux(s3)
|
|
848
|
+
s2 += s1[mo.start() : mo.end()]
|
|
849
|
+
pos = mo.end()
|
|
850
|
+
s3 = s1[pos:]
|
|
851
|
+
s2 += quote_xml_aux(s3)
|
|
852
|
+
return s2
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
def quote_xml_aux(inStr):
|
|
856
|
+
s1 = inStr.replace("&", "&")
|
|
857
|
+
s1 = s1.replace("<", "<")
|
|
858
|
+
s1 = s1.replace(">", ">")
|
|
859
|
+
return s1
|
|
860
|
+
|
|
861
|
+
|
|
862
|
+
def quote_attrib(inStr):
|
|
863
|
+
s1 = isinstance(inStr, BaseStrType_) and inStr or "%s" % inStr
|
|
864
|
+
s1 = s1.replace("&", "&")
|
|
865
|
+
s1 = s1.replace("<", "<")
|
|
866
|
+
s1 = s1.replace(">", ">")
|
|
867
|
+
s1 = s1.replace("\n", " ")
|
|
868
|
+
if '"' in s1:
|
|
869
|
+
if "'" in s1:
|
|
870
|
+
s1 = '"%s"' % s1.replace('"', """)
|
|
871
|
+
else:
|
|
872
|
+
s1 = "'%s'" % s1
|
|
873
|
+
else:
|
|
874
|
+
s1 = '"%s"' % s1
|
|
875
|
+
return s1
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
def quote_python(inStr):
|
|
879
|
+
s1 = inStr
|
|
880
|
+
if s1.find("'") == -1:
|
|
881
|
+
if s1.find("\n") == -1:
|
|
882
|
+
return "'%s'" % s1
|
|
883
|
+
else:
|
|
884
|
+
return "'''%s'''" % s1
|
|
885
|
+
else:
|
|
886
|
+
if s1.find('"') != -1:
|
|
887
|
+
s1 = s1.replace('"', '\\"')
|
|
888
|
+
if s1.find("\n") == -1:
|
|
889
|
+
return '"%s"' % s1
|
|
890
|
+
else:
|
|
891
|
+
return '"""%s"""' % s1
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
def get_all_text_(node):
|
|
895
|
+
if node.text is not None:
|
|
896
|
+
text = node.text
|
|
897
|
+
else:
|
|
898
|
+
text = ""
|
|
899
|
+
for child in node:
|
|
900
|
+
if child.tail is not None:
|
|
901
|
+
text += child.tail
|
|
902
|
+
return text
|
|
903
|
+
|
|
904
|
+
|
|
905
|
+
def find_attr_value_(attr_name, node):
|
|
906
|
+
attrs = node.attrib
|
|
907
|
+
attr_parts = attr_name.split(":")
|
|
908
|
+
value = None
|
|
909
|
+
if len(attr_parts) == 1:
|
|
910
|
+
value = attrs.get(attr_name)
|
|
911
|
+
elif len(attr_parts) == 2:
|
|
912
|
+
prefix, name = attr_parts
|
|
913
|
+
if prefix == "xml":
|
|
914
|
+
namespace = "http://www.w3.org/XML/1998/namespace"
|
|
915
|
+
else:
|
|
916
|
+
namespace = node.nsmap.get(prefix)
|
|
917
|
+
if namespace is not None:
|
|
918
|
+
value = attrs.get(
|
|
919
|
+
"{%s}%s"
|
|
920
|
+
% (
|
|
921
|
+
namespace,
|
|
922
|
+
name,
|
|
923
|
+
)
|
|
924
|
+
)
|
|
925
|
+
return value
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
def encode_str_2_3(instr):
|
|
929
|
+
return instr
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
class GDSParseError(Exception):
|
|
933
|
+
pass
|
|
934
|
+
|
|
935
|
+
|
|
936
|
+
def raise_parse_error(node, msg):
|
|
937
|
+
if node is not None:
|
|
938
|
+
msg = "%s (element %s/line %d)" % (
|
|
939
|
+
msg,
|
|
940
|
+
node.tag,
|
|
941
|
+
node.sourceline,
|
|
942
|
+
)
|
|
943
|
+
raise GDSParseError(msg)
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
class MixedContainer:
|
|
947
|
+
# Constants for category:
|
|
948
|
+
CategoryNone = 0
|
|
949
|
+
CategoryText = 1
|
|
950
|
+
CategorySimple = 2
|
|
951
|
+
CategoryComplex = 3
|
|
952
|
+
# Constants for content_type:
|
|
953
|
+
TypeNone = 0
|
|
954
|
+
TypeText = 1
|
|
955
|
+
TypeString = 2
|
|
956
|
+
TypeInteger = 3
|
|
957
|
+
TypeFloat = 4
|
|
958
|
+
TypeDecimal = 5
|
|
959
|
+
TypeDouble = 6
|
|
960
|
+
TypeBoolean = 7
|
|
961
|
+
TypeBase64 = 8
|
|
962
|
+
|
|
963
|
+
def __init__(self, category, content_type, name, value):
|
|
964
|
+
self.category = category
|
|
965
|
+
self.content_type = content_type
|
|
966
|
+
self.name = name
|
|
967
|
+
self.value = value
|
|
968
|
+
|
|
969
|
+
def getCategory(self):
|
|
970
|
+
return self.category
|
|
971
|
+
|
|
972
|
+
def getContenttype(self, content_type):
|
|
973
|
+
return self.content_type
|
|
974
|
+
|
|
975
|
+
def getValue(self):
|
|
976
|
+
return self.value
|
|
977
|
+
|
|
978
|
+
def getName(self):
|
|
979
|
+
return self.name
|
|
980
|
+
|
|
981
|
+
def export(self, outfile, level, name, namespace, pretty_print=True):
|
|
982
|
+
if self.category == MixedContainer.CategoryText:
|
|
983
|
+
# Prevent exporting empty content as empty lines.
|
|
984
|
+
if self.value.strip():
|
|
985
|
+
outfile.write(self.value)
|
|
986
|
+
elif self.category == MixedContainer.CategorySimple:
|
|
987
|
+
self.exportSimple(outfile, level, name)
|
|
988
|
+
else: # category == MixedContainer.CategoryComplex
|
|
989
|
+
self.value.export(
|
|
990
|
+
outfile, level, namespace, name_=name, pretty_print=pretty_print
|
|
991
|
+
)
|
|
992
|
+
|
|
993
|
+
def exportSimple(self, outfile, level, name):
|
|
994
|
+
if self.content_type == MixedContainer.TypeString:
|
|
995
|
+
outfile.write("<%s>%s</%s>" % (self.name, self.value, self.name))
|
|
996
|
+
elif (
|
|
997
|
+
self.content_type == MixedContainer.TypeInteger
|
|
998
|
+
or self.content_type == MixedContainer.TypeBoolean
|
|
999
|
+
):
|
|
1000
|
+
outfile.write("<%s>%d</%s>" % (self.name, self.value, self.name))
|
|
1001
|
+
elif (
|
|
1002
|
+
self.content_type == MixedContainer.TypeFloat
|
|
1003
|
+
or self.content_type == MixedContainer.TypeDecimal
|
|
1004
|
+
):
|
|
1005
|
+
outfile.write("<%s>%f</%s>" % (self.name, self.value, self.name))
|
|
1006
|
+
elif self.content_type == MixedContainer.TypeDouble:
|
|
1007
|
+
outfile.write("<%s>%g</%s>" % (self.name, self.value, self.name))
|
|
1008
|
+
elif self.content_type == MixedContainer.TypeBase64:
|
|
1009
|
+
outfile.write(
|
|
1010
|
+
"<%s>%s</%s>" % (self.name, base64.b64encode(self.value), self.name)
|
|
1011
|
+
)
|
|
1012
|
+
|
|
1013
|
+
def to_etree(self, element, mapping_=None, reverse_mapping_=None, nsmap_=None):
|
|
1014
|
+
if self.category == MixedContainer.CategoryText:
|
|
1015
|
+
# Prevent exporting empty content as empty lines.
|
|
1016
|
+
if self.value.strip():
|
|
1017
|
+
if len(element) > 0:
|
|
1018
|
+
if element[-1].tail is None:
|
|
1019
|
+
element[-1].tail = self.value
|
|
1020
|
+
else:
|
|
1021
|
+
element[-1].tail += self.value
|
|
1022
|
+
else:
|
|
1023
|
+
if element.text is None:
|
|
1024
|
+
element.text = self.value
|
|
1025
|
+
else:
|
|
1026
|
+
element.text += self.value
|
|
1027
|
+
elif self.category == MixedContainer.CategorySimple:
|
|
1028
|
+
subelement = etree_.SubElement(element, "%s" % self.name)
|
|
1029
|
+
subelement.text = self.to_etree_simple()
|
|
1030
|
+
else: # category == MixedContainer.CategoryComplex
|
|
1031
|
+
self.value.to_etree(element)
|
|
1032
|
+
|
|
1033
|
+
def to_etree_simple(self, mapping_=None, reverse_mapping_=None, nsmap_=None):
|
|
1034
|
+
if self.content_type == MixedContainer.TypeString:
|
|
1035
|
+
text = self.value
|
|
1036
|
+
elif (
|
|
1037
|
+
self.content_type == MixedContainer.TypeInteger
|
|
1038
|
+
or self.content_type == MixedContainer.TypeBoolean
|
|
1039
|
+
):
|
|
1040
|
+
text = "%d" % self.value
|
|
1041
|
+
elif (
|
|
1042
|
+
self.content_type == MixedContainer.TypeFloat
|
|
1043
|
+
or self.content_type == MixedContainer.TypeDecimal
|
|
1044
|
+
):
|
|
1045
|
+
text = "%f" % self.value
|
|
1046
|
+
elif self.content_type == MixedContainer.TypeDouble:
|
|
1047
|
+
text = "%g" % self.value
|
|
1048
|
+
elif self.content_type == MixedContainer.TypeBase64:
|
|
1049
|
+
text = "%s" % base64.b64encode(self.value)
|
|
1050
|
+
return text
|
|
1051
|
+
|
|
1052
|
+
def exportLiteral(self, outfile, level, name):
|
|
1053
|
+
if self.category == MixedContainer.CategoryText:
|
|
1054
|
+
showIndent(outfile, level)
|
|
1055
|
+
outfile.write(
|
|
1056
|
+
'model_.MixedContainer(%d, %d, "%s", "%s"),\n'
|
|
1057
|
+
% (self.category, self.content_type, self.name, self.value)
|
|
1058
|
+
)
|
|
1059
|
+
elif self.category == MixedContainer.CategorySimple:
|
|
1060
|
+
showIndent(outfile, level)
|
|
1061
|
+
outfile.write(
|
|
1062
|
+
'model_.MixedContainer(%d, %d, "%s", "%s"),\n'
|
|
1063
|
+
% (self.category, self.content_type, self.name, self.value)
|
|
1064
|
+
)
|
|
1065
|
+
else: # category == MixedContainer.CategoryComplex
|
|
1066
|
+
showIndent(outfile, level)
|
|
1067
|
+
outfile.write(
|
|
1068
|
+
'model_.MixedContainer(%d, %d, "%s",\n'
|
|
1069
|
+
% (
|
|
1070
|
+
self.category,
|
|
1071
|
+
self.content_type,
|
|
1072
|
+
self.name,
|
|
1073
|
+
)
|
|
1074
|
+
)
|
|
1075
|
+
self.value.exportLiteral(outfile, level + 1)
|
|
1076
|
+
showIndent(outfile, level)
|
|
1077
|
+
outfile.write(")\n")
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
class MemberSpec_(object):
|
|
1081
|
+
def __init__(
|
|
1082
|
+
self,
|
|
1083
|
+
name="",
|
|
1084
|
+
data_type="",
|
|
1085
|
+
container=0,
|
|
1086
|
+
optional=0,
|
|
1087
|
+
child_attrs=None,
|
|
1088
|
+
choice=None,
|
|
1089
|
+
):
|
|
1090
|
+
self.name = name
|
|
1091
|
+
self.data_type = data_type
|
|
1092
|
+
self.container = container
|
|
1093
|
+
self.child_attrs = child_attrs
|
|
1094
|
+
self.choice = choice
|
|
1095
|
+
self.optional = optional
|
|
1096
|
+
|
|
1097
|
+
def set_name(self, name):
|
|
1098
|
+
self.name = name
|
|
1099
|
+
|
|
1100
|
+
def get_name(self):
|
|
1101
|
+
return self.name
|
|
1102
|
+
|
|
1103
|
+
def set_data_type(self, data_type):
|
|
1104
|
+
self.data_type = data_type
|
|
1105
|
+
|
|
1106
|
+
def get_data_type_chain(self):
|
|
1107
|
+
return self.data_type
|
|
1108
|
+
|
|
1109
|
+
def get_data_type(self):
|
|
1110
|
+
if isinstance(self.data_type, list):
|
|
1111
|
+
if len(self.data_type) > 0:
|
|
1112
|
+
return self.data_type[-1]
|
|
1113
|
+
else:
|
|
1114
|
+
return "xs:string"
|
|
1115
|
+
else:
|
|
1116
|
+
return self.data_type
|
|
1117
|
+
|
|
1118
|
+
def set_container(self, container):
|
|
1119
|
+
self.container = container
|
|
1120
|
+
|
|
1121
|
+
def get_container(self):
|
|
1122
|
+
return self.container
|
|
1123
|
+
|
|
1124
|
+
def set_child_attrs(self, child_attrs):
|
|
1125
|
+
self.child_attrs = child_attrs
|
|
1126
|
+
|
|
1127
|
+
def get_child_attrs(self):
|
|
1128
|
+
return self.child_attrs
|
|
1129
|
+
|
|
1130
|
+
def set_choice(self, choice):
|
|
1131
|
+
self.choice = choice
|
|
1132
|
+
|
|
1133
|
+
def get_choice(self):
|
|
1134
|
+
return self.choice
|
|
1135
|
+
|
|
1136
|
+
def set_optional(self, optional):
|
|
1137
|
+
self.optional = optional
|
|
1138
|
+
|
|
1139
|
+
def get_optional(self):
|
|
1140
|
+
return self.optional
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
def _cast(typ, value):
|
|
1144
|
+
if typ is None or value is None:
|
|
1145
|
+
return value
|
|
1146
|
+
return typ(value)
|
|
1147
|
+
|
|
1148
|
+
|
|
1149
|
+
#
|
|
1150
|
+
# Data representation classes.
|
|
1151
|
+
#
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
class Freightcom(GeneratedsSuper):
|
|
1155
|
+
__hash__ = GeneratedsSuper.__hash__
|
|
1156
|
+
subclass = None
|
|
1157
|
+
superclass = None
|
|
1158
|
+
|
|
1159
|
+
def __init__(
|
|
1160
|
+
self,
|
|
1161
|
+
username=None,
|
|
1162
|
+
password=None,
|
|
1163
|
+
version=None,
|
|
1164
|
+
QuoteRequest=None,
|
|
1165
|
+
gds_collector_=None,
|
|
1166
|
+
**kwargs_
|
|
1167
|
+
):
|
|
1168
|
+
self.gds_collector_ = gds_collector_
|
|
1169
|
+
self.gds_elementtree_node_ = None
|
|
1170
|
+
self.original_tagname_ = None
|
|
1171
|
+
self.parent_object_ = kwargs_.get("parent_object_")
|
|
1172
|
+
self.ns_prefix_ = None
|
|
1173
|
+
self.username = _cast(None, username)
|
|
1174
|
+
self.username_nsprefix_ = None
|
|
1175
|
+
self.password = _cast(None, password)
|
|
1176
|
+
self.password_nsprefix_ = None
|
|
1177
|
+
self.version = _cast(None, version)
|
|
1178
|
+
self.version_nsprefix_ = None
|
|
1179
|
+
self.QuoteRequest = QuoteRequest
|
|
1180
|
+
self.QuoteRequest_nsprefix_ = None
|
|
1181
|
+
|
|
1182
|
+
def factory(*args_, **kwargs_):
|
|
1183
|
+
if CurrentSubclassModule_ is not None:
|
|
1184
|
+
subclass = getSubclassFromModule_(CurrentSubclassModule_, Freightcom)
|
|
1185
|
+
if subclass is not None:
|
|
1186
|
+
return subclass(*args_, **kwargs_)
|
|
1187
|
+
if Freightcom.subclass:
|
|
1188
|
+
return Freightcom.subclass(*args_, **kwargs_)
|
|
1189
|
+
else:
|
|
1190
|
+
return Freightcom(*args_, **kwargs_)
|
|
1191
|
+
|
|
1192
|
+
factory = staticmethod(factory)
|
|
1193
|
+
|
|
1194
|
+
def get_ns_prefix_(self):
|
|
1195
|
+
return self.ns_prefix_
|
|
1196
|
+
|
|
1197
|
+
def set_ns_prefix_(self, ns_prefix):
|
|
1198
|
+
self.ns_prefix_ = ns_prefix
|
|
1199
|
+
|
|
1200
|
+
def get_QuoteRequest(self):
|
|
1201
|
+
return self.QuoteRequest
|
|
1202
|
+
|
|
1203
|
+
def set_QuoteRequest(self, QuoteRequest):
|
|
1204
|
+
self.QuoteRequest = QuoteRequest
|
|
1205
|
+
|
|
1206
|
+
def get_username(self):
|
|
1207
|
+
return self.username
|
|
1208
|
+
|
|
1209
|
+
def set_username(self, username):
|
|
1210
|
+
self.username = username
|
|
1211
|
+
|
|
1212
|
+
def get_password(self):
|
|
1213
|
+
return self.password
|
|
1214
|
+
|
|
1215
|
+
def set_password(self, password):
|
|
1216
|
+
self.password = password
|
|
1217
|
+
|
|
1218
|
+
def get_version(self):
|
|
1219
|
+
return self.version
|
|
1220
|
+
|
|
1221
|
+
def set_version(self, version):
|
|
1222
|
+
self.version = version
|
|
1223
|
+
|
|
1224
|
+
def _hasContent(self):
|
|
1225
|
+
if self.QuoteRequest is not None:
|
|
1226
|
+
return True
|
|
1227
|
+
else:
|
|
1228
|
+
return False
|
|
1229
|
+
|
|
1230
|
+
def export(
|
|
1231
|
+
self,
|
|
1232
|
+
outfile,
|
|
1233
|
+
level,
|
|
1234
|
+
namespaceprefix_="",
|
|
1235
|
+
namespacedef_="",
|
|
1236
|
+
name_="Freightcom",
|
|
1237
|
+
pretty_print=True,
|
|
1238
|
+
):
|
|
1239
|
+
imported_ns_def_ = GenerateDSNamespaceDefs_.get("Freightcom")
|
|
1240
|
+
if imported_ns_def_ is not None:
|
|
1241
|
+
namespacedef_ = imported_ns_def_
|
|
1242
|
+
if pretty_print:
|
|
1243
|
+
eol_ = "\n"
|
|
1244
|
+
else:
|
|
1245
|
+
eol_ = ""
|
|
1246
|
+
if self.original_tagname_ is not None and name_ == "Freightcom":
|
|
1247
|
+
name_ = self.original_tagname_
|
|
1248
|
+
if UseCapturedNS_ and self.ns_prefix_:
|
|
1249
|
+
namespaceprefix_ = self.ns_prefix_ + ":"
|
|
1250
|
+
showIndent(outfile, level, pretty_print)
|
|
1251
|
+
outfile.write(
|
|
1252
|
+
"<%s%s%s"
|
|
1253
|
+
% (
|
|
1254
|
+
namespaceprefix_,
|
|
1255
|
+
name_,
|
|
1256
|
+
namespacedef_ and " " + namespacedef_ or "",
|
|
1257
|
+
)
|
|
1258
|
+
)
|
|
1259
|
+
already_processed = set()
|
|
1260
|
+
self._exportAttributes(
|
|
1261
|
+
outfile, level, already_processed, namespaceprefix_, name_="Freightcom"
|
|
1262
|
+
)
|
|
1263
|
+
if self._hasContent():
|
|
1264
|
+
outfile.write(">%s" % (eol_,))
|
|
1265
|
+
self._exportChildren(
|
|
1266
|
+
outfile,
|
|
1267
|
+
level + 1,
|
|
1268
|
+
namespaceprefix_,
|
|
1269
|
+
namespacedef_,
|
|
1270
|
+
name_="Freightcom",
|
|
1271
|
+
pretty_print=pretty_print,
|
|
1272
|
+
)
|
|
1273
|
+
showIndent(outfile, level, pretty_print)
|
|
1274
|
+
outfile.write("</%s%s>%s" % (namespaceprefix_, name_, eol_))
|
|
1275
|
+
else:
|
|
1276
|
+
outfile.write("/>%s" % (eol_,))
|
|
1277
|
+
|
|
1278
|
+
def _exportAttributes(
|
|
1279
|
+
self, outfile, level, already_processed, namespaceprefix_="", name_="Freightcom"
|
|
1280
|
+
):
|
|
1281
|
+
if self.username is not None and "username" not in already_processed:
|
|
1282
|
+
already_processed.add("username")
|
|
1283
|
+
outfile.write(
|
|
1284
|
+
" username=%s"
|
|
1285
|
+
% (
|
|
1286
|
+
self.gds_encode(
|
|
1287
|
+
self.gds_format_string(
|
|
1288
|
+
quote_attrib(self.username), input_name="username"
|
|
1289
|
+
)
|
|
1290
|
+
),
|
|
1291
|
+
)
|
|
1292
|
+
)
|
|
1293
|
+
if self.password is not None and "password" not in already_processed:
|
|
1294
|
+
already_processed.add("password")
|
|
1295
|
+
outfile.write(
|
|
1296
|
+
" password=%s"
|
|
1297
|
+
% (
|
|
1298
|
+
self.gds_encode(
|
|
1299
|
+
self.gds_format_string(
|
|
1300
|
+
quote_attrib(self.password), input_name="password"
|
|
1301
|
+
)
|
|
1302
|
+
),
|
|
1303
|
+
)
|
|
1304
|
+
)
|
|
1305
|
+
if self.version is not None and "version" not in already_processed:
|
|
1306
|
+
already_processed.add("version")
|
|
1307
|
+
outfile.write(
|
|
1308
|
+
" version=%s"
|
|
1309
|
+
% (
|
|
1310
|
+
self.gds_encode(
|
|
1311
|
+
self.gds_format_string(
|
|
1312
|
+
quote_attrib(self.version), input_name="version"
|
|
1313
|
+
)
|
|
1314
|
+
),
|
|
1315
|
+
)
|
|
1316
|
+
)
|
|
1317
|
+
|
|
1318
|
+
def _exportChildren(
|
|
1319
|
+
self,
|
|
1320
|
+
outfile,
|
|
1321
|
+
level,
|
|
1322
|
+
namespaceprefix_="",
|
|
1323
|
+
namespacedef_="",
|
|
1324
|
+
name_="Freightcom",
|
|
1325
|
+
fromsubclass_=False,
|
|
1326
|
+
pretty_print=True,
|
|
1327
|
+
):
|
|
1328
|
+
if pretty_print:
|
|
1329
|
+
eol_ = "\n"
|
|
1330
|
+
else:
|
|
1331
|
+
eol_ = ""
|
|
1332
|
+
if self.QuoteRequest is not None:
|
|
1333
|
+
namespaceprefix_ = (
|
|
1334
|
+
self.QuoteRequest_nsprefix_ + ":"
|
|
1335
|
+
if (UseCapturedNS_ and self.QuoteRequest_nsprefix_)
|
|
1336
|
+
else ""
|
|
1337
|
+
)
|
|
1338
|
+
self.QuoteRequest.export(
|
|
1339
|
+
outfile,
|
|
1340
|
+
level,
|
|
1341
|
+
namespaceprefix_,
|
|
1342
|
+
namespacedef_="",
|
|
1343
|
+
name_="QuoteRequest",
|
|
1344
|
+
pretty_print=pretty_print,
|
|
1345
|
+
)
|
|
1346
|
+
|
|
1347
|
+
def build(self, node, gds_collector_=None):
|
|
1348
|
+
self.gds_collector_ = gds_collector_
|
|
1349
|
+
if SaveElementTreeNode:
|
|
1350
|
+
self.gds_elementtree_node_ = node
|
|
1351
|
+
already_processed = set()
|
|
1352
|
+
self.ns_prefix_ = node.prefix
|
|
1353
|
+
self._buildAttributes(node, node.attrib, already_processed)
|
|
1354
|
+
for child in node:
|
|
1355
|
+
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
|
|
1356
|
+
self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
|
|
1357
|
+
return self
|
|
1358
|
+
|
|
1359
|
+
def _buildAttributes(self, node, attrs, already_processed):
|
|
1360
|
+
value = find_attr_value_("username", node)
|
|
1361
|
+
if value is not None and "username" not in already_processed:
|
|
1362
|
+
already_processed.add("username")
|
|
1363
|
+
self.username = value
|
|
1364
|
+
value = find_attr_value_("password", node)
|
|
1365
|
+
if value is not None and "password" not in already_processed:
|
|
1366
|
+
already_processed.add("password")
|
|
1367
|
+
self.password = value
|
|
1368
|
+
value = find_attr_value_("version", node)
|
|
1369
|
+
if value is not None and "version" not in already_processed:
|
|
1370
|
+
already_processed.add("version")
|
|
1371
|
+
self.version = value
|
|
1372
|
+
|
|
1373
|
+
def _buildChildren(
|
|
1374
|
+
self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None
|
|
1375
|
+
):
|
|
1376
|
+
if nodeName_ == "QuoteRequest":
|
|
1377
|
+
obj_ = QuoteRequestType.factory(parent_object_=self)
|
|
1378
|
+
obj_.build(child_, gds_collector_=gds_collector_)
|
|
1379
|
+
self.QuoteRequest = obj_
|
|
1380
|
+
obj_.original_tagname_ = "QuoteRequest"
|
|
1381
|
+
|
|
1382
|
+
|
|
1383
|
+
# end class Freightcom
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+
class QuoteRequestType(GeneratedsSuper):
|
|
1387
|
+
__hash__ = GeneratedsSuper.__hash__
|
|
1388
|
+
subclass = None
|
|
1389
|
+
superclass = None
|
|
1390
|
+
|
|
1391
|
+
def __init__(
|
|
1392
|
+
self,
|
|
1393
|
+
saturdayPickupRequired=None,
|
|
1394
|
+
homelandSecurity=None,
|
|
1395
|
+
pierCharge=None,
|
|
1396
|
+
exhibitionConventionSite=None,
|
|
1397
|
+
militaryBaseDelivery=None,
|
|
1398
|
+
customsIn_bondFreight=None,
|
|
1399
|
+
limitedAccess=None,
|
|
1400
|
+
excessLength=None,
|
|
1401
|
+
tailgatePickup=None,
|
|
1402
|
+
residentialPickup=None,
|
|
1403
|
+
crossBorderFee=None,
|
|
1404
|
+
notifyRecipient=None,
|
|
1405
|
+
singleShipment=None,
|
|
1406
|
+
tailgateDelivery=None,
|
|
1407
|
+
residentialDelivery=None,
|
|
1408
|
+
insuranceType=None,
|
|
1409
|
+
scheduledShipDate=None,
|
|
1410
|
+
insideDelivery=None,
|
|
1411
|
+
isSaturdayService=None,
|
|
1412
|
+
dangerousGoodsType=None,
|
|
1413
|
+
serviceId=None,
|
|
1414
|
+
stackable=None,
|
|
1415
|
+
From=None,
|
|
1416
|
+
To=None,
|
|
1417
|
+
COD=None,
|
|
1418
|
+
Packages=None,
|
|
1419
|
+
gds_collector_=None,
|
|
1420
|
+
**kwargs_
|
|
1421
|
+
):
|
|
1422
|
+
self.gds_collector_ = gds_collector_
|
|
1423
|
+
self.gds_elementtree_node_ = None
|
|
1424
|
+
self.original_tagname_ = None
|
|
1425
|
+
self.parent_object_ = kwargs_.get("parent_object_")
|
|
1426
|
+
self.ns_prefix_ = None
|
|
1427
|
+
self.saturdayPickupRequired = _cast(None, saturdayPickupRequired)
|
|
1428
|
+
self.saturdayPickupRequired_nsprefix_ = None
|
|
1429
|
+
self.homelandSecurity = _cast(None, homelandSecurity)
|
|
1430
|
+
self.homelandSecurity_nsprefix_ = None
|
|
1431
|
+
self.pierCharge = _cast(None, pierCharge)
|
|
1432
|
+
self.pierCharge_nsprefix_ = None
|
|
1433
|
+
self.exhibitionConventionSite = _cast(None, exhibitionConventionSite)
|
|
1434
|
+
self.exhibitionConventionSite_nsprefix_ = None
|
|
1435
|
+
self.militaryBaseDelivery = _cast(None, militaryBaseDelivery)
|
|
1436
|
+
self.militaryBaseDelivery_nsprefix_ = None
|
|
1437
|
+
self.customsIn_bondFreight = _cast(None, customsIn_bondFreight)
|
|
1438
|
+
self.customsIn_bondFreight_nsprefix_ = None
|
|
1439
|
+
self.limitedAccess = _cast(None, limitedAccess)
|
|
1440
|
+
self.limitedAccess_nsprefix_ = None
|
|
1441
|
+
self.excessLength = _cast(None, excessLength)
|
|
1442
|
+
self.excessLength_nsprefix_ = None
|
|
1443
|
+
self.tailgatePickup = _cast(None, tailgatePickup)
|
|
1444
|
+
self.tailgatePickup_nsprefix_ = None
|
|
1445
|
+
self.residentialPickup = _cast(None, residentialPickup)
|
|
1446
|
+
self.residentialPickup_nsprefix_ = None
|
|
1447
|
+
self.crossBorderFee = _cast(None, crossBorderFee)
|
|
1448
|
+
self.crossBorderFee_nsprefix_ = None
|
|
1449
|
+
self.notifyRecipient = _cast(None, notifyRecipient)
|
|
1450
|
+
self.notifyRecipient_nsprefix_ = None
|
|
1451
|
+
self.singleShipment = _cast(None, singleShipment)
|
|
1452
|
+
self.singleShipment_nsprefix_ = None
|
|
1453
|
+
self.tailgateDelivery = _cast(None, tailgateDelivery)
|
|
1454
|
+
self.tailgateDelivery_nsprefix_ = None
|
|
1455
|
+
self.residentialDelivery = _cast(None, residentialDelivery)
|
|
1456
|
+
self.residentialDelivery_nsprefix_ = None
|
|
1457
|
+
self.insuranceType = _cast(None, insuranceType)
|
|
1458
|
+
self.insuranceType_nsprefix_ = None
|
|
1459
|
+
self.scheduledShipDate = _cast(None, scheduledShipDate)
|
|
1460
|
+
self.scheduledShipDate_nsprefix_ = None
|
|
1461
|
+
self.insideDelivery = _cast(None, insideDelivery)
|
|
1462
|
+
self.insideDelivery_nsprefix_ = None
|
|
1463
|
+
self.isSaturdayService = _cast(None, isSaturdayService)
|
|
1464
|
+
self.isSaturdayService_nsprefix_ = None
|
|
1465
|
+
self.dangerousGoodsType = _cast(None, dangerousGoodsType)
|
|
1466
|
+
self.dangerousGoodsType_nsprefix_ = None
|
|
1467
|
+
self.serviceId = _cast(int, serviceId)
|
|
1468
|
+
self.serviceId_nsprefix_ = None
|
|
1469
|
+
self.stackable = _cast(None, stackable)
|
|
1470
|
+
self.stackable_nsprefix_ = None
|
|
1471
|
+
self.From = From
|
|
1472
|
+
self.From_nsprefix_ = None
|
|
1473
|
+
self.To = To
|
|
1474
|
+
self.To_nsprefix_ = None
|
|
1475
|
+
self.COD = COD
|
|
1476
|
+
self.COD_nsprefix_ = None
|
|
1477
|
+
self.Packages = Packages
|
|
1478
|
+
self.Packages_nsprefix_ = None
|
|
1479
|
+
|
|
1480
|
+
def factory(*args_, **kwargs_):
|
|
1481
|
+
if CurrentSubclassModule_ is not None:
|
|
1482
|
+
subclass = getSubclassFromModule_(CurrentSubclassModule_, QuoteRequestType)
|
|
1483
|
+
if subclass is not None:
|
|
1484
|
+
return subclass(*args_, **kwargs_)
|
|
1485
|
+
if QuoteRequestType.subclass:
|
|
1486
|
+
return QuoteRequestType.subclass(*args_, **kwargs_)
|
|
1487
|
+
else:
|
|
1488
|
+
return QuoteRequestType(*args_, **kwargs_)
|
|
1489
|
+
|
|
1490
|
+
factory = staticmethod(factory)
|
|
1491
|
+
|
|
1492
|
+
def get_ns_prefix_(self):
|
|
1493
|
+
return self.ns_prefix_
|
|
1494
|
+
|
|
1495
|
+
def set_ns_prefix_(self, ns_prefix):
|
|
1496
|
+
self.ns_prefix_ = ns_prefix
|
|
1497
|
+
|
|
1498
|
+
def get_From(self):
|
|
1499
|
+
return self.From
|
|
1500
|
+
|
|
1501
|
+
def set_From(self, From):
|
|
1502
|
+
self.From = From
|
|
1503
|
+
|
|
1504
|
+
def get_To(self):
|
|
1505
|
+
return self.To
|
|
1506
|
+
|
|
1507
|
+
def set_To(self, To):
|
|
1508
|
+
self.To = To
|
|
1509
|
+
|
|
1510
|
+
def get_COD(self):
|
|
1511
|
+
return self.COD
|
|
1512
|
+
|
|
1513
|
+
def set_COD(self, COD):
|
|
1514
|
+
self.COD = COD
|
|
1515
|
+
|
|
1516
|
+
def get_Packages(self):
|
|
1517
|
+
return self.Packages
|
|
1518
|
+
|
|
1519
|
+
def set_Packages(self, Packages):
|
|
1520
|
+
self.Packages = Packages
|
|
1521
|
+
|
|
1522
|
+
def get_saturdayPickupRequired(self):
|
|
1523
|
+
return self.saturdayPickupRequired
|
|
1524
|
+
|
|
1525
|
+
def set_saturdayPickupRequired(self, saturdayPickupRequired):
|
|
1526
|
+
self.saturdayPickupRequired = saturdayPickupRequired
|
|
1527
|
+
|
|
1528
|
+
def get_homelandSecurity(self):
|
|
1529
|
+
return self.homelandSecurity
|
|
1530
|
+
|
|
1531
|
+
def set_homelandSecurity(self, homelandSecurity):
|
|
1532
|
+
self.homelandSecurity = homelandSecurity
|
|
1533
|
+
|
|
1534
|
+
def get_pierCharge(self):
|
|
1535
|
+
return self.pierCharge
|
|
1536
|
+
|
|
1537
|
+
def set_pierCharge(self, pierCharge):
|
|
1538
|
+
self.pierCharge = pierCharge
|
|
1539
|
+
|
|
1540
|
+
def get_exhibitionConventionSite(self):
|
|
1541
|
+
return self.exhibitionConventionSite
|
|
1542
|
+
|
|
1543
|
+
def set_exhibitionConventionSite(self, exhibitionConventionSite):
|
|
1544
|
+
self.exhibitionConventionSite = exhibitionConventionSite
|
|
1545
|
+
|
|
1546
|
+
def get_militaryBaseDelivery(self):
|
|
1547
|
+
return self.militaryBaseDelivery
|
|
1548
|
+
|
|
1549
|
+
def set_militaryBaseDelivery(self, militaryBaseDelivery):
|
|
1550
|
+
self.militaryBaseDelivery = militaryBaseDelivery
|
|
1551
|
+
|
|
1552
|
+
def get_customsIn_bondFreight(self):
|
|
1553
|
+
return self.customsIn_bondFreight
|
|
1554
|
+
|
|
1555
|
+
def set_customsIn_bondFreight(self, customsIn_bondFreight):
|
|
1556
|
+
self.customsIn_bondFreight = customsIn_bondFreight
|
|
1557
|
+
|
|
1558
|
+
def get_limitedAccess(self):
|
|
1559
|
+
return self.limitedAccess
|
|
1560
|
+
|
|
1561
|
+
def set_limitedAccess(self, limitedAccess):
|
|
1562
|
+
self.limitedAccess = limitedAccess
|
|
1563
|
+
|
|
1564
|
+
def get_excessLength(self):
|
|
1565
|
+
return self.excessLength
|
|
1566
|
+
|
|
1567
|
+
def set_excessLength(self, excessLength):
|
|
1568
|
+
self.excessLength = excessLength
|
|
1569
|
+
|
|
1570
|
+
def get_tailgatePickup(self):
|
|
1571
|
+
return self.tailgatePickup
|
|
1572
|
+
|
|
1573
|
+
def set_tailgatePickup(self, tailgatePickup):
|
|
1574
|
+
self.tailgatePickup = tailgatePickup
|
|
1575
|
+
|
|
1576
|
+
def get_residentialPickup(self):
|
|
1577
|
+
return self.residentialPickup
|
|
1578
|
+
|
|
1579
|
+
def set_residentialPickup(self, residentialPickup):
|
|
1580
|
+
self.residentialPickup = residentialPickup
|
|
1581
|
+
|
|
1582
|
+
def get_crossBorderFee(self):
|
|
1583
|
+
return self.crossBorderFee
|
|
1584
|
+
|
|
1585
|
+
def set_crossBorderFee(self, crossBorderFee):
|
|
1586
|
+
self.crossBorderFee = crossBorderFee
|
|
1587
|
+
|
|
1588
|
+
def get_notifyRecipient(self):
|
|
1589
|
+
return self.notifyRecipient
|
|
1590
|
+
|
|
1591
|
+
def set_notifyRecipient(self, notifyRecipient):
|
|
1592
|
+
self.notifyRecipient = notifyRecipient
|
|
1593
|
+
|
|
1594
|
+
def get_singleShipment(self):
|
|
1595
|
+
return self.singleShipment
|
|
1596
|
+
|
|
1597
|
+
def set_singleShipment(self, singleShipment):
|
|
1598
|
+
self.singleShipment = singleShipment
|
|
1599
|
+
|
|
1600
|
+
def get_tailgateDelivery(self):
|
|
1601
|
+
return self.tailgateDelivery
|
|
1602
|
+
|
|
1603
|
+
def set_tailgateDelivery(self, tailgateDelivery):
|
|
1604
|
+
self.tailgateDelivery = tailgateDelivery
|
|
1605
|
+
|
|
1606
|
+
def get_residentialDelivery(self):
|
|
1607
|
+
return self.residentialDelivery
|
|
1608
|
+
|
|
1609
|
+
def set_residentialDelivery(self, residentialDelivery):
|
|
1610
|
+
self.residentialDelivery = residentialDelivery
|
|
1611
|
+
|
|
1612
|
+
def get_insuranceType(self):
|
|
1613
|
+
return self.insuranceType
|
|
1614
|
+
|
|
1615
|
+
def set_insuranceType(self, insuranceType):
|
|
1616
|
+
self.insuranceType = insuranceType
|
|
1617
|
+
|
|
1618
|
+
def get_scheduledShipDate(self):
|
|
1619
|
+
return self.scheduledShipDate
|
|
1620
|
+
|
|
1621
|
+
def set_scheduledShipDate(self, scheduledShipDate):
|
|
1622
|
+
self.scheduledShipDate = scheduledShipDate
|
|
1623
|
+
|
|
1624
|
+
def get_insideDelivery(self):
|
|
1625
|
+
return self.insideDelivery
|
|
1626
|
+
|
|
1627
|
+
def set_insideDelivery(self, insideDelivery):
|
|
1628
|
+
self.insideDelivery = insideDelivery
|
|
1629
|
+
|
|
1630
|
+
def get_isSaturdayService(self):
|
|
1631
|
+
return self.isSaturdayService
|
|
1632
|
+
|
|
1633
|
+
def set_isSaturdayService(self, isSaturdayService):
|
|
1634
|
+
self.isSaturdayService = isSaturdayService
|
|
1635
|
+
|
|
1636
|
+
def get_dangerousGoodsType(self):
|
|
1637
|
+
return self.dangerousGoodsType
|
|
1638
|
+
|
|
1639
|
+
def set_dangerousGoodsType(self, dangerousGoodsType):
|
|
1640
|
+
self.dangerousGoodsType = dangerousGoodsType
|
|
1641
|
+
|
|
1642
|
+
def get_serviceId(self):
|
|
1643
|
+
return self.serviceId
|
|
1644
|
+
|
|
1645
|
+
def set_serviceId(self, serviceId):
|
|
1646
|
+
self.serviceId = serviceId
|
|
1647
|
+
|
|
1648
|
+
def get_stackable(self):
|
|
1649
|
+
return self.stackable
|
|
1650
|
+
|
|
1651
|
+
def set_stackable(self, stackable):
|
|
1652
|
+
self.stackable = stackable
|
|
1653
|
+
|
|
1654
|
+
def _hasContent(self):
|
|
1655
|
+
if (
|
|
1656
|
+
self.From is not None
|
|
1657
|
+
or self.To is not None
|
|
1658
|
+
or self.COD is not None
|
|
1659
|
+
or self.Packages is not None
|
|
1660
|
+
):
|
|
1661
|
+
return True
|
|
1662
|
+
else:
|
|
1663
|
+
return False
|
|
1664
|
+
|
|
1665
|
+
def export(
|
|
1666
|
+
self,
|
|
1667
|
+
outfile,
|
|
1668
|
+
level,
|
|
1669
|
+
namespaceprefix_="",
|
|
1670
|
+
namespacedef_="",
|
|
1671
|
+
name_="QuoteRequestType",
|
|
1672
|
+
pretty_print=True,
|
|
1673
|
+
):
|
|
1674
|
+
imported_ns_def_ = GenerateDSNamespaceDefs_.get("QuoteRequestType")
|
|
1675
|
+
if imported_ns_def_ is not None:
|
|
1676
|
+
namespacedef_ = imported_ns_def_
|
|
1677
|
+
if pretty_print:
|
|
1678
|
+
eol_ = "\n"
|
|
1679
|
+
else:
|
|
1680
|
+
eol_ = ""
|
|
1681
|
+
if self.original_tagname_ is not None and name_ == "QuoteRequestType":
|
|
1682
|
+
name_ = self.original_tagname_
|
|
1683
|
+
if UseCapturedNS_ and self.ns_prefix_:
|
|
1684
|
+
namespaceprefix_ = self.ns_prefix_ + ":"
|
|
1685
|
+
showIndent(outfile, level, pretty_print)
|
|
1686
|
+
outfile.write(
|
|
1687
|
+
"<%s%s%s"
|
|
1688
|
+
% (
|
|
1689
|
+
namespaceprefix_,
|
|
1690
|
+
name_,
|
|
1691
|
+
namespacedef_ and " " + namespacedef_ or "",
|
|
1692
|
+
)
|
|
1693
|
+
)
|
|
1694
|
+
already_processed = set()
|
|
1695
|
+
self._exportAttributes(
|
|
1696
|
+
outfile,
|
|
1697
|
+
level,
|
|
1698
|
+
already_processed,
|
|
1699
|
+
namespaceprefix_,
|
|
1700
|
+
name_="QuoteRequestType",
|
|
1701
|
+
)
|
|
1702
|
+
if self._hasContent():
|
|
1703
|
+
outfile.write(">%s" % (eol_,))
|
|
1704
|
+
self._exportChildren(
|
|
1705
|
+
outfile,
|
|
1706
|
+
level + 1,
|
|
1707
|
+
namespaceprefix_,
|
|
1708
|
+
namespacedef_,
|
|
1709
|
+
name_="QuoteRequestType",
|
|
1710
|
+
pretty_print=pretty_print,
|
|
1711
|
+
)
|
|
1712
|
+
showIndent(outfile, level, pretty_print)
|
|
1713
|
+
outfile.write("</%s%s>%s" % (namespaceprefix_, name_, eol_))
|
|
1714
|
+
else:
|
|
1715
|
+
outfile.write("/>%s" % (eol_,))
|
|
1716
|
+
|
|
1717
|
+
def _exportAttributes(
|
|
1718
|
+
self,
|
|
1719
|
+
outfile,
|
|
1720
|
+
level,
|
|
1721
|
+
already_processed,
|
|
1722
|
+
namespaceprefix_="",
|
|
1723
|
+
name_="QuoteRequestType",
|
|
1724
|
+
):
|
|
1725
|
+
if (
|
|
1726
|
+
self.saturdayPickupRequired is not None
|
|
1727
|
+
and "saturdayPickupRequired" not in already_processed
|
|
1728
|
+
):
|
|
1729
|
+
already_processed.add("saturdayPickupRequired")
|
|
1730
|
+
outfile.write(
|
|
1731
|
+
" saturdayPickupRequired=%s"
|
|
1732
|
+
% (
|
|
1733
|
+
self.gds_encode(
|
|
1734
|
+
self.gds_format_string(
|
|
1735
|
+
quote_attrib(self.saturdayPickupRequired),
|
|
1736
|
+
input_name="saturdayPickupRequired",
|
|
1737
|
+
)
|
|
1738
|
+
),
|
|
1739
|
+
)
|
|
1740
|
+
)
|
|
1741
|
+
if (
|
|
1742
|
+
self.homelandSecurity is not None
|
|
1743
|
+
and "homelandSecurity" not in already_processed
|
|
1744
|
+
):
|
|
1745
|
+
already_processed.add("homelandSecurity")
|
|
1746
|
+
outfile.write(
|
|
1747
|
+
" homelandSecurity=%s"
|
|
1748
|
+
% (
|
|
1749
|
+
self.gds_encode(
|
|
1750
|
+
self.gds_format_string(
|
|
1751
|
+
quote_attrib(self.homelandSecurity),
|
|
1752
|
+
input_name="homelandSecurity",
|
|
1753
|
+
)
|
|
1754
|
+
),
|
|
1755
|
+
)
|
|
1756
|
+
)
|
|
1757
|
+
if self.pierCharge is not None and "pierCharge" not in already_processed:
|
|
1758
|
+
already_processed.add("pierCharge")
|
|
1759
|
+
outfile.write(
|
|
1760
|
+
" pierCharge=%s"
|
|
1761
|
+
% (
|
|
1762
|
+
self.gds_encode(
|
|
1763
|
+
self.gds_format_string(
|
|
1764
|
+
quote_attrib(self.pierCharge), input_name="pierCharge"
|
|
1765
|
+
)
|
|
1766
|
+
),
|
|
1767
|
+
)
|
|
1768
|
+
)
|
|
1769
|
+
if (
|
|
1770
|
+
self.exhibitionConventionSite is not None
|
|
1771
|
+
and "exhibitionConventionSite" not in already_processed
|
|
1772
|
+
):
|
|
1773
|
+
already_processed.add("exhibitionConventionSite")
|
|
1774
|
+
outfile.write(
|
|
1775
|
+
" exhibitionConventionSite=%s"
|
|
1776
|
+
% (
|
|
1777
|
+
self.gds_encode(
|
|
1778
|
+
self.gds_format_string(
|
|
1779
|
+
quote_attrib(self.exhibitionConventionSite),
|
|
1780
|
+
input_name="exhibitionConventionSite",
|
|
1781
|
+
)
|
|
1782
|
+
),
|
|
1783
|
+
)
|
|
1784
|
+
)
|
|
1785
|
+
if (
|
|
1786
|
+
self.militaryBaseDelivery is not None
|
|
1787
|
+
and "militaryBaseDelivery" not in already_processed
|
|
1788
|
+
):
|
|
1789
|
+
already_processed.add("militaryBaseDelivery")
|
|
1790
|
+
outfile.write(
|
|
1791
|
+
" militaryBaseDelivery=%s"
|
|
1792
|
+
% (
|
|
1793
|
+
self.gds_encode(
|
|
1794
|
+
self.gds_format_string(
|
|
1795
|
+
quote_attrib(self.militaryBaseDelivery),
|
|
1796
|
+
input_name="militaryBaseDelivery",
|
|
1797
|
+
)
|
|
1798
|
+
),
|
|
1799
|
+
)
|
|
1800
|
+
)
|
|
1801
|
+
if (
|
|
1802
|
+
self.customsIn_bondFreight is not None
|
|
1803
|
+
and "customsIn_bondFreight" not in already_processed
|
|
1804
|
+
):
|
|
1805
|
+
already_processed.add("customsIn_bondFreight")
|
|
1806
|
+
outfile.write(
|
|
1807
|
+
" customsIn-bondFreight=%s"
|
|
1808
|
+
% (
|
|
1809
|
+
self.gds_encode(
|
|
1810
|
+
self.gds_format_string(
|
|
1811
|
+
quote_attrib(self.customsIn_bondFreight),
|
|
1812
|
+
input_name="customsIn-bondFreight",
|
|
1813
|
+
)
|
|
1814
|
+
),
|
|
1815
|
+
)
|
|
1816
|
+
)
|
|
1817
|
+
if self.limitedAccess is not None and "limitedAccess" not in already_processed:
|
|
1818
|
+
already_processed.add("limitedAccess")
|
|
1819
|
+
outfile.write(
|
|
1820
|
+
" limitedAccess=%s"
|
|
1821
|
+
% (
|
|
1822
|
+
self.gds_encode(
|
|
1823
|
+
self.gds_format_string(
|
|
1824
|
+
quote_attrib(self.limitedAccess), input_name="limitedAccess"
|
|
1825
|
+
)
|
|
1826
|
+
),
|
|
1827
|
+
)
|
|
1828
|
+
)
|
|
1829
|
+
if self.excessLength is not None and "excessLength" not in already_processed:
|
|
1830
|
+
already_processed.add("excessLength")
|
|
1831
|
+
outfile.write(
|
|
1832
|
+
" excessLength=%s"
|
|
1833
|
+
% (
|
|
1834
|
+
self.gds_encode(
|
|
1835
|
+
self.gds_format_string(
|
|
1836
|
+
quote_attrib(self.excessLength), input_name="excessLength"
|
|
1837
|
+
)
|
|
1838
|
+
),
|
|
1839
|
+
)
|
|
1840
|
+
)
|
|
1841
|
+
if (
|
|
1842
|
+
self.tailgatePickup is not None
|
|
1843
|
+
and "tailgatePickup" not in already_processed
|
|
1844
|
+
):
|
|
1845
|
+
already_processed.add("tailgatePickup")
|
|
1846
|
+
outfile.write(
|
|
1847
|
+
" tailgatePickup=%s"
|
|
1848
|
+
% (
|
|
1849
|
+
self.gds_encode(
|
|
1850
|
+
self.gds_format_string(
|
|
1851
|
+
quote_attrib(self.tailgatePickup),
|
|
1852
|
+
input_name="tailgatePickup",
|
|
1853
|
+
)
|
|
1854
|
+
),
|
|
1855
|
+
)
|
|
1856
|
+
)
|
|
1857
|
+
if (
|
|
1858
|
+
self.residentialPickup is not None
|
|
1859
|
+
and "residentialPickup" not in already_processed
|
|
1860
|
+
):
|
|
1861
|
+
already_processed.add("residentialPickup")
|
|
1862
|
+
outfile.write(
|
|
1863
|
+
" residentialPickup=%s"
|
|
1864
|
+
% (
|
|
1865
|
+
self.gds_encode(
|
|
1866
|
+
self.gds_format_string(
|
|
1867
|
+
quote_attrib(self.residentialPickup),
|
|
1868
|
+
input_name="residentialPickup",
|
|
1869
|
+
)
|
|
1870
|
+
),
|
|
1871
|
+
)
|
|
1872
|
+
)
|
|
1873
|
+
if (
|
|
1874
|
+
self.crossBorderFee is not None
|
|
1875
|
+
and "crossBorderFee" not in already_processed
|
|
1876
|
+
):
|
|
1877
|
+
already_processed.add("crossBorderFee")
|
|
1878
|
+
outfile.write(
|
|
1879
|
+
" crossBorderFee=%s"
|
|
1880
|
+
% (
|
|
1881
|
+
self.gds_encode(
|
|
1882
|
+
self.gds_format_string(
|
|
1883
|
+
quote_attrib(self.crossBorderFee),
|
|
1884
|
+
input_name="crossBorderFee",
|
|
1885
|
+
)
|
|
1886
|
+
),
|
|
1887
|
+
)
|
|
1888
|
+
)
|
|
1889
|
+
if (
|
|
1890
|
+
self.notifyRecipient is not None
|
|
1891
|
+
and "notifyRecipient" not in already_processed
|
|
1892
|
+
):
|
|
1893
|
+
already_processed.add("notifyRecipient")
|
|
1894
|
+
outfile.write(
|
|
1895
|
+
" notifyRecipient=%s"
|
|
1896
|
+
% (
|
|
1897
|
+
self.gds_encode(
|
|
1898
|
+
self.gds_format_string(
|
|
1899
|
+
quote_attrib(self.notifyRecipient),
|
|
1900
|
+
input_name="notifyRecipient",
|
|
1901
|
+
)
|
|
1902
|
+
),
|
|
1903
|
+
)
|
|
1904
|
+
)
|
|
1905
|
+
if (
|
|
1906
|
+
self.singleShipment is not None
|
|
1907
|
+
and "singleShipment" not in already_processed
|
|
1908
|
+
):
|
|
1909
|
+
already_processed.add("singleShipment")
|
|
1910
|
+
outfile.write(
|
|
1911
|
+
" singleShipment=%s"
|
|
1912
|
+
% (
|
|
1913
|
+
self.gds_encode(
|
|
1914
|
+
self.gds_format_string(
|
|
1915
|
+
quote_attrib(self.singleShipment),
|
|
1916
|
+
input_name="singleShipment",
|
|
1917
|
+
)
|
|
1918
|
+
),
|
|
1919
|
+
)
|
|
1920
|
+
)
|
|
1921
|
+
if (
|
|
1922
|
+
self.tailgateDelivery is not None
|
|
1923
|
+
and "tailgateDelivery" not in already_processed
|
|
1924
|
+
):
|
|
1925
|
+
already_processed.add("tailgateDelivery")
|
|
1926
|
+
outfile.write(
|
|
1927
|
+
" tailgateDelivery=%s"
|
|
1928
|
+
% (
|
|
1929
|
+
self.gds_encode(
|
|
1930
|
+
self.gds_format_string(
|
|
1931
|
+
quote_attrib(self.tailgateDelivery),
|
|
1932
|
+
input_name="tailgateDelivery",
|
|
1933
|
+
)
|
|
1934
|
+
),
|
|
1935
|
+
)
|
|
1936
|
+
)
|
|
1937
|
+
if (
|
|
1938
|
+
self.residentialDelivery is not None
|
|
1939
|
+
and "residentialDelivery" not in already_processed
|
|
1940
|
+
):
|
|
1941
|
+
already_processed.add("residentialDelivery")
|
|
1942
|
+
outfile.write(
|
|
1943
|
+
" residentialDelivery=%s"
|
|
1944
|
+
% (
|
|
1945
|
+
self.gds_encode(
|
|
1946
|
+
self.gds_format_string(
|
|
1947
|
+
quote_attrib(self.residentialDelivery),
|
|
1948
|
+
input_name="residentialDelivery",
|
|
1949
|
+
)
|
|
1950
|
+
),
|
|
1951
|
+
)
|
|
1952
|
+
)
|
|
1953
|
+
if self.insuranceType is not None and "insuranceType" not in already_processed:
|
|
1954
|
+
already_processed.add("insuranceType")
|
|
1955
|
+
outfile.write(
|
|
1956
|
+
" insuranceType=%s"
|
|
1957
|
+
% (
|
|
1958
|
+
self.gds_encode(
|
|
1959
|
+
self.gds_format_string(
|
|
1960
|
+
quote_attrib(self.insuranceType), input_name="insuranceType"
|
|
1961
|
+
)
|
|
1962
|
+
),
|
|
1963
|
+
)
|
|
1964
|
+
)
|
|
1965
|
+
if (
|
|
1966
|
+
self.scheduledShipDate is not None
|
|
1967
|
+
and "scheduledShipDate" not in already_processed
|
|
1968
|
+
):
|
|
1969
|
+
already_processed.add("scheduledShipDate")
|
|
1970
|
+
outfile.write(
|
|
1971
|
+
" scheduledShipDate=%s"
|
|
1972
|
+
% (
|
|
1973
|
+
self.gds_encode(
|
|
1974
|
+
self.gds_format_string(
|
|
1975
|
+
quote_attrib(self.scheduledShipDate),
|
|
1976
|
+
input_name="scheduledShipDate",
|
|
1977
|
+
)
|
|
1978
|
+
),
|
|
1979
|
+
)
|
|
1980
|
+
)
|
|
1981
|
+
if (
|
|
1982
|
+
self.insideDelivery is not None
|
|
1983
|
+
and "insideDelivery" not in already_processed
|
|
1984
|
+
):
|
|
1985
|
+
already_processed.add("insideDelivery")
|
|
1986
|
+
outfile.write(
|
|
1987
|
+
" insideDelivery=%s"
|
|
1988
|
+
% (
|
|
1989
|
+
self.gds_encode(
|
|
1990
|
+
self.gds_format_string(
|
|
1991
|
+
quote_attrib(self.insideDelivery),
|
|
1992
|
+
input_name="insideDelivery",
|
|
1993
|
+
)
|
|
1994
|
+
),
|
|
1995
|
+
)
|
|
1996
|
+
)
|
|
1997
|
+
if (
|
|
1998
|
+
self.isSaturdayService is not None
|
|
1999
|
+
and "isSaturdayService" not in already_processed
|
|
2000
|
+
):
|
|
2001
|
+
already_processed.add("isSaturdayService")
|
|
2002
|
+
outfile.write(
|
|
2003
|
+
" isSaturdayService=%s"
|
|
2004
|
+
% (
|
|
2005
|
+
self.gds_encode(
|
|
2006
|
+
self.gds_format_string(
|
|
2007
|
+
quote_attrib(self.isSaturdayService),
|
|
2008
|
+
input_name="isSaturdayService",
|
|
2009
|
+
)
|
|
2010
|
+
),
|
|
2011
|
+
)
|
|
2012
|
+
)
|
|
2013
|
+
if (
|
|
2014
|
+
self.dangerousGoodsType is not None
|
|
2015
|
+
and "dangerousGoodsType" not in already_processed
|
|
2016
|
+
):
|
|
2017
|
+
already_processed.add("dangerousGoodsType")
|
|
2018
|
+
outfile.write(
|
|
2019
|
+
" dangerousGoodsType=%s"
|
|
2020
|
+
% (
|
|
2021
|
+
self.gds_encode(
|
|
2022
|
+
self.gds_format_string(
|
|
2023
|
+
quote_attrib(self.dangerousGoodsType),
|
|
2024
|
+
input_name="dangerousGoodsType",
|
|
2025
|
+
)
|
|
2026
|
+
),
|
|
2027
|
+
)
|
|
2028
|
+
)
|
|
2029
|
+
if self.serviceId is not None and "serviceId" not in already_processed:
|
|
2030
|
+
already_processed.add("serviceId")
|
|
2031
|
+
outfile.write(
|
|
2032
|
+
' serviceId="%s"'
|
|
2033
|
+
% self.gds_format_integer(self.serviceId, input_name="serviceId")
|
|
2034
|
+
)
|
|
2035
|
+
if self.stackable is not None and "stackable" not in already_processed:
|
|
2036
|
+
already_processed.add("stackable")
|
|
2037
|
+
outfile.write(
|
|
2038
|
+
" stackable=%s"
|
|
2039
|
+
% (
|
|
2040
|
+
self.gds_encode(
|
|
2041
|
+
self.gds_format_string(
|
|
2042
|
+
quote_attrib(self.stackable), input_name="stackable"
|
|
2043
|
+
)
|
|
2044
|
+
),
|
|
2045
|
+
)
|
|
2046
|
+
)
|
|
2047
|
+
|
|
2048
|
+
def _exportChildren(
|
|
2049
|
+
self,
|
|
2050
|
+
outfile,
|
|
2051
|
+
level,
|
|
2052
|
+
namespaceprefix_="",
|
|
2053
|
+
namespacedef_="",
|
|
2054
|
+
name_="QuoteRequestType",
|
|
2055
|
+
fromsubclass_=False,
|
|
2056
|
+
pretty_print=True,
|
|
2057
|
+
):
|
|
2058
|
+
if pretty_print:
|
|
2059
|
+
eol_ = "\n"
|
|
2060
|
+
else:
|
|
2061
|
+
eol_ = ""
|
|
2062
|
+
if self.From is not None:
|
|
2063
|
+
namespaceprefix_ = (
|
|
2064
|
+
self.From_nsprefix_ + ":"
|
|
2065
|
+
if (UseCapturedNS_ and self.From_nsprefix_)
|
|
2066
|
+
else ""
|
|
2067
|
+
)
|
|
2068
|
+
self.From.export(
|
|
2069
|
+
outfile,
|
|
2070
|
+
level,
|
|
2071
|
+
namespaceprefix_,
|
|
2072
|
+
namespacedef_="",
|
|
2073
|
+
name_="From",
|
|
2074
|
+
pretty_print=pretty_print,
|
|
2075
|
+
)
|
|
2076
|
+
if self.To is not None:
|
|
2077
|
+
namespaceprefix_ = (
|
|
2078
|
+
self.To_nsprefix_ + ":"
|
|
2079
|
+
if (UseCapturedNS_ and self.To_nsprefix_)
|
|
2080
|
+
else ""
|
|
2081
|
+
)
|
|
2082
|
+
self.To.export(
|
|
2083
|
+
outfile,
|
|
2084
|
+
level,
|
|
2085
|
+
namespaceprefix_,
|
|
2086
|
+
namespacedef_="",
|
|
2087
|
+
name_="To",
|
|
2088
|
+
pretty_print=pretty_print,
|
|
2089
|
+
)
|
|
2090
|
+
if self.COD is not None:
|
|
2091
|
+
namespaceprefix_ = (
|
|
2092
|
+
self.COD_nsprefix_ + ":"
|
|
2093
|
+
if (UseCapturedNS_ and self.COD_nsprefix_)
|
|
2094
|
+
else ""
|
|
2095
|
+
)
|
|
2096
|
+
self.COD.export(
|
|
2097
|
+
outfile,
|
|
2098
|
+
level,
|
|
2099
|
+
namespaceprefix_,
|
|
2100
|
+
namespacedef_="",
|
|
2101
|
+
name_="COD",
|
|
2102
|
+
pretty_print=pretty_print,
|
|
2103
|
+
)
|
|
2104
|
+
if self.Packages is not None:
|
|
2105
|
+
namespaceprefix_ = (
|
|
2106
|
+
self.Packages_nsprefix_ + ":"
|
|
2107
|
+
if (UseCapturedNS_ and self.Packages_nsprefix_)
|
|
2108
|
+
else ""
|
|
2109
|
+
)
|
|
2110
|
+
self.Packages.export(
|
|
2111
|
+
outfile,
|
|
2112
|
+
level,
|
|
2113
|
+
namespaceprefix_,
|
|
2114
|
+
namespacedef_="",
|
|
2115
|
+
name_="Packages",
|
|
2116
|
+
pretty_print=pretty_print,
|
|
2117
|
+
)
|
|
2118
|
+
|
|
2119
|
+
def build(self, node, gds_collector_=None):
|
|
2120
|
+
self.gds_collector_ = gds_collector_
|
|
2121
|
+
if SaveElementTreeNode:
|
|
2122
|
+
self.gds_elementtree_node_ = node
|
|
2123
|
+
already_processed = set()
|
|
2124
|
+
self.ns_prefix_ = node.prefix
|
|
2125
|
+
self._buildAttributes(node, node.attrib, already_processed)
|
|
2126
|
+
for child in node:
|
|
2127
|
+
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
|
|
2128
|
+
self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
|
|
2129
|
+
return self
|
|
2130
|
+
|
|
2131
|
+
def _buildAttributes(self, node, attrs, already_processed):
|
|
2132
|
+
value = find_attr_value_("saturdayPickupRequired", node)
|
|
2133
|
+
if value is not None and "saturdayPickupRequired" not in already_processed:
|
|
2134
|
+
already_processed.add("saturdayPickupRequired")
|
|
2135
|
+
self.saturdayPickupRequired = value
|
|
2136
|
+
value = find_attr_value_("homelandSecurity", node)
|
|
2137
|
+
if value is not None and "homelandSecurity" not in already_processed:
|
|
2138
|
+
already_processed.add("homelandSecurity")
|
|
2139
|
+
self.homelandSecurity = value
|
|
2140
|
+
value = find_attr_value_("pierCharge", node)
|
|
2141
|
+
if value is not None and "pierCharge" not in already_processed:
|
|
2142
|
+
already_processed.add("pierCharge")
|
|
2143
|
+
self.pierCharge = value
|
|
2144
|
+
value = find_attr_value_("exhibitionConventionSite", node)
|
|
2145
|
+
if value is not None and "exhibitionConventionSite" not in already_processed:
|
|
2146
|
+
already_processed.add("exhibitionConventionSite")
|
|
2147
|
+
self.exhibitionConventionSite = value
|
|
2148
|
+
value = find_attr_value_("militaryBaseDelivery", node)
|
|
2149
|
+
if value is not None and "militaryBaseDelivery" not in already_processed:
|
|
2150
|
+
already_processed.add("militaryBaseDelivery")
|
|
2151
|
+
self.militaryBaseDelivery = value
|
|
2152
|
+
value = find_attr_value_("customsIn-bondFreight", node)
|
|
2153
|
+
if value is not None and "customsIn-bondFreight" not in already_processed:
|
|
2154
|
+
already_processed.add("customsIn-bondFreight")
|
|
2155
|
+
self.customsIn_bondFreight = value
|
|
2156
|
+
value = find_attr_value_("limitedAccess", node)
|
|
2157
|
+
if value is not None and "limitedAccess" not in already_processed:
|
|
2158
|
+
already_processed.add("limitedAccess")
|
|
2159
|
+
self.limitedAccess = value
|
|
2160
|
+
value = find_attr_value_("excessLength", node)
|
|
2161
|
+
if value is not None and "excessLength" not in already_processed:
|
|
2162
|
+
already_processed.add("excessLength")
|
|
2163
|
+
self.excessLength = value
|
|
2164
|
+
value = find_attr_value_("tailgatePickup", node)
|
|
2165
|
+
if value is not None and "tailgatePickup" not in already_processed:
|
|
2166
|
+
already_processed.add("tailgatePickup")
|
|
2167
|
+
self.tailgatePickup = value
|
|
2168
|
+
value = find_attr_value_("residentialPickup", node)
|
|
2169
|
+
if value is not None and "residentialPickup" not in already_processed:
|
|
2170
|
+
already_processed.add("residentialPickup")
|
|
2171
|
+
self.residentialPickup = value
|
|
2172
|
+
value = find_attr_value_("crossBorderFee", node)
|
|
2173
|
+
if value is not None and "crossBorderFee" not in already_processed:
|
|
2174
|
+
already_processed.add("crossBorderFee")
|
|
2175
|
+
self.crossBorderFee = value
|
|
2176
|
+
value = find_attr_value_("notifyRecipient", node)
|
|
2177
|
+
if value is not None and "notifyRecipient" not in already_processed:
|
|
2178
|
+
already_processed.add("notifyRecipient")
|
|
2179
|
+
self.notifyRecipient = value
|
|
2180
|
+
value = find_attr_value_("singleShipment", node)
|
|
2181
|
+
if value is not None and "singleShipment" not in already_processed:
|
|
2182
|
+
already_processed.add("singleShipment")
|
|
2183
|
+
self.singleShipment = value
|
|
2184
|
+
value = find_attr_value_("tailgateDelivery", node)
|
|
2185
|
+
if value is not None and "tailgateDelivery" not in already_processed:
|
|
2186
|
+
already_processed.add("tailgateDelivery")
|
|
2187
|
+
self.tailgateDelivery = value
|
|
2188
|
+
value = find_attr_value_("residentialDelivery", node)
|
|
2189
|
+
if value is not None and "residentialDelivery" not in already_processed:
|
|
2190
|
+
already_processed.add("residentialDelivery")
|
|
2191
|
+
self.residentialDelivery = value
|
|
2192
|
+
value = find_attr_value_("insuranceType", node)
|
|
2193
|
+
if value is not None and "insuranceType" not in already_processed:
|
|
2194
|
+
already_processed.add("insuranceType")
|
|
2195
|
+
self.insuranceType = value
|
|
2196
|
+
value = find_attr_value_("scheduledShipDate", node)
|
|
2197
|
+
if value is not None and "scheduledShipDate" not in already_processed:
|
|
2198
|
+
already_processed.add("scheduledShipDate")
|
|
2199
|
+
self.scheduledShipDate = value
|
|
2200
|
+
value = find_attr_value_("insideDelivery", node)
|
|
2201
|
+
if value is not None and "insideDelivery" not in already_processed:
|
|
2202
|
+
already_processed.add("insideDelivery")
|
|
2203
|
+
self.insideDelivery = value
|
|
2204
|
+
value = find_attr_value_("isSaturdayService", node)
|
|
2205
|
+
if value is not None and "isSaturdayService" not in already_processed:
|
|
2206
|
+
already_processed.add("isSaturdayService")
|
|
2207
|
+
self.isSaturdayService = value
|
|
2208
|
+
value = find_attr_value_("dangerousGoodsType", node)
|
|
2209
|
+
if value is not None and "dangerousGoodsType" not in already_processed:
|
|
2210
|
+
already_processed.add("dangerousGoodsType")
|
|
2211
|
+
self.dangerousGoodsType = value
|
|
2212
|
+
value = find_attr_value_("serviceId", node)
|
|
2213
|
+
if value is not None and "serviceId" not in already_processed:
|
|
2214
|
+
already_processed.add("serviceId")
|
|
2215
|
+
self.serviceId = self.gds_parse_integer(value, node, "serviceId")
|
|
2216
|
+
value = find_attr_value_("stackable", node)
|
|
2217
|
+
if value is not None and "stackable" not in already_processed:
|
|
2218
|
+
already_processed.add("stackable")
|
|
2219
|
+
self.stackable = value
|
|
2220
|
+
|
|
2221
|
+
def _buildChildren(
|
|
2222
|
+
self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None
|
|
2223
|
+
):
|
|
2224
|
+
if nodeName_ == "From":
|
|
2225
|
+
obj_ = FromType.factory(parent_object_=self)
|
|
2226
|
+
obj_.build(child_, gds_collector_=gds_collector_)
|
|
2227
|
+
self.From = obj_
|
|
2228
|
+
obj_.original_tagname_ = "From"
|
|
2229
|
+
elif nodeName_ == "To":
|
|
2230
|
+
obj_ = ToType.factory(parent_object_=self)
|
|
2231
|
+
obj_.build(child_, gds_collector_=gds_collector_)
|
|
2232
|
+
self.To = obj_
|
|
2233
|
+
obj_.original_tagname_ = "To"
|
|
2234
|
+
elif nodeName_ == "COD":
|
|
2235
|
+
obj_ = CODType.factory(parent_object_=self)
|
|
2236
|
+
obj_.build(child_, gds_collector_=gds_collector_)
|
|
2237
|
+
self.COD = obj_
|
|
2238
|
+
obj_.original_tagname_ = "COD"
|
|
2239
|
+
elif nodeName_ == "Packages":
|
|
2240
|
+
obj_ = PackagesType.factory(parent_object_=self)
|
|
2241
|
+
obj_.build(child_, gds_collector_=gds_collector_)
|
|
2242
|
+
self.Packages = obj_
|
|
2243
|
+
obj_.original_tagname_ = "Packages"
|
|
2244
|
+
|
|
2245
|
+
|
|
2246
|
+
# end class QuoteRequestType
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
class FromType(GeneratedsSuper):
|
|
2250
|
+
__hash__ = GeneratedsSuper.__hash__
|
|
2251
|
+
subclass = None
|
|
2252
|
+
superclass = None
|
|
2253
|
+
|
|
2254
|
+
def __init__(
|
|
2255
|
+
self,
|
|
2256
|
+
id=None,
|
|
2257
|
+
company=None,
|
|
2258
|
+
instructions=None,
|
|
2259
|
+
email=None,
|
|
2260
|
+
attention=None,
|
|
2261
|
+
phone=None,
|
|
2262
|
+
tailgateRequired=None,
|
|
2263
|
+
residential=None,
|
|
2264
|
+
address1=None,
|
|
2265
|
+
address2=None,
|
|
2266
|
+
city=None,
|
|
2267
|
+
state=None,
|
|
2268
|
+
country=None,
|
|
2269
|
+
zip=None,
|
|
2270
|
+
valueOf_=None,
|
|
2271
|
+
gds_collector_=None,
|
|
2272
|
+
**kwargs_
|
|
2273
|
+
):
|
|
2274
|
+
self.gds_collector_ = gds_collector_
|
|
2275
|
+
self.gds_elementtree_node_ = None
|
|
2276
|
+
self.original_tagname_ = None
|
|
2277
|
+
self.parent_object_ = kwargs_.get("parent_object_")
|
|
2278
|
+
self.ns_prefix_ = None
|
|
2279
|
+
self.id = _cast(None, id)
|
|
2280
|
+
self.id_nsprefix_ = None
|
|
2281
|
+
self.company = _cast(None, company)
|
|
2282
|
+
self.company_nsprefix_ = None
|
|
2283
|
+
self.instructions = _cast(None, instructions)
|
|
2284
|
+
self.instructions_nsprefix_ = None
|
|
2285
|
+
self.email = _cast(None, email)
|
|
2286
|
+
self.email_nsprefix_ = None
|
|
2287
|
+
self.attention = _cast(None, attention)
|
|
2288
|
+
self.attention_nsprefix_ = None
|
|
2289
|
+
self.phone = _cast(None, phone)
|
|
2290
|
+
self.phone_nsprefix_ = None
|
|
2291
|
+
self.tailgateRequired = _cast(None, tailgateRequired)
|
|
2292
|
+
self.tailgateRequired_nsprefix_ = None
|
|
2293
|
+
self.residential = _cast(None, residential)
|
|
2294
|
+
self.residential_nsprefix_ = None
|
|
2295
|
+
self.address1 = _cast(None, address1)
|
|
2296
|
+
self.address1_nsprefix_ = None
|
|
2297
|
+
self.address2 = _cast(None, address2)
|
|
2298
|
+
self.address2_nsprefix_ = None
|
|
2299
|
+
self.city = _cast(None, city)
|
|
2300
|
+
self.city_nsprefix_ = None
|
|
2301
|
+
self.state = _cast(None, state)
|
|
2302
|
+
self.state_nsprefix_ = None
|
|
2303
|
+
self.country = _cast(None, country)
|
|
2304
|
+
self.country_nsprefix_ = None
|
|
2305
|
+
self.zip = _cast(None, zip)
|
|
2306
|
+
self.zip_nsprefix_ = None
|
|
2307
|
+
self.valueOf_ = valueOf_
|
|
2308
|
+
|
|
2309
|
+
def factory(*args_, **kwargs_):
|
|
2310
|
+
if CurrentSubclassModule_ is not None:
|
|
2311
|
+
subclass = getSubclassFromModule_(CurrentSubclassModule_, FromType)
|
|
2312
|
+
if subclass is not None:
|
|
2313
|
+
return subclass(*args_, **kwargs_)
|
|
2314
|
+
if FromType.subclass:
|
|
2315
|
+
return FromType.subclass(*args_, **kwargs_)
|
|
2316
|
+
else:
|
|
2317
|
+
return FromType(*args_, **kwargs_)
|
|
2318
|
+
|
|
2319
|
+
factory = staticmethod(factory)
|
|
2320
|
+
|
|
2321
|
+
def get_ns_prefix_(self):
|
|
2322
|
+
return self.ns_prefix_
|
|
2323
|
+
|
|
2324
|
+
def set_ns_prefix_(self, ns_prefix):
|
|
2325
|
+
self.ns_prefix_ = ns_prefix
|
|
2326
|
+
|
|
2327
|
+
def get_id(self):
|
|
2328
|
+
return self.id
|
|
2329
|
+
|
|
2330
|
+
def set_id(self, id):
|
|
2331
|
+
self.id = id
|
|
2332
|
+
|
|
2333
|
+
def get_company(self):
|
|
2334
|
+
return self.company
|
|
2335
|
+
|
|
2336
|
+
def set_company(self, company):
|
|
2337
|
+
self.company = company
|
|
2338
|
+
|
|
2339
|
+
def get_instructions(self):
|
|
2340
|
+
return self.instructions
|
|
2341
|
+
|
|
2342
|
+
def set_instructions(self, instructions):
|
|
2343
|
+
self.instructions = instructions
|
|
2344
|
+
|
|
2345
|
+
def get_email(self):
|
|
2346
|
+
return self.email
|
|
2347
|
+
|
|
2348
|
+
def set_email(self, email):
|
|
2349
|
+
self.email = email
|
|
2350
|
+
|
|
2351
|
+
def get_attention(self):
|
|
2352
|
+
return self.attention
|
|
2353
|
+
|
|
2354
|
+
def set_attention(self, attention):
|
|
2355
|
+
self.attention = attention
|
|
2356
|
+
|
|
2357
|
+
def get_phone(self):
|
|
2358
|
+
return self.phone
|
|
2359
|
+
|
|
2360
|
+
def set_phone(self, phone):
|
|
2361
|
+
self.phone = phone
|
|
2362
|
+
|
|
2363
|
+
def get_tailgateRequired(self):
|
|
2364
|
+
return self.tailgateRequired
|
|
2365
|
+
|
|
2366
|
+
def set_tailgateRequired(self, tailgateRequired):
|
|
2367
|
+
self.tailgateRequired = tailgateRequired
|
|
2368
|
+
|
|
2369
|
+
def get_residential(self):
|
|
2370
|
+
return self.residential
|
|
2371
|
+
|
|
2372
|
+
def set_residential(self, residential):
|
|
2373
|
+
self.residential = residential
|
|
2374
|
+
|
|
2375
|
+
def get_address1(self):
|
|
2376
|
+
return self.address1
|
|
2377
|
+
|
|
2378
|
+
def set_address1(self, address1):
|
|
2379
|
+
self.address1 = address1
|
|
2380
|
+
|
|
2381
|
+
def get_address2(self):
|
|
2382
|
+
return self.address2
|
|
2383
|
+
|
|
2384
|
+
def set_address2(self, address2):
|
|
2385
|
+
self.address2 = address2
|
|
2386
|
+
|
|
2387
|
+
def get_city(self):
|
|
2388
|
+
return self.city
|
|
2389
|
+
|
|
2390
|
+
def set_city(self, city):
|
|
2391
|
+
self.city = city
|
|
2392
|
+
|
|
2393
|
+
def get_state(self):
|
|
2394
|
+
return self.state
|
|
2395
|
+
|
|
2396
|
+
def set_state(self, state):
|
|
2397
|
+
self.state = state
|
|
2398
|
+
|
|
2399
|
+
def get_country(self):
|
|
2400
|
+
return self.country
|
|
2401
|
+
|
|
2402
|
+
def set_country(self, country):
|
|
2403
|
+
self.country = country
|
|
2404
|
+
|
|
2405
|
+
def get_zip(self):
|
|
2406
|
+
return self.zip
|
|
2407
|
+
|
|
2408
|
+
def set_zip(self, zip):
|
|
2409
|
+
self.zip = zip
|
|
2410
|
+
|
|
2411
|
+
def get_valueOf_(self):
|
|
2412
|
+
return self.valueOf_
|
|
2413
|
+
|
|
2414
|
+
def set_valueOf_(self, valueOf_):
|
|
2415
|
+
self.valueOf_ = valueOf_
|
|
2416
|
+
|
|
2417
|
+
def _hasContent(self):
|
|
2418
|
+
if 1 if type(self.valueOf_) in [int, float] else self.valueOf_:
|
|
2419
|
+
return True
|
|
2420
|
+
else:
|
|
2421
|
+
return False
|
|
2422
|
+
|
|
2423
|
+
def export(
|
|
2424
|
+
self,
|
|
2425
|
+
outfile,
|
|
2426
|
+
level,
|
|
2427
|
+
namespaceprefix_="",
|
|
2428
|
+
namespacedef_="",
|
|
2429
|
+
name_="FromType",
|
|
2430
|
+
pretty_print=True,
|
|
2431
|
+
):
|
|
2432
|
+
imported_ns_def_ = GenerateDSNamespaceDefs_.get("FromType")
|
|
2433
|
+
if imported_ns_def_ is not None:
|
|
2434
|
+
namespacedef_ = imported_ns_def_
|
|
2435
|
+
if pretty_print:
|
|
2436
|
+
eol_ = "\n"
|
|
2437
|
+
else:
|
|
2438
|
+
eol_ = ""
|
|
2439
|
+
if self.original_tagname_ is not None and name_ == "FromType":
|
|
2440
|
+
name_ = self.original_tagname_
|
|
2441
|
+
if UseCapturedNS_ and self.ns_prefix_:
|
|
2442
|
+
namespaceprefix_ = self.ns_prefix_ + ":"
|
|
2443
|
+
showIndent(outfile, level, pretty_print)
|
|
2444
|
+
outfile.write(
|
|
2445
|
+
"<%s%s%s"
|
|
2446
|
+
% (
|
|
2447
|
+
namespaceprefix_,
|
|
2448
|
+
name_,
|
|
2449
|
+
namespacedef_ and " " + namespacedef_ or "",
|
|
2450
|
+
)
|
|
2451
|
+
)
|
|
2452
|
+
already_processed = set()
|
|
2453
|
+
self._exportAttributes(
|
|
2454
|
+
outfile, level, already_processed, namespaceprefix_, name_="FromType"
|
|
2455
|
+
)
|
|
2456
|
+
if self._hasContent():
|
|
2457
|
+
outfile.write(">")
|
|
2458
|
+
outfile.write(self.convert_unicode(self.valueOf_))
|
|
2459
|
+
self._exportChildren(
|
|
2460
|
+
outfile,
|
|
2461
|
+
level + 1,
|
|
2462
|
+
namespaceprefix_,
|
|
2463
|
+
namespacedef_,
|
|
2464
|
+
name_="FromType",
|
|
2465
|
+
pretty_print=pretty_print,
|
|
2466
|
+
)
|
|
2467
|
+
outfile.write("</%s%s>%s" % (namespaceprefix_, name_, eol_))
|
|
2468
|
+
else:
|
|
2469
|
+
outfile.write("/>%s" % (eol_,))
|
|
2470
|
+
|
|
2471
|
+
def _exportAttributes(
|
|
2472
|
+
self, outfile, level, already_processed, namespaceprefix_="", name_="FromType"
|
|
2473
|
+
):
|
|
2474
|
+
if self.id is not None and "id" not in already_processed:
|
|
2475
|
+
already_processed.add("id")
|
|
2476
|
+
outfile.write(
|
|
2477
|
+
" id=%s"
|
|
2478
|
+
% (
|
|
2479
|
+
self.gds_encode(
|
|
2480
|
+
self.gds_format_string(quote_attrib(self.id), input_name="id")
|
|
2481
|
+
),
|
|
2482
|
+
)
|
|
2483
|
+
)
|
|
2484
|
+
if self.company is not None and "company" not in already_processed:
|
|
2485
|
+
already_processed.add("company")
|
|
2486
|
+
outfile.write(
|
|
2487
|
+
" company=%s"
|
|
2488
|
+
% (
|
|
2489
|
+
self.gds_encode(
|
|
2490
|
+
self.gds_format_string(
|
|
2491
|
+
quote_attrib(self.company), input_name="company"
|
|
2492
|
+
)
|
|
2493
|
+
),
|
|
2494
|
+
)
|
|
2495
|
+
)
|
|
2496
|
+
if self.instructions is not None and "instructions" not in already_processed:
|
|
2497
|
+
already_processed.add("instructions")
|
|
2498
|
+
outfile.write(
|
|
2499
|
+
" instructions=%s"
|
|
2500
|
+
% (
|
|
2501
|
+
self.gds_encode(
|
|
2502
|
+
self.gds_format_string(
|
|
2503
|
+
quote_attrib(self.instructions), input_name="instructions"
|
|
2504
|
+
)
|
|
2505
|
+
),
|
|
2506
|
+
)
|
|
2507
|
+
)
|
|
2508
|
+
if self.email is not None and "email" not in already_processed:
|
|
2509
|
+
already_processed.add("email")
|
|
2510
|
+
outfile.write(
|
|
2511
|
+
" email=%s"
|
|
2512
|
+
% (
|
|
2513
|
+
self.gds_encode(
|
|
2514
|
+
self.gds_format_string(
|
|
2515
|
+
quote_attrib(self.email), input_name="email"
|
|
2516
|
+
)
|
|
2517
|
+
),
|
|
2518
|
+
)
|
|
2519
|
+
)
|
|
2520
|
+
if self.attention is not None and "attention" not in already_processed:
|
|
2521
|
+
already_processed.add("attention")
|
|
2522
|
+
outfile.write(
|
|
2523
|
+
" attention=%s"
|
|
2524
|
+
% (
|
|
2525
|
+
self.gds_encode(
|
|
2526
|
+
self.gds_format_string(
|
|
2527
|
+
quote_attrib(self.attention), input_name="attention"
|
|
2528
|
+
)
|
|
2529
|
+
),
|
|
2530
|
+
)
|
|
2531
|
+
)
|
|
2532
|
+
if self.phone is not None and "phone" not in already_processed:
|
|
2533
|
+
already_processed.add("phone")
|
|
2534
|
+
outfile.write(
|
|
2535
|
+
" phone=%s"
|
|
2536
|
+
% (
|
|
2537
|
+
self.gds_encode(
|
|
2538
|
+
self.gds_format_string(
|
|
2539
|
+
quote_attrib(self.phone), input_name="phone"
|
|
2540
|
+
)
|
|
2541
|
+
),
|
|
2542
|
+
)
|
|
2543
|
+
)
|
|
2544
|
+
if (
|
|
2545
|
+
self.tailgateRequired is not None
|
|
2546
|
+
and "tailgateRequired" not in already_processed
|
|
2547
|
+
):
|
|
2548
|
+
already_processed.add("tailgateRequired")
|
|
2549
|
+
outfile.write(
|
|
2550
|
+
" tailgateRequired=%s"
|
|
2551
|
+
% (
|
|
2552
|
+
self.gds_encode(
|
|
2553
|
+
self.gds_format_string(
|
|
2554
|
+
quote_attrib(self.tailgateRequired),
|
|
2555
|
+
input_name="tailgateRequired",
|
|
2556
|
+
)
|
|
2557
|
+
),
|
|
2558
|
+
)
|
|
2559
|
+
)
|
|
2560
|
+
if self.residential is not None and "residential" not in already_processed:
|
|
2561
|
+
already_processed.add("residential")
|
|
2562
|
+
outfile.write(
|
|
2563
|
+
" residential=%s"
|
|
2564
|
+
% (
|
|
2565
|
+
self.gds_encode(
|
|
2566
|
+
self.gds_format_string(
|
|
2567
|
+
quote_attrib(self.residential), input_name="residential"
|
|
2568
|
+
)
|
|
2569
|
+
),
|
|
2570
|
+
)
|
|
2571
|
+
)
|
|
2572
|
+
if self.address1 is not None and "address1" not in already_processed:
|
|
2573
|
+
already_processed.add("address1")
|
|
2574
|
+
outfile.write(
|
|
2575
|
+
" address1=%s"
|
|
2576
|
+
% (
|
|
2577
|
+
self.gds_encode(
|
|
2578
|
+
self.gds_format_string(
|
|
2579
|
+
quote_attrib(self.address1), input_name="address1"
|
|
2580
|
+
)
|
|
2581
|
+
),
|
|
2582
|
+
)
|
|
2583
|
+
)
|
|
2584
|
+
if self.address2 is not None and "address2" not in already_processed:
|
|
2585
|
+
already_processed.add("address2")
|
|
2586
|
+
outfile.write(
|
|
2587
|
+
" address2=%s"
|
|
2588
|
+
% (
|
|
2589
|
+
self.gds_encode(
|
|
2590
|
+
self.gds_format_string(
|
|
2591
|
+
quote_attrib(self.address2), input_name="address2"
|
|
2592
|
+
)
|
|
2593
|
+
),
|
|
2594
|
+
)
|
|
2595
|
+
)
|
|
2596
|
+
if self.city is not None and "city" not in already_processed:
|
|
2597
|
+
already_processed.add("city")
|
|
2598
|
+
outfile.write(
|
|
2599
|
+
" city=%s"
|
|
2600
|
+
% (
|
|
2601
|
+
self.gds_encode(
|
|
2602
|
+
self.gds_format_string(
|
|
2603
|
+
quote_attrib(self.city), input_name="city"
|
|
2604
|
+
)
|
|
2605
|
+
),
|
|
2606
|
+
)
|
|
2607
|
+
)
|
|
2608
|
+
if self.state is not None and "state" not in already_processed:
|
|
2609
|
+
already_processed.add("state")
|
|
2610
|
+
outfile.write(
|
|
2611
|
+
" state=%s"
|
|
2612
|
+
% (
|
|
2613
|
+
self.gds_encode(
|
|
2614
|
+
self.gds_format_string(
|
|
2615
|
+
quote_attrib(self.state), input_name="state"
|
|
2616
|
+
)
|
|
2617
|
+
),
|
|
2618
|
+
)
|
|
2619
|
+
)
|
|
2620
|
+
if self.country is not None and "country" not in already_processed:
|
|
2621
|
+
already_processed.add("country")
|
|
2622
|
+
outfile.write(
|
|
2623
|
+
" country=%s"
|
|
2624
|
+
% (
|
|
2625
|
+
self.gds_encode(
|
|
2626
|
+
self.gds_format_string(
|
|
2627
|
+
quote_attrib(self.country), input_name="country"
|
|
2628
|
+
)
|
|
2629
|
+
),
|
|
2630
|
+
)
|
|
2631
|
+
)
|
|
2632
|
+
if self.zip is not None and "zip" not in already_processed:
|
|
2633
|
+
already_processed.add("zip")
|
|
2634
|
+
outfile.write(
|
|
2635
|
+
" zip=%s"
|
|
2636
|
+
% (
|
|
2637
|
+
self.gds_encode(
|
|
2638
|
+
self.gds_format_string(quote_attrib(self.zip), input_name="zip")
|
|
2639
|
+
),
|
|
2640
|
+
)
|
|
2641
|
+
)
|
|
2642
|
+
|
|
2643
|
+
def _exportChildren(
|
|
2644
|
+
self,
|
|
2645
|
+
outfile,
|
|
2646
|
+
level,
|
|
2647
|
+
namespaceprefix_="",
|
|
2648
|
+
namespacedef_="",
|
|
2649
|
+
name_="FromType",
|
|
2650
|
+
fromsubclass_=False,
|
|
2651
|
+
pretty_print=True,
|
|
2652
|
+
):
|
|
2653
|
+
pass
|
|
2654
|
+
|
|
2655
|
+
def build(self, node, gds_collector_=None):
|
|
2656
|
+
self.gds_collector_ = gds_collector_
|
|
2657
|
+
if SaveElementTreeNode:
|
|
2658
|
+
self.gds_elementtree_node_ = node
|
|
2659
|
+
already_processed = set()
|
|
2660
|
+
self.ns_prefix_ = node.prefix
|
|
2661
|
+
self._buildAttributes(node, node.attrib, already_processed)
|
|
2662
|
+
self.valueOf_ = get_all_text_(node)
|
|
2663
|
+
for child in node:
|
|
2664
|
+
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
|
|
2665
|
+
self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
|
|
2666
|
+
return self
|
|
2667
|
+
|
|
2668
|
+
def _buildAttributes(self, node, attrs, already_processed):
|
|
2669
|
+
value = find_attr_value_("id", node)
|
|
2670
|
+
if value is not None and "id" not in already_processed:
|
|
2671
|
+
already_processed.add("id")
|
|
2672
|
+
self.id = value
|
|
2673
|
+
value = find_attr_value_("company", node)
|
|
2674
|
+
if value is not None and "company" not in already_processed:
|
|
2675
|
+
already_processed.add("company")
|
|
2676
|
+
self.company = value
|
|
2677
|
+
value = find_attr_value_("instructions", node)
|
|
2678
|
+
if value is not None and "instructions" not in already_processed:
|
|
2679
|
+
already_processed.add("instructions")
|
|
2680
|
+
self.instructions = value
|
|
2681
|
+
value = find_attr_value_("email", node)
|
|
2682
|
+
if value is not None and "email" not in already_processed:
|
|
2683
|
+
already_processed.add("email")
|
|
2684
|
+
self.email = value
|
|
2685
|
+
value = find_attr_value_("attention", node)
|
|
2686
|
+
if value is not None and "attention" not in already_processed:
|
|
2687
|
+
already_processed.add("attention")
|
|
2688
|
+
self.attention = value
|
|
2689
|
+
value = find_attr_value_("phone", node)
|
|
2690
|
+
if value is not None and "phone" not in already_processed:
|
|
2691
|
+
already_processed.add("phone")
|
|
2692
|
+
self.phone = value
|
|
2693
|
+
value = find_attr_value_("tailgateRequired", node)
|
|
2694
|
+
if value is not None and "tailgateRequired" not in already_processed:
|
|
2695
|
+
already_processed.add("tailgateRequired")
|
|
2696
|
+
self.tailgateRequired = value
|
|
2697
|
+
value = find_attr_value_("residential", node)
|
|
2698
|
+
if value is not None and "residential" not in already_processed:
|
|
2699
|
+
already_processed.add("residential")
|
|
2700
|
+
self.residential = value
|
|
2701
|
+
value = find_attr_value_("address1", node)
|
|
2702
|
+
if value is not None and "address1" not in already_processed:
|
|
2703
|
+
already_processed.add("address1")
|
|
2704
|
+
self.address1 = value
|
|
2705
|
+
value = find_attr_value_("address2", node)
|
|
2706
|
+
if value is not None and "address2" not in already_processed:
|
|
2707
|
+
already_processed.add("address2")
|
|
2708
|
+
self.address2 = value
|
|
2709
|
+
value = find_attr_value_("city", node)
|
|
2710
|
+
if value is not None and "city" not in already_processed:
|
|
2711
|
+
already_processed.add("city")
|
|
2712
|
+
self.city = value
|
|
2713
|
+
value = find_attr_value_("state", node)
|
|
2714
|
+
if value is not None and "state" not in already_processed:
|
|
2715
|
+
already_processed.add("state")
|
|
2716
|
+
self.state = value
|
|
2717
|
+
value = find_attr_value_("country", node)
|
|
2718
|
+
if value is not None and "country" not in already_processed:
|
|
2719
|
+
already_processed.add("country")
|
|
2720
|
+
self.country = value
|
|
2721
|
+
value = find_attr_value_("zip", node)
|
|
2722
|
+
if value is not None and "zip" not in already_processed:
|
|
2723
|
+
already_processed.add("zip")
|
|
2724
|
+
self.zip = value
|
|
2725
|
+
|
|
2726
|
+
def _buildChildren(
|
|
2727
|
+
self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None
|
|
2728
|
+
):
|
|
2729
|
+
pass
|
|
2730
|
+
|
|
2731
|
+
|
|
2732
|
+
# end class FromType
|
|
2733
|
+
|
|
2734
|
+
|
|
2735
|
+
class ToType(GeneratedsSuper):
|
|
2736
|
+
__hash__ = GeneratedsSuper.__hash__
|
|
2737
|
+
subclass = None
|
|
2738
|
+
superclass = None
|
|
2739
|
+
|
|
2740
|
+
def __init__(
|
|
2741
|
+
self,
|
|
2742
|
+
id=None,
|
|
2743
|
+
company=None,
|
|
2744
|
+
notifyRecipient=None,
|
|
2745
|
+
instructions=None,
|
|
2746
|
+
email=None,
|
|
2747
|
+
attention=None,
|
|
2748
|
+
phone=None,
|
|
2749
|
+
tailgateRequired=None,
|
|
2750
|
+
residential=None,
|
|
2751
|
+
address1=None,
|
|
2752
|
+
address2=None,
|
|
2753
|
+
city=None,
|
|
2754
|
+
state=None,
|
|
2755
|
+
zip=None,
|
|
2756
|
+
country=None,
|
|
2757
|
+
valueOf_=None,
|
|
2758
|
+
gds_collector_=None,
|
|
2759
|
+
**kwargs_
|
|
2760
|
+
):
|
|
2761
|
+
self.gds_collector_ = gds_collector_
|
|
2762
|
+
self.gds_elementtree_node_ = None
|
|
2763
|
+
self.original_tagname_ = None
|
|
2764
|
+
self.parent_object_ = kwargs_.get("parent_object_")
|
|
2765
|
+
self.ns_prefix_ = None
|
|
2766
|
+
self.id = _cast(None, id)
|
|
2767
|
+
self.id_nsprefix_ = None
|
|
2768
|
+
self.company = _cast(None, company)
|
|
2769
|
+
self.company_nsprefix_ = None
|
|
2770
|
+
self.notifyRecipient = _cast(None, notifyRecipient)
|
|
2771
|
+
self.notifyRecipient_nsprefix_ = None
|
|
2772
|
+
self.instructions = _cast(None, instructions)
|
|
2773
|
+
self.instructions_nsprefix_ = None
|
|
2774
|
+
self.email = _cast(None, email)
|
|
2775
|
+
self.email_nsprefix_ = None
|
|
2776
|
+
self.attention = _cast(None, attention)
|
|
2777
|
+
self.attention_nsprefix_ = None
|
|
2778
|
+
self.phone = _cast(None, phone)
|
|
2779
|
+
self.phone_nsprefix_ = None
|
|
2780
|
+
self.tailgateRequired = _cast(None, tailgateRequired)
|
|
2781
|
+
self.tailgateRequired_nsprefix_ = None
|
|
2782
|
+
self.residential = _cast(None, residential)
|
|
2783
|
+
self.residential_nsprefix_ = None
|
|
2784
|
+
self.address1 = _cast(None, address1)
|
|
2785
|
+
self.address1_nsprefix_ = None
|
|
2786
|
+
self.address2 = _cast(None, address2)
|
|
2787
|
+
self.address2_nsprefix_ = None
|
|
2788
|
+
self.city = _cast(None, city)
|
|
2789
|
+
self.city_nsprefix_ = None
|
|
2790
|
+
self.state = _cast(None, state)
|
|
2791
|
+
self.state_nsprefix_ = None
|
|
2792
|
+
self.zip = _cast(None, zip)
|
|
2793
|
+
self.zip_nsprefix_ = None
|
|
2794
|
+
self.country = _cast(None, country)
|
|
2795
|
+
self.country_nsprefix_ = None
|
|
2796
|
+
self.valueOf_ = valueOf_
|
|
2797
|
+
|
|
2798
|
+
def factory(*args_, **kwargs_):
|
|
2799
|
+
if CurrentSubclassModule_ is not None:
|
|
2800
|
+
subclass = getSubclassFromModule_(CurrentSubclassModule_, ToType)
|
|
2801
|
+
if subclass is not None:
|
|
2802
|
+
return subclass(*args_, **kwargs_)
|
|
2803
|
+
if ToType.subclass:
|
|
2804
|
+
return ToType.subclass(*args_, **kwargs_)
|
|
2805
|
+
else:
|
|
2806
|
+
return ToType(*args_, **kwargs_)
|
|
2807
|
+
|
|
2808
|
+
factory = staticmethod(factory)
|
|
2809
|
+
|
|
2810
|
+
def get_ns_prefix_(self):
|
|
2811
|
+
return self.ns_prefix_
|
|
2812
|
+
|
|
2813
|
+
def set_ns_prefix_(self, ns_prefix):
|
|
2814
|
+
self.ns_prefix_ = ns_prefix
|
|
2815
|
+
|
|
2816
|
+
def get_id(self):
|
|
2817
|
+
return self.id
|
|
2818
|
+
|
|
2819
|
+
def set_id(self, id):
|
|
2820
|
+
self.id = id
|
|
2821
|
+
|
|
2822
|
+
def get_company(self):
|
|
2823
|
+
return self.company
|
|
2824
|
+
|
|
2825
|
+
def set_company(self, company):
|
|
2826
|
+
self.company = company
|
|
2827
|
+
|
|
2828
|
+
def get_notifyRecipient(self):
|
|
2829
|
+
return self.notifyRecipient
|
|
2830
|
+
|
|
2831
|
+
def set_notifyRecipient(self, notifyRecipient):
|
|
2832
|
+
self.notifyRecipient = notifyRecipient
|
|
2833
|
+
|
|
2834
|
+
def get_instructions(self):
|
|
2835
|
+
return self.instructions
|
|
2836
|
+
|
|
2837
|
+
def set_instructions(self, instructions):
|
|
2838
|
+
self.instructions = instructions
|
|
2839
|
+
|
|
2840
|
+
def get_email(self):
|
|
2841
|
+
return self.email
|
|
2842
|
+
|
|
2843
|
+
def set_email(self, email):
|
|
2844
|
+
self.email = email
|
|
2845
|
+
|
|
2846
|
+
def get_attention(self):
|
|
2847
|
+
return self.attention
|
|
2848
|
+
|
|
2849
|
+
def set_attention(self, attention):
|
|
2850
|
+
self.attention = attention
|
|
2851
|
+
|
|
2852
|
+
def get_phone(self):
|
|
2853
|
+
return self.phone
|
|
2854
|
+
|
|
2855
|
+
def set_phone(self, phone):
|
|
2856
|
+
self.phone = phone
|
|
2857
|
+
|
|
2858
|
+
def get_tailgateRequired(self):
|
|
2859
|
+
return self.tailgateRequired
|
|
2860
|
+
|
|
2861
|
+
def set_tailgateRequired(self, tailgateRequired):
|
|
2862
|
+
self.tailgateRequired = tailgateRequired
|
|
2863
|
+
|
|
2864
|
+
def get_residential(self):
|
|
2865
|
+
return self.residential
|
|
2866
|
+
|
|
2867
|
+
def set_residential(self, residential):
|
|
2868
|
+
self.residential = residential
|
|
2869
|
+
|
|
2870
|
+
def get_address1(self):
|
|
2871
|
+
return self.address1
|
|
2872
|
+
|
|
2873
|
+
def set_address1(self, address1):
|
|
2874
|
+
self.address1 = address1
|
|
2875
|
+
|
|
2876
|
+
def get_address2(self):
|
|
2877
|
+
return self.address2
|
|
2878
|
+
|
|
2879
|
+
def set_address2(self, address2):
|
|
2880
|
+
self.address2 = address2
|
|
2881
|
+
|
|
2882
|
+
def get_city(self):
|
|
2883
|
+
return self.city
|
|
2884
|
+
|
|
2885
|
+
def set_city(self, city):
|
|
2886
|
+
self.city = city
|
|
2887
|
+
|
|
2888
|
+
def get_state(self):
|
|
2889
|
+
return self.state
|
|
2890
|
+
|
|
2891
|
+
def set_state(self, state):
|
|
2892
|
+
self.state = state
|
|
2893
|
+
|
|
2894
|
+
def get_zip(self):
|
|
2895
|
+
return self.zip
|
|
2896
|
+
|
|
2897
|
+
def set_zip(self, zip):
|
|
2898
|
+
self.zip = zip
|
|
2899
|
+
|
|
2900
|
+
def get_country(self):
|
|
2901
|
+
return self.country
|
|
2902
|
+
|
|
2903
|
+
def set_country(self, country):
|
|
2904
|
+
self.country = country
|
|
2905
|
+
|
|
2906
|
+
def get_valueOf_(self):
|
|
2907
|
+
return self.valueOf_
|
|
2908
|
+
|
|
2909
|
+
def set_valueOf_(self, valueOf_):
|
|
2910
|
+
self.valueOf_ = valueOf_
|
|
2911
|
+
|
|
2912
|
+
def _hasContent(self):
|
|
2913
|
+
if 1 if type(self.valueOf_) in [int, float] else self.valueOf_:
|
|
2914
|
+
return True
|
|
2915
|
+
else:
|
|
2916
|
+
return False
|
|
2917
|
+
|
|
2918
|
+
def export(
|
|
2919
|
+
self,
|
|
2920
|
+
outfile,
|
|
2921
|
+
level,
|
|
2922
|
+
namespaceprefix_="",
|
|
2923
|
+
namespacedef_="",
|
|
2924
|
+
name_="ToType",
|
|
2925
|
+
pretty_print=True,
|
|
2926
|
+
):
|
|
2927
|
+
imported_ns_def_ = GenerateDSNamespaceDefs_.get("ToType")
|
|
2928
|
+
if imported_ns_def_ is not None:
|
|
2929
|
+
namespacedef_ = imported_ns_def_
|
|
2930
|
+
if pretty_print:
|
|
2931
|
+
eol_ = "\n"
|
|
2932
|
+
else:
|
|
2933
|
+
eol_ = ""
|
|
2934
|
+
if self.original_tagname_ is not None and name_ == "ToType":
|
|
2935
|
+
name_ = self.original_tagname_
|
|
2936
|
+
if UseCapturedNS_ and self.ns_prefix_:
|
|
2937
|
+
namespaceprefix_ = self.ns_prefix_ + ":"
|
|
2938
|
+
showIndent(outfile, level, pretty_print)
|
|
2939
|
+
outfile.write(
|
|
2940
|
+
"<%s%s%s"
|
|
2941
|
+
% (
|
|
2942
|
+
namespaceprefix_,
|
|
2943
|
+
name_,
|
|
2944
|
+
namespacedef_ and " " + namespacedef_ or "",
|
|
2945
|
+
)
|
|
2946
|
+
)
|
|
2947
|
+
already_processed = set()
|
|
2948
|
+
self._exportAttributes(
|
|
2949
|
+
outfile, level, already_processed, namespaceprefix_, name_="ToType"
|
|
2950
|
+
)
|
|
2951
|
+
if self._hasContent():
|
|
2952
|
+
outfile.write(">")
|
|
2953
|
+
outfile.write(self.convert_unicode(self.valueOf_))
|
|
2954
|
+
self._exportChildren(
|
|
2955
|
+
outfile,
|
|
2956
|
+
level + 1,
|
|
2957
|
+
namespaceprefix_,
|
|
2958
|
+
namespacedef_,
|
|
2959
|
+
name_="ToType",
|
|
2960
|
+
pretty_print=pretty_print,
|
|
2961
|
+
)
|
|
2962
|
+
outfile.write("</%s%s>%s" % (namespaceprefix_, name_, eol_))
|
|
2963
|
+
else:
|
|
2964
|
+
outfile.write("/>%s" % (eol_,))
|
|
2965
|
+
|
|
2966
|
+
def _exportAttributes(
|
|
2967
|
+
self, outfile, level, already_processed, namespaceprefix_="", name_="ToType"
|
|
2968
|
+
):
|
|
2969
|
+
if self.id is not None and "id" not in already_processed:
|
|
2970
|
+
already_processed.add("id")
|
|
2971
|
+
outfile.write(
|
|
2972
|
+
" id=%s"
|
|
2973
|
+
% (
|
|
2974
|
+
self.gds_encode(
|
|
2975
|
+
self.gds_format_string(quote_attrib(self.id), input_name="id")
|
|
2976
|
+
),
|
|
2977
|
+
)
|
|
2978
|
+
)
|
|
2979
|
+
if self.company is not None and "company" not in already_processed:
|
|
2980
|
+
already_processed.add("company")
|
|
2981
|
+
outfile.write(
|
|
2982
|
+
" company=%s"
|
|
2983
|
+
% (
|
|
2984
|
+
self.gds_encode(
|
|
2985
|
+
self.gds_format_string(
|
|
2986
|
+
quote_attrib(self.company), input_name="company"
|
|
2987
|
+
)
|
|
2988
|
+
),
|
|
2989
|
+
)
|
|
2990
|
+
)
|
|
2991
|
+
if (
|
|
2992
|
+
self.notifyRecipient is not None
|
|
2993
|
+
and "notifyRecipient" not in already_processed
|
|
2994
|
+
):
|
|
2995
|
+
already_processed.add("notifyRecipient")
|
|
2996
|
+
outfile.write(
|
|
2997
|
+
" notifyRecipient=%s"
|
|
2998
|
+
% (
|
|
2999
|
+
self.gds_encode(
|
|
3000
|
+
self.gds_format_string(
|
|
3001
|
+
quote_attrib(self.notifyRecipient),
|
|
3002
|
+
input_name="notifyRecipient",
|
|
3003
|
+
)
|
|
3004
|
+
),
|
|
3005
|
+
)
|
|
3006
|
+
)
|
|
3007
|
+
if self.instructions is not None and "instructions" not in already_processed:
|
|
3008
|
+
already_processed.add("instructions")
|
|
3009
|
+
outfile.write(
|
|
3010
|
+
" instructions=%s"
|
|
3011
|
+
% (
|
|
3012
|
+
self.gds_encode(
|
|
3013
|
+
self.gds_format_string(
|
|
3014
|
+
quote_attrib(self.instructions), input_name="instructions"
|
|
3015
|
+
)
|
|
3016
|
+
),
|
|
3017
|
+
)
|
|
3018
|
+
)
|
|
3019
|
+
if self.email is not None and "email" not in already_processed:
|
|
3020
|
+
already_processed.add("email")
|
|
3021
|
+
outfile.write(
|
|
3022
|
+
" email=%s"
|
|
3023
|
+
% (
|
|
3024
|
+
self.gds_encode(
|
|
3025
|
+
self.gds_format_string(
|
|
3026
|
+
quote_attrib(self.email), input_name="email"
|
|
3027
|
+
)
|
|
3028
|
+
),
|
|
3029
|
+
)
|
|
3030
|
+
)
|
|
3031
|
+
if self.attention is not None and "attention" not in already_processed:
|
|
3032
|
+
already_processed.add("attention")
|
|
3033
|
+
outfile.write(
|
|
3034
|
+
" attention=%s"
|
|
3035
|
+
% (
|
|
3036
|
+
self.gds_encode(
|
|
3037
|
+
self.gds_format_string(
|
|
3038
|
+
quote_attrib(self.attention), input_name="attention"
|
|
3039
|
+
)
|
|
3040
|
+
),
|
|
3041
|
+
)
|
|
3042
|
+
)
|
|
3043
|
+
if self.phone is not None and "phone" not in already_processed:
|
|
3044
|
+
already_processed.add("phone")
|
|
3045
|
+
outfile.write(
|
|
3046
|
+
" phone=%s"
|
|
3047
|
+
% (
|
|
3048
|
+
self.gds_encode(
|
|
3049
|
+
self.gds_format_string(
|
|
3050
|
+
quote_attrib(self.phone), input_name="phone"
|
|
3051
|
+
)
|
|
3052
|
+
),
|
|
3053
|
+
)
|
|
3054
|
+
)
|
|
3055
|
+
if (
|
|
3056
|
+
self.tailgateRequired is not None
|
|
3057
|
+
and "tailgateRequired" not in already_processed
|
|
3058
|
+
):
|
|
3059
|
+
already_processed.add("tailgateRequired")
|
|
3060
|
+
outfile.write(
|
|
3061
|
+
" tailgateRequired=%s"
|
|
3062
|
+
% (
|
|
3063
|
+
self.gds_encode(
|
|
3064
|
+
self.gds_format_string(
|
|
3065
|
+
quote_attrib(self.tailgateRequired),
|
|
3066
|
+
input_name="tailgateRequired",
|
|
3067
|
+
)
|
|
3068
|
+
),
|
|
3069
|
+
)
|
|
3070
|
+
)
|
|
3071
|
+
if self.residential is not None and "residential" not in already_processed:
|
|
3072
|
+
already_processed.add("residential")
|
|
3073
|
+
outfile.write(
|
|
3074
|
+
" residential=%s"
|
|
3075
|
+
% (
|
|
3076
|
+
self.gds_encode(
|
|
3077
|
+
self.gds_format_string(
|
|
3078
|
+
quote_attrib(self.residential), input_name="residential"
|
|
3079
|
+
)
|
|
3080
|
+
),
|
|
3081
|
+
)
|
|
3082
|
+
)
|
|
3083
|
+
if self.address1 is not None and "address1" not in already_processed:
|
|
3084
|
+
already_processed.add("address1")
|
|
3085
|
+
outfile.write(
|
|
3086
|
+
" address1=%s"
|
|
3087
|
+
% (
|
|
3088
|
+
self.gds_encode(
|
|
3089
|
+
self.gds_format_string(
|
|
3090
|
+
quote_attrib(self.address1), input_name="address1"
|
|
3091
|
+
)
|
|
3092
|
+
),
|
|
3093
|
+
)
|
|
3094
|
+
)
|
|
3095
|
+
if self.address2 is not None and "address2" not in already_processed:
|
|
3096
|
+
already_processed.add("address2")
|
|
3097
|
+
outfile.write(
|
|
3098
|
+
" address2=%s"
|
|
3099
|
+
% (
|
|
3100
|
+
self.gds_encode(
|
|
3101
|
+
self.gds_format_string(
|
|
3102
|
+
quote_attrib(self.address2), input_name="address2"
|
|
3103
|
+
)
|
|
3104
|
+
),
|
|
3105
|
+
)
|
|
3106
|
+
)
|
|
3107
|
+
if self.city is not None and "city" not in already_processed:
|
|
3108
|
+
already_processed.add("city")
|
|
3109
|
+
outfile.write(
|
|
3110
|
+
" city=%s"
|
|
3111
|
+
% (
|
|
3112
|
+
self.gds_encode(
|
|
3113
|
+
self.gds_format_string(
|
|
3114
|
+
quote_attrib(self.city), input_name="city"
|
|
3115
|
+
)
|
|
3116
|
+
),
|
|
3117
|
+
)
|
|
3118
|
+
)
|
|
3119
|
+
if self.state is not None and "state" not in already_processed:
|
|
3120
|
+
already_processed.add("state")
|
|
3121
|
+
outfile.write(
|
|
3122
|
+
" state=%s"
|
|
3123
|
+
% (
|
|
3124
|
+
self.gds_encode(
|
|
3125
|
+
self.gds_format_string(
|
|
3126
|
+
quote_attrib(self.state), input_name="state"
|
|
3127
|
+
)
|
|
3128
|
+
),
|
|
3129
|
+
)
|
|
3130
|
+
)
|
|
3131
|
+
if self.zip is not None and "zip" not in already_processed:
|
|
3132
|
+
already_processed.add("zip")
|
|
3133
|
+
outfile.write(
|
|
3134
|
+
" zip=%s"
|
|
3135
|
+
% (
|
|
3136
|
+
self.gds_encode(
|
|
3137
|
+
self.gds_format_string(quote_attrib(self.zip), input_name="zip")
|
|
3138
|
+
),
|
|
3139
|
+
)
|
|
3140
|
+
)
|
|
3141
|
+
if self.country is not None and "country" not in already_processed:
|
|
3142
|
+
already_processed.add("country")
|
|
3143
|
+
outfile.write(
|
|
3144
|
+
" country=%s"
|
|
3145
|
+
% (
|
|
3146
|
+
self.gds_encode(
|
|
3147
|
+
self.gds_format_string(
|
|
3148
|
+
quote_attrib(self.country), input_name="country"
|
|
3149
|
+
)
|
|
3150
|
+
),
|
|
3151
|
+
)
|
|
3152
|
+
)
|
|
3153
|
+
|
|
3154
|
+
def _exportChildren(
|
|
3155
|
+
self,
|
|
3156
|
+
outfile,
|
|
3157
|
+
level,
|
|
3158
|
+
namespaceprefix_="",
|
|
3159
|
+
namespacedef_="",
|
|
3160
|
+
name_="ToType",
|
|
3161
|
+
fromsubclass_=False,
|
|
3162
|
+
pretty_print=True,
|
|
3163
|
+
):
|
|
3164
|
+
pass
|
|
3165
|
+
|
|
3166
|
+
def build(self, node, gds_collector_=None):
|
|
3167
|
+
self.gds_collector_ = gds_collector_
|
|
3168
|
+
if SaveElementTreeNode:
|
|
3169
|
+
self.gds_elementtree_node_ = node
|
|
3170
|
+
already_processed = set()
|
|
3171
|
+
self.ns_prefix_ = node.prefix
|
|
3172
|
+
self._buildAttributes(node, node.attrib, already_processed)
|
|
3173
|
+
self.valueOf_ = get_all_text_(node)
|
|
3174
|
+
for child in node:
|
|
3175
|
+
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
|
|
3176
|
+
self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
|
|
3177
|
+
return self
|
|
3178
|
+
|
|
3179
|
+
def _buildAttributes(self, node, attrs, already_processed):
|
|
3180
|
+
value = find_attr_value_("id", node)
|
|
3181
|
+
if value is not None and "id" not in already_processed:
|
|
3182
|
+
already_processed.add("id")
|
|
3183
|
+
self.id = value
|
|
3184
|
+
value = find_attr_value_("company", node)
|
|
3185
|
+
if value is not None and "company" not in already_processed:
|
|
3186
|
+
already_processed.add("company")
|
|
3187
|
+
self.company = value
|
|
3188
|
+
value = find_attr_value_("notifyRecipient", node)
|
|
3189
|
+
if value is not None and "notifyRecipient" not in already_processed:
|
|
3190
|
+
already_processed.add("notifyRecipient")
|
|
3191
|
+
self.notifyRecipient = value
|
|
3192
|
+
value = find_attr_value_("instructions", node)
|
|
3193
|
+
if value is not None and "instructions" not in already_processed:
|
|
3194
|
+
already_processed.add("instructions")
|
|
3195
|
+
self.instructions = value
|
|
3196
|
+
value = find_attr_value_("email", node)
|
|
3197
|
+
if value is not None and "email" not in already_processed:
|
|
3198
|
+
already_processed.add("email")
|
|
3199
|
+
self.email = value
|
|
3200
|
+
value = find_attr_value_("attention", node)
|
|
3201
|
+
if value is not None and "attention" not in already_processed:
|
|
3202
|
+
already_processed.add("attention")
|
|
3203
|
+
self.attention = value
|
|
3204
|
+
value = find_attr_value_("phone", node)
|
|
3205
|
+
if value is not None and "phone" not in already_processed:
|
|
3206
|
+
already_processed.add("phone")
|
|
3207
|
+
self.phone = value
|
|
3208
|
+
value = find_attr_value_("tailgateRequired", node)
|
|
3209
|
+
if value is not None and "tailgateRequired" not in already_processed:
|
|
3210
|
+
already_processed.add("tailgateRequired")
|
|
3211
|
+
self.tailgateRequired = value
|
|
3212
|
+
value = find_attr_value_("residential", node)
|
|
3213
|
+
if value is not None and "residential" not in already_processed:
|
|
3214
|
+
already_processed.add("residential")
|
|
3215
|
+
self.residential = value
|
|
3216
|
+
value = find_attr_value_("address1", node)
|
|
3217
|
+
if value is not None and "address1" not in already_processed:
|
|
3218
|
+
already_processed.add("address1")
|
|
3219
|
+
self.address1 = value
|
|
3220
|
+
value = find_attr_value_("address2", node)
|
|
3221
|
+
if value is not None and "address2" not in already_processed:
|
|
3222
|
+
already_processed.add("address2")
|
|
3223
|
+
self.address2 = value
|
|
3224
|
+
value = find_attr_value_("city", node)
|
|
3225
|
+
if value is not None and "city" not in already_processed:
|
|
3226
|
+
already_processed.add("city")
|
|
3227
|
+
self.city = value
|
|
3228
|
+
value = find_attr_value_("state", node)
|
|
3229
|
+
if value is not None and "state" not in already_processed:
|
|
3230
|
+
already_processed.add("state")
|
|
3231
|
+
self.state = value
|
|
3232
|
+
value = find_attr_value_("zip", node)
|
|
3233
|
+
if value is not None and "zip" not in already_processed:
|
|
3234
|
+
already_processed.add("zip")
|
|
3235
|
+
self.zip = value
|
|
3236
|
+
value = find_attr_value_("country", node)
|
|
3237
|
+
if value is not None and "country" not in already_processed:
|
|
3238
|
+
already_processed.add("country")
|
|
3239
|
+
self.country = value
|
|
3240
|
+
|
|
3241
|
+
def _buildChildren(
|
|
3242
|
+
self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None
|
|
3243
|
+
):
|
|
3244
|
+
pass
|
|
3245
|
+
|
|
3246
|
+
|
|
3247
|
+
# end class ToType
|
|
3248
|
+
|
|
3249
|
+
|
|
3250
|
+
class CODType(GeneratedsSuper):
|
|
3251
|
+
__hash__ = GeneratedsSuper.__hash__
|
|
3252
|
+
subclass = None
|
|
3253
|
+
superclass = None
|
|
3254
|
+
|
|
3255
|
+
def __init__(
|
|
3256
|
+
self, paymentType=None, CODReturnAddress=None, gds_collector_=None, **kwargs_
|
|
3257
|
+
):
|
|
3258
|
+
self.gds_collector_ = gds_collector_
|
|
3259
|
+
self.gds_elementtree_node_ = None
|
|
3260
|
+
self.original_tagname_ = None
|
|
3261
|
+
self.parent_object_ = kwargs_.get("parent_object_")
|
|
3262
|
+
self.ns_prefix_ = None
|
|
3263
|
+
self.paymentType = _cast(None, paymentType)
|
|
3264
|
+
self.paymentType_nsprefix_ = None
|
|
3265
|
+
self.CODReturnAddress = CODReturnAddress
|
|
3266
|
+
self.CODReturnAddress_nsprefix_ = None
|
|
3267
|
+
|
|
3268
|
+
def factory(*args_, **kwargs_):
|
|
3269
|
+
if CurrentSubclassModule_ is not None:
|
|
3270
|
+
subclass = getSubclassFromModule_(CurrentSubclassModule_, CODType)
|
|
3271
|
+
if subclass is not None:
|
|
3272
|
+
return subclass(*args_, **kwargs_)
|
|
3273
|
+
if CODType.subclass:
|
|
3274
|
+
return CODType.subclass(*args_, **kwargs_)
|
|
3275
|
+
else:
|
|
3276
|
+
return CODType(*args_, **kwargs_)
|
|
3277
|
+
|
|
3278
|
+
factory = staticmethod(factory)
|
|
3279
|
+
|
|
3280
|
+
def get_ns_prefix_(self):
|
|
3281
|
+
return self.ns_prefix_
|
|
3282
|
+
|
|
3283
|
+
def set_ns_prefix_(self, ns_prefix):
|
|
3284
|
+
self.ns_prefix_ = ns_prefix
|
|
3285
|
+
|
|
3286
|
+
def get_CODReturnAddress(self):
|
|
3287
|
+
return self.CODReturnAddress
|
|
3288
|
+
|
|
3289
|
+
def set_CODReturnAddress(self, CODReturnAddress):
|
|
3290
|
+
self.CODReturnAddress = CODReturnAddress
|
|
3291
|
+
|
|
3292
|
+
def get_paymentType(self):
|
|
3293
|
+
return self.paymentType
|
|
3294
|
+
|
|
3295
|
+
def set_paymentType(self, paymentType):
|
|
3296
|
+
self.paymentType = paymentType
|
|
3297
|
+
|
|
3298
|
+
def _hasContent(self):
|
|
3299
|
+
if self.CODReturnAddress is not None:
|
|
3300
|
+
return True
|
|
3301
|
+
else:
|
|
3302
|
+
return False
|
|
3303
|
+
|
|
3304
|
+
def export(
|
|
3305
|
+
self,
|
|
3306
|
+
outfile,
|
|
3307
|
+
level,
|
|
3308
|
+
namespaceprefix_="",
|
|
3309
|
+
namespacedef_="",
|
|
3310
|
+
name_="CODType",
|
|
3311
|
+
pretty_print=True,
|
|
3312
|
+
):
|
|
3313
|
+
imported_ns_def_ = GenerateDSNamespaceDefs_.get("CODType")
|
|
3314
|
+
if imported_ns_def_ is not None:
|
|
3315
|
+
namespacedef_ = imported_ns_def_
|
|
3316
|
+
if pretty_print:
|
|
3317
|
+
eol_ = "\n"
|
|
3318
|
+
else:
|
|
3319
|
+
eol_ = ""
|
|
3320
|
+
if self.original_tagname_ is not None and name_ == "CODType":
|
|
3321
|
+
name_ = self.original_tagname_
|
|
3322
|
+
if UseCapturedNS_ and self.ns_prefix_:
|
|
3323
|
+
namespaceprefix_ = self.ns_prefix_ + ":"
|
|
3324
|
+
showIndent(outfile, level, pretty_print)
|
|
3325
|
+
outfile.write(
|
|
3326
|
+
"<%s%s%s"
|
|
3327
|
+
% (
|
|
3328
|
+
namespaceprefix_,
|
|
3329
|
+
name_,
|
|
3330
|
+
namespacedef_ and " " + namespacedef_ or "",
|
|
3331
|
+
)
|
|
3332
|
+
)
|
|
3333
|
+
already_processed = set()
|
|
3334
|
+
self._exportAttributes(
|
|
3335
|
+
outfile, level, already_processed, namespaceprefix_, name_="CODType"
|
|
3336
|
+
)
|
|
3337
|
+
if self._hasContent():
|
|
3338
|
+
outfile.write(">%s" % (eol_,))
|
|
3339
|
+
self._exportChildren(
|
|
3340
|
+
outfile,
|
|
3341
|
+
level + 1,
|
|
3342
|
+
namespaceprefix_,
|
|
3343
|
+
namespacedef_,
|
|
3344
|
+
name_="CODType",
|
|
3345
|
+
pretty_print=pretty_print,
|
|
3346
|
+
)
|
|
3347
|
+
showIndent(outfile, level, pretty_print)
|
|
3348
|
+
outfile.write("</%s%s>%s" % (namespaceprefix_, name_, eol_))
|
|
3349
|
+
else:
|
|
3350
|
+
outfile.write("/>%s" % (eol_,))
|
|
3351
|
+
|
|
3352
|
+
def _exportAttributes(
|
|
3353
|
+
self, outfile, level, already_processed, namespaceprefix_="", name_="CODType"
|
|
3354
|
+
):
|
|
3355
|
+
if self.paymentType is not None and "paymentType" not in already_processed:
|
|
3356
|
+
already_processed.add("paymentType")
|
|
3357
|
+
outfile.write(
|
|
3358
|
+
" paymentType=%s"
|
|
3359
|
+
% (
|
|
3360
|
+
self.gds_encode(
|
|
3361
|
+
self.gds_format_string(
|
|
3362
|
+
quote_attrib(self.paymentType), input_name="paymentType"
|
|
3363
|
+
)
|
|
3364
|
+
),
|
|
3365
|
+
)
|
|
3366
|
+
)
|
|
3367
|
+
|
|
3368
|
+
def _exportChildren(
|
|
3369
|
+
self,
|
|
3370
|
+
outfile,
|
|
3371
|
+
level,
|
|
3372
|
+
namespaceprefix_="",
|
|
3373
|
+
namespacedef_="",
|
|
3374
|
+
name_="CODType",
|
|
3375
|
+
fromsubclass_=False,
|
|
3376
|
+
pretty_print=True,
|
|
3377
|
+
):
|
|
3378
|
+
if pretty_print:
|
|
3379
|
+
eol_ = "\n"
|
|
3380
|
+
else:
|
|
3381
|
+
eol_ = ""
|
|
3382
|
+
if self.CODReturnAddress is not None:
|
|
3383
|
+
namespaceprefix_ = (
|
|
3384
|
+
self.CODReturnAddress_nsprefix_ + ":"
|
|
3385
|
+
if (UseCapturedNS_ and self.CODReturnAddress_nsprefix_)
|
|
3386
|
+
else ""
|
|
3387
|
+
)
|
|
3388
|
+
self.CODReturnAddress.export(
|
|
3389
|
+
outfile,
|
|
3390
|
+
level,
|
|
3391
|
+
namespaceprefix_,
|
|
3392
|
+
namespacedef_="",
|
|
3393
|
+
name_="CODReturnAddress",
|
|
3394
|
+
pretty_print=pretty_print,
|
|
3395
|
+
)
|
|
3396
|
+
|
|
3397
|
+
def build(self, node, gds_collector_=None):
|
|
3398
|
+
self.gds_collector_ = gds_collector_
|
|
3399
|
+
if SaveElementTreeNode:
|
|
3400
|
+
self.gds_elementtree_node_ = node
|
|
3401
|
+
already_processed = set()
|
|
3402
|
+
self.ns_prefix_ = node.prefix
|
|
3403
|
+
self._buildAttributes(node, node.attrib, already_processed)
|
|
3404
|
+
for child in node:
|
|
3405
|
+
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
|
|
3406
|
+
self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
|
|
3407
|
+
return self
|
|
3408
|
+
|
|
3409
|
+
def _buildAttributes(self, node, attrs, already_processed):
|
|
3410
|
+
value = find_attr_value_("paymentType", node)
|
|
3411
|
+
if value is not None and "paymentType" not in already_processed:
|
|
3412
|
+
already_processed.add("paymentType")
|
|
3413
|
+
self.paymentType = value
|
|
3414
|
+
|
|
3415
|
+
def _buildChildren(
|
|
3416
|
+
self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None
|
|
3417
|
+
):
|
|
3418
|
+
if nodeName_ == "CODReturnAddress":
|
|
3419
|
+
obj_ = CODReturnAddressType.factory(parent_object_=self)
|
|
3420
|
+
obj_.build(child_, gds_collector_=gds_collector_)
|
|
3421
|
+
self.CODReturnAddress = obj_
|
|
3422
|
+
obj_.original_tagname_ = "CODReturnAddress"
|
|
3423
|
+
|
|
3424
|
+
|
|
3425
|
+
# end class CODType
|
|
3426
|
+
|
|
3427
|
+
|
|
3428
|
+
class CODReturnAddressType(GeneratedsSuper):
|
|
3429
|
+
__hash__ = GeneratedsSuper.__hash__
|
|
3430
|
+
subclass = None
|
|
3431
|
+
superclass = None
|
|
3432
|
+
|
|
3433
|
+
def __init__(
|
|
3434
|
+
self,
|
|
3435
|
+
codCompany=None,
|
|
3436
|
+
codName=None,
|
|
3437
|
+
codAddress1=None,
|
|
3438
|
+
codCity=None,
|
|
3439
|
+
codStateCode=None,
|
|
3440
|
+
codZip=None,
|
|
3441
|
+
codCountry=None,
|
|
3442
|
+
valueOf_=None,
|
|
3443
|
+
gds_collector_=None,
|
|
3444
|
+
**kwargs_
|
|
3445
|
+
):
|
|
3446
|
+
self.gds_collector_ = gds_collector_
|
|
3447
|
+
self.gds_elementtree_node_ = None
|
|
3448
|
+
self.original_tagname_ = None
|
|
3449
|
+
self.parent_object_ = kwargs_.get("parent_object_")
|
|
3450
|
+
self.ns_prefix_ = None
|
|
3451
|
+
self.codCompany = _cast(None, codCompany)
|
|
3452
|
+
self.codCompany_nsprefix_ = None
|
|
3453
|
+
self.codName = _cast(None, codName)
|
|
3454
|
+
self.codName_nsprefix_ = None
|
|
3455
|
+
self.codAddress1 = _cast(None, codAddress1)
|
|
3456
|
+
self.codAddress1_nsprefix_ = None
|
|
3457
|
+
self.codCity = _cast(None, codCity)
|
|
3458
|
+
self.codCity_nsprefix_ = None
|
|
3459
|
+
self.codStateCode = _cast(None, codStateCode)
|
|
3460
|
+
self.codStateCode_nsprefix_ = None
|
|
3461
|
+
self.codZip = _cast(None, codZip)
|
|
3462
|
+
self.codZip_nsprefix_ = None
|
|
3463
|
+
self.codCountry = _cast(None, codCountry)
|
|
3464
|
+
self.codCountry_nsprefix_ = None
|
|
3465
|
+
self.valueOf_ = valueOf_
|
|
3466
|
+
|
|
3467
|
+
def factory(*args_, **kwargs_):
|
|
3468
|
+
if CurrentSubclassModule_ is not None:
|
|
3469
|
+
subclass = getSubclassFromModule_(
|
|
3470
|
+
CurrentSubclassModule_, CODReturnAddressType
|
|
3471
|
+
)
|
|
3472
|
+
if subclass is not None:
|
|
3473
|
+
return subclass(*args_, **kwargs_)
|
|
3474
|
+
if CODReturnAddressType.subclass:
|
|
3475
|
+
return CODReturnAddressType.subclass(*args_, **kwargs_)
|
|
3476
|
+
else:
|
|
3477
|
+
return CODReturnAddressType(*args_, **kwargs_)
|
|
3478
|
+
|
|
3479
|
+
factory = staticmethod(factory)
|
|
3480
|
+
|
|
3481
|
+
def get_ns_prefix_(self):
|
|
3482
|
+
return self.ns_prefix_
|
|
3483
|
+
|
|
3484
|
+
def set_ns_prefix_(self, ns_prefix):
|
|
3485
|
+
self.ns_prefix_ = ns_prefix
|
|
3486
|
+
|
|
3487
|
+
def get_codCompany(self):
|
|
3488
|
+
return self.codCompany
|
|
3489
|
+
|
|
3490
|
+
def set_codCompany(self, codCompany):
|
|
3491
|
+
self.codCompany = codCompany
|
|
3492
|
+
|
|
3493
|
+
def get_codName(self):
|
|
3494
|
+
return self.codName
|
|
3495
|
+
|
|
3496
|
+
def set_codName(self, codName):
|
|
3497
|
+
self.codName = codName
|
|
3498
|
+
|
|
3499
|
+
def get_codAddress1(self):
|
|
3500
|
+
return self.codAddress1
|
|
3501
|
+
|
|
3502
|
+
def set_codAddress1(self, codAddress1):
|
|
3503
|
+
self.codAddress1 = codAddress1
|
|
3504
|
+
|
|
3505
|
+
def get_codCity(self):
|
|
3506
|
+
return self.codCity
|
|
3507
|
+
|
|
3508
|
+
def set_codCity(self, codCity):
|
|
3509
|
+
self.codCity = codCity
|
|
3510
|
+
|
|
3511
|
+
def get_codStateCode(self):
|
|
3512
|
+
return self.codStateCode
|
|
3513
|
+
|
|
3514
|
+
def set_codStateCode(self, codStateCode):
|
|
3515
|
+
self.codStateCode = codStateCode
|
|
3516
|
+
|
|
3517
|
+
def get_codZip(self):
|
|
3518
|
+
return self.codZip
|
|
3519
|
+
|
|
3520
|
+
def set_codZip(self, codZip):
|
|
3521
|
+
self.codZip = codZip
|
|
3522
|
+
|
|
3523
|
+
def get_codCountry(self):
|
|
3524
|
+
return self.codCountry
|
|
3525
|
+
|
|
3526
|
+
def set_codCountry(self, codCountry):
|
|
3527
|
+
self.codCountry = codCountry
|
|
3528
|
+
|
|
3529
|
+
def get_valueOf_(self):
|
|
3530
|
+
return self.valueOf_
|
|
3531
|
+
|
|
3532
|
+
def set_valueOf_(self, valueOf_):
|
|
3533
|
+
self.valueOf_ = valueOf_
|
|
3534
|
+
|
|
3535
|
+
def _hasContent(self):
|
|
3536
|
+
if 1 if type(self.valueOf_) in [int, float] else self.valueOf_:
|
|
3537
|
+
return True
|
|
3538
|
+
else:
|
|
3539
|
+
return False
|
|
3540
|
+
|
|
3541
|
+
def export(
|
|
3542
|
+
self,
|
|
3543
|
+
outfile,
|
|
3544
|
+
level,
|
|
3545
|
+
namespaceprefix_="",
|
|
3546
|
+
namespacedef_="",
|
|
3547
|
+
name_="CODReturnAddressType",
|
|
3548
|
+
pretty_print=True,
|
|
3549
|
+
):
|
|
3550
|
+
imported_ns_def_ = GenerateDSNamespaceDefs_.get("CODReturnAddressType")
|
|
3551
|
+
if imported_ns_def_ is not None:
|
|
3552
|
+
namespacedef_ = imported_ns_def_
|
|
3553
|
+
if pretty_print:
|
|
3554
|
+
eol_ = "\n"
|
|
3555
|
+
else:
|
|
3556
|
+
eol_ = ""
|
|
3557
|
+
if self.original_tagname_ is not None and name_ == "CODReturnAddressType":
|
|
3558
|
+
name_ = self.original_tagname_
|
|
3559
|
+
if UseCapturedNS_ and self.ns_prefix_:
|
|
3560
|
+
namespaceprefix_ = self.ns_prefix_ + ":"
|
|
3561
|
+
showIndent(outfile, level, pretty_print)
|
|
3562
|
+
outfile.write(
|
|
3563
|
+
"<%s%s%s"
|
|
3564
|
+
% (
|
|
3565
|
+
namespaceprefix_,
|
|
3566
|
+
name_,
|
|
3567
|
+
namespacedef_ and " " + namespacedef_ or "",
|
|
3568
|
+
)
|
|
3569
|
+
)
|
|
3570
|
+
already_processed = set()
|
|
3571
|
+
self._exportAttributes(
|
|
3572
|
+
outfile,
|
|
3573
|
+
level,
|
|
3574
|
+
already_processed,
|
|
3575
|
+
namespaceprefix_,
|
|
3576
|
+
name_="CODReturnAddressType",
|
|
3577
|
+
)
|
|
3578
|
+
if self._hasContent():
|
|
3579
|
+
outfile.write(">")
|
|
3580
|
+
outfile.write(self.convert_unicode(self.valueOf_))
|
|
3581
|
+
self._exportChildren(
|
|
3582
|
+
outfile,
|
|
3583
|
+
level + 1,
|
|
3584
|
+
namespaceprefix_,
|
|
3585
|
+
namespacedef_,
|
|
3586
|
+
name_="CODReturnAddressType",
|
|
3587
|
+
pretty_print=pretty_print,
|
|
3588
|
+
)
|
|
3589
|
+
outfile.write("</%s%s>%s" % (namespaceprefix_, name_, eol_))
|
|
3590
|
+
else:
|
|
3591
|
+
outfile.write("/>%s" % (eol_,))
|
|
3592
|
+
|
|
3593
|
+
def _exportAttributes(
|
|
3594
|
+
self,
|
|
3595
|
+
outfile,
|
|
3596
|
+
level,
|
|
3597
|
+
already_processed,
|
|
3598
|
+
namespaceprefix_="",
|
|
3599
|
+
name_="CODReturnAddressType",
|
|
3600
|
+
):
|
|
3601
|
+
if self.codCompany is not None and "codCompany" not in already_processed:
|
|
3602
|
+
already_processed.add("codCompany")
|
|
3603
|
+
outfile.write(
|
|
3604
|
+
" codCompany=%s"
|
|
3605
|
+
% (
|
|
3606
|
+
self.gds_encode(
|
|
3607
|
+
self.gds_format_string(
|
|
3608
|
+
quote_attrib(self.codCompany), input_name="codCompany"
|
|
3609
|
+
)
|
|
3610
|
+
),
|
|
3611
|
+
)
|
|
3612
|
+
)
|
|
3613
|
+
if self.codName is not None and "codName" not in already_processed:
|
|
3614
|
+
already_processed.add("codName")
|
|
3615
|
+
outfile.write(
|
|
3616
|
+
" codName=%s"
|
|
3617
|
+
% (
|
|
3618
|
+
self.gds_encode(
|
|
3619
|
+
self.gds_format_string(
|
|
3620
|
+
quote_attrib(self.codName), input_name="codName"
|
|
3621
|
+
)
|
|
3622
|
+
),
|
|
3623
|
+
)
|
|
3624
|
+
)
|
|
3625
|
+
if self.codAddress1 is not None and "codAddress1" not in already_processed:
|
|
3626
|
+
already_processed.add("codAddress1")
|
|
3627
|
+
outfile.write(
|
|
3628
|
+
" codAddress1=%s"
|
|
3629
|
+
% (
|
|
3630
|
+
self.gds_encode(
|
|
3631
|
+
self.gds_format_string(
|
|
3632
|
+
quote_attrib(self.codAddress1), input_name="codAddress1"
|
|
3633
|
+
)
|
|
3634
|
+
),
|
|
3635
|
+
)
|
|
3636
|
+
)
|
|
3637
|
+
if self.codCity is not None and "codCity" not in already_processed:
|
|
3638
|
+
already_processed.add("codCity")
|
|
3639
|
+
outfile.write(
|
|
3640
|
+
" codCity=%s"
|
|
3641
|
+
% (
|
|
3642
|
+
self.gds_encode(
|
|
3643
|
+
self.gds_format_string(
|
|
3644
|
+
quote_attrib(self.codCity), input_name="codCity"
|
|
3645
|
+
)
|
|
3646
|
+
),
|
|
3647
|
+
)
|
|
3648
|
+
)
|
|
3649
|
+
if self.codStateCode is not None and "codStateCode" not in already_processed:
|
|
3650
|
+
already_processed.add("codStateCode")
|
|
3651
|
+
outfile.write(
|
|
3652
|
+
" codStateCode=%s"
|
|
3653
|
+
% (
|
|
3654
|
+
self.gds_encode(
|
|
3655
|
+
self.gds_format_string(
|
|
3656
|
+
quote_attrib(self.codStateCode), input_name="codStateCode"
|
|
3657
|
+
)
|
|
3658
|
+
),
|
|
3659
|
+
)
|
|
3660
|
+
)
|
|
3661
|
+
if self.codZip is not None and "codZip" not in already_processed:
|
|
3662
|
+
already_processed.add("codZip")
|
|
3663
|
+
outfile.write(
|
|
3664
|
+
" codZip=%s"
|
|
3665
|
+
% (
|
|
3666
|
+
self.gds_encode(
|
|
3667
|
+
self.gds_format_string(
|
|
3668
|
+
quote_attrib(self.codZip), input_name="codZip"
|
|
3669
|
+
)
|
|
3670
|
+
),
|
|
3671
|
+
)
|
|
3672
|
+
)
|
|
3673
|
+
if self.codCountry is not None and "codCountry" not in already_processed:
|
|
3674
|
+
already_processed.add("codCountry")
|
|
3675
|
+
outfile.write(
|
|
3676
|
+
" codCountry=%s"
|
|
3677
|
+
% (
|
|
3678
|
+
self.gds_encode(
|
|
3679
|
+
self.gds_format_string(
|
|
3680
|
+
quote_attrib(self.codCountry), input_name="codCountry"
|
|
3681
|
+
)
|
|
3682
|
+
),
|
|
3683
|
+
)
|
|
3684
|
+
)
|
|
3685
|
+
|
|
3686
|
+
def _exportChildren(
|
|
3687
|
+
self,
|
|
3688
|
+
outfile,
|
|
3689
|
+
level,
|
|
3690
|
+
namespaceprefix_="",
|
|
3691
|
+
namespacedef_="",
|
|
3692
|
+
name_="CODReturnAddressType",
|
|
3693
|
+
fromsubclass_=False,
|
|
3694
|
+
pretty_print=True,
|
|
3695
|
+
):
|
|
3696
|
+
pass
|
|
3697
|
+
|
|
3698
|
+
def build(self, node, gds_collector_=None):
|
|
3699
|
+
self.gds_collector_ = gds_collector_
|
|
3700
|
+
if SaveElementTreeNode:
|
|
3701
|
+
self.gds_elementtree_node_ = node
|
|
3702
|
+
already_processed = set()
|
|
3703
|
+
self.ns_prefix_ = node.prefix
|
|
3704
|
+
self._buildAttributes(node, node.attrib, already_processed)
|
|
3705
|
+
self.valueOf_ = get_all_text_(node)
|
|
3706
|
+
for child in node:
|
|
3707
|
+
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
|
|
3708
|
+
self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
|
|
3709
|
+
return self
|
|
3710
|
+
|
|
3711
|
+
def _buildAttributes(self, node, attrs, already_processed):
|
|
3712
|
+
value = find_attr_value_("codCompany", node)
|
|
3713
|
+
if value is not None and "codCompany" not in already_processed:
|
|
3714
|
+
already_processed.add("codCompany")
|
|
3715
|
+
self.codCompany = value
|
|
3716
|
+
value = find_attr_value_("codName", node)
|
|
3717
|
+
if value is not None and "codName" not in already_processed:
|
|
3718
|
+
already_processed.add("codName")
|
|
3719
|
+
self.codName = value
|
|
3720
|
+
value = find_attr_value_("codAddress1", node)
|
|
3721
|
+
if value is not None and "codAddress1" not in already_processed:
|
|
3722
|
+
already_processed.add("codAddress1")
|
|
3723
|
+
self.codAddress1 = value
|
|
3724
|
+
value = find_attr_value_("codCity", node)
|
|
3725
|
+
if value is not None and "codCity" not in already_processed:
|
|
3726
|
+
already_processed.add("codCity")
|
|
3727
|
+
self.codCity = value
|
|
3728
|
+
value = find_attr_value_("codStateCode", node)
|
|
3729
|
+
if value is not None and "codStateCode" not in already_processed:
|
|
3730
|
+
already_processed.add("codStateCode")
|
|
3731
|
+
self.codStateCode = value
|
|
3732
|
+
value = find_attr_value_("codZip", node)
|
|
3733
|
+
if value is not None and "codZip" not in already_processed:
|
|
3734
|
+
already_processed.add("codZip")
|
|
3735
|
+
self.codZip = value
|
|
3736
|
+
value = find_attr_value_("codCountry", node)
|
|
3737
|
+
if value is not None and "codCountry" not in already_processed:
|
|
3738
|
+
already_processed.add("codCountry")
|
|
3739
|
+
self.codCountry = value
|
|
3740
|
+
|
|
3741
|
+
def _buildChildren(
|
|
3742
|
+
self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None
|
|
3743
|
+
):
|
|
3744
|
+
pass
|
|
3745
|
+
|
|
3746
|
+
|
|
3747
|
+
# end class CODReturnAddressType
|
|
3748
|
+
|
|
3749
|
+
|
|
3750
|
+
class PackagesType(GeneratedsSuper):
|
|
3751
|
+
__hash__ = GeneratedsSuper.__hash__
|
|
3752
|
+
subclass = None
|
|
3753
|
+
superclass = None
|
|
3754
|
+
|
|
3755
|
+
def __init__(self, type_=None, Package=None, gds_collector_=None, **kwargs_):
|
|
3756
|
+
self.gds_collector_ = gds_collector_
|
|
3757
|
+
self.gds_elementtree_node_ = None
|
|
3758
|
+
self.original_tagname_ = None
|
|
3759
|
+
self.parent_object_ = kwargs_.get("parent_object_")
|
|
3760
|
+
self.ns_prefix_ = None
|
|
3761
|
+
self.type_ = _cast(None, type_)
|
|
3762
|
+
self.type__nsprefix_ = None
|
|
3763
|
+
if Package is None:
|
|
3764
|
+
self.Package = []
|
|
3765
|
+
else:
|
|
3766
|
+
self.Package = Package
|
|
3767
|
+
self.Package_nsprefix_ = None
|
|
3768
|
+
|
|
3769
|
+
def factory(*args_, **kwargs_):
|
|
3770
|
+
if CurrentSubclassModule_ is not None:
|
|
3771
|
+
subclass = getSubclassFromModule_(CurrentSubclassModule_, PackagesType)
|
|
3772
|
+
if subclass is not None:
|
|
3773
|
+
return subclass(*args_, **kwargs_)
|
|
3774
|
+
if PackagesType.subclass:
|
|
3775
|
+
return PackagesType.subclass(*args_, **kwargs_)
|
|
3776
|
+
else:
|
|
3777
|
+
return PackagesType(*args_, **kwargs_)
|
|
3778
|
+
|
|
3779
|
+
factory = staticmethod(factory)
|
|
3780
|
+
|
|
3781
|
+
def get_ns_prefix_(self):
|
|
3782
|
+
return self.ns_prefix_
|
|
3783
|
+
|
|
3784
|
+
def set_ns_prefix_(self, ns_prefix):
|
|
3785
|
+
self.ns_prefix_ = ns_prefix
|
|
3786
|
+
|
|
3787
|
+
def get_Package(self):
|
|
3788
|
+
return self.Package
|
|
3789
|
+
|
|
3790
|
+
def set_Package(self, Package):
|
|
3791
|
+
self.Package = Package
|
|
3792
|
+
|
|
3793
|
+
def add_Package(self, value):
|
|
3794
|
+
self.Package.append(value)
|
|
3795
|
+
|
|
3796
|
+
def insert_Package_at(self, index, value):
|
|
3797
|
+
self.Package.insert(index, value)
|
|
3798
|
+
|
|
3799
|
+
def replace_Package_at(self, index, value):
|
|
3800
|
+
self.Package[index] = value
|
|
3801
|
+
|
|
3802
|
+
def get_type(self):
|
|
3803
|
+
return self.type_
|
|
3804
|
+
|
|
3805
|
+
def set_type(self, type_):
|
|
3806
|
+
self.type_ = type_
|
|
3807
|
+
|
|
3808
|
+
def _hasContent(self):
|
|
3809
|
+
if self.Package:
|
|
3810
|
+
return True
|
|
3811
|
+
else:
|
|
3812
|
+
return False
|
|
3813
|
+
|
|
3814
|
+
def export(
|
|
3815
|
+
self,
|
|
3816
|
+
outfile,
|
|
3817
|
+
level,
|
|
3818
|
+
namespaceprefix_="",
|
|
3819
|
+
namespacedef_="",
|
|
3820
|
+
name_="PackagesType",
|
|
3821
|
+
pretty_print=True,
|
|
3822
|
+
):
|
|
3823
|
+
imported_ns_def_ = GenerateDSNamespaceDefs_.get("PackagesType")
|
|
3824
|
+
if imported_ns_def_ is not None:
|
|
3825
|
+
namespacedef_ = imported_ns_def_
|
|
3826
|
+
if pretty_print:
|
|
3827
|
+
eol_ = "\n"
|
|
3828
|
+
else:
|
|
3829
|
+
eol_ = ""
|
|
3830
|
+
if self.original_tagname_ is not None and name_ == "PackagesType":
|
|
3831
|
+
name_ = self.original_tagname_
|
|
3832
|
+
if UseCapturedNS_ and self.ns_prefix_:
|
|
3833
|
+
namespaceprefix_ = self.ns_prefix_ + ":"
|
|
3834
|
+
showIndent(outfile, level, pretty_print)
|
|
3835
|
+
outfile.write(
|
|
3836
|
+
"<%s%s%s"
|
|
3837
|
+
% (
|
|
3838
|
+
namespaceprefix_,
|
|
3839
|
+
name_,
|
|
3840
|
+
namespacedef_ and " " + namespacedef_ or "",
|
|
3841
|
+
)
|
|
3842
|
+
)
|
|
3843
|
+
already_processed = set()
|
|
3844
|
+
self._exportAttributes(
|
|
3845
|
+
outfile, level, already_processed, namespaceprefix_, name_="PackagesType"
|
|
3846
|
+
)
|
|
3847
|
+
if self._hasContent():
|
|
3848
|
+
outfile.write(">%s" % (eol_,))
|
|
3849
|
+
self._exportChildren(
|
|
3850
|
+
outfile,
|
|
3851
|
+
level + 1,
|
|
3852
|
+
namespaceprefix_,
|
|
3853
|
+
namespacedef_,
|
|
3854
|
+
name_="PackagesType",
|
|
3855
|
+
pretty_print=pretty_print,
|
|
3856
|
+
)
|
|
3857
|
+
showIndent(outfile, level, pretty_print)
|
|
3858
|
+
outfile.write("</%s%s>%s" % (namespaceprefix_, name_, eol_))
|
|
3859
|
+
else:
|
|
3860
|
+
outfile.write("/>%s" % (eol_,))
|
|
3861
|
+
|
|
3862
|
+
def _exportAttributes(
|
|
3863
|
+
self,
|
|
3864
|
+
outfile,
|
|
3865
|
+
level,
|
|
3866
|
+
already_processed,
|
|
3867
|
+
namespaceprefix_="",
|
|
3868
|
+
name_="PackagesType",
|
|
3869
|
+
):
|
|
3870
|
+
if self.type_ is not None and "type_" not in already_processed:
|
|
3871
|
+
already_processed.add("type_")
|
|
3872
|
+
outfile.write(
|
|
3873
|
+
" type=%s"
|
|
3874
|
+
% (
|
|
3875
|
+
self.gds_encode(
|
|
3876
|
+
self.gds_format_string(
|
|
3877
|
+
quote_attrib(self.type_), input_name="type"
|
|
3878
|
+
)
|
|
3879
|
+
),
|
|
3880
|
+
)
|
|
3881
|
+
)
|
|
3882
|
+
|
|
3883
|
+
def _exportChildren(
|
|
3884
|
+
self,
|
|
3885
|
+
outfile,
|
|
3886
|
+
level,
|
|
3887
|
+
namespaceprefix_="",
|
|
3888
|
+
namespacedef_="",
|
|
3889
|
+
name_="PackagesType",
|
|
3890
|
+
fromsubclass_=False,
|
|
3891
|
+
pretty_print=True,
|
|
3892
|
+
):
|
|
3893
|
+
if pretty_print:
|
|
3894
|
+
eol_ = "\n"
|
|
3895
|
+
else:
|
|
3896
|
+
eol_ = ""
|
|
3897
|
+
for Package_ in self.Package:
|
|
3898
|
+
namespaceprefix_ = (
|
|
3899
|
+
self.Package_nsprefix_ + ":"
|
|
3900
|
+
if (UseCapturedNS_ and self.Package_nsprefix_)
|
|
3901
|
+
else ""
|
|
3902
|
+
)
|
|
3903
|
+
Package_.export(
|
|
3904
|
+
outfile,
|
|
3905
|
+
level,
|
|
3906
|
+
namespaceprefix_,
|
|
3907
|
+
namespacedef_="",
|
|
3908
|
+
name_="Package",
|
|
3909
|
+
pretty_print=pretty_print,
|
|
3910
|
+
)
|
|
3911
|
+
|
|
3912
|
+
def build(self, node, gds_collector_=None):
|
|
3913
|
+
self.gds_collector_ = gds_collector_
|
|
3914
|
+
if SaveElementTreeNode:
|
|
3915
|
+
self.gds_elementtree_node_ = node
|
|
3916
|
+
already_processed = set()
|
|
3917
|
+
self.ns_prefix_ = node.prefix
|
|
3918
|
+
self._buildAttributes(node, node.attrib, already_processed)
|
|
3919
|
+
for child in node:
|
|
3920
|
+
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
|
|
3921
|
+
self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
|
|
3922
|
+
return self
|
|
3923
|
+
|
|
3924
|
+
def _buildAttributes(self, node, attrs, already_processed):
|
|
3925
|
+
value = find_attr_value_("type", node)
|
|
3926
|
+
if value is not None and "type" not in already_processed:
|
|
3927
|
+
already_processed.add("type")
|
|
3928
|
+
self.type_ = value
|
|
3929
|
+
|
|
3930
|
+
def _buildChildren(
|
|
3931
|
+
self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None
|
|
3932
|
+
):
|
|
3933
|
+
if nodeName_ == "Package":
|
|
3934
|
+
obj_ = PackageType.factory(parent_object_=self)
|
|
3935
|
+
obj_.build(child_, gds_collector_=gds_collector_)
|
|
3936
|
+
self.Package.append(obj_)
|
|
3937
|
+
obj_.original_tagname_ = "Package"
|
|
3938
|
+
|
|
3939
|
+
|
|
3940
|
+
# end class PackagesType
|
|
3941
|
+
|
|
3942
|
+
|
|
3943
|
+
class PackageType(GeneratedsSuper):
|
|
3944
|
+
__hash__ = GeneratedsSuper.__hash__
|
|
3945
|
+
subclass = None
|
|
3946
|
+
superclass = None
|
|
3947
|
+
|
|
3948
|
+
def __init__(
|
|
3949
|
+
self,
|
|
3950
|
+
length=None,
|
|
3951
|
+
width=None,
|
|
3952
|
+
height=None,
|
|
3953
|
+
weight=None,
|
|
3954
|
+
type_=None,
|
|
3955
|
+
freightClass=None,
|
|
3956
|
+
nmfcCode=None,
|
|
3957
|
+
insuranceAmount=None,
|
|
3958
|
+
codAmount=None,
|
|
3959
|
+
description=None,
|
|
3960
|
+
valueOf_=None,
|
|
3961
|
+
gds_collector_=None,
|
|
3962
|
+
**kwargs_
|
|
3963
|
+
):
|
|
3964
|
+
self.gds_collector_ = gds_collector_
|
|
3965
|
+
self.gds_elementtree_node_ = None
|
|
3966
|
+
self.original_tagname_ = None
|
|
3967
|
+
self.parent_object_ = kwargs_.get("parent_object_")
|
|
3968
|
+
self.ns_prefix_ = None
|
|
3969
|
+
self.length = _cast(int, length)
|
|
3970
|
+
self.length_nsprefix_ = None
|
|
3971
|
+
self.width = _cast(int, width)
|
|
3972
|
+
self.width_nsprefix_ = None
|
|
3973
|
+
self.height = _cast(int, height)
|
|
3974
|
+
self.height_nsprefix_ = None
|
|
3975
|
+
self.weight = _cast(int, weight)
|
|
3976
|
+
self.weight_nsprefix_ = None
|
|
3977
|
+
self.type_ = _cast(None, type_)
|
|
3978
|
+
self.type__nsprefix_ = None
|
|
3979
|
+
self.freightClass = _cast(int, freightClass)
|
|
3980
|
+
self.freightClass_nsprefix_ = None
|
|
3981
|
+
self.nmfcCode = _cast(None, nmfcCode)
|
|
3982
|
+
self.nmfcCode_nsprefix_ = None
|
|
3983
|
+
self.insuranceAmount = _cast(float, insuranceAmount)
|
|
3984
|
+
self.insuranceAmount_nsprefix_ = None
|
|
3985
|
+
self.codAmount = _cast(float, codAmount)
|
|
3986
|
+
self.codAmount_nsprefix_ = None
|
|
3987
|
+
self.description = _cast(None, description)
|
|
3988
|
+
self.description_nsprefix_ = None
|
|
3989
|
+
self.valueOf_ = valueOf_
|
|
3990
|
+
|
|
3991
|
+
def factory(*args_, **kwargs_):
|
|
3992
|
+
if CurrentSubclassModule_ is not None:
|
|
3993
|
+
subclass = getSubclassFromModule_(CurrentSubclassModule_, PackageType)
|
|
3994
|
+
if subclass is not None:
|
|
3995
|
+
return subclass(*args_, **kwargs_)
|
|
3996
|
+
if PackageType.subclass:
|
|
3997
|
+
return PackageType.subclass(*args_, **kwargs_)
|
|
3998
|
+
else:
|
|
3999
|
+
return PackageType(*args_, **kwargs_)
|
|
4000
|
+
|
|
4001
|
+
factory = staticmethod(factory)
|
|
4002
|
+
|
|
4003
|
+
def get_ns_prefix_(self):
|
|
4004
|
+
return self.ns_prefix_
|
|
4005
|
+
|
|
4006
|
+
def set_ns_prefix_(self, ns_prefix):
|
|
4007
|
+
self.ns_prefix_ = ns_prefix
|
|
4008
|
+
|
|
4009
|
+
def get_length(self):
|
|
4010
|
+
return self.length
|
|
4011
|
+
|
|
4012
|
+
def set_length(self, length):
|
|
4013
|
+
self.length = length
|
|
4014
|
+
|
|
4015
|
+
def get_width(self):
|
|
4016
|
+
return self.width
|
|
4017
|
+
|
|
4018
|
+
def set_width(self, width):
|
|
4019
|
+
self.width = width
|
|
4020
|
+
|
|
4021
|
+
def get_height(self):
|
|
4022
|
+
return self.height
|
|
4023
|
+
|
|
4024
|
+
def set_height(self, height):
|
|
4025
|
+
self.height = height
|
|
4026
|
+
|
|
4027
|
+
def get_weight(self):
|
|
4028
|
+
return self.weight
|
|
4029
|
+
|
|
4030
|
+
def set_weight(self, weight):
|
|
4031
|
+
self.weight = weight
|
|
4032
|
+
|
|
4033
|
+
def get_type(self):
|
|
4034
|
+
return self.type_
|
|
4035
|
+
|
|
4036
|
+
def set_type(self, type_):
|
|
4037
|
+
self.type_ = type_
|
|
4038
|
+
|
|
4039
|
+
def get_freightClass(self):
|
|
4040
|
+
return self.freightClass
|
|
4041
|
+
|
|
4042
|
+
def set_freightClass(self, freightClass):
|
|
4043
|
+
self.freightClass = freightClass
|
|
4044
|
+
|
|
4045
|
+
def get_nmfcCode(self):
|
|
4046
|
+
return self.nmfcCode
|
|
4047
|
+
|
|
4048
|
+
def set_nmfcCode(self, nmfcCode):
|
|
4049
|
+
self.nmfcCode = nmfcCode
|
|
4050
|
+
|
|
4051
|
+
def get_insuranceAmount(self):
|
|
4052
|
+
return self.insuranceAmount
|
|
4053
|
+
|
|
4054
|
+
def set_insuranceAmount(self, insuranceAmount):
|
|
4055
|
+
self.insuranceAmount = insuranceAmount
|
|
4056
|
+
|
|
4057
|
+
def get_codAmount(self):
|
|
4058
|
+
return self.codAmount
|
|
4059
|
+
|
|
4060
|
+
def set_codAmount(self, codAmount):
|
|
4061
|
+
self.codAmount = codAmount
|
|
4062
|
+
|
|
4063
|
+
def get_description(self):
|
|
4064
|
+
return self.description
|
|
4065
|
+
|
|
4066
|
+
def set_description(self, description):
|
|
4067
|
+
self.description = description
|
|
4068
|
+
|
|
4069
|
+
def get_valueOf_(self):
|
|
4070
|
+
return self.valueOf_
|
|
4071
|
+
|
|
4072
|
+
def set_valueOf_(self, valueOf_):
|
|
4073
|
+
self.valueOf_ = valueOf_
|
|
4074
|
+
|
|
4075
|
+
def _hasContent(self):
|
|
4076
|
+
if 1 if type(self.valueOf_) in [int, float] else self.valueOf_:
|
|
4077
|
+
return True
|
|
4078
|
+
else:
|
|
4079
|
+
return False
|
|
4080
|
+
|
|
4081
|
+
def export(
|
|
4082
|
+
self,
|
|
4083
|
+
outfile,
|
|
4084
|
+
level,
|
|
4085
|
+
namespaceprefix_="",
|
|
4086
|
+
namespacedef_="",
|
|
4087
|
+
name_="PackageType",
|
|
4088
|
+
pretty_print=True,
|
|
4089
|
+
):
|
|
4090
|
+
imported_ns_def_ = GenerateDSNamespaceDefs_.get("PackageType")
|
|
4091
|
+
if imported_ns_def_ is not None:
|
|
4092
|
+
namespacedef_ = imported_ns_def_
|
|
4093
|
+
if pretty_print:
|
|
4094
|
+
eol_ = "\n"
|
|
4095
|
+
else:
|
|
4096
|
+
eol_ = ""
|
|
4097
|
+
if self.original_tagname_ is not None and name_ == "PackageType":
|
|
4098
|
+
name_ = self.original_tagname_
|
|
4099
|
+
if UseCapturedNS_ and self.ns_prefix_:
|
|
4100
|
+
namespaceprefix_ = self.ns_prefix_ + ":"
|
|
4101
|
+
showIndent(outfile, level, pretty_print)
|
|
4102
|
+
outfile.write(
|
|
4103
|
+
"<%s%s%s"
|
|
4104
|
+
% (
|
|
4105
|
+
namespaceprefix_,
|
|
4106
|
+
name_,
|
|
4107
|
+
namespacedef_ and " " + namespacedef_ or "",
|
|
4108
|
+
)
|
|
4109
|
+
)
|
|
4110
|
+
already_processed = set()
|
|
4111
|
+
self._exportAttributes(
|
|
4112
|
+
outfile, level, already_processed, namespaceprefix_, name_="PackageType"
|
|
4113
|
+
)
|
|
4114
|
+
if self._hasContent():
|
|
4115
|
+
outfile.write(">")
|
|
4116
|
+
outfile.write(self.convert_unicode(self.valueOf_))
|
|
4117
|
+
self._exportChildren(
|
|
4118
|
+
outfile,
|
|
4119
|
+
level + 1,
|
|
4120
|
+
namespaceprefix_,
|
|
4121
|
+
namespacedef_,
|
|
4122
|
+
name_="PackageType",
|
|
4123
|
+
pretty_print=pretty_print,
|
|
4124
|
+
)
|
|
4125
|
+
outfile.write("</%s%s>%s" % (namespaceprefix_, name_, eol_))
|
|
4126
|
+
else:
|
|
4127
|
+
outfile.write("/>%s" % (eol_,))
|
|
4128
|
+
|
|
4129
|
+
def _exportAttributes(
|
|
4130
|
+
self,
|
|
4131
|
+
outfile,
|
|
4132
|
+
level,
|
|
4133
|
+
already_processed,
|
|
4134
|
+
namespaceprefix_="",
|
|
4135
|
+
name_="PackageType",
|
|
4136
|
+
):
|
|
4137
|
+
if self.length is not None and "length" not in already_processed:
|
|
4138
|
+
already_processed.add("length")
|
|
4139
|
+
outfile.write(
|
|
4140
|
+
' length="%s"'
|
|
4141
|
+
% self.gds_format_integer(self.length, input_name="length")
|
|
4142
|
+
)
|
|
4143
|
+
if self.width is not None and "width" not in already_processed:
|
|
4144
|
+
already_processed.add("width")
|
|
4145
|
+
outfile.write(
|
|
4146
|
+
' width="%s"' % self.gds_format_integer(self.width, input_name="width")
|
|
4147
|
+
)
|
|
4148
|
+
if self.height is not None and "height" not in already_processed:
|
|
4149
|
+
already_processed.add("height")
|
|
4150
|
+
outfile.write(
|
|
4151
|
+
' height="%s"'
|
|
4152
|
+
% self.gds_format_integer(self.height, input_name="height")
|
|
4153
|
+
)
|
|
4154
|
+
if self.weight is not None and "weight" not in already_processed:
|
|
4155
|
+
already_processed.add("weight")
|
|
4156
|
+
outfile.write(
|
|
4157
|
+
' weight="%s"'
|
|
4158
|
+
% self.gds_format_integer(self.weight, input_name="weight")
|
|
4159
|
+
)
|
|
4160
|
+
if self.type_ is not None and "type_" not in already_processed:
|
|
4161
|
+
already_processed.add("type_")
|
|
4162
|
+
outfile.write(
|
|
4163
|
+
" type=%s"
|
|
4164
|
+
% (
|
|
4165
|
+
self.gds_encode(
|
|
4166
|
+
self.gds_format_string(
|
|
4167
|
+
quote_attrib(self.type_), input_name="type"
|
|
4168
|
+
)
|
|
4169
|
+
),
|
|
4170
|
+
)
|
|
4171
|
+
)
|
|
4172
|
+
if self.freightClass is not None and "freightClass" not in already_processed:
|
|
4173
|
+
already_processed.add("freightClass")
|
|
4174
|
+
outfile.write(
|
|
4175
|
+
' freightClass="%s"'
|
|
4176
|
+
% self.gds_format_integer(self.freightClass, input_name="freightClass")
|
|
4177
|
+
)
|
|
4178
|
+
if self.nmfcCode is not None and "nmfcCode" not in already_processed:
|
|
4179
|
+
already_processed.add("nmfcCode")
|
|
4180
|
+
outfile.write(
|
|
4181
|
+
" nmfcCode=%s"
|
|
4182
|
+
% (
|
|
4183
|
+
self.gds_encode(
|
|
4184
|
+
self.gds_format_string(
|
|
4185
|
+
quote_attrib(self.nmfcCode), input_name="nmfcCode"
|
|
4186
|
+
)
|
|
4187
|
+
),
|
|
4188
|
+
)
|
|
4189
|
+
)
|
|
4190
|
+
if (
|
|
4191
|
+
self.insuranceAmount is not None
|
|
4192
|
+
and "insuranceAmount" not in already_processed
|
|
4193
|
+
):
|
|
4194
|
+
already_processed.add("insuranceAmount")
|
|
4195
|
+
outfile.write(
|
|
4196
|
+
' insuranceAmount="%s"'
|
|
4197
|
+
% self.gds_format_float(
|
|
4198
|
+
self.insuranceAmount, input_name="insuranceAmount"
|
|
4199
|
+
)
|
|
4200
|
+
)
|
|
4201
|
+
if self.codAmount is not None and "codAmount" not in already_processed:
|
|
4202
|
+
already_processed.add("codAmount")
|
|
4203
|
+
outfile.write(
|
|
4204
|
+
' codAmount="%s"'
|
|
4205
|
+
% self.gds_format_float(self.codAmount, input_name="codAmount")
|
|
4206
|
+
)
|
|
4207
|
+
if self.description is not None and "description" not in already_processed:
|
|
4208
|
+
already_processed.add("description")
|
|
4209
|
+
outfile.write(
|
|
4210
|
+
" description=%s"
|
|
4211
|
+
% (
|
|
4212
|
+
self.gds_encode(
|
|
4213
|
+
self.gds_format_string(
|
|
4214
|
+
quote_attrib(self.description), input_name="description"
|
|
4215
|
+
)
|
|
4216
|
+
),
|
|
4217
|
+
)
|
|
4218
|
+
)
|
|
4219
|
+
|
|
4220
|
+
def _exportChildren(
|
|
4221
|
+
self,
|
|
4222
|
+
outfile,
|
|
4223
|
+
level,
|
|
4224
|
+
namespaceprefix_="",
|
|
4225
|
+
namespacedef_="",
|
|
4226
|
+
name_="PackageType",
|
|
4227
|
+
fromsubclass_=False,
|
|
4228
|
+
pretty_print=True,
|
|
4229
|
+
):
|
|
4230
|
+
pass
|
|
4231
|
+
|
|
4232
|
+
def build(self, node, gds_collector_=None):
|
|
4233
|
+
self.gds_collector_ = gds_collector_
|
|
4234
|
+
if SaveElementTreeNode:
|
|
4235
|
+
self.gds_elementtree_node_ = node
|
|
4236
|
+
already_processed = set()
|
|
4237
|
+
self.ns_prefix_ = node.prefix
|
|
4238
|
+
self._buildAttributes(node, node.attrib, already_processed)
|
|
4239
|
+
self.valueOf_ = get_all_text_(node)
|
|
4240
|
+
for child in node:
|
|
4241
|
+
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
|
|
4242
|
+
self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
|
|
4243
|
+
return self
|
|
4244
|
+
|
|
4245
|
+
def _buildAttributes(self, node, attrs, already_processed):
|
|
4246
|
+
value = find_attr_value_("length", node)
|
|
4247
|
+
if value is not None and "length" not in already_processed:
|
|
4248
|
+
already_processed.add("length")
|
|
4249
|
+
self.length = self.gds_parse_integer(value, node, "length")
|
|
4250
|
+
value = find_attr_value_("width", node)
|
|
4251
|
+
if value is not None and "width" not in already_processed:
|
|
4252
|
+
already_processed.add("width")
|
|
4253
|
+
self.width = self.gds_parse_integer(value, node, "width")
|
|
4254
|
+
value = find_attr_value_("height", node)
|
|
4255
|
+
if value is not None and "height" not in already_processed:
|
|
4256
|
+
already_processed.add("height")
|
|
4257
|
+
self.height = self.gds_parse_integer(value, node, "height")
|
|
4258
|
+
value = find_attr_value_("weight", node)
|
|
4259
|
+
if value is not None and "weight" not in already_processed:
|
|
4260
|
+
already_processed.add("weight")
|
|
4261
|
+
self.weight = self.gds_parse_integer(value, node, "weight")
|
|
4262
|
+
value = find_attr_value_("type", node)
|
|
4263
|
+
if value is not None and "type" not in already_processed:
|
|
4264
|
+
already_processed.add("type")
|
|
4265
|
+
self.type_ = value
|
|
4266
|
+
value = find_attr_value_("freightClass", node)
|
|
4267
|
+
if value is not None and "freightClass" not in already_processed:
|
|
4268
|
+
already_processed.add("freightClass")
|
|
4269
|
+
self.freightClass = self.gds_parse_integer(value, node, "freightClass")
|
|
4270
|
+
value = find_attr_value_("nmfcCode", node)
|
|
4271
|
+
if value is not None and "nmfcCode" not in already_processed:
|
|
4272
|
+
already_processed.add("nmfcCode")
|
|
4273
|
+
self.nmfcCode = value
|
|
4274
|
+
value = find_attr_value_("insuranceAmount", node)
|
|
4275
|
+
if value is not None and "insuranceAmount" not in already_processed:
|
|
4276
|
+
already_processed.add("insuranceAmount")
|
|
4277
|
+
value = self.gds_parse_float(value, node, "insuranceAmount")
|
|
4278
|
+
self.insuranceAmount = value
|
|
4279
|
+
value = find_attr_value_("codAmount", node)
|
|
4280
|
+
if value is not None and "codAmount" not in already_processed:
|
|
4281
|
+
already_processed.add("codAmount")
|
|
4282
|
+
value = self.gds_parse_float(value, node, "codAmount")
|
|
4283
|
+
self.codAmount = value
|
|
4284
|
+
value = find_attr_value_("description", node)
|
|
4285
|
+
if value is not None and "description" not in already_processed:
|
|
4286
|
+
already_processed.add("description")
|
|
4287
|
+
self.description = value
|
|
4288
|
+
|
|
4289
|
+
def _buildChildren(
|
|
4290
|
+
self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None
|
|
4291
|
+
):
|
|
4292
|
+
pass
|
|
4293
|
+
|
|
4294
|
+
|
|
4295
|
+
# end class PackageType
|
|
4296
|
+
|
|
4297
|
+
|
|
4298
|
+
GDSClassesMapping = {}
|
|
4299
|
+
|
|
4300
|
+
|
|
4301
|
+
USAGE_TEXT = """
|
|
4302
|
+
Usage: python <Parser>.py [ -s ] <in_xml_file>
|
|
4303
|
+
"""
|
|
4304
|
+
|
|
4305
|
+
|
|
4306
|
+
def usage():
|
|
4307
|
+
print(USAGE_TEXT)
|
|
4308
|
+
sys.exit(1)
|
|
4309
|
+
|
|
4310
|
+
|
|
4311
|
+
def get_root_tag(node):
|
|
4312
|
+
tag = Tag_pattern_.match(node.tag).groups()[-1]
|
|
4313
|
+
prefix_tag = TagNamePrefix + tag
|
|
4314
|
+
rootClass = GDSClassesMapping.get(prefix_tag)
|
|
4315
|
+
if rootClass is None:
|
|
4316
|
+
rootClass = globals().get(prefix_tag)
|
|
4317
|
+
return tag, rootClass
|
|
4318
|
+
|
|
4319
|
+
|
|
4320
|
+
def get_required_ns_prefix_defs(rootNode):
|
|
4321
|
+
"""Get all name space prefix definitions required in this XML doc.
|
|
4322
|
+
Return a dictionary of definitions and a char string of definitions.
|
|
4323
|
+
"""
|
|
4324
|
+
nsmap = {
|
|
4325
|
+
prefix: uri
|
|
4326
|
+
for node in rootNode.iter()
|
|
4327
|
+
for (prefix, uri) in node.nsmap.items()
|
|
4328
|
+
if prefix is not None
|
|
4329
|
+
}
|
|
4330
|
+
namespacedefs = " ".join(
|
|
4331
|
+
['xmlns:{}="{}"'.format(prefix, uri) for prefix, uri in nsmap.items()]
|
|
4332
|
+
)
|
|
4333
|
+
return nsmap, namespacedefs
|
|
4334
|
+
|
|
4335
|
+
|
|
4336
|
+
def parse(inFileName, silence=False, print_warnings=True):
|
|
4337
|
+
global CapturedNsmap_
|
|
4338
|
+
gds_collector = GdsCollector_()
|
|
4339
|
+
parser = None
|
|
4340
|
+
doc = parsexml_(inFileName, parser)
|
|
4341
|
+
rootNode = doc.getroot()
|
|
4342
|
+
rootTag, rootClass = get_root_tag(rootNode)
|
|
4343
|
+
if rootClass is None:
|
|
4344
|
+
rootTag = "Freightcom"
|
|
4345
|
+
rootClass = Freightcom
|
|
4346
|
+
rootObj = rootClass.factory()
|
|
4347
|
+
rootObj.build(rootNode, gds_collector_=gds_collector)
|
|
4348
|
+
CapturedNsmap_, namespacedefs = get_required_ns_prefix_defs(rootNode)
|
|
4349
|
+
if not SaveElementTreeNode:
|
|
4350
|
+
doc = None
|
|
4351
|
+
rootNode = None
|
|
4352
|
+
if not silence:
|
|
4353
|
+
sys.stdout.write('<?xml version="1.0" ?>\n')
|
|
4354
|
+
rootObj.export(
|
|
4355
|
+
sys.stdout, 0, name_=rootTag, namespacedef_=namespacedefs, pretty_print=True
|
|
4356
|
+
)
|
|
4357
|
+
if print_warnings and len(gds_collector.get_messages()) > 0:
|
|
4358
|
+
separator = ("-" * 50) + "\n"
|
|
4359
|
+
sys.stderr.write(separator)
|
|
4360
|
+
sys.stderr.write(
|
|
4361
|
+
"----- Warnings -- count: {} -----\n".format(
|
|
4362
|
+
len(gds_collector.get_messages()),
|
|
4363
|
+
)
|
|
4364
|
+
)
|
|
4365
|
+
gds_collector.write_messages(sys.stderr)
|
|
4366
|
+
sys.stderr.write(separator)
|
|
4367
|
+
return rootObj
|
|
4368
|
+
|
|
4369
|
+
|
|
4370
|
+
def parseEtree(
|
|
4371
|
+
inFileName,
|
|
4372
|
+
silence=False,
|
|
4373
|
+
print_warnings=True,
|
|
4374
|
+
mapping=None,
|
|
4375
|
+
reverse_mapping=None,
|
|
4376
|
+
nsmap=None,
|
|
4377
|
+
):
|
|
4378
|
+
parser = None
|
|
4379
|
+
doc = parsexml_(inFileName, parser)
|
|
4380
|
+
gds_collector = GdsCollector_()
|
|
4381
|
+
rootNode = doc.getroot()
|
|
4382
|
+
rootTag, rootClass = get_root_tag(rootNode)
|
|
4383
|
+
if rootClass is None:
|
|
4384
|
+
rootTag = "Freightcom"
|
|
4385
|
+
rootClass = Freightcom
|
|
4386
|
+
rootObj = rootClass.factory()
|
|
4387
|
+
rootObj.build(rootNode, gds_collector_=gds_collector)
|
|
4388
|
+
if mapping is None:
|
|
4389
|
+
mapping = {}
|
|
4390
|
+
if reverse_mapping is None:
|
|
4391
|
+
reverse_mapping = {}
|
|
4392
|
+
rootElement = rootObj.to_etree(
|
|
4393
|
+
None,
|
|
4394
|
+
name_=rootTag,
|
|
4395
|
+
mapping_=mapping,
|
|
4396
|
+
reverse_mapping_=reverse_mapping,
|
|
4397
|
+
nsmap_=nsmap,
|
|
4398
|
+
)
|
|
4399
|
+
reverse_node_mapping = rootObj.gds_reverse_node_mapping(mapping)
|
|
4400
|
+
# Enable Python to collect the space used by the DOM.
|
|
4401
|
+
if not SaveElementTreeNode:
|
|
4402
|
+
doc = None
|
|
4403
|
+
rootNode = None
|
|
4404
|
+
if not silence:
|
|
4405
|
+
content = etree_.tostring(
|
|
4406
|
+
rootElement, pretty_print=True, xml_declaration=True, encoding="utf-8"
|
|
4407
|
+
)
|
|
4408
|
+
sys.stdout.write(str(content))
|
|
4409
|
+
sys.stdout.write("\n")
|
|
4410
|
+
if print_warnings and len(gds_collector.get_messages()) > 0:
|
|
4411
|
+
separator = ("-" * 50) + "\n"
|
|
4412
|
+
sys.stderr.write(separator)
|
|
4413
|
+
sys.stderr.write(
|
|
4414
|
+
"----- Warnings -- count: {} -----\n".format(
|
|
4415
|
+
len(gds_collector.get_messages()),
|
|
4416
|
+
)
|
|
4417
|
+
)
|
|
4418
|
+
gds_collector.write_messages(sys.stderr)
|
|
4419
|
+
sys.stderr.write(separator)
|
|
4420
|
+
return rootObj, rootElement, mapping, reverse_node_mapping
|
|
4421
|
+
|
|
4422
|
+
|
|
4423
|
+
def parseString(inString, silence=False, print_warnings=True):
|
|
4424
|
+
"""Parse a string, create the object tree, and export it.
|
|
4425
|
+
|
|
4426
|
+
Arguments:
|
|
4427
|
+
- inString -- A string. This XML fragment should not start
|
|
4428
|
+
with an XML declaration containing an encoding.
|
|
4429
|
+
- silence -- A boolean. If False, export the object.
|
|
4430
|
+
Returns -- The root object in the tree.
|
|
4431
|
+
"""
|
|
4432
|
+
parser = None
|
|
4433
|
+
rootNode = parsexmlstring_(inString, parser)
|
|
4434
|
+
gds_collector = GdsCollector_()
|
|
4435
|
+
rootTag, rootClass = get_root_tag(rootNode)
|
|
4436
|
+
if rootClass is None:
|
|
4437
|
+
rootTag = "Freightcom"
|
|
4438
|
+
rootClass = Freightcom
|
|
4439
|
+
rootObj = rootClass.factory()
|
|
4440
|
+
rootObj.build(rootNode, gds_collector_=gds_collector)
|
|
4441
|
+
if not SaveElementTreeNode:
|
|
4442
|
+
rootNode = None
|
|
4443
|
+
if not silence:
|
|
4444
|
+
sys.stdout.write('<?xml version="1.0" ?>\n')
|
|
4445
|
+
rootObj.export(sys.stdout, 0, name_=rootTag, namespacedef_="")
|
|
4446
|
+
if print_warnings and len(gds_collector.get_messages()) > 0:
|
|
4447
|
+
separator = ("-" * 50) + "\n"
|
|
4448
|
+
sys.stderr.write(separator)
|
|
4449
|
+
sys.stderr.write(
|
|
4450
|
+
"----- Warnings -- count: {} -----\n".format(
|
|
4451
|
+
len(gds_collector.get_messages()),
|
|
4452
|
+
)
|
|
4453
|
+
)
|
|
4454
|
+
gds_collector.write_messages(sys.stderr)
|
|
4455
|
+
sys.stderr.write(separator)
|
|
4456
|
+
return rootObj
|
|
4457
|
+
|
|
4458
|
+
|
|
4459
|
+
def parseLiteral(inFileName, silence=False, print_warnings=True):
|
|
4460
|
+
parser = None
|
|
4461
|
+
doc = parsexml_(inFileName, parser)
|
|
4462
|
+
gds_collector = GdsCollector_()
|
|
4463
|
+
rootNode = doc.getroot()
|
|
4464
|
+
rootTag, rootClass = get_root_tag(rootNode)
|
|
4465
|
+
if rootClass is None:
|
|
4466
|
+
rootTag = "Freightcom"
|
|
4467
|
+
rootClass = Freightcom
|
|
4468
|
+
rootObj = rootClass.factory()
|
|
4469
|
+
rootObj.build(rootNode, gds_collector_=gds_collector)
|
|
4470
|
+
# Enable Python to collect the space used by the DOM.
|
|
4471
|
+
if not SaveElementTreeNode:
|
|
4472
|
+
doc = None
|
|
4473
|
+
rootNode = None
|
|
4474
|
+
if not silence:
|
|
4475
|
+
sys.stdout.write("#from quote_request import *\n\n")
|
|
4476
|
+
sys.stdout.write("import quote_request as model_\n\n")
|
|
4477
|
+
sys.stdout.write("rootObj = model_.rootClass(\n")
|
|
4478
|
+
rootObj.exportLiteral(sys.stdout, 0, name_=rootTag)
|
|
4479
|
+
sys.stdout.write(")\n")
|
|
4480
|
+
if print_warnings and len(gds_collector.get_messages()) > 0:
|
|
4481
|
+
separator = ("-" * 50) + "\n"
|
|
4482
|
+
sys.stderr.write(separator)
|
|
4483
|
+
sys.stderr.write(
|
|
4484
|
+
"----- Warnings -- count: {} -----\n".format(
|
|
4485
|
+
len(gds_collector.get_messages()),
|
|
4486
|
+
)
|
|
4487
|
+
)
|
|
4488
|
+
gds_collector.write_messages(sys.stderr)
|
|
4489
|
+
sys.stderr.write(separator)
|
|
4490
|
+
return rootObj
|
|
4491
|
+
|
|
4492
|
+
|
|
4493
|
+
def main():
|
|
4494
|
+
args = sys.argv[1:]
|
|
4495
|
+
if len(args) == 1:
|
|
4496
|
+
parse(args[0])
|
|
4497
|
+
else:
|
|
4498
|
+
usage()
|
|
4499
|
+
|
|
4500
|
+
|
|
4501
|
+
if __name__ == "__main__":
|
|
4502
|
+
# import pdb; pdb.set_trace()
|
|
4503
|
+
main()
|
|
4504
|
+
|
|
4505
|
+
RenameMappings_ = {}
|
|
4506
|
+
|
|
4507
|
+
#
|
|
4508
|
+
# Mapping of namespaces to types defined in them
|
|
4509
|
+
# and the file in which each is defined.
|
|
4510
|
+
# simpleTypes are marked "ST" and complexTypes "CT".
|
|
4511
|
+
NamespaceToDefMappings_ = {"http://www.freightcom.net/XMLSchema": []}
|
|
4512
|
+
|
|
4513
|
+
__all__ = [
|
|
4514
|
+
"CODReturnAddressType",
|
|
4515
|
+
"CODType",
|
|
4516
|
+
"Freightcom",
|
|
4517
|
+
"FromType",
|
|
4518
|
+
"PackageType",
|
|
4519
|
+
"PackagesType",
|
|
4520
|
+
"QuoteRequestType",
|
|
4521
|
+
"ToType",
|
|
4522
|
+
]
|