lino 25.3.0__py3-none-any.whl → 25.3.1__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.
Files changed (39) hide show
  1. lino/__init__.py +1 -1
  2. lino/api/doctest.py +34 -36
  3. lino/core/inject.py +7 -6
  4. lino/core/kernel.py +0 -46
  5. lino/core/model.py +17 -15
  6. lino/core/plugin.py +4 -4
  7. lino/core/site.py +84 -30
  8. lino/management/commands/prep.py +1 -1
  9. lino/modlib/help/management/commands/makehelp.py +5 -2
  10. lino/modlib/jinja/mixins.py +2 -2
  11. lino/modlib/linod/mixins.py +3 -0
  12. lino/modlib/printing/mixins.py +3 -0
  13. lino/modlib/uploads/models.py +7 -6
  14. {lino-25.3.0.dist-info → lino-25.3.1.dist-info}/METADATA +1 -1
  15. {lino-25.3.0.dist-info → lino-25.3.1.dist-info}/RECORD +18 -39
  16. lino/sandbox/bcss/PerformInvestigation.py +0 -2260
  17. lino/sandbox/bcss/SSDNReply.py +0 -3924
  18. lino/sandbox/bcss/SSDNRequest.py +0 -3723
  19. lino/sandbox/bcss/__init__.py +0 -0
  20. lino/sandbox/bcss/readme.txt +0 -1
  21. lino/sandbox/bcss/test.py +0 -92
  22. lino/sandbox/bcss/test2.py +0 -128
  23. lino/sandbox/bcss/test3.py +0 -161
  24. lino/sandbox/bcss/test4.py +0 -167
  25. lino/sandbox/contacts/__init__.py +0 -0
  26. lino/sandbox/contacts/fixtures/__init__.py +0 -0
  27. lino/sandbox/contacts/fixtures/demo.py +0 -365
  28. lino/sandbox/contacts/manage.py +0 -10
  29. lino/sandbox/contacts/models.py +0 -395
  30. lino/sandbox/contacts/settings.py +0 -67
  31. lino/sandbox/tx25/XSD/RetrieveTIGroupsV3.wsdl +0 -65
  32. lino/sandbox/tx25/XSD/RetrieveTIGroupsV3.xsd +0 -286
  33. lino/sandbox/tx25/XSD/rn25_Release201104.xsd +0 -2855
  34. lino/sandbox/tx25/xsd2py1.py +0 -68
  35. lino/sandbox/tx25/xsd2py2.py +0 -62
  36. lino/sandbox/tx25/xsd2py3.py +0 -56
  37. {lino-25.3.0.dist-info → lino-25.3.1.dist-info}/WHEEL +0 -0
  38. {lino-25.3.0.dist-info → lino-25.3.1.dist-info}/licenses/AUTHORS.rst +0 -0
  39. {lino-25.3.0.dist-info → lino-25.3.1.dist-info}/licenses/COPYING +0 -0
@@ -1,2260 +0,0 @@
1
- #!/usr/bin/env python
2
- # -*- coding: utf-8 -*-
3
-
4
- #
5
- # Generated Mon Oct 03 15:32:13 2011 by generateDS.py version 2.6a.
6
- #
7
-
8
- import sys
9
- import getopt
10
- import re as re_
11
-
12
- etree_ = None
13
- Verbose_import_ = False
14
- (XMLParser_import_none, XMLParser_import_lxml,
15
- XMLParser_import_elementtree) = range(3)
16
- XMLParser_import_library = None
17
- try:
18
- # lxml
19
- from lxml import etree as etree_
20
- XMLParser_import_library = XMLParser_import_lxml
21
- if Verbose_import_:
22
- print("running with lxml.etree")
23
- except ImportError:
24
- try:
25
- # cElementTree from Python 2.5+
26
- import xml.etree.cElementTree as etree_
27
- XMLParser_import_library = XMLParser_import_elementtree
28
- if Verbose_import_:
29
- print("running with cElementTree on Python 2.5+")
30
- except ImportError:
31
- try:
32
- # ElementTree from Python 2.5+
33
- import xml.etree.ElementTree as etree_
34
- XMLParser_import_library = XMLParser_import_elementtree
35
- if Verbose_import_:
36
- print("running with ElementTree on Python 2.5+")
37
- except ImportError:
38
- try:
39
- # normal cElementTree install
40
- import cElementTree as etree_
41
- XMLParser_import_library = XMLParser_import_elementtree
42
- if Verbose_import_:
43
- print("running with cElementTree")
44
- except ImportError:
45
- try:
46
- # normal ElementTree install
47
- import elementtree.ElementTree as etree_
48
- XMLParser_import_library = XMLParser_import_elementtree
49
- if Verbose_import_:
50
- print("running with ElementTree")
51
- except ImportError:
52
- raise ImportError(
53
- "Failed to import ElementTree from any known place")
54
-
55
-
56
- def parsexml_(*args, **kwargs):
57
- if (XMLParser_import_library == XMLParser_import_lxml
58
- and 'parser' not in kwargs):
59
- # Use the lxml ElementTree compatible parser so that, e.g.,
60
- # we ignore comments.
61
- kwargs['parser'] = etree_.ETCompatXMLParser()
62
- doc = etree_.parse(*args, **kwargs)
63
- return doc
64
-
65
-
66
- #
67
- # User methods
68
- #
69
- # Calls to the methods in these classes are generated by generateDS.py.
70
- # You can replace these methods by re-implementing the following class
71
- # in a module named generatedssuper.py.
72
-
73
- try:
74
- from generatedssuper import GeneratedsSuper
75
- except ImportError, exp:
76
-
77
- class GeneratedsSuper(object):
78
-
79
- def gds_format_string(self, input_data, input_name=''):
80
- return input_data
81
-
82
- def gds_validate_string(self, input_data, node, input_name=''):
83
- return input_data
84
-
85
- def gds_format_integer(self, input_data, input_name=''):
86
- return '%d' % input_data
87
-
88
- def gds_validate_integer(self, input_data, node, input_name=''):
89
- return input_data
90
-
91
- def gds_format_integer_list(self, input_data, input_name=''):
92
- return '%s' % input_data
93
-
94
- def gds_validate_integer_list(self, input_data, node, input_name=''):
95
- values = input_data.split()
96
- for value in values:
97
- try:
98
- fvalue = float(value)
99
- except (TypeError, ValueError), exp:
100
- raise_parse_error(node, 'Requires sequence of integers')
101
- return input_data
102
-
103
- def gds_format_float(self, input_data, input_name=''):
104
- return '%f' % input_data
105
-
106
- def gds_validate_float(self, input_data, node, input_name=''):
107
- return input_data
108
-
109
- def gds_format_float_list(self, input_data, input_name=''):
110
- return '%s' % input_data
111
-
112
- def gds_validate_float_list(self, input_data, node, input_name=''):
113
- values = input_data.split()
114
- for value in values:
115
- try:
116
- fvalue = float(value)
117
- except (TypeError, ValueError), exp:
118
- raise_parse_error(node, 'Requires sequence of floats')
119
- return input_data
120
-
121
- def gds_format_double(self, input_data, input_name=''):
122
- return '%e' % input_data
123
-
124
- def gds_validate_double(self, input_data, node, input_name=''):
125
- return input_data
126
-
127
- def gds_format_double_list(self, input_data, input_name=''):
128
- return '%s' % input_data
129
-
130
- def gds_validate_double_list(self, input_data, node, input_name=''):
131
- values = input_data.split()
132
- for value in values:
133
- try:
134
- fvalue = float(value)
135
- except (TypeError, ValueError), exp:
136
- raise_parse_error(node, 'Requires sequence of doubles')
137
- return input_data
138
-
139
- def gds_format_boolean(self, input_data, input_name=''):
140
- return '%s' % input_data
141
-
142
- def gds_validate_boolean(self, input_data, node, input_name=''):
143
- return input_data
144
-
145
- def gds_format_boolean_list(self, input_data, input_name=''):
146
- return '%s' % input_data
147
-
148
- def gds_validate_boolean_list(self, input_data, node, input_name=''):
149
- values = input_data.split()
150
- for value in values:
151
- if value not in (
152
- 'true',
153
- '1',
154
- 'false',
155
- '0',
156
- ):
157
- raise_parse_error(
158
- node,
159
- 'Requires sequence of booleans ("true", "1", "false", "0")'
160
- )
161
- return input_data
162
-
163
- def gds_str_lower(self, instring):
164
- return instring.lower()
165
-
166
- def get_path_(self, node):
167
- path_list = []
168
- self.get_path_list_(node, path_list)
169
- path_list.reverse()
170
- path = '/'.join(path_list)
171
- return path
172
-
173
- Tag_strip_pattern_ = re_.compile(r'\{.*\}')
174
-
175
- def get_path_list_(self, node, path_list):
176
- if node is None:
177
- return
178
- tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)
179
- if tag:
180
- path_list.append(tag)
181
- self.get_path_list_(node.getparent(), path_list)
182
-
183
- def get_class_obj_(self, node, default_class=None):
184
- class_obj1 = default_class
185
- if 'xsi' in node.nsmap:
186
- classname = node.get('{%s}type' % node.nsmap['xsi'])
187
- if classname is not None:
188
- names = classname.split(':')
189
- if len(names) == 2:
190
- classname = names[1]
191
- class_obj2 = globals().get(classname)
192
- if class_obj2 is not None:
193
- class_obj1 = class_obj2
194
- return class_obj1
195
-
196
-
197
- #
198
- # If you have installed IPython you can uncomment and use the following.
199
- # IPython is available from http://ipython.scipy.org/.
200
- #
201
-
202
- ## from IPython.Shell import IPShellEmbed
203
- ## args = ''
204
- # ipshell = IPShellEmbed(args,
205
- ## banner = 'Dropping into IPython',
206
- # exit_msg = 'Leaving Interpreter, back to program.')
207
-
208
- # Then use the following line where and when you want to drop into the
209
- # IPython shell:
210
- # ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')
211
-
212
- #
213
- # Globals
214
- #
215
-
216
- ExternalEncoding = 'ascii'
217
- Tag_pattern_ = re_.compile(r'({.*})?(.*)')
218
- String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
219
- Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')
220
-
221
- #
222
- # Support/utility functions.
223
- #
224
-
225
-
226
- def showIndent(outfile, level):
227
- for idx in range(level):
228
- outfile.write(' ')
229
-
230
-
231
- def quote_xml(inStr):
232
- if not inStr:
233
- return ''
234
- s1 = (isinstance(inStr, basestring) and inStr or '%s' % inStr)
235
- s1 = s1.replace('&', '&amp;')
236
- s1 = s1.replace('<', '&lt;')
237
- s1 = s1.replace('>', '&gt;')
238
- return s1
239
-
240
-
241
- def quote_attrib(inStr):
242
- s1 = (isinstance(inStr, basestring) and inStr or '%s' % inStr)
243
- s1 = s1.replace('&', '&amp;')
244
- s1 = s1.replace('<', '&lt;')
245
- s1 = s1.replace('>', '&gt;')
246
- if '"' in s1:
247
- if "'" in s1:
248
- s1 = '"%s"' % s1.replace('"', "&quot;")
249
- else:
250
- s1 = "'%s'" % s1
251
- else:
252
- s1 = '"%s"' % s1
253
- return s1
254
-
255
-
256
- def quote_python(inStr):
257
- s1 = inStr
258
- if s1.find("'") == -1:
259
- if s1.find('\n') == -1:
260
- return "'%s'" % s1
261
- else:
262
- return "'''%s'''" % s1
263
- else:
264
- if s1.find('"') != -1:
265
- s1 = s1.replace('"', '\\"')
266
- if s1.find('\n') == -1:
267
- return '"%s"' % s1
268
- else:
269
- return '"""%s"""' % s1
270
-
271
-
272
- def get_all_text_(node):
273
- if node.text is not None:
274
- text = node.text
275
- else:
276
- text = ''
277
- for child in node:
278
- if child.tail is not None:
279
- text += child.tail
280
- return text
281
-
282
-
283
- def find_attr_value_(attr_name, node):
284
- attrs = node.attrib
285
- attr_parts = attr_name.split(':')
286
- value = None
287
- if len(attr_parts) == 1:
288
- value = attrs.get(attr_name)
289
- elif len(attr_parts) == 2:
290
- prefix, name = attr_parts
291
- namespace = node.nsmap.get(prefix)
292
- if namespace is not None:
293
- value = attrs.get('{%s}%s' % (
294
- namespace,
295
- name,
296
- ))
297
- return value
298
-
299
-
300
- class GDSParseError(Exception):
301
- pass
302
-
303
-
304
- def raise_parse_error(node, msg):
305
- if XMLParser_import_library == XMLParser_import_lxml:
306
- msg = '%s (element %s/line %d)' % (
307
- msg,
308
- node.tag,
309
- node.sourceline,
310
- )
311
- else:
312
- msg = '%s (element %s)' % (
313
- msg,
314
- node.tag,
315
- )
316
- raise GDSParseError(msg)
317
-
318
-
319
- class MixedContainer:
320
- # Constants for category:
321
- CategoryNone = 0
322
- CategoryText = 1
323
- CategorySimple = 2
324
- CategoryComplex = 3
325
- # Constants for content_type:
326
- TypeNone = 0
327
- TypeText = 1
328
- TypeString = 2
329
- TypeInteger = 3
330
- TypeFloat = 4
331
- TypeDecimal = 5
332
- TypeDouble = 6
333
- TypeBoolean = 7
334
-
335
- def __init__(self, category, content_type, name, value):
336
- self.category = category
337
- self.content_type = content_type
338
- self.name = name
339
- self.value = value
340
-
341
- def getCategory(self):
342
- return self.category
343
-
344
- def getContenttype(self, content_type):
345
- return self.content_type
346
-
347
- def getValue(self):
348
- return self.value
349
-
350
- def getName(self):
351
- return self.name
352
-
353
- def export(self, outfile, level, name, namespace):
354
- if self.category == MixedContainer.CategoryText:
355
- # Prevent exporting empty content as empty lines.
356
- if self.value.strip():
357
- outfile.write(self.value)
358
- elif self.category == MixedContainer.CategorySimple:
359
- self.exportSimple(outfile, level, name)
360
- else: # category == MixedContainer.CategoryComplex
361
- self.value.export(outfile, level, namespace, name)
362
-
363
- def exportSimple(self, outfile, level, name):
364
- if self.content_type == MixedContainer.TypeString:
365
- outfile.write('<%s>%s</%s>' % (self.name, self.value, self.name))
366
- elif self.content_type == MixedContainer.TypeInteger or \
367
- self.content_type == MixedContainer.TypeBoolean:
368
- outfile.write('<%s>%d</%s>' % (self.name, self.value, self.name))
369
- elif self.content_type == MixedContainer.TypeFloat or \
370
- self.content_type == MixedContainer.TypeDecimal:
371
- outfile.write('<%s>%f</%s>' % (self.name, self.value, self.name))
372
- elif self.content_type == MixedContainer.TypeDouble:
373
- outfile.write('<%s>%g</%s>' % (self.name, self.value, self.name))
374
-
375
- def exportLiteral(self, outfile, level, name):
376
- if self.category == MixedContainer.CategoryText:
377
- showIndent(outfile, level)
378
- outfile.write(
379
- 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' %
380
- (self.category, self.content_type, self.name, self.value))
381
- elif self.category == MixedContainer.CategorySimple:
382
- showIndent(outfile, level)
383
- outfile.write(
384
- 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' %
385
- (self.category, self.content_type, self.name, self.value))
386
- else: # category == MixedContainer.CategoryComplex
387
- showIndent(outfile, level)
388
- outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % (
389
- self.category,
390
- self.content_type,
391
- self.name,
392
- ))
393
- self.value.exportLiteral(outfile, level + 1)
394
- showIndent(outfile, level)
395
- outfile.write(')\n')
396
-
397
-
398
- class MemberSpec_(object):
399
-
400
- def __init__(self, name='', data_type='', container=0):
401
- self.name = name
402
- self.data_type = data_type
403
- self.container = container
404
-
405
- def set_name(self, name):
406
- self.name = name
407
-
408
- def get_name(self):
409
- return self.name
410
-
411
- def set_data_type(self, data_type):
412
- self.data_type = data_type
413
-
414
- def get_data_type_chain(self):
415
- return self.data_type
416
-
417
- def get_data_type(self):
418
- if isinstance(self.data_type, list):
419
- if len(self.data_type) > 0:
420
- return self.data_type[-1]
421
- else:
422
- return 'xs:string'
423
- else:
424
- return self.data_type
425
-
426
- def set_container(self, container):
427
- self.container = container
428
-
429
- def get_container(self):
430
- return self.container
431
-
432
-
433
- def _cast(typ, value):
434
- if typ is None or value is None:
435
- return value
436
- return typ(value)
437
-
438
-
439
- #
440
- # Data representation classes.
441
- #
442
-
443
-
444
- class PerformInvestigationRequest(GeneratedsSuper):
445
- """Request to perform social and financial investigation"""
446
- subclass = None
447
- superclass = None
448
-
449
- def __init__(self, SocialSecurityUser=None, DataGroups=None):
450
- self.SocialSecurityUser = SocialSecurityUser
451
- self.DataGroups = DataGroups
452
-
453
- def factory(*args_, **kwargs_):
454
- if PerformInvestigationRequest.subclass:
455
- return PerformInvestigationRequest.subclass(*args_, **kwargs_)
456
- else:
457
- return PerformInvestigationRequest(*args_, **kwargs_)
458
-
459
- factory = staticmethod(factory)
460
-
461
- def get_SocialSecurityUser(self):
462
- return self.SocialSecurityUser
463
-
464
- def set_SocialSecurityUser(self, SocialSecurityUser):
465
- self.SocialSecurityUser = SocialSecurityUser
466
-
467
- def validate_t_SSIN(self, value):
468
- # Validate type t_SSIN, a restriction on xs:string.
469
- pass
470
-
471
- def get_DataGroups(self):
472
- return self.DataGroups
473
-
474
- def set_DataGroups(self, DataGroups):
475
- self.DataGroups = DataGroups
476
-
477
- def export(self,
478
- outfile,
479
- level,
480
- namespace_='',
481
- name_='PerformInvestigationRequest',
482
- namespacedef_=''):
483
- showIndent(outfile, level)
484
- outfile.write('<%s%s%s' % (
485
- namespace_,
486
- name_,
487
- namespacedef_ and ' ' + namespacedef_ or '',
488
- ))
489
- already_processed = []
490
- self.exportAttributes(outfile,
491
- level,
492
- already_processed,
493
- namespace_,
494
- name_='PerformInvestigationRequest')
495
- if self.hasContent_():
496
- outfile.write('>\n')
497
- self.exportChildren(outfile, level + 1, namespace_, name_)
498
- showIndent(outfile, level)
499
- outfile.write('</%s%s>\n' % (namespace_, name_))
500
- else:
501
- outfile.write('/>\n')
502
-
503
- def exportAttributes(self,
504
- outfile,
505
- level,
506
- already_processed,
507
- namespace_='',
508
- name_='PerformInvestigationRequest'):
509
- pass
510
-
511
- def exportChildren(self,
512
- outfile,
513
- level,
514
- namespace_='',
515
- name_='PerformInvestigationRequest',
516
- fromsubclass_=False):
517
- if self.SocialSecurityUser is not None:
518
- showIndent(outfile, level)
519
- outfile.write(
520
- '<%sSocialSecurityUser>%s</%sSocialSecurityUser>\n' %
521
- (namespace_,
522
- self.gds_format_string(
523
- quote_xml(
524
- self.SocialSecurityUser).encode(ExternalEncoding),
525
- input_name='SocialSecurityUser'), namespace_))
526
- if self.DataGroups:
527
- self.DataGroups.export(outfile,
528
- level,
529
- namespace_,
530
- name_='DataGroups')
531
-
532
- def hasContent_(self):
533
- if (self.SocialSecurityUser is not None
534
- or self.DataGroups is not None):
535
- return True
536
- else:
537
- return False
538
-
539
- def exportLiteral(self,
540
- outfile,
541
- level,
542
- name_='PerformInvestigationRequest'):
543
- level += 1
544
- self.exportLiteralAttributes(outfile, level, [], name_)
545
- if self.hasContent_():
546
- self.exportLiteralChildren(outfile, level, name_)
547
-
548
- def exportLiteralAttributes(self, outfile, level, already_processed,
549
- name_):
550
- pass
551
-
552
- def exportLiteralChildren(self, outfile, level, name_):
553
- if self.SocialSecurityUser is not None:
554
- showIndent(outfile, level)
555
- outfile.write(
556
- 'SocialSecurityUser=%s,\n' %
557
- quote_python(self.SocialSecurityUser).encode(ExternalEncoding))
558
- if self.DataGroups is not None:
559
- showIndent(outfile, level)
560
- outfile.write('DataGroups=model_.RequestDataGroupsType(\n')
561
- self.DataGroups.exportLiteral(outfile, level, name_='DataGroups')
562
- showIndent(outfile, level)
563
- outfile.write('),\n')
564
-
565
- def build(self, node):
566
- self.buildAttributes(node, node.attrib, [])
567
- for child in node:
568
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
569
- self.buildChildren(child, node, nodeName_)
570
-
571
- def buildAttributes(self, node, attrs, already_processed):
572
- pass
573
-
574
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
575
- if nodeName_ == 'SocialSecurityUser':
576
- SocialSecurityUser_ = child_.text
577
- SocialSecurityUser_ = self.gds_validate_string(
578
- SocialSecurityUser_, node, 'SocialSecurityUser')
579
- self.SocialSecurityUser = SocialSecurityUser_
580
- # validate type t_SSIN
581
- self.validate_t_SSIN(self.SocialSecurityUser)
582
- elif nodeName_ == 'DataGroups':
583
- obj_ = RequestDataGroupsType.factory()
584
- obj_.build(child_)
585
- self.set_DataGroups(obj_)
586
-
587
-
588
- # end class PerformInvestigationRequest
589
-
590
-
591
- class RequestDataGroupsType(GeneratedsSuper):
592
- """The possible types of information that can be obtained. If not
593
- specified, all available information is returned"""
594
- subclass = None
595
- superclass = None
596
-
597
- def __init__(self,
598
- FamilyCompositionGroup=None,
599
- CitizenGroup=None,
600
- AddressHistoryGroup=None,
601
- WaitRegisterGroup=None):
602
- self.FamilyCompositionGroup = FamilyCompositionGroup
603
- self.CitizenGroup = CitizenGroup
604
- self.AddressHistoryGroup = AddressHistoryGroup
605
- self.WaitRegisterGroup = WaitRegisterGroup
606
-
607
- def factory(*args_, **kwargs_):
608
- if RequestDataGroupsType.subclass:
609
- return RequestDataGroupsType.subclass(*args_, **kwargs_)
610
- else:
611
- return RequestDataGroupsType(*args_, **kwargs_)
612
-
613
- factory = staticmethod(factory)
614
-
615
- def get_FamilyCompositionGroup(self):
616
- return self.FamilyCompositionGroup
617
-
618
- def set_FamilyCompositionGroup(self, FamilyCompositionGroup):
619
- self.FamilyCompositionGroup = FamilyCompositionGroup
620
-
621
- def get_CitizenGroup(self):
622
- return self.CitizenGroup
623
-
624
- def set_CitizenGroup(self, CitizenGroup):
625
- self.CitizenGroup = CitizenGroup
626
-
627
- def get_AddressHistoryGroup(self):
628
- return self.AddressHistoryGroup
629
-
630
- def set_AddressHistoryGroup(self, AddressHistoryGroup):
631
- self.AddressHistoryGroup = AddressHistoryGroup
632
-
633
- def get_WaitRegisterGroup(self):
634
- return self.WaitRegisterGroup
635
-
636
- def set_WaitRegisterGroup(self, WaitRegisterGroup):
637
- self.WaitRegisterGroup = WaitRegisterGroup
638
-
639
- def export(self,
640
- outfile,
641
- level,
642
- namespace_='',
643
- name_='RequestDataGroupsType',
644
- namespacedef_=''):
645
- showIndent(outfile, level)
646
- outfile.write('<%s%s%s' % (
647
- namespace_,
648
- name_,
649
- namespacedef_ and ' ' + namespacedef_ or '',
650
- ))
651
- already_processed = []
652
- self.exportAttributes(outfile,
653
- level,
654
- already_processed,
655
- namespace_,
656
- name_='RequestDataGroupsType')
657
- if self.hasContent_():
658
- outfile.write('>\n')
659
- self.exportChildren(outfile, level + 1, namespace_, name_)
660
- showIndent(outfile, level)
661
- outfile.write('</%s%s>\n' % (namespace_, name_))
662
- else:
663
- outfile.write('/>\n')
664
-
665
- def exportAttributes(self,
666
- outfile,
667
- level,
668
- already_processed,
669
- namespace_='',
670
- name_='RequestDataGroupsType'):
671
- pass
672
-
673
- def exportChildren(self,
674
- outfile,
675
- level,
676
- namespace_='',
677
- name_='RequestDataGroupsType',
678
- fromsubclass_=False):
679
- if self.FamilyCompositionGroup is not None:
680
- showIndent(outfile, level)
681
- outfile.write(
682
- '<%sFamilyCompositionGroup>%s</%sFamilyCompositionGroup>\n' %
683
- (namespace_,
684
- self.gds_format_boolean(
685
- self.gds_str_lower(str(self.FamilyCompositionGroup)),
686
- input_name='FamilyCompositionGroup'), namespace_))
687
- if self.CitizenGroup is not None:
688
- showIndent(outfile, level)
689
- outfile.write('<%sCitizenGroup>%s</%sCitizenGroup>\n' %
690
- (namespace_,
691
- self.gds_format_boolean(
692
- self.gds_str_lower(str(self.CitizenGroup)),
693
- input_name='CitizenGroup'), namespace_))
694
- if self.AddressHistoryGroup is not None:
695
- showIndent(outfile, level)
696
- outfile.write(
697
- '<%sAddressHistoryGroup>%s</%sAddressHistoryGroup>\n' %
698
- (namespace_,
699
- self.gds_format_boolean(
700
- self.gds_str_lower(str(self.AddressHistoryGroup)),
701
- input_name='AddressHistoryGroup'), namespace_))
702
- if self.WaitRegisterGroup is not None:
703
- showIndent(outfile, level)
704
- outfile.write('<%sWaitRegisterGroup>%s</%sWaitRegisterGroup>\n' %
705
- (namespace_,
706
- self.gds_format_boolean(
707
- self.gds_str_lower(str(self.WaitRegisterGroup)),
708
- input_name='WaitRegisterGroup'), namespace_))
709
-
710
- def hasContent_(self):
711
- if (self.FamilyCompositionGroup is not None
712
- or self.CitizenGroup is not None
713
- or self.AddressHistoryGroup is not None
714
- or self.WaitRegisterGroup is not None):
715
- return True
716
- else:
717
- return False
718
-
719
- def exportLiteral(self, outfile, level, name_='RequestDataGroupsType'):
720
- level += 1
721
- self.exportLiteralAttributes(outfile, level, [], name_)
722
- if self.hasContent_():
723
- self.exportLiteralChildren(outfile, level, name_)
724
-
725
- def exportLiteralAttributes(self, outfile, level, already_processed,
726
- name_):
727
- pass
728
-
729
- def exportLiteralChildren(self, outfile, level, name_):
730
- if self.FamilyCompositionGroup is not None:
731
- showIndent(outfile, level)
732
- outfile.write('FamilyCompositionGroup=%s,\n' %
733
- self.FamilyCompositionGroup)
734
- if self.CitizenGroup is not None:
735
- showIndent(outfile, level)
736
- outfile.write('CitizenGroup=%s,\n' % self.CitizenGroup)
737
- if self.AddressHistoryGroup is not None:
738
- showIndent(outfile, level)
739
- outfile.write('AddressHistoryGroup=%s,\n' %
740
- self.AddressHistoryGroup)
741
- if self.WaitRegisterGroup is not None:
742
- showIndent(outfile, level)
743
- outfile.write('WaitRegisterGroup=%s,\n' % self.WaitRegisterGroup)
744
-
745
- def build(self, node):
746
- self.buildAttributes(node, node.attrib, [])
747
- for child in node:
748
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
749
- self.buildChildren(child, node, nodeName_)
750
-
751
- def buildAttributes(self, node, attrs, already_processed):
752
- pass
753
-
754
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
755
- if nodeName_ == 'FamilyCompositionGroup':
756
- sval_ = child_.text
757
- if sval_ in ('true', '1'):
758
- ival_ = True
759
- elif sval_ in ('false', '0'):
760
- ival_ = False
761
- else:
762
- raise_parse_error(child_, 'requires boolean')
763
- ival_ = self.gds_validate_boolean(ival_, node,
764
- 'FamilyCompositionGroup')
765
- self.FamilyCompositionGroup = ival_
766
- elif nodeName_ == 'CitizenGroup':
767
- sval_ = child_.text
768
- if sval_ in ('true', '1'):
769
- ival_ = True
770
- elif sval_ in ('false', '0'):
771
- ival_ = False
772
- else:
773
- raise_parse_error(child_, 'requires boolean')
774
- ival_ = self.gds_validate_boolean(ival_, node, 'CitizenGroup')
775
- self.CitizenGroup = ival_
776
- elif nodeName_ == 'AddressHistoryGroup':
777
- sval_ = child_.text
778
- if sval_ in ('true', '1'):
779
- ival_ = True
780
- elif sval_ in ('false', '0'):
781
- ival_ = False
782
- else:
783
- raise_parse_error(child_, 'requires boolean')
784
- ival_ = self.gds_validate_boolean(ival_, node,
785
- 'AddressHistoryGroup')
786
- self.AddressHistoryGroup = ival_
787
- elif nodeName_ == 'WaitRegisterGroup':
788
- sval_ = child_.text
789
- if sval_ in ('true', '1'):
790
- ival_ = True
791
- elif sval_ in ('false', '0'):
792
- ival_ = False
793
- else:
794
- raise_parse_error(child_, 'requires boolean')
795
- ival_ = self.gds_validate_boolean(ival_, node, 'WaitRegisterGroup')
796
- self.WaitRegisterGroup = ival_
797
-
798
-
799
- # end class RequestDataGroupsType
800
-
801
-
802
- class FamilyCompositionGroup(GeneratedsSuper):
803
- """Give the composition of the family. Specifying true here implies
804
- that the other data groups will be returned for each member of
805
- the family, where applicable."""
806
- subclass = None
807
- superclass = None
808
-
809
- def __init__(self):
810
- pass
811
-
812
- def factory(*args_, **kwargs_):
813
- if FamilyCompositionGroup.subclass:
814
- return FamilyCompositionGroup.subclass(*args_, **kwargs_)
815
- else:
816
- return FamilyCompositionGroup(*args_, **kwargs_)
817
-
818
- factory = staticmethod(factory)
819
-
820
- def export(self,
821
- outfile,
822
- level,
823
- namespace_='',
824
- name_='FamilyCompositionGroup',
825
- namespacedef_=''):
826
- showIndent(outfile, level)
827
- outfile.write('<%s%s%s' % (
828
- namespace_,
829
- name_,
830
- namespacedef_ and ' ' + namespacedef_ or '',
831
- ))
832
- already_processed = []
833
- self.exportAttributes(outfile,
834
- level,
835
- already_processed,
836
- namespace_,
837
- name_='FamilyCompositionGroup')
838
- if self.hasContent_():
839
- outfile.write('>\n')
840
- self.exportChildren(outfile, level + 1, namespace_, name_)
841
- outfile.write('</%s%s>\n' % (namespace_, name_))
842
- else:
843
- outfile.write('/>\n')
844
-
845
- def exportAttributes(self,
846
- outfile,
847
- level,
848
- already_processed,
849
- namespace_='',
850
- name_='FamilyCompositionGroup'):
851
- pass
852
-
853
- def exportChildren(self,
854
- outfile,
855
- level,
856
- namespace_='',
857
- name_='FamilyCompositionGroup',
858
- fromsubclass_=False):
859
- pass
860
-
861
- def hasContent_(self):
862
- if ():
863
- return True
864
- else:
865
- return False
866
-
867
- def exportLiteral(self, outfile, level, name_='FamilyCompositionGroup'):
868
- level += 1
869
- self.exportLiteralAttributes(outfile, level, [], name_)
870
- if self.hasContent_():
871
- self.exportLiteralChildren(outfile, level, name_)
872
-
873
- def exportLiteralAttributes(self, outfile, level, already_processed,
874
- name_):
875
- pass
876
-
877
- def exportLiteralChildren(self, outfile, level, name_):
878
- pass
879
-
880
- def build(self, node):
881
- self.buildAttributes(node, node.attrib, [])
882
- for child in node:
883
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
884
- self.buildChildren(child, node, nodeName_)
885
-
886
- def buildAttributes(self, node, attrs, already_processed):
887
- pass
888
-
889
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
890
- pass
891
-
892
-
893
- # end class FamilyCompositionGroup
894
-
895
-
896
- class CitizenGroup(GeneratedsSuper):
897
- """Give the full set of legal information about a person."""
898
- subclass = None
899
- superclass = None
900
-
901
- def __init__(self):
902
- pass
903
-
904
- def factory(*args_, **kwargs_):
905
- if CitizenGroup.subclass:
906
- return CitizenGroup.subclass(*args_, **kwargs_)
907
- else:
908
- return CitizenGroup(*args_, **kwargs_)
909
-
910
- factory = staticmethod(factory)
911
-
912
- def export(self,
913
- outfile,
914
- level,
915
- namespace_='',
916
- name_='CitizenGroup',
917
- namespacedef_=''):
918
- showIndent(outfile, level)
919
- outfile.write('<%s%s%s' % (
920
- namespace_,
921
- name_,
922
- namespacedef_ and ' ' + namespacedef_ or '',
923
- ))
924
- already_processed = []
925
- self.exportAttributes(outfile,
926
- level,
927
- already_processed,
928
- namespace_,
929
- name_='CitizenGroup')
930
- if self.hasContent_():
931
- outfile.write('>\n')
932
- self.exportChildren(outfile, level + 1, namespace_, name_)
933
- outfile.write('</%s%s>\n' % (namespace_, name_))
934
- else:
935
- outfile.write('/>\n')
936
-
937
- def exportAttributes(self,
938
- outfile,
939
- level,
940
- already_processed,
941
- namespace_='',
942
- name_='CitizenGroup'):
943
- pass
944
-
945
- def exportChildren(self,
946
- outfile,
947
- level,
948
- namespace_='',
949
- name_='CitizenGroup',
950
- fromsubclass_=False):
951
- pass
952
-
953
- def hasContent_(self):
954
- if ():
955
- return True
956
- else:
957
- return False
958
-
959
- def exportLiteral(self, outfile, level, name_='CitizenGroup'):
960
- level += 1
961
- self.exportLiteralAttributes(outfile, level, [], name_)
962
- if self.hasContent_():
963
- self.exportLiteralChildren(outfile, level, name_)
964
-
965
- def exportLiteralAttributes(self, outfile, level, already_processed,
966
- name_):
967
- pass
968
-
969
- def exportLiteralChildren(self, outfile, level, name_):
970
- pass
971
-
972
- def build(self, node):
973
- self.buildAttributes(node, node.attrib, [])
974
- for child in node:
975
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
976
- self.buildChildren(child, node, nodeName_)
977
-
978
- def buildAttributes(self, node, attrs, already_processed):
979
- pass
980
-
981
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
982
- pass
983
-
984
-
985
- # end class CitizenGroup
986
-
987
-
988
- class AddressHistoryGroup(GeneratedsSuper):
989
- """Give a history of the legal and declared addresses for a person."""
990
- subclass = None
991
- superclass = None
992
-
993
- def __init__(self):
994
- pass
995
-
996
- def factory(*args_, **kwargs_):
997
- if AddressHistoryGroup.subclass:
998
- return AddressHistoryGroup.subclass(*args_, **kwargs_)
999
- else:
1000
- return AddressHistoryGroup(*args_, **kwargs_)
1001
-
1002
- factory = staticmethod(factory)
1003
-
1004
- def export(self,
1005
- outfile,
1006
- level,
1007
- namespace_='',
1008
- name_='AddressHistoryGroup',
1009
- namespacedef_=''):
1010
- showIndent(outfile, level)
1011
- outfile.write('<%s%s%s' % (
1012
- namespace_,
1013
- name_,
1014
- namespacedef_ and ' ' + namespacedef_ or '',
1015
- ))
1016
- already_processed = []
1017
- self.exportAttributes(outfile,
1018
- level,
1019
- already_processed,
1020
- namespace_,
1021
- name_='AddressHistoryGroup')
1022
- if self.hasContent_():
1023
- outfile.write('>\n')
1024
- self.exportChildren(outfile, level + 1, namespace_, name_)
1025
- outfile.write('</%s%s>\n' % (namespace_, name_))
1026
- else:
1027
- outfile.write('/>\n')
1028
-
1029
- def exportAttributes(self,
1030
- outfile,
1031
- level,
1032
- already_processed,
1033
- namespace_='',
1034
- name_='AddressHistoryGroup'):
1035
- pass
1036
-
1037
- def exportChildren(self,
1038
- outfile,
1039
- level,
1040
- namespace_='',
1041
- name_='AddressHistoryGroup',
1042
- fromsubclass_=False):
1043
- pass
1044
-
1045
- def hasContent_(self):
1046
- if ():
1047
- return True
1048
- else:
1049
- return False
1050
-
1051
- def exportLiteral(self, outfile, level, name_='AddressHistoryGroup'):
1052
- level += 1
1053
- self.exportLiteralAttributes(outfile, level, [], name_)
1054
- if self.hasContent_():
1055
- self.exportLiteralChildren(outfile, level, name_)
1056
-
1057
- def exportLiteralAttributes(self, outfile, level, already_processed,
1058
- name_):
1059
- pass
1060
-
1061
- def exportLiteralChildren(self, outfile, level, name_):
1062
- pass
1063
-
1064
- def build(self, node):
1065
- self.buildAttributes(node, node.attrib, [])
1066
- for child in node:
1067
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
1068
- self.buildChildren(child, node, nodeName_)
1069
-
1070
- def buildAttributes(self, node, attrs, already_processed):
1071
- pass
1072
-
1073
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1074
- pass
1075
-
1076
-
1077
- # end class AddressHistoryGroup
1078
-
1079
-
1080
- class InscriptionType(GeneratedsSuper):
1081
- """An inscription"""
1082
- subclass = None
1083
- superclass = None
1084
-
1085
- def __init__(self,
1086
- SSIN=None,
1087
- OrgUnit=None,
1088
- Purpose=None,
1089
- Period=None,
1090
- InscriptionCode=None,
1091
- PhaseCode=None):
1092
- self.SSIN = SSIN
1093
- self.OrgUnit = OrgUnit
1094
- self.Purpose = Purpose
1095
- self.Period = Period
1096
- self.InscriptionCode = InscriptionCode
1097
- self.PhaseCode = PhaseCode
1098
-
1099
- def factory(*args_, **kwargs_):
1100
- if InscriptionType.subclass:
1101
- return InscriptionType.subclass(*args_, **kwargs_)
1102
- else:
1103
- return InscriptionType(*args_, **kwargs_)
1104
-
1105
- factory = staticmethod(factory)
1106
-
1107
- def get_SSIN(self):
1108
- return self.SSIN
1109
-
1110
- def set_SSIN(self, SSIN):
1111
- self.SSIN = SSIN
1112
-
1113
- def validate_t_SSIN(self, value):
1114
- # Validate type t_SSIN, a restriction on xs:string.
1115
- pass
1116
-
1117
- def get_OrgUnit(self):
1118
- return self.OrgUnit
1119
-
1120
- def set_OrgUnit(self, OrgUnit):
1121
- self.OrgUnit = OrgUnit
1122
-
1123
- def get_Purpose(self):
1124
- return self.Purpose
1125
-
1126
- def set_Purpose(self, Purpose):
1127
- self.Purpose = Purpose
1128
-
1129
- def get_Period(self):
1130
- return self.Period
1131
-
1132
- def set_Period(self, Period):
1133
- self.Period = Period
1134
-
1135
- def get_InscriptionCode(self):
1136
- return self.InscriptionCode
1137
-
1138
- def set_InscriptionCode(self, InscriptionCode):
1139
- self.InscriptionCode = InscriptionCode
1140
-
1141
- def get_PhaseCode(self):
1142
- return self.PhaseCode
1143
-
1144
- def set_PhaseCode(self, PhaseCode):
1145
- self.PhaseCode = PhaseCode
1146
-
1147
- def export(self,
1148
- outfile,
1149
- level,
1150
- namespace_='',
1151
- name_='InscriptionType',
1152
- namespacedef_=''):
1153
- showIndent(outfile, level)
1154
- outfile.write('<%s%s%s' % (
1155
- namespace_,
1156
- name_,
1157
- namespacedef_ and ' ' + namespacedef_ or '',
1158
- ))
1159
- already_processed = []
1160
- self.exportAttributes(outfile,
1161
- level,
1162
- already_processed,
1163
- namespace_,
1164
- name_='InscriptionType')
1165
- if self.hasContent_():
1166
- outfile.write('>\n')
1167
- self.exportChildren(outfile, level + 1, namespace_, name_)
1168
- showIndent(outfile, level)
1169
- outfile.write('</%s%s>\n' % (namespace_, name_))
1170
- else:
1171
- outfile.write('/>\n')
1172
-
1173
- def exportAttributes(self,
1174
- outfile,
1175
- level,
1176
- already_processed,
1177
- namespace_='',
1178
- name_='InscriptionType'):
1179
- pass
1180
-
1181
- def exportChildren(self,
1182
- outfile,
1183
- level,
1184
- namespace_='',
1185
- name_='InscriptionType',
1186
- fromsubclass_=False):
1187
- if self.SSIN is not None:
1188
- showIndent(outfile, level)
1189
- outfile.write('<%sSSIN>%s</%sSSIN>\n' %
1190
- (namespace_,
1191
- self.gds_format_string(
1192
- quote_xml(self.SSIN).encode(ExternalEncoding),
1193
- input_name='SSIN'), namespace_))
1194
- if self.OrgUnit is not None:
1195
- showIndent(outfile, level)
1196
- outfile.write(
1197
- '<%sOrgUnit>%s</%sOrgUnit>\n' %
1198
- (namespace_,
1199
- self.gds_format_string(quote_xml(
1200
- self.OrgUnit).encode(ExternalEncoding),
1201
- input_name='OrgUnit'), namespace_))
1202
- if self.Purpose is not None:
1203
- showIndent(outfile, level)
1204
- outfile.write(
1205
- '<%sPurpose>%s</%sPurpose>\n' %
1206
- (namespace_,
1207
- self.gds_format_integer(self.Purpose,
1208
- input_name='Purpose'), namespace_))
1209
- if self.Period:
1210
- self.Period.export(outfile, level, namespace_, name_='Period')
1211
- if self.InscriptionCode is not None:
1212
- showIndent(outfile, level)
1213
- outfile.write('<%sInscriptionCode>%s</%sInscriptionCode>\n' %
1214
- (namespace_,
1215
- self.gds_format_integer(
1216
- self.InscriptionCode,
1217
- input_name='InscriptionCode'), namespace_))
1218
- if self.PhaseCode is not None:
1219
- showIndent(outfile, level)
1220
- outfile.write(
1221
- '<%sPhaseCode>%s</%sPhaseCode>\n' %
1222
- (namespace_,
1223
- self.gds_format_integer(self.PhaseCode,
1224
- input_name='PhaseCode'), namespace_))
1225
-
1226
- def hasContent_(self):
1227
- if (self.SSIN is not None or self.OrgUnit is not None
1228
- or self.Purpose is not None or self.Period is not None
1229
- or self.InscriptionCode is not None
1230
- or self.PhaseCode is not None):
1231
- return True
1232
- else:
1233
- return False
1234
-
1235
- def exportLiteral(self, outfile, level, name_='InscriptionType'):
1236
- level += 1
1237
- self.exportLiteralAttributes(outfile, level, [], name_)
1238
- if self.hasContent_():
1239
- self.exportLiteralChildren(outfile, level, name_)
1240
-
1241
- def exportLiteralAttributes(self, outfile, level, already_processed,
1242
- name_):
1243
- pass
1244
-
1245
- def exportLiteralChildren(self, outfile, level, name_):
1246
- if self.SSIN is not None:
1247
- showIndent(outfile, level)
1248
- outfile.write('SSIN=%s,\n' %
1249
- quote_python(self.SSIN).encode(ExternalEncoding))
1250
- if self.OrgUnit is not None:
1251
- showIndent(outfile, level)
1252
- outfile.write('OrgUnit=%s,\n' %
1253
- quote_python(self.OrgUnit).encode(ExternalEncoding))
1254
- if self.Purpose is not None:
1255
- showIndent(outfile, level)
1256
- outfile.write('Purpose=%d,\n' % self.Purpose)
1257
- if self.Period is not None:
1258
- showIndent(outfile, level)
1259
- outfile.write('Period=model_.PeriodType(\n')
1260
- self.Period.exportLiteral(outfile, level, name_='Period')
1261
- showIndent(outfile, level)
1262
- outfile.write('),\n')
1263
- if self.InscriptionCode is not None:
1264
- showIndent(outfile, level)
1265
- outfile.write('InscriptionCode=%d,\n' % self.InscriptionCode)
1266
- if self.PhaseCode is not None:
1267
- showIndent(outfile, level)
1268
- outfile.write('PhaseCode=%d,\n' % self.PhaseCode)
1269
-
1270
- def build(self, node):
1271
- self.buildAttributes(node, node.attrib, [])
1272
- for child in node:
1273
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
1274
- self.buildChildren(child, node, nodeName_)
1275
-
1276
- def buildAttributes(self, node, attrs, already_processed):
1277
- pass
1278
-
1279
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1280
- if nodeName_ == 'SSIN':
1281
- SSIN_ = child_.text
1282
- SSIN_ = self.gds_validate_string(SSIN_, node, 'SSIN')
1283
- self.SSIN = SSIN_
1284
- self.validate_t_SSIN(self.SSIN) # validate type t_SSIN
1285
- elif nodeName_ == 'OrgUnit':
1286
- OrgUnit_ = child_.text
1287
- OrgUnit_ = self.gds_validate_string(OrgUnit_, node, 'OrgUnit')
1288
- self.OrgUnit = OrgUnit_
1289
- elif nodeName_ == 'Purpose':
1290
- sval_ = child_.text
1291
- try:
1292
- ival_ = int(sval_)
1293
- except (TypeError, ValueError), exp:
1294
- raise_parse_error(child_, 'requires integer: %s' % exp)
1295
- ival_ = self.gds_validate_integer(ival_, node, 'Purpose')
1296
- self.Purpose = ival_
1297
- elif nodeName_ == 'Period':
1298
- obj_ = PeriodType.factory()
1299
- obj_.build(child_)
1300
- self.set_Period(obj_)
1301
- elif nodeName_ == 'InscriptionCode':
1302
- sval_ = child_.text
1303
- try:
1304
- ival_ = int(sval_)
1305
- except (TypeError, ValueError), exp:
1306
- raise_parse_error(child_, 'requires integer: %s' % exp)
1307
- ival_ = self.gds_validate_integer(ival_, node, 'InscriptionCode')
1308
- self.InscriptionCode = ival_
1309
- elif nodeName_ == 'PhaseCode':
1310
- sval_ = child_.text
1311
- try:
1312
- ival_ = int(sval_)
1313
- except (TypeError, ValueError), exp:
1314
- raise_parse_error(child_, 'requires integer: %s' % exp)
1315
- ival_ = self.gds_validate_integer(ival_, node, 'PhaseCode')
1316
- self.PhaseCode = ival_
1317
-
1318
-
1319
- # end class InscriptionType
1320
-
1321
-
1322
- class DescriptionType(GeneratedsSuper):
1323
- subclass = None
1324
- superclass = None
1325
-
1326
- def __init__(self, lang=None, valueOf_=None):
1327
- self.lang = _cast(None, lang)
1328
- self.valueOf_ = valueOf_
1329
-
1330
- def factory(*args_, **kwargs_):
1331
- if DescriptionType.subclass:
1332
- return DescriptionType.subclass(*args_, **kwargs_)
1333
- else:
1334
- return DescriptionType(*args_, **kwargs_)
1335
-
1336
- factory = staticmethod(factory)
1337
-
1338
- def get_lang(self):
1339
- return self.lang
1340
-
1341
- def set_lang(self, lang):
1342
- self.lang = lang
1343
-
1344
- def validate_t_Language(self, value):
1345
- # Validate type t_Language, a restriction on xs:string.
1346
- pass
1347
-
1348
- def get_valueOf_(self):
1349
- return self.valueOf_
1350
-
1351
- def set_valueOf_(self, valueOf_):
1352
- self.valueOf_ = valueOf_
1353
-
1354
- def export(self,
1355
- outfile,
1356
- level,
1357
- namespace_='',
1358
- name_='DescriptionType',
1359
- namespacedef_=''):
1360
- showIndent(outfile, level)
1361
- outfile.write('<%s%s%s' % (
1362
- namespace_,
1363
- name_,
1364
- namespacedef_ and ' ' + namespacedef_ or '',
1365
- ))
1366
- already_processed = []
1367
- self.exportAttributes(outfile,
1368
- level,
1369
- already_processed,
1370
- namespace_,
1371
- name_='DescriptionType')
1372
- if self.hasContent_():
1373
- outfile.write('>')
1374
- outfile.write(str(self.valueOf_).encode(ExternalEncoding))
1375
- self.exportChildren(outfile, level + 1, namespace_, name_)
1376
- outfile.write('</%s%s>\n' % (namespace_, name_))
1377
- else:
1378
- outfile.write('/>\n')
1379
-
1380
- def exportAttributes(self,
1381
- outfile,
1382
- level,
1383
- already_processed,
1384
- namespace_='',
1385
- name_='DescriptionType'):
1386
- if self.lang is not None and 'lang' not in already_processed:
1387
- already_processed.append('lang')
1388
- outfile.write(' lang=%s' % (quote_attrib(self.lang), ))
1389
-
1390
- def exportChildren(self,
1391
- outfile,
1392
- level,
1393
- namespace_='',
1394
- name_='DescriptionType',
1395
- fromsubclass_=False):
1396
- pass
1397
-
1398
- def hasContent_(self):
1399
- if (self.valueOf_):
1400
- return True
1401
- else:
1402
- return False
1403
-
1404
- def exportLiteral(self, outfile, level, name_='DescriptionType'):
1405
- level += 1
1406
- self.exportLiteralAttributes(outfile, level, [], name_)
1407
- if self.hasContent_():
1408
- self.exportLiteralChildren(outfile, level, name_)
1409
- showIndent(outfile, level)
1410
- outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_, ))
1411
-
1412
- def exportLiteralAttributes(self, outfile, level, already_processed,
1413
- name_):
1414
- if self.lang is not None and 'lang' not in already_processed:
1415
- already_processed.append('lang')
1416
- showIndent(outfile, level)
1417
- outfile.write('lang = "%s",\n' % (self.lang, ))
1418
-
1419
- def exportLiteralChildren(self, outfile, level, name_):
1420
- pass
1421
-
1422
- def build(self, node):
1423
- self.buildAttributes(node, node.attrib, [])
1424
- self.valueOf_ = get_all_text_(node)
1425
- for child in node:
1426
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
1427
- self.buildChildren(child, node, nodeName_)
1428
-
1429
- def buildAttributes(self, node, attrs, already_processed):
1430
- value = find_attr_value_('lang', node)
1431
- if value is not None and 'lang' not in already_processed:
1432
- already_processed.append('lang')
1433
- self.lang = value
1434
- self.validate_t_Language(self.lang) # validate type t_Language
1435
-
1436
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1437
- pass
1438
-
1439
-
1440
- # end class DescriptionType
1441
-
1442
-
1443
- class PeriodType(GeneratedsSuper):
1444
- """A period of time between a startdate and an enddate"""
1445
- subclass = None
1446
- superclass = None
1447
-
1448
- def __init__(self, StartDate=None, EndDate=None):
1449
- self.StartDate = StartDate
1450
- self.EndDate = EndDate
1451
-
1452
- def factory(*args_, **kwargs_):
1453
- if PeriodType.subclass:
1454
- return PeriodType.subclass(*args_, **kwargs_)
1455
- else:
1456
- return PeriodType(*args_, **kwargs_)
1457
-
1458
- factory = staticmethod(factory)
1459
-
1460
- def get_StartDate(self):
1461
- return self.StartDate
1462
-
1463
- def set_StartDate(self, StartDate):
1464
- self.StartDate = StartDate
1465
-
1466
- def get_EndDate(self):
1467
- return self.EndDate
1468
-
1469
- def set_EndDate(self, EndDate):
1470
- self.EndDate = EndDate
1471
-
1472
- def export(self,
1473
- outfile,
1474
- level,
1475
- namespace_='',
1476
- name_='PeriodType',
1477
- namespacedef_=''):
1478
- showIndent(outfile, level)
1479
- outfile.write('<%s%s%s' % (
1480
- namespace_,
1481
- name_,
1482
- namespacedef_ and ' ' + namespacedef_ or '',
1483
- ))
1484
- already_processed = []
1485
- self.exportAttributes(outfile,
1486
- level,
1487
- already_processed,
1488
- namespace_,
1489
- name_='PeriodType')
1490
- if self.hasContent_():
1491
- outfile.write('>\n')
1492
- self.exportChildren(outfile, level + 1, namespace_, name_)
1493
- showIndent(outfile, level)
1494
- outfile.write('</%s%s>\n' % (namespace_, name_))
1495
- else:
1496
- outfile.write('/>\n')
1497
-
1498
- def exportAttributes(self,
1499
- outfile,
1500
- level,
1501
- already_processed,
1502
- namespace_='',
1503
- name_='PeriodType'):
1504
- pass
1505
-
1506
- def exportChildren(self,
1507
- outfile,
1508
- level,
1509
- namespace_='',
1510
- name_='PeriodType',
1511
- fromsubclass_=False):
1512
- if self.StartDate is not None:
1513
- showIndent(outfile, level)
1514
- outfile.write(
1515
- '<%sStartDate>%s</%sStartDate>\n' %
1516
- (namespace_,
1517
- self.gds_format_string(quote_xml(
1518
- self.StartDate).encode(ExternalEncoding),
1519
- input_name='StartDate'), namespace_))
1520
- if self.EndDate is not None:
1521
- showIndent(outfile, level)
1522
- outfile.write(
1523
- '<%sEndDate>%s</%sEndDate>\n' %
1524
- (namespace_,
1525
- self.gds_format_string(quote_xml(
1526
- self.EndDate).encode(ExternalEncoding),
1527
- input_name='EndDate'), namespace_))
1528
-
1529
- def hasContent_(self):
1530
- if (self.StartDate is not None or self.EndDate is not None):
1531
- return True
1532
- else:
1533
- return False
1534
-
1535
- def exportLiteral(self, outfile, level, name_='PeriodType'):
1536
- level += 1
1537
- self.exportLiteralAttributes(outfile, level, [], name_)
1538
- if self.hasContent_():
1539
- self.exportLiteralChildren(outfile, level, name_)
1540
-
1541
- def exportLiteralAttributes(self, outfile, level, already_processed,
1542
- name_):
1543
- pass
1544
-
1545
- def exportLiteralChildren(self, outfile, level, name_):
1546
- if self.StartDate is not None:
1547
- showIndent(outfile, level)
1548
- outfile.write(
1549
- 'StartDate=%s,\n' %
1550
- quote_python(self.StartDate).encode(ExternalEncoding))
1551
- if self.EndDate is not None:
1552
- showIndent(outfile, level)
1553
- outfile.write('EndDate=%s,\n' %
1554
- quote_python(self.EndDate).encode(ExternalEncoding))
1555
-
1556
- def build(self, node):
1557
- self.buildAttributes(node, node.attrib, [])
1558
- for child in node:
1559
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
1560
- self.buildChildren(child, node, nodeName_)
1561
-
1562
- def buildAttributes(self, node, attrs, already_processed):
1563
- pass
1564
-
1565
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1566
- if nodeName_ == 'StartDate':
1567
- StartDate_ = child_.text
1568
- StartDate_ = self.gds_validate_string(StartDate_, node,
1569
- 'StartDate')
1570
- self.StartDate = StartDate_
1571
- elif nodeName_ == 'EndDate':
1572
- EndDate_ = child_.text
1573
- EndDate_ = self.gds_validate_string(EndDate_, node, 'EndDate')
1574
- self.EndDate = EndDate_
1575
-
1576
-
1577
- # end class PeriodType
1578
-
1579
-
1580
- class StartDate(GeneratedsSuper):
1581
- subclass = None
1582
- superclass = None
1583
-
1584
- def __init__(self):
1585
- pass
1586
-
1587
- def factory(*args_, **kwargs_):
1588
- if StartDate.subclass:
1589
- return StartDate.subclass(*args_, **kwargs_)
1590
- else:
1591
- return StartDate(*args_, **kwargs_)
1592
-
1593
- factory = staticmethod(factory)
1594
-
1595
- def export(self,
1596
- outfile,
1597
- level,
1598
- namespace_='',
1599
- name_='StartDate',
1600
- namespacedef_=''):
1601
- showIndent(outfile, level)
1602
- outfile.write('<%s%s%s' % (
1603
- namespace_,
1604
- name_,
1605
- namespacedef_ and ' ' + namespacedef_ or '',
1606
- ))
1607
- already_processed = []
1608
- self.exportAttributes(outfile,
1609
- level,
1610
- already_processed,
1611
- namespace_,
1612
- name_='StartDate')
1613
- if self.hasContent_():
1614
- outfile.write('>\n')
1615
- self.exportChildren(outfile, level + 1, namespace_, name_)
1616
- outfile.write('</%s%s>\n' % (namespace_, name_))
1617
- else:
1618
- outfile.write('/>\n')
1619
-
1620
- def exportAttributes(self,
1621
- outfile,
1622
- level,
1623
- already_processed,
1624
- namespace_='',
1625
- name_='StartDate'):
1626
- pass
1627
-
1628
- def exportChildren(self,
1629
- outfile,
1630
- level,
1631
- namespace_='',
1632
- name_='StartDate',
1633
- fromsubclass_=False):
1634
- pass
1635
-
1636
- def hasContent_(self):
1637
- if ():
1638
- return True
1639
- else:
1640
- return False
1641
-
1642
- def exportLiteral(self, outfile, level, name_='StartDate'):
1643
- level += 1
1644
- self.exportLiteralAttributes(outfile, level, [], name_)
1645
- if self.hasContent_():
1646
- self.exportLiteralChildren(outfile, level, name_)
1647
-
1648
- def exportLiteralAttributes(self, outfile, level, already_processed,
1649
- name_):
1650
- pass
1651
-
1652
- def exportLiteralChildren(self, outfile, level, name_):
1653
- pass
1654
-
1655
- def build(self, node):
1656
- self.buildAttributes(node, node.attrib, [])
1657
- for child in node:
1658
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
1659
- self.buildChildren(child, node, nodeName_)
1660
-
1661
- def buildAttributes(self, node, attrs, already_processed):
1662
- pass
1663
-
1664
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1665
- pass
1666
-
1667
-
1668
- # end class StartDate
1669
-
1670
-
1671
- class EndDate(GeneratedsSuper):
1672
- subclass = None
1673
- superclass = None
1674
-
1675
- def __init__(self):
1676
- pass
1677
-
1678
- def factory(*args_, **kwargs_):
1679
- if EndDate.subclass:
1680
- return EndDate.subclass(*args_, **kwargs_)
1681
- else:
1682
- return EndDate(*args_, **kwargs_)
1683
-
1684
- factory = staticmethod(factory)
1685
-
1686
- def export(self,
1687
- outfile,
1688
- level,
1689
- namespace_='',
1690
- name_='EndDate',
1691
- namespacedef_=''):
1692
- showIndent(outfile, level)
1693
- outfile.write('<%s%s%s' % (
1694
- namespace_,
1695
- name_,
1696
- namespacedef_ and ' ' + namespacedef_ or '',
1697
- ))
1698
- already_processed = []
1699
- self.exportAttributes(outfile,
1700
- level,
1701
- already_processed,
1702
- namespace_,
1703
- name_='EndDate')
1704
- if self.hasContent_():
1705
- outfile.write('>\n')
1706
- self.exportChildren(outfile, level + 1, namespace_, name_)
1707
- outfile.write('</%s%s>\n' % (namespace_, name_))
1708
- else:
1709
- outfile.write('/>\n')
1710
-
1711
- def exportAttributes(self,
1712
- outfile,
1713
- level,
1714
- already_processed,
1715
- namespace_='',
1716
- name_='EndDate'):
1717
- pass
1718
-
1719
- def exportChildren(self,
1720
- outfile,
1721
- level,
1722
- namespace_='',
1723
- name_='EndDate',
1724
- fromsubclass_=False):
1725
- pass
1726
-
1727
- def hasContent_(self):
1728
- if ():
1729
- return True
1730
- else:
1731
- return False
1732
-
1733
- def exportLiteral(self, outfile, level, name_='EndDate'):
1734
- level += 1
1735
- self.exportLiteralAttributes(outfile, level, [], name_)
1736
- if self.hasContent_():
1737
- self.exportLiteralChildren(outfile, level, name_)
1738
-
1739
- def exportLiteralAttributes(self, outfile, level, already_processed,
1740
- name_):
1741
- pass
1742
-
1743
- def exportLiteralChildren(self, outfile, level, name_):
1744
- pass
1745
-
1746
- def build(self, node):
1747
- self.buildAttributes(node, node.attrib, [])
1748
- for child in node:
1749
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
1750
- self.buildChildren(child, node, nodeName_)
1751
-
1752
- def buildAttributes(self, node, attrs, already_processed):
1753
- pass
1754
-
1755
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1756
- pass
1757
-
1758
-
1759
- # end class EndDate
1760
-
1761
-
1762
- class ClosedPeriodType(GeneratedsSuper):
1763
- """A closed period with a mandatory start and end date"""
1764
- subclass = None
1765
- superclass = None
1766
-
1767
- def __init__(self, StartDate=None, EndDate=None):
1768
- self.StartDate = StartDate
1769
- self.EndDate = EndDate
1770
-
1771
- def factory(*args_, **kwargs_):
1772
- if ClosedPeriodType.subclass:
1773
- return ClosedPeriodType.subclass(*args_, **kwargs_)
1774
- else:
1775
- return ClosedPeriodType(*args_, **kwargs_)
1776
-
1777
- factory = staticmethod(factory)
1778
-
1779
- def get_StartDate(self):
1780
- return self.StartDate
1781
-
1782
- def set_StartDate(self, StartDate):
1783
- self.StartDate = StartDate
1784
-
1785
- def get_EndDate(self):
1786
- return self.EndDate
1787
-
1788
- def set_EndDate(self, EndDate):
1789
- self.EndDate = EndDate
1790
-
1791
- def export(self,
1792
- outfile,
1793
- level,
1794
- namespace_='',
1795
- name_='ClosedPeriodType',
1796
- namespacedef_=''):
1797
- showIndent(outfile, level)
1798
- outfile.write('<%s%s%s' % (
1799
- namespace_,
1800
- name_,
1801
- namespacedef_ and ' ' + namespacedef_ or '',
1802
- ))
1803
- already_processed = []
1804
- self.exportAttributes(outfile,
1805
- level,
1806
- already_processed,
1807
- namespace_,
1808
- name_='ClosedPeriodType')
1809
- if self.hasContent_():
1810
- outfile.write('>\n')
1811
- self.exportChildren(outfile, level + 1, namespace_, name_)
1812
- showIndent(outfile, level)
1813
- outfile.write('</%s%s>\n' % (namespace_, name_))
1814
- else:
1815
- outfile.write('/>\n')
1816
-
1817
- def exportAttributes(self,
1818
- outfile,
1819
- level,
1820
- already_processed,
1821
- namespace_='',
1822
- name_='ClosedPeriodType'):
1823
- pass
1824
-
1825
- def exportChildren(self,
1826
- outfile,
1827
- level,
1828
- namespace_='',
1829
- name_='ClosedPeriodType',
1830
- fromsubclass_=False):
1831
- if self.StartDate is not None:
1832
- showIndent(outfile, level)
1833
- outfile.write(
1834
- '<%sStartDate>%s</%sStartDate>\n' %
1835
- (namespace_,
1836
- self.gds_format_string(quote_xml(
1837
- self.StartDate).encode(ExternalEncoding),
1838
- input_name='StartDate'), namespace_))
1839
- if self.EndDate is not None:
1840
- showIndent(outfile, level)
1841
- outfile.write(
1842
- '<%sEndDate>%s</%sEndDate>\n' %
1843
- (namespace_,
1844
- self.gds_format_string(quote_xml(
1845
- self.EndDate).encode(ExternalEncoding),
1846
- input_name='EndDate'), namespace_))
1847
-
1848
- def hasContent_(self):
1849
- if (self.StartDate is not None or self.EndDate is not None):
1850
- return True
1851
- else:
1852
- return False
1853
-
1854
- def exportLiteral(self, outfile, level, name_='ClosedPeriodType'):
1855
- level += 1
1856
- self.exportLiteralAttributes(outfile, level, [], name_)
1857
- if self.hasContent_():
1858
- self.exportLiteralChildren(outfile, level, name_)
1859
-
1860
- def exportLiteralAttributes(self, outfile, level, already_processed,
1861
- name_):
1862
- pass
1863
-
1864
- def exportLiteralChildren(self, outfile, level, name_):
1865
- if self.StartDate is not None:
1866
- showIndent(outfile, level)
1867
- outfile.write(
1868
- 'StartDate=%s,\n' %
1869
- quote_python(self.StartDate).encode(ExternalEncoding))
1870
- if self.EndDate is not None:
1871
- showIndent(outfile, level)
1872
- outfile.write('EndDate=%s,\n' %
1873
- quote_python(self.EndDate).encode(ExternalEncoding))
1874
-
1875
- def build(self, node):
1876
- self.buildAttributes(node, node.attrib, [])
1877
- for child in node:
1878
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
1879
- self.buildChildren(child, node, nodeName_)
1880
-
1881
- def buildAttributes(self, node, attrs, already_processed):
1882
- pass
1883
-
1884
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1885
- if nodeName_ == 'StartDate':
1886
- StartDate_ = child_.text
1887
- StartDate_ = self.gds_validate_string(StartDate_, node,
1888
- 'StartDate')
1889
- self.StartDate = StartDate_
1890
- elif nodeName_ == 'EndDate':
1891
- EndDate_ = child_.text
1892
- EndDate_ = self.gds_validate_string(EndDate_, node, 'EndDate')
1893
- self.EndDate = EndDate_
1894
-
1895
-
1896
- # end class ClosedPeriodType
1897
-
1898
-
1899
- class StartingPeriodType(GeneratedsSuper):
1900
- """A halfopen period with a mandatory start date"""
1901
- subclass = None
1902
- superclass = None
1903
-
1904
- def __init__(self, StartDate=None, EndDate=None):
1905
- self.StartDate = StartDate
1906
- self.EndDate = EndDate
1907
-
1908
- def factory(*args_, **kwargs_):
1909
- if StartingPeriodType.subclass:
1910
- return StartingPeriodType.subclass(*args_, **kwargs_)
1911
- else:
1912
- return StartingPeriodType(*args_, **kwargs_)
1913
-
1914
- factory = staticmethod(factory)
1915
-
1916
- def get_StartDate(self):
1917
- return self.StartDate
1918
-
1919
- def set_StartDate(self, StartDate):
1920
- self.StartDate = StartDate
1921
-
1922
- def get_EndDate(self):
1923
- return self.EndDate
1924
-
1925
- def set_EndDate(self, EndDate):
1926
- self.EndDate = EndDate
1927
-
1928
- def export(self,
1929
- outfile,
1930
- level,
1931
- namespace_='',
1932
- name_='StartingPeriodType',
1933
- namespacedef_=''):
1934
- showIndent(outfile, level)
1935
- outfile.write('<%s%s%s' % (
1936
- namespace_,
1937
- name_,
1938
- namespacedef_ and ' ' + namespacedef_ or '',
1939
- ))
1940
- already_processed = []
1941
- self.exportAttributes(outfile,
1942
- level,
1943
- already_processed,
1944
- namespace_,
1945
- name_='StartingPeriodType')
1946
- if self.hasContent_():
1947
- outfile.write('>\n')
1948
- self.exportChildren(outfile, level + 1, namespace_, name_)
1949
- showIndent(outfile, level)
1950
- outfile.write('</%s%s>\n' % (namespace_, name_))
1951
- else:
1952
- outfile.write('/>\n')
1953
-
1954
- def exportAttributes(self,
1955
- outfile,
1956
- level,
1957
- already_processed,
1958
- namespace_='',
1959
- name_='StartingPeriodType'):
1960
- pass
1961
-
1962
- def exportChildren(self,
1963
- outfile,
1964
- level,
1965
- namespace_='',
1966
- name_='StartingPeriodType',
1967
- fromsubclass_=False):
1968
- if self.StartDate is not None:
1969
- showIndent(outfile, level)
1970
- outfile.write(
1971
- '<%sStartDate>%s</%sStartDate>\n' %
1972
- (namespace_,
1973
- self.gds_format_string(quote_xml(
1974
- self.StartDate).encode(ExternalEncoding),
1975
- input_name='StartDate'), namespace_))
1976
- if self.EndDate is not None:
1977
- showIndent(outfile, level)
1978
- outfile.write(
1979
- '<%sEndDate>%s</%sEndDate>\n' %
1980
- (namespace_,
1981
- self.gds_format_string(quote_xml(
1982
- self.EndDate).encode(ExternalEncoding),
1983
- input_name='EndDate'), namespace_))
1984
-
1985
- def hasContent_(self):
1986
- if (self.StartDate is not None or self.EndDate is not None):
1987
- return True
1988
- else:
1989
- return False
1990
-
1991
- def exportLiteral(self, outfile, level, name_='StartingPeriodType'):
1992
- level += 1
1993
- self.exportLiteralAttributes(outfile, level, [], name_)
1994
- if self.hasContent_():
1995
- self.exportLiteralChildren(outfile, level, name_)
1996
-
1997
- def exportLiteralAttributes(self, outfile, level, already_processed,
1998
- name_):
1999
- pass
2000
-
2001
- def exportLiteralChildren(self, outfile, level, name_):
2002
- if self.StartDate is not None:
2003
- showIndent(outfile, level)
2004
- outfile.write(
2005
- 'StartDate=%s,\n' %
2006
- quote_python(self.StartDate).encode(ExternalEncoding))
2007
- if self.EndDate is not None:
2008
- showIndent(outfile, level)
2009
- outfile.write('EndDate=%s,\n' %
2010
- quote_python(self.EndDate).encode(ExternalEncoding))
2011
-
2012
- def build(self, node):
2013
- self.buildAttributes(node, node.attrib, [])
2014
- for child in node:
2015
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
2016
- self.buildChildren(child, node, nodeName_)
2017
-
2018
- def buildAttributes(self, node, attrs, already_processed):
2019
- pass
2020
-
2021
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2022
- if nodeName_ == 'StartDate':
2023
- StartDate_ = child_.text
2024
- StartDate_ = self.gds_validate_string(StartDate_, node,
2025
- 'StartDate')
2026
- self.StartDate = StartDate_
2027
- elif nodeName_ == 'EndDate':
2028
- EndDate_ = child_.text
2029
- EndDate_ = self.gds_validate_string(EndDate_, node, 'EndDate')
2030
- self.EndDate = EndDate_
2031
-
2032
-
2033
- # end class StartingPeriodType
2034
-
2035
-
2036
- class EndingPeriodType(GeneratedsSuper):
2037
- """A halfopen period with a mandatory end date"""
2038
- subclass = None
2039
- superclass = None
2040
-
2041
- def __init__(self, StartDate=None, EndDate=None):
2042
- self.StartDate = StartDate
2043
- self.EndDate = EndDate
2044
-
2045
- def factory(*args_, **kwargs_):
2046
- if EndingPeriodType.subclass:
2047
- return EndingPeriodType.subclass(*args_, **kwargs_)
2048
- else:
2049
- return EndingPeriodType(*args_, **kwargs_)
2050
-
2051
- factory = staticmethod(factory)
2052
-
2053
- def get_StartDate(self):
2054
- return self.StartDate
2055
-
2056
- def set_StartDate(self, StartDate):
2057
- self.StartDate = StartDate
2058
-
2059
- def get_EndDate(self):
2060
- return self.EndDate
2061
-
2062
- def set_EndDate(self, EndDate):
2063
- self.EndDate = EndDate
2064
-
2065
- def export(self,
2066
- outfile,
2067
- level,
2068
- namespace_='',
2069
- name_='EndingPeriodType',
2070
- namespacedef_=''):
2071
- showIndent(outfile, level)
2072
- outfile.write('<%s%s%s' % (
2073
- namespace_,
2074
- name_,
2075
- namespacedef_ and ' ' + namespacedef_ or '',
2076
- ))
2077
- already_processed = []
2078
- self.exportAttributes(outfile,
2079
- level,
2080
- already_processed,
2081
- namespace_,
2082
- name_='EndingPeriodType')
2083
- if self.hasContent_():
2084
- outfile.write('>\n')
2085
- self.exportChildren(outfile, level + 1, namespace_, name_)
2086
- showIndent(outfile, level)
2087
- outfile.write('</%s%s>\n' % (namespace_, name_))
2088
- else:
2089
- outfile.write('/>\n')
2090
-
2091
- def exportAttributes(self,
2092
- outfile,
2093
- level,
2094
- already_processed,
2095
- namespace_='',
2096
- name_='EndingPeriodType'):
2097
- pass
2098
-
2099
- def exportChildren(self,
2100
- outfile,
2101
- level,
2102
- namespace_='',
2103
- name_='EndingPeriodType',
2104
- fromsubclass_=False):
2105
- if self.StartDate is not None:
2106
- showIndent(outfile, level)
2107
- outfile.write(
2108
- '<%sStartDate>%s</%sStartDate>\n' %
2109
- (namespace_,
2110
- self.gds_format_string(quote_xml(
2111
- self.StartDate).encode(ExternalEncoding),
2112
- input_name='StartDate'), namespace_))
2113
- if self.EndDate is not None:
2114
- showIndent(outfile, level)
2115
- outfile.write(
2116
- '<%sEndDate>%s</%sEndDate>\n' %
2117
- (namespace_,
2118
- self.gds_format_string(quote_xml(
2119
- self.EndDate).encode(ExternalEncoding),
2120
- input_name='EndDate'), namespace_))
2121
-
2122
- def hasContent_(self):
2123
- if (self.StartDate is not None or self.EndDate is not None):
2124
- return True
2125
- else:
2126
- return False
2127
-
2128
- def exportLiteral(self, outfile, level, name_='EndingPeriodType'):
2129
- level += 1
2130
- self.exportLiteralAttributes(outfile, level, [], name_)
2131
- if self.hasContent_():
2132
- self.exportLiteralChildren(outfile, level, name_)
2133
-
2134
- def exportLiteralAttributes(self, outfile, level, already_processed,
2135
- name_):
2136
- pass
2137
-
2138
- def exportLiteralChildren(self, outfile, level, name_):
2139
- if self.StartDate is not None:
2140
- showIndent(outfile, level)
2141
- outfile.write(
2142
- 'StartDate=%s,\n' %
2143
- quote_python(self.StartDate).encode(ExternalEncoding))
2144
- if self.EndDate is not None:
2145
- showIndent(outfile, level)
2146
- outfile.write('EndDate=%s,\n' %
2147
- quote_python(self.EndDate).encode(ExternalEncoding))
2148
-
2149
- def build(self, node):
2150
- self.buildAttributes(node, node.attrib, [])
2151
- for child in node:
2152
- nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
2153
- self.buildChildren(child, node, nodeName_)
2154
-
2155
- def buildAttributes(self, node, attrs, already_processed):
2156
- pass
2157
-
2158
- def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2159
- if nodeName_ == 'StartDate':
2160
- StartDate_ = child_.text
2161
- StartDate_ = self.gds_validate_string(StartDate_, node,
2162
- 'StartDate')
2163
- self.StartDate = StartDate_
2164
- elif nodeName_ == 'EndDate':
2165
- EndDate_ = child_.text
2166
- EndDate_ = self.gds_validate_string(EndDate_, node, 'EndDate')
2167
- self.EndDate = EndDate_
2168
-
2169
-
2170
- # end class EndingPeriodType
2171
-
2172
- USAGE_TEXT = """
2173
- Usage: python <Parser>.py [ -s ] <in_xml_file>
2174
- """
2175
-
2176
-
2177
- def usage():
2178
- print(USAGE_TEXT)
2179
- sys.exit(1)
2180
-
2181
-
2182
- def get_root_tag(node):
2183
- tag = Tag_pattern_.match(node.tag).groups()[-1]
2184
- rootClass = globals().get(tag)
2185
- return tag, rootClass
2186
-
2187
-
2188
- def parse(inFileName):
2189
- doc = parsexml_(inFileName)
2190
- rootNode = doc.getroot()
2191
- rootTag, rootClass = get_root_tag(rootNode)
2192
- if rootClass is None:
2193
- rootTag = 'PerformInvestigationRequest'
2194
- rootClass = PerformInvestigationRequest
2195
- rootObj = rootClass.factory()
2196
- rootObj.build(rootNode)
2197
- # Enable Python to collect the space used by the DOM.
2198
- doc = None
2199
- sys.stdout.write('<?xml version="1.0" ?>\n')
2200
- rootObj.export(sys.stdout, 0, name_=rootTag, namespacedef_='')
2201
- return rootObj
2202
-
2203
-
2204
- def parseString(inString):
2205
- from StringIO import StringIO
2206
- doc = parsexml_(StringIO(inString))
2207
- rootNode = doc.getroot()
2208
- rootTag, rootClass = get_root_tag(rootNode)
2209
- if rootClass is None:
2210
- rootTag = 'PerformInvestigationRequest'
2211
- rootClass = PerformInvestigationRequest
2212
- rootObj = rootClass.factory()
2213
- rootObj.build(rootNode)
2214
- # Enable Python to collect the space used by the DOM.
2215
- doc = None
2216
- sys.stdout.write('<?xml version="1.0" ?>\n')
2217
- rootObj.export(sys.stdout,
2218
- 0,
2219
- name_="PerformInvestigationRequest",
2220
- namespacedef_='')
2221
- return rootObj
2222
-
2223
-
2224
- def parseLiteral(inFileName):
2225
- doc = parsexml_(inFileName)
2226
- rootNode = doc.getroot()
2227
- rootTag, rootClass = get_root_tag(rootNode)
2228
- if rootClass is None:
2229
- rootTag = 'PerformInvestigationRequest'
2230
- rootClass = PerformInvestigationRequest
2231
- rootObj = rootClass.factory()
2232
- rootObj.build(rootNode)
2233
- # Enable Python to collect the space used by the DOM.
2234
- doc = None
2235
- sys.stdout.write('#from PerformInvestigation import *\n\n')
2236
- sys.stdout.write('import PerformInvestigation as model_\n\n')
2237
- sys.stdout.write('rootObj = model_.rootTag(\n')
2238
- rootObj.exportLiteral(sys.stdout, 0, name_=rootTag)
2239
- sys.stdout.write(')\n')
2240
- return rootObj
2241
-
2242
-
2243
- def main():
2244
- args = sys.argv[1:]
2245
- if len(args) == 1:
2246
- parse(args[0])
2247
- else:
2248
- usage()
2249
-
2250
-
2251
- if __name__ == '__main__':
2252
- #import pdb; pdb.set_trace()
2253
- main()
2254
-
2255
- __all__ = [
2256
- "AddressHistoryGroup", "CitizenGroup", "ClosedPeriodType",
2257
- "DescriptionType", "EndDate", "EndingPeriodType", "FamilyCompositionGroup",
2258
- "InscriptionType", "PerformInvestigationRequest", "PeriodType",
2259
- "RequestDataGroupsType", "StartDate", "StartingPeriodType"
2260
- ]