Skip to content
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
4437 lines (4280 sloc) 200 KB
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of REDHAWK core.
#
# REDHAWK core is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# REDHAWK core is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# Generated Mon Jul 30 12:29:34 2018 by generateDS.py version 2.29.14.
# Python 2.7.5 (default, Nov 6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]
#
# Command line options:
# ('-f', '')
# ('--silence', '')
# ('-m', '')
# ('-o', 'ossie/parsers/dcd.py')
#
# Command line arguments:
# ../../../xml/xsd/dcd.xsd
#
# Command line:
# /usr/bin/generateDS.py -f --silence -m -o "ossie/parsers/dcd.py" ../../../xml/xsd/dcd.xsd
#
# Current working directory (os.getcwd()):
# python
#
import sys
import re as re_
import base64
import datetime as datetime_
import warnings as warnings_
try:
from lxml import etree as etree_
except ImportError:
from xml.etree import ElementTree as etree_
Validate_simpletypes_ = True
if sys.version_info[0] == 2:
BaseStrType_ = basestring
else:
BaseStrType_ = str
def parsexml_(infile, parser=None, **kwargs):
if parser is None:
# Use the lxml ElementTree compatible parser so that, e.g.,
# we ignore comments.
try:
parser = etree_.ETCompatXMLParser()
except AttributeError:
# fallback to xml.etree
parser = etree_.XMLParser()
doc = etree_.parse(infile, parser=parser, **kwargs)
return doc
def parsexmlstring_(instring, parser=None, **kwargs):
if parser is None:
# Use the lxml ElementTree compatible parser so that, e.g.,
# we ignore comments.
try:
parser = etree_.ETCompatXMLParser()
except AttributeError:
# fallback to xml.etree
parser = etree_.XMLParser()
element = etree_.fromstring(instring, parser=parser, **kwargs)
return element
#
# Namespace prefix definition table (and other attributes, too)
#
# The module generatedsnamespaces, if it is importable, must contain
# a dictionary named GeneratedsNamespaceDefs. This Python dictionary
# should map element type names (strings) to XML schema namespace prefix
# definitions. The export method for any class for which there is
# a namespace prefix definition, will export that definition in the
# XML representation of that element. See the export method of
# any generated element type class for a example of the use of this
# table.
# A sample table is:
#
# # File: generatedsnamespaces.py
#
# GenerateDSNamespaceDefs = {
# "ElementtypeA": "http://www.xxx.com/namespaceA",
# "ElementtypeB": "http://www.xxx.com/namespaceB",
# }
#
try:
from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_
except ImportError:
GenerateDSNamespaceDefs_ = {}
#
# The root super-class for element type classes
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these methods by re-implementing the following class
# in a module named generatedssuper.py.
try:
from generatedssuper import GeneratedsSuper
except ImportError as exp:
class GeneratedsSuper(object):
tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$')
class _FixedOffsetTZ(datetime_.tzinfo):
def __init__(self, offset, name):
self.__offset = datetime_.timedelta(minutes=offset)
self.__name = name
def utcoffset(self, dt):
return self.__offset
def tzname(self, dt):
return self.__name
def dst(self, dt):
return None
def gds_format_string(self, input_data, input_name=''):
return input_data
def gds_validate_string(self, input_data, node=None, input_name=''):
if not input_data:
return ''
else:
return input_data
def gds_format_base64(self, input_data, input_name=''):
return base64.b64encode(input_data)
def gds_validate_base64(self, input_data, node=None, input_name=''):
return input_data
def gds_format_integer(self, input_data, input_name=''):
return '%d' % input_data
def gds_validate_integer(self, input_data, node=None, input_name=''):
return input_data
def gds_format_integer_list(self, input_data, input_name=''):
return '%s' % ' '.join(input_data)
def gds_validate_integer_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
try:
int(value)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires sequence of integers')
return values
def gds_format_float(self, input_data, input_name=''):
return ('%.15f' % input_data).rstrip('0')
def gds_validate_float(self, input_data, node=None, input_name=''):
return input_data
def gds_format_float_list(self, input_data, input_name=''):
return '%s' % ' '.join(input_data)
def gds_validate_float_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
try:
float(value)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires sequence of floats')
return values
def gds_format_double(self, input_data, input_name=''):
return '%e' % input_data
def gds_validate_double(self, input_data, node=None, input_name=''):
return input_data
def gds_format_double_list(self, input_data, input_name=''):
return '%s' % ' '.join(input_data)
def gds_validate_double_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
try:
float(value)
except (TypeError, ValueError):
raise_parse_error(node, 'Requires sequence of doubles')
return values
def gds_format_boolean(self, input_data, input_name=''):
return ('%s' % input_data).lower()
def gds_validate_boolean(self, input_data, node=None, input_name=''):
return input_data
def gds_format_boolean_list(self, input_data, input_name=''):
return '%s' % ' '.join(input_data)
def gds_validate_boolean_list(
self, input_data, node=None, input_name=''):
values = input_data.split()
for value in values:
if value not in ('true', '1', 'false', '0', ):
raise_parse_error(
node,
'Requires sequence of booleans '
'("true", "1", "false", "0")')
return values
def gds_validate_datetime(self, input_data, node=None, input_name=''):
return input_data
def gds_format_datetime(self, input_data, input_name=''):
if input_data.microsecond == 0:
_svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (
input_data.year,
input_data.month,
input_data.day,
input_data.hour,
input_data.minute,
input_data.second,
)
else:
_svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (
input_data.year,
input_data.month,
input_data.day,
input_data.hour,
input_data.minute,
input_data.second,
('%f' % (float(input_data.microsecond) / 1000000))[2:],
)
if input_data.tzinfo is not None:
tzoff = input_data.tzinfo.utcoffset(input_data)
if tzoff is not None:
total_seconds = tzoff.seconds + (86400 * tzoff.days)
if total_seconds == 0:
_svalue += 'Z'
else:
if total_seconds < 0:
_svalue += '-'
total_seconds *= -1
else:
_svalue += '+'
hours = total_seconds // 3600
minutes = (total_seconds - (hours * 3600)) // 60
_svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
return _svalue
@classmethod
def gds_parse_datetime(cls, input_data):
tz = None
if input_data[-1] == 'Z':
tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
input_data = input_data[:-1]
else:
results = GeneratedsSuper.tzoff_pattern.search(input_data)
if results is not None:
tzoff_parts = results.group(2).split(':')
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
if results.group(1) == '-':
tzoff *= -1
tz = GeneratedsSuper._FixedOffsetTZ(
tzoff, results.group(0))
input_data = input_data[:-6]
time_parts = input_data.split('.')
if len(time_parts) > 1:
micro_seconds = int(float('0.' + time_parts[1]) * 1000000)
input_data = '%s.%s' % (time_parts[0], micro_seconds, )
dt = datetime_.datetime.strptime(
input_data, '%Y-%m-%dT%H:%M:%S.%f')
else:
dt = datetime_.datetime.strptime(
input_data, '%Y-%m-%dT%H:%M:%S')
dt = dt.replace(tzinfo=tz)
return dt
def gds_validate_date(self, input_data, node=None, input_name=''):
return input_data
def gds_format_date(self, input_data, input_name=''):
_svalue = '%04d-%02d-%02d' % (
input_data.year,
input_data.month,
input_data.day,
)
try:
if input_data.tzinfo is not None:
tzoff = input_data.tzinfo.utcoffset(input_data)
if tzoff is not None:
total_seconds = tzoff.seconds + (86400 * tzoff.days)
if total_seconds == 0:
_svalue += 'Z'
else:
if total_seconds < 0:
_svalue += '-'
total_seconds *= -1
else:
_svalue += '+'
hours = total_seconds // 3600
minutes = (total_seconds - (hours * 3600)) // 60
_svalue += '{0:02d}:{1:02d}'.format(
hours, minutes)
except AttributeError:
pass
return _svalue
@classmethod
def gds_parse_date(cls, input_data):
tz = None
if input_data[-1] == 'Z':
tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
input_data = input_data[:-1]
else:
results = GeneratedsSuper.tzoff_pattern.search(input_data)
if results is not None:
tzoff_parts = results.group(2).split(':')
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
if results.group(1) == '-':
tzoff *= -1
tz = GeneratedsSuper._FixedOffsetTZ(
tzoff, results.group(0))
input_data = input_data[:-6]
dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')
dt = dt.replace(tzinfo=tz)
return dt.date()
def gds_validate_time(self, input_data, node=None, input_name=''):
return input_data
def gds_format_time(self, input_data, input_name=''):
if input_data.microsecond == 0:
_svalue = '%02d:%02d:%02d' % (
input_data.hour,
input_data.minute,
input_data.second,
)
else:
_svalue = '%02d:%02d:%02d.%s' % (
input_data.hour,
input_data.minute,
input_data.second,
('%f' % (float(input_data.microsecond) / 1000000))[2:],
)
if input_data.tzinfo is not None:
tzoff = input_data.tzinfo.utcoffset(input_data)
if tzoff is not None:
total_seconds = tzoff.seconds + (86400 * tzoff.days)
if total_seconds == 0:
_svalue += 'Z'
else:
if total_seconds < 0:
_svalue += '-'
total_seconds *= -1
else:
_svalue += '+'
hours = total_seconds // 3600
minutes = (total_seconds - (hours * 3600)) // 60
_svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
return _svalue
def gds_validate_simple_patterns(self, patterns, target):
# pat is a list of lists of strings/patterns. We should:
# - AND the outer elements
# - OR the inner elements
found1 = True
for patterns1 in patterns:
found2 = False
for patterns2 in patterns1:
if re_.search(patterns2, target) is not None:
found2 = True
break
if not found2:
found1 = False
break
return found1
@classmethod
def gds_parse_time(cls, input_data):
tz = None
if input_data[-1] == 'Z':
tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
input_data = input_data[:-1]
else:
results = GeneratedsSuper.tzoff_pattern.search(input_data)
if results is not None:
tzoff_parts = results.group(2).split(':')
tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
if results.group(1) == '-':
tzoff *= -1
tz = GeneratedsSuper._FixedOffsetTZ(
tzoff, results.group(0))
input_data = input_data[:-6]
if len(input_data.split('.')) > 1:
dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')
else:
dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')
dt = dt.replace(tzinfo=tz)
return dt.time()
def gds_str_lower(self, instring):
return instring.lower()
def get_path_(self, node):
path_list = []
self.get_path_list_(node, path_list)
path_list.reverse()
path = '/'.join(path_list)
return path
Tag_strip_pattern_ = re_.compile(r'\{.*\}')
def get_path_list_(self, node, path_list):
if node is None:
return
tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)
if tag:
path_list.append(tag)
self.get_path_list_(node.getparent(), path_list)
def get_class_obj_(self, node, default_class=None):
class_obj1 = default_class
if 'xsi' in node.nsmap:
classname = node.get('{%s}type' % node.nsmap['xsi'])
if classname is not None:
names = classname.split(':')
if len(names) == 2:
classname = names[1]
class_obj2 = globals().get(classname)
if class_obj2 is not None:
class_obj1 = class_obj2
return class_obj1
def gds_build_any(self, node, type_name=None):
return None
@classmethod
def gds_reverse_node_mapping(cls, mapping):
return dict(((v, k) for k, v in mapping.iteritems()))
@staticmethod
def gds_encode(instring):
if sys.version_info[0] == 2:
return instring.encode(ExternalEncoding)
else:
return instring
@staticmethod
def convert_unicode(instring):
if isinstance(instring, str):
result = quote_xml(instring)
elif sys.version_info[0] == 2 and isinstance(instring, unicode):
result = quote_xml(instring).encode('utf8')
else:
result = GeneratedsSuper.gds_encode(str(instring))
return result
def __eq__(self, other):
if type(self) != type(other):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
return not self.__eq__(other)
def getSubclassFromModule_(module, class_):
'''Get the subclass of a class from a specific module.'''
name = class_.__name__ + 'Sub'
if hasattr(module, name):
return getattr(module, name)
else:
return None
#
# If you have installed IPython you can uncomment and use the following.
# IPython is available from http://ipython.scipy.org/.
#
## from IPython.Shell import IPShellEmbed
## args = ''
## ipshell = IPShellEmbed(args,
## banner = 'Dropping into IPython',
## exit_msg = 'Leaving Interpreter, back to program.')
# Then use the following line where and when you want to drop into the
# IPython shell:
# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')
#
# Globals
#
ExternalEncoding = 'ascii'
Tag_pattern_ = re_.compile(r'({.*})?(.*)')
String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')
CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL)
# Change this to redirect the generated superclass module to use a
# specific subclass module.
CurrentSubclassModule_ = None
#
# Support/utility functions.
#
def showIndent(outfile, level, pretty_print=True):
if pretty_print:
for idx in range(level):
outfile.write(' ')
def quote_xml(inStr):
"Escape markup chars, but do not modify CDATA sections."
if not inStr:
return ''
s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)
s2 = ''
pos = 0
matchobjects = CDATA_pattern_.finditer(s1)
for mo in matchobjects:
s3 = s1[pos:mo.start()]
s2 += quote_xml_aux(s3)
s2 += s1[mo.start():mo.end()]
pos = mo.end()
s3 = s1[pos:]
s2 += quote_xml_aux(s3)
return s2
def quote_xml_aux(inStr):
s1 = inStr.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
s1 = s1.replace('>', '&gt;')
return s1
def quote_attrib(inStr):
s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)
s1 = s1.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
s1 = s1.replace('>', '&gt;')
if '"' in s1:
if "'" in s1:
s1 = '"%s"' % s1.replace('"', "&quot;")
else:
s1 = "'%s'" % s1
else:
s1 = '"%s"' % s1
return s1
def quote_python(inStr):
s1 = inStr
if s1.find("'") == -1:
if s1.find('\n') == -1:
return "'%s'" % s1
else:
return "'''%s'''" % s1
else:
if s1.find('"') != -1:
s1 = s1.replace('"', '\\"')
if s1.find('\n') == -1:
return '"%s"' % s1
else:
return '"""%s"""' % s1
def get_all_text_(node):
if node.text is not None:
text = node.text
else:
text = ''
for child in node:
if child.tail is not None:
text += child.tail
return text
def find_attr_value_(attr_name, node):
attrs = node.attrib
attr_parts = attr_name.split(':')
value = None
if len(attr_parts) == 1:
value = attrs.get(attr_name)
elif len(attr_parts) == 2:
prefix, name = attr_parts
namespace = node.nsmap.get(prefix)
if namespace is not None:
value = attrs.get('{%s}%s' % (namespace, name, ))
return value
class GDSParseError(Exception):
pass
def raise_parse_error(node, msg):
msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )
raise GDSParseError(msg)
class MixedContainer:
# Constants for category:
CategoryNone = 0
CategoryText = 1
CategorySimple = 2
CategoryComplex = 3
# Constants for content_type:
TypeNone = 0
TypeText = 1
TypeString = 2
TypeInteger = 3
TypeFloat = 4
TypeDecimal = 5
TypeDouble = 6
TypeBoolean = 7
TypeBase64 = 8
def __init__(self, category, content_type, name, value):
self.category = category
self.content_type = content_type
self.name = name
self.value = value
def getCategory(self):
return self.category
def getContenttype(self, content_type):
return self.content_type
def getValue(self):
return self.value
def getName(self):
return self.name
def export(self, outfile, level, name, namespace,
pretty_print=True):
if self.category == MixedContainer.CategoryText:
# Prevent exporting empty content as empty lines.
if self.value.strip():
outfile.write(self.value)
elif self.category == MixedContainer.CategorySimple:
self.exportSimple(outfile, level, name)
else: # category == MixedContainer.CategoryComplex
self.value.export(
outfile, level, namespace, name,
pretty_print=pretty_print)
def exportSimple(self, outfile, level, name):
if self.content_type == MixedContainer.TypeString:
outfile.write('<%s>%s</%s>' % (
self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeInteger or \
self.content_type == MixedContainer.TypeBoolean:
outfile.write('<%s>%d</%s>' % (
self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeFloat or \
self.content_type == MixedContainer.TypeDecimal:
outfile.write('<%s>%f</%s>' % (
self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeDouble:
outfile.write('<%s>%g</%s>' % (
self.name, self.value, self.name))
elif self.content_type == MixedContainer.TypeBase64:
outfile.write('<%s>%s</%s>' % (
self.name,
base64.b64encode(self.value),
self.name))
def to_etree(self, element):
if self.category == MixedContainer.CategoryText:
# Prevent exporting empty content as empty lines.
if self.value.strip():
if len(element) > 0:
if element[-1].tail is None:
element[-1].tail = self.value
else:
element[-1].tail += self.value
else:
if element.text is None:
element.text = self.value
else:
element.text += self.value
elif self.category == MixedContainer.CategorySimple:
subelement = etree_.SubElement(
element, '%s' % self.name)
subelement.text = self.to_etree_simple()
else: # category == MixedContainer.CategoryComplex
self.value.to_etree(element)
def to_etree_simple(self):
if self.content_type == MixedContainer.TypeString:
text = self.value
elif (self.content_type == MixedContainer.TypeInteger or
self.content_type == MixedContainer.TypeBoolean):
text = '%d' % self.value
elif (self.content_type == MixedContainer.TypeFloat or
self.content_type == MixedContainer.TypeDecimal):
text = '%f' % self.value
elif self.content_type == MixedContainer.TypeDouble:
text = '%g' % self.value
elif self.content_type == MixedContainer.TypeBase64:
text = '%s' % base64.b64encode(self.value)
return text
def exportLiteral(self, outfile, level, name):
if self.category == MixedContainer.CategoryText:
showIndent(outfile, level)
outfile.write(
'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
self.category, self.content_type,
self.name, self.value))
elif self.category == MixedContainer.CategorySimple:
showIndent(outfile, level)
outfile.write(
'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
self.category, self.content_type,
self.name, self.value))
else: # category == MixedContainer.CategoryComplex
showIndent(outfile, level)
outfile.write(
'model_.MixedContainer(%d, %d, "%s",\n' % (
self.category, self.content_type, self.name,))
self.value.exportLiteral(outfile, level + 1)
showIndent(outfile, level)
outfile.write(')\n')
class MemberSpec_(object):
def __init__(self, name='', data_type='', container=0,
optional=0, child_attrs=None, choice=None):
self.name = name
self.data_type = data_type
self.container = container
self.child_attrs = child_attrs
self.choice = choice
self.optional = optional
def set_name(self, name): self.name = name
def get_name(self): return self.name
def set_data_type(self, data_type): self.data_type = data_type
def get_data_type_chain(self): return self.data_type
def get_data_type(self):
if isinstance(self.data_type, list):
if len(self.data_type) > 0:
return self.data_type[-1]
else:
return 'xs:string'
else:
return self.data_type
def set_container(self, container): self.container = container
def get_container(self): return self.container
def set_child_attrs(self, child_attrs): self.child_attrs = child_attrs
def get_child_attrs(self): return self.child_attrs
def set_choice(self, choice): self.choice = choice
def get_choice(self): return self.choice
def set_optional(self, optional): self.optional = optional
def get_optional(self): return self.optional
def _cast(typ, value):
if typ is None or value is None:
return value
return typ(value)
#
# Data representation classes.
#
class deviceconfiguration(GeneratedsSuper):
"""The DCD is based on the SAD (e.g., componentfiles, partitioning,
etc.) DTD. The intent of the DCD is to provide the means of
describing the components that are initially started on the CF
DeviceManager node, how to obtain the CF DomainManager object
reference, connections of services to components (CF Devices, CF
DeviceManager), and the characteristics (file system names,
etc.) for a CF DeviceManager. The componentfiles and
partitioning elements are optional; if not provided, that means
no components are started up on the node, except for a CF
DeviceManager. If the partitioning element is specified then a
componentfiles element has to be specified also.The
deviceconfiguration element’s id attribute is a unique
identifier within the domain for the device configuration. This
id attribute is a UUID value as specified in section D.2.1.The
name attribute is the user-friendly name for the CF
DeviceManager’s label attribute."""
subclass = None
superclass = None
def __init__(self, id_=None, name=None, description=None, devicemanagersoftpkg=None, componentfiles=None, partitioning=None, connections=None, domainmanager=None, filesystemnames=None):
self.original_tagname_ = None
self.id_ = _cast(None, id_)
self.name = _cast(None, name)
self.description = description
self.devicemanagersoftpkg = devicemanagersoftpkg
self.componentfiles = componentfiles
self.partitioning = partitioning
self.connections = connections
self.domainmanager = domainmanager
self.filesystemnames = filesystemnames
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, deviceconfiguration)
if subclass is not None:
return subclass(*args_, **kwargs_)
if deviceconfiguration.subclass:
return deviceconfiguration.subclass(*args_, **kwargs_)
else:
return deviceconfiguration(*args_, **kwargs_)
factory = staticmethod(factory)
def get_description(self): return self.description
def set_description(self, description): self.description = description
descriptionProp = property(get_description, set_description)
def get_devicemanagersoftpkg(self): return self.devicemanagersoftpkg
def set_devicemanagersoftpkg(self, devicemanagersoftpkg): self.devicemanagersoftpkg = devicemanagersoftpkg
devicemanagersoftpkgProp = property(get_devicemanagersoftpkg, set_devicemanagersoftpkg)
def get_componentfiles(self): return self.componentfiles
def set_componentfiles(self, componentfiles): self.componentfiles = componentfiles
componentfilesProp = property(get_componentfiles, set_componentfiles)
def get_partitioning(self): return self.partitioning
def set_partitioning(self, partitioning): self.partitioning = partitioning
partitioningProp = property(get_partitioning, set_partitioning)
def get_connections(self): return self.connections
def set_connections(self, connections): self.connections = connections
connectionsProp = property(get_connections, set_connections)
def get_domainmanager(self): return self.domainmanager
def set_domainmanager(self, domainmanager): self.domainmanager = domainmanager
domainmanagerProp = property(get_domainmanager, set_domainmanager)
def get_filesystemnames(self): return self.filesystemnames
def set_filesystemnames(self, filesystemnames): self.filesystemnames = filesystemnames
filesystemnamesProp = property(get_filesystemnames, set_filesystemnames)
def get_id(self): return self.id_
def set_id(self, id_): self.id_ = id_
idProp = property(get_id, set_id)
def get_name(self): return self.name
def set_name(self, name): self.name = name
nameProp = property(get_name, set_name)
def hasContent_(self):
if (
self.description is not None or
self.devicemanagersoftpkg is not None or
self.componentfiles is not None or
self.partitioning is not None or
self.connections is not None or
self.domainmanager is not None or
self.filesystemnames is not None
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='deviceconfiguration', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('deviceconfiguration')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='deviceconfiguration')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='deviceconfiguration', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='deviceconfiguration'):
if self.id_ is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id_), input_name='id')), ))
if self.name is not None and 'name' not in already_processed:
already_processed.add('name')
outfile.write(' name=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.name), input_name='name')), ))
def exportChildren(self, outfile, level, namespace_='', name_='deviceconfiguration', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.description is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<description>%s</description>%s' % (self.gds_encode(self.gds_format_string(quote_xml(self.description), input_name='description')), eol_))
if self.devicemanagersoftpkg is not None:
self.devicemanagersoftpkg.export(outfile, level, namespace_, name_='devicemanagersoftpkg', pretty_print=pretty_print)
if self.componentfiles is not None:
self.componentfiles.export(outfile, level, namespace_, name_='componentfiles', pretty_print=pretty_print)
if self.partitioning is not None:
self.partitioning.export(outfile, level, namespace_, name_='partitioning', pretty_print=pretty_print)
if self.connections is not None:
self.connections.export(outfile, level, namespace_, name_='connections', pretty_print=pretty_print)
if self.domainmanager is not None:
self.domainmanager.export(outfile, level, namespace_, name_='domainmanager', pretty_print=pretty_print)
if self.filesystemnames is not None:
self.filesystemnames.export(outfile, level, namespace_, name_='filesystemnames', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
self.id_ = value
value = find_attr_value_('name', node)
if value is not None and 'name' not in already_processed:
already_processed.add('name')
self.name = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'description':
description_ = child_.text
description_ = self.gds_validate_string(description_, node, 'description')
self.description = description_
elif nodeName_ == 'devicemanagersoftpkg':
obj_ = devicemanagersoftpkg.factory()
obj_.build(child_)
self.devicemanagersoftpkg = obj_
obj_.original_tagname_ = 'devicemanagersoftpkg'
elif nodeName_ == 'componentfiles':
obj_ = componentfiles.factory()
obj_.build(child_)
self.componentfiles = obj_
obj_.original_tagname_ = 'componentfiles'
elif nodeName_ == 'partitioning':
obj_ = partitioning.factory()
obj_.build(child_)
self.partitioning = obj_
obj_.original_tagname_ = 'partitioning'
elif nodeName_ == 'connections':
obj_ = connections.factory()
obj_.build(child_)
self.connections = obj_
obj_.original_tagname_ = 'connections'
elif nodeName_ == 'domainmanager':
obj_ = domainmanager.factory()
obj_.build(child_)
self.domainmanager = obj_
obj_.original_tagname_ = 'domainmanager'
elif nodeName_ == 'filesystemnames':
obj_ = filesystemnames.factory()
obj_.build(child_)
self.filesystemnames = obj_
obj_.original_tagname_ = 'filesystemnames'
# end class deviceconfiguration
class devicemanagersoftpkg(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, localfile=None):
self.original_tagname_ = None
self.localfile = localfile
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, devicemanagersoftpkg)
if subclass is not None:
return subclass(*args_, **kwargs_)
if devicemanagersoftpkg.subclass:
return devicemanagersoftpkg.subclass(*args_, **kwargs_)
else:
return devicemanagersoftpkg(*args_, **kwargs_)
factory = staticmethod(factory)
def get_localfile(self): return self.localfile
def set_localfile(self, localfile): self.localfile = localfile
localfileProp = property(get_localfile, set_localfile)
def hasContent_(self):
if (
self.localfile is not None
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='devicemanagersoftpkg', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('devicemanagersoftpkg')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='devicemanagersoftpkg')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='devicemanagersoftpkg', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='devicemanagersoftpkg'):
pass
def exportChildren(self, outfile, level, namespace_='', name_='devicemanagersoftpkg', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.localfile is not None:
self.localfile.export(outfile, level, namespace_, name_='localfile', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'localfile':
obj_ = localfile.factory()
obj_.build(child_)
self.localfile = obj_
obj_.original_tagname_ = 'localfile'
# end class devicemanagersoftpkg
class componentfiles(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, componentfile=None):
self.original_tagname_ = None
if componentfile is None:
self.componentfile = []
else:
self.componentfile = componentfile
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, componentfiles)
if subclass is not None:
return subclass(*args_, **kwargs_)
if componentfiles.subclass:
return componentfiles.subclass(*args_, **kwargs_)
else:
return componentfiles(*args_, **kwargs_)
factory = staticmethod(factory)
def get_componentfile(self): return self.componentfile
def set_componentfile(self, componentfile): self.componentfile = componentfile
def add_componentfile(self, value): self.componentfile.append(value)
def insert_componentfile_at(self, index, value): self.componentfile.insert(index, value)
def replace_componentfile_at(self, index, value): self.componentfile[index] = value
componentfileProp = property(get_componentfile, set_componentfile)
def hasContent_(self):
if (
self.componentfile
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='componentfiles', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('componentfiles')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='componentfiles')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='componentfiles', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='componentfiles'):
pass
def exportChildren(self, outfile, level, namespace_='', name_='componentfiles', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for componentfile_ in self.componentfile:
componentfile_.export(outfile, level, namespace_, name_='componentfile', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'componentfile':
obj_ = componentfile.factory()
obj_.build(child_)
self.componentfile.append(obj_)
obj_.original_tagname_ = 'componentfile'
# end class componentfiles
class componentfile(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, id_=None, type_=None, localfile=None):
self.original_tagname_ = None
self.id_ = _cast(None, id_)
self.type_ = _cast(None, type_)
self.localfile = localfile
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, componentfile)
if subclass is not None:
return subclass(*args_, **kwargs_)
if componentfile.subclass:
return componentfile.subclass(*args_, **kwargs_)
else:
return componentfile(*args_, **kwargs_)
factory = staticmethod(factory)
def get_localfile(self): return self.localfile
def set_localfile(self, localfile): self.localfile = localfile
localfileProp = property(get_localfile, set_localfile)
def get_id(self): return self.id_
def set_id(self, id_): self.id_ = id_
idProp = property(get_id, set_id)
def get_type(self): return self.type_
def set_type(self, type_): self.type_ = type_
typeProp = property(get_type, set_type)
def hasContent_(self):
if (
self.localfile is not None
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='componentfile', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('componentfile')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='componentfile')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='componentfile', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='componentfile'):
if self.id_ is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id_), input_name='id')), ))
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
def exportChildren(self, outfile, level, namespace_='', name_='componentfile', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.localfile is not None:
self.localfile.export(outfile, level, namespace_, name_='localfile', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
self.id_ = value
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'localfile':
obj_ = localfile.factory()
obj_.build(child_)
self.localfile = obj_
obj_.original_tagname_ = 'localfile'
# end class componentfile
class localfile(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, name=None):
self.original_tagname_ = None
self.name = _cast(None, name)
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, localfile)
if subclass is not None:
return subclass(*args_, **kwargs_)
if localfile.subclass:
return localfile.subclass(*args_, **kwargs_)
else:
return localfile(*args_, **kwargs_)
factory = staticmethod(factory)
def get_name(self): return self.name
def set_name(self, name): self.name = name
nameProp = property(get_name, set_name)
def hasContent_(self):
if (
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='localfile', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('localfile')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='localfile')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='localfile', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='localfile'):
if self.name is not None and 'name' not in already_processed:
already_processed.add('name')
outfile.write(' name=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.name), input_name='name')), ))
def exportChildren(self, outfile, level, namespace_='', name_='localfile', fromsubclass_=False, pretty_print=True):
pass
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('name', node)
if value is not None and 'name' not in already_processed:
already_processed.add('name')
self.name = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class localfile
class partitioning(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, componentplacement=None):
self.original_tagname_ = None
if componentplacement is None:
self.componentplacement = []
else:
self.componentplacement = componentplacement
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, partitioning)
if subclass is not None:
return subclass(*args_, **kwargs_)
if partitioning.subclass:
return partitioning.subclass(*args_, **kwargs_)
else:
return partitioning(*args_, **kwargs_)
factory = staticmethod(factory)
def get_componentplacement(self): return self.componentplacement
def set_componentplacement(self, componentplacement): self.componentplacement = componentplacement
def add_componentplacement(self, value): self.componentplacement.append(value)
def insert_componentplacement_at(self, index, value): self.componentplacement.insert(index, value)
def replace_componentplacement_at(self, index, value): self.componentplacement[index] = value
componentplacementProp = property(get_componentplacement, set_componentplacement)
def hasContent_(self):
if (
self.componentplacement
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='partitioning', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('partitioning')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='partitioning')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='partitioning', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='partitioning'):
pass
def exportChildren(self, outfile, level, namespace_='', name_='partitioning', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for componentplacement_ in self.componentplacement:
componentplacement_.export(outfile, level, namespace_, name_='componentplacement', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'componentplacement':
obj_ = componentplacement.factory()
obj_.build(child_)
self.componentplacement.append(obj_)
obj_.original_tagname_ = 'componentplacement'
# end class partitioning
class componentplacement(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, componentfileref=None, deployondevice=None, compositepartofdevice=None, devicepkgfile=None, componentinstantiation=None):
self.original_tagname_ = None
self.componentfileref = componentfileref
self.deployondevice = deployondevice
self.compositepartofdevice = compositepartofdevice
self.devicepkgfile = devicepkgfile
if componentinstantiation is None:
self.componentinstantiation = []
else:
self.componentinstantiation = componentinstantiation
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, componentplacement)
if subclass is not None:
return subclass(*args_, **kwargs_)
if componentplacement.subclass:
return componentplacement.subclass(*args_, **kwargs_)
else:
return componentplacement(*args_, **kwargs_)
factory = staticmethod(factory)
def get_componentfileref(self): return self.componentfileref
def set_componentfileref(self, componentfileref): self.componentfileref = componentfileref
componentfilerefProp = property(get_componentfileref, set_componentfileref)
def get_deployondevice(self): return self.deployondevice
def set_deployondevice(self, deployondevice): self.deployondevice = deployondevice
deployondeviceProp = property(get_deployondevice, set_deployondevice)
def get_compositepartofdevice(self): return self.compositepartofdevice
def set_compositepartofdevice(self, compositepartofdevice): self.compositepartofdevice = compositepartofdevice
compositepartofdeviceProp = property(get_compositepartofdevice, set_compositepartofdevice)
def get_devicepkgfile(self): return self.devicepkgfile
def set_devicepkgfile(self, devicepkgfile): self.devicepkgfile = devicepkgfile
devicepkgfileProp = property(get_devicepkgfile, set_devicepkgfile)
def get_componentinstantiation(self): return self.componentinstantiation
def set_componentinstantiation(self, componentinstantiation): self.componentinstantiation = componentinstantiation
def add_componentinstantiation(self, value): self.componentinstantiation.append(value)
def insert_componentinstantiation_at(self, index, value): self.componentinstantiation.insert(index, value)
def replace_componentinstantiation_at(self, index, value): self.componentinstantiation[index] = value
componentinstantiationProp = property(get_componentinstantiation, set_componentinstantiation)
def hasContent_(self):
if (
self.componentfileref is not None or
self.deployondevice is not None or
self.compositepartofdevice is not None or
self.devicepkgfile is not None or
self.componentinstantiation
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='componentplacement', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('componentplacement')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='componentplacement')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='componentplacement', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='componentplacement'):
pass
def exportChildren(self, outfile, level, namespace_='', name_='componentplacement', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.componentfileref is not None:
self.componentfileref.export(outfile, level, namespace_, name_='componentfileref', pretty_print=pretty_print)
if self.deployondevice is not None:
self.deployondevice.export(outfile, level, namespace_, name_='deployondevice', pretty_print=pretty_print)
if self.compositepartofdevice is not None:
self.compositepartofdevice.export(outfile, level, namespace_, name_='compositepartofdevice', pretty_print=pretty_print)
if self.devicepkgfile is not None:
self.devicepkgfile.export(outfile, level, namespace_, name_='devicepkgfile', pretty_print=pretty_print)
for componentinstantiation_ in self.componentinstantiation:
componentinstantiation_.export(outfile, level, namespace_, name_='componentinstantiation', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'componentfileref':
obj_ = componentfileref.factory()
obj_.build(child_)
self.componentfileref = obj_
obj_.original_tagname_ = 'componentfileref'
elif nodeName_ == 'deployondevice':
obj_ = deployondevice.factory()
obj_.build(child_)
self.deployondevice = obj_
obj_.original_tagname_ = 'deployondevice'
elif nodeName_ == 'compositepartofdevice':
obj_ = compositepartofdevice.factory()
obj_.build(child_)
self.compositepartofdevice = obj_
obj_.original_tagname_ = 'compositepartofdevice'
elif nodeName_ == 'devicepkgfile':
obj_ = devicepkgfile.factory()
obj_.build(child_)
self.devicepkgfile = obj_
obj_.original_tagname_ = 'devicepkgfile'
elif nodeName_ == 'componentinstantiation':
obj_ = componentinstantiation.factory()
obj_.build(child_)
self.componentinstantiation.append(obj_)
obj_.original_tagname_ = 'componentinstantiation'
# end class componentplacement
class componentfileref(GeneratedsSuper):
"""The componentfileref element is used to reference a componentfile
element within the componentfiles element.The componentfileref
element’s refid attribute corresponds to a componentfile
element’s id attribute."""
subclass = None
superclass = None
def __init__(self, refid=None):
self.original_tagname_ = None
self.refid = _cast(None, refid)
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, componentfileref)
if subclass is not None:
return subclass(*args_, **kwargs_)
if componentfileref.subclass:
return componentfileref.subclass(*args_, **kwargs_)
else:
return componentfileref(*args_, **kwargs_)
factory = staticmethod(factory)
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
refidProp = property(get_refid, set_refid)
def hasContent_(self):
if (
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='componentfileref', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('componentfileref')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='componentfileref')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='componentfileref', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='componentfileref'):
if self.refid is not None and 'refid' not in already_processed:
already_processed.add('refid')
outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
def exportChildren(self, outfile, level, namespace_='', name_='componentfileref', fromsubclass_=False, pretty_print=True):
pass
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('refid', node)
if value is not None and 'refid' not in already_processed:
already_processed.add('refid')
self.refid = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class componentfileref
class deployondevice(GeneratedsSuper):
"""The deployondevice element is used to reference a
componentinstantiation element on which this
componentinstantiation is deployed."""
subclass = None
superclass = None
def __init__(self, refid=None):
self.original_tagname_ = None
self.refid = _cast(None, refid)
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, deployondevice)
if subclass is not None:
return subclass(*args_, **kwargs_)
if deployondevice.subclass:
return deployondevice.subclass(*args_, **kwargs_)
else:
return deployondevice(*args_, **kwargs_)
factory = staticmethod(factory)
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
refidProp = property(get_refid, set_refid)
def hasContent_(self):
if (
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='deployondevice', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('deployondevice')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='deployondevice')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='deployondevice', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='deployondevice'):
if self.refid is not None and 'refid' not in already_processed:
already_processed.add('refid')
outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
def exportChildren(self, outfile, level, namespace_='', name_='deployondevice', fromsubclass_=False, pretty_print=True):
pass
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('refid', node)
if value is not None and 'refid' not in already_processed:
already_processed.add('refid')
self.refid = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class deployondevice
class compositepartofdevice(GeneratedsSuper):
"""The compositepartofdevice element is used when an aggregate
relationship exists to reference the componentinstantiation
element that describes the whole Device for which this Device’s
componentinstantiation element describes a part of the aggregate
Device."""
subclass = None
superclass = None
def __init__(self, refid=None):
self.original_tagname_ = None
self.refid = _cast(None, refid)
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, compositepartofdevice)
if subclass is not None:
return subclass(*args_, **kwargs_)
if compositepartofdevice.subclass:
return compositepartofdevice.subclass(*args_, **kwargs_)
else:
return compositepartofdevice(*args_, **kwargs_)
factory = staticmethod(factory)
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
refidProp = property(get_refid, set_refid)
def hasContent_(self):
if (
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='compositepartofdevice', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('compositepartofdevice')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='compositepartofdevice')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='compositepartofdevice', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='compositepartofdevice'):
if self.refid is not None and 'refid' not in already_processed:
already_processed.add('refid')
outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
def exportChildren(self, outfile, level, namespace_='', name_='compositepartofdevice', fromsubclass_=False, pretty_print=True):
pass
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('refid', node)
if value is not None and 'refid' not in already_processed:
already_processed.add('refid')
self.refid = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class compositepartofdevice
class devicepkgfile(GeneratedsSuper):
"""The devicepkgfile element is used to refer to a device package file
that contains the hardware device definition."""
subclass = None
superclass = None
def __init__(self, type_=None, localfile=None):
self.original_tagname_ = None
self.type_ = _cast(None, type_)
self.localfile = localfile
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, devicepkgfile)
if subclass is not None:
return subclass(*args_, **kwargs_)
if devicepkgfile.subclass:
return devicepkgfile.subclass(*args_, **kwargs_)
else:
return devicepkgfile(*args_, **kwargs_)
factory = staticmethod(factory)
def get_localfile(self): return self.localfile
def set_localfile(self, localfile): self.localfile = localfile
localfileProp = property(get_localfile, set_localfile)
def get_type(self): return self.type_
def set_type(self, type_): self.type_ = type_
typeProp = property(get_type, set_type)
def hasContent_(self):
if (
self.localfile is not None
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='devicepkgfile', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('devicepkgfile')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='devicepkgfile')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='devicepkgfile', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='devicepkgfile'):
if self.type_ is not None and 'type_' not in already_processed:
already_processed.add('type_')
outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
def exportChildren(self, outfile, level, namespace_='', name_='devicepkgfile', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.localfile is not None:
self.localfile.export(outfile, level, namespace_, name_='localfile', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('type', node)
if value is not None and 'type' not in already_processed:
already_processed.add('type')
self.type_ = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'localfile':
obj_ = localfile.factory()
obj_.build(child_)
self.localfile = obj_
obj_.original_tagname_ = 'localfile'
# end class devicepkgfile
class componentinstantiation(GeneratedsSuper):
"""The componentinstantiation element (see Figure D-35) is intended to
describe a particular instantiation of a component relative to a
componentplacement elementThe componentinstantiation‘s id
attribute is a DCE UUID that uniquely identifier the component."""
subclass = None
superclass = None
def __init__(self, id_=None, startorder=None, usagename=None, componentproperties=None, affinity=None, loggingconfig=None, deployerrequires=None):
self.original_tagname_ = None
self.id_ = _cast(None, id_)
self.startorder = _cast(None, startorder)
self.usagename = usagename
self.componentproperties = componentproperties
self.affinity = affinity
self.loggingconfig = loggingconfig
self.deployerrequires = deployerrequires
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, componentinstantiation)
if subclass is not None:
return subclass(*args_, **kwargs_)
if componentinstantiation.subclass:
return componentinstantiation.subclass(*args_, **kwargs_)
else:
return componentinstantiation(*args_, **kwargs_)
factory = staticmethod(factory)
def get_usagename(self): return self.usagename
def set_usagename(self, usagename): self.usagename = usagename
usagenameProp = property(get_usagename, set_usagename)
def get_componentproperties(self): return self.componentproperties
def set_componentproperties(self, componentproperties): self.componentproperties = componentproperties
componentpropertiesProp = property(get_componentproperties, set_componentproperties)
def get_affinity(self): return self.affinity
def set_affinity(self, affinity): self.affinity = affinity
affinityProp = property(get_affinity, set_affinity)
def get_loggingconfig(self): return self.loggingconfig
def set_loggingconfig(self, loggingconfig): self.loggingconfig = loggingconfig
loggingconfigProp = property(get_loggingconfig, set_loggingconfig)
def get_deployerrequires(self): return self.deployerrequires
def set_deployerrequires(self, deployerrequires): self.deployerrequires = deployerrequires
deployerrequiresProp = property(get_deployerrequires, set_deployerrequires)
def get_id(self): return self.id_
def set_id(self, id_): self.id_ = id_
idProp = property(get_id, set_id)
def get_startorder(self): return self.startorder
def set_startorder(self, startorder): self.startorder = startorder
startorderProp = property(get_startorder, set_startorder)
def hasContent_(self):
if (
self.usagename is not None or
self.componentproperties is not None or
self.affinity is not None or
self.loggingconfig is not None or
self.deployerrequires is not None
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='componentinstantiation', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('componentinstantiation')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='componentinstantiation')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='componentinstantiation', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='componentinstantiation'):
if self.id_ is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id_), input_name='id')), ))
if self.startorder is not None and 'startorder' not in already_processed:
already_processed.add('startorder')
outfile.write(' startorder=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.startorder), input_name='startorder')), ))
def exportChildren(self, outfile, level, namespace_='', name_='componentinstantiation', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.usagename is not None:
showIndent(outfile, level, pretty_print)
outfile.write('<usagename>%s</usagename>%s' % (self.gds_encode(self.gds_format_string(quote_xml(self.usagename), input_name='usagename')), eol_))
if self.componentproperties is not None:
self.componentproperties.export(outfile, level, namespace_, name_='componentproperties', pretty_print=pretty_print)
if self.affinity is not None:
self.affinity.export(outfile, level, namespace_, name_='affinity', pretty_print=pretty_print)
if self.loggingconfig is not None:
self.loggingconfig.export(outfile, level, namespace_, name_='loggingconfig', pretty_print=pretty_print)
if self.deployerrequires is not None:
self.deployerrequires.export(outfile, level, namespace_, name_='deployerrequires', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
self.id_ = value
value = find_attr_value_('startorder', node)
if value is not None and 'startorder' not in already_processed:
already_processed.add('startorder')
self.startorder = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'usagename':
usagename_ = child_.text
usagename_ = self.gds_validate_string(usagename_, node, 'usagename')
self.usagename = usagename_
elif nodeName_ == 'componentproperties':
obj_ = componentproperties.factory()
obj_.build(child_)
self.componentproperties = obj_
obj_.original_tagname_ = 'componentproperties'
elif nodeName_ == 'affinity':
obj_ = affinity.factory()
obj_.build(child_)
self.affinity = obj_
obj_.original_tagname_ = 'affinity'
elif nodeName_ == 'loggingconfig':
obj_ = loggingconfig.factory()
obj_.build(child_)
self.loggingconfig = obj_
obj_.original_tagname_ = 'loggingconfig'
elif nodeName_ == 'deployerrequires':
obj_ = deployerrequires.factory()
obj_.build(child_)
self.deployerrequires = obj_
obj_.original_tagname_ = 'deployerrequires'
# end class componentinstantiation
class loggingconfig(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, level=None, valueOf_=None):
self.original_tagname_ = None
self.level = _cast(None, level)
self.value = valueOf_
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, loggingconfig)
if subclass is not None:
return subclass(*args_, **kwargs_)
if loggingconfig.subclass:
return loggingconfig.subclass(*args_, **kwargs_)
else:
return loggingconfig(*args_, **kwargs_)
factory = staticmethod(factory)
def get_level(self): return self.level
def set_level(self, level): self.level = level
levelProp = property(get_level, set_level)
def get_value(self): return self.value
def set_value(self, valueOf_): self.value = valueOf_
def hasContent_(self):
if (
(1 if type(self.value) in [int,float] else self.value)
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='loggingconfig', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('loggingconfig')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='loggingconfig')
if self.hasContent_():
outfile.write('>')
outfile.write(self.convert_unicode(self.value))
self.exportChildren(outfile, level + 1, namespace_='', name_='loggingconfig', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='loggingconfig'):
if self.level is not None and 'level' not in already_processed:
already_processed.add('level')
outfile.write(' level=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.level), input_name='level')), ))
def exportChildren(self, outfile, level, namespace_='', name_='loggingconfig', fromsubclass_=False, pretty_print=True):
pass
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
self.value = get_all_text_(node)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('level', node)
if value is not None and 'level' not in already_processed:
already_processed.add('level')
self.level = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class loggingconfig
class affinity(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, simpleref=None, simplesequenceref=None, structref=None, structsequenceref=None):
self.original_tagname_ = None
if simpleref is None:
self.simpleref = []
else:
self.simpleref = simpleref
if simplesequenceref is None:
self.simplesequenceref = []
else:
self.simplesequenceref = simplesequenceref
if structref is None:
self.structref = []
else:
self.structref = structref
if structsequenceref is None:
self.structsequenceref = []
else:
self.structsequenceref = structsequenceref
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, affinity)
if subclass is not None:
return subclass(*args_, **kwargs_)
if affinity.subclass:
return affinity.subclass(*args_, **kwargs_)
else:
return affinity(*args_, **kwargs_)
factory = staticmethod(factory)
def get_simpleref(self): return self.simpleref
def set_simpleref(self, simpleref): self.simpleref = simpleref
def add_simpleref(self, value): self.simpleref.append(value)
def insert_simpleref_at(self, index, value): self.simpleref.insert(index, value)
def replace_simpleref_at(self, index, value): self.simpleref[index] = value
simplerefProp = property(get_simpleref, set_simpleref)
def get_simplesequenceref(self): return self.simplesequenceref
def set_simplesequenceref(self, simplesequenceref): self.simplesequenceref = simplesequenceref
def add_simplesequenceref(self, value): self.simplesequenceref.append(value)
def insert_simplesequenceref_at(self, index, value): self.simplesequenceref.insert(index, value)
def replace_simplesequenceref_at(self, index, value): self.simplesequenceref[index] = value
simplesequencerefProp = property(get_simplesequenceref, set_simplesequenceref)
def get_structref(self): return self.structref
def set_structref(self, structref): self.structref = structref
def add_structref(self, value): self.structref.append(value)
def insert_structref_at(self, index, value): self.structref.insert(index, value)
def replace_structref_at(self, index, value): self.structref[index] = value
structrefProp = property(get_structref, set_structref)
def get_structsequenceref(self): return self.structsequenceref
def set_structsequenceref(self, structsequenceref): self.structsequenceref = structsequenceref
def add_structsequenceref(self, value): self.structsequenceref.append(value)
def insert_structsequenceref_at(self, index, value): self.structsequenceref.insert(index, value)
def replace_structsequenceref_at(self, index, value): self.structsequenceref[index] = value
structsequencerefProp = property(get_structsequenceref, set_structsequenceref)
def hasContent_(self):
if (
self.simpleref or
self.simplesequenceref or
self.structref or
self.structsequenceref
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='affinity', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('affinity')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='affinity')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='affinity', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='affinity'):
pass
def exportChildren(self, outfile, level, namespace_='', name_='affinity', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for simpleref_ in self.simpleref:
simpleref_.export(outfile, level, namespace_, name_='simpleref', pretty_print=pretty_print)
for simplesequenceref_ in self.simplesequenceref:
simplesequenceref_.export(outfile, level, namespace_, name_='simplesequenceref', pretty_print=pretty_print)
for structref_ in self.structref:
structref_.export(outfile, level, namespace_, name_='structref', pretty_print=pretty_print)
for structsequenceref_ in self.structsequenceref:
structsequenceref_.export(outfile, level, namespace_, name_='structsequenceref', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'simpleref':
obj_ = simpleref.factory()
obj_.build(child_)
self.simpleref.append(obj_)
obj_.original_tagname_ = 'simpleref'
elif nodeName_ == 'simplesequenceref':
obj_ = simplesequenceref.factory()
obj_.build(child_)
self.simplesequenceref.append(obj_)
obj_.original_tagname_ = 'simplesequenceref'
elif nodeName_ == 'structref':
obj_ = structref.factory()
obj_.build(child_)
self.structref.append(obj_)
obj_.original_tagname_ = 'structref'
elif nodeName_ == 'structsequenceref':
obj_ = structsequenceref.factory()
obj_.build(child_)
self.structsequenceref.append(obj_)
obj_.original_tagname_ = 'structsequenceref'
# end class affinity
class deployerrequires(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, requires=None):
self.original_tagname_ = None
if requires is None:
self.requires = []
else:
self.requires = requires
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, deployerrequires)
if subclass is not None:
return subclass(*args_, **kwargs_)
if deployerrequires.subclass:
return deployerrequires.subclass(*args_, **kwargs_)
else:
return deployerrequires(*args_, **kwargs_)
factory = staticmethod(factory)
def get_requires(self): return self.requires
def set_requires(self, requires): self.requires = requires
def add_requires(self, value): self.requires.append(value)
def insert_requires_at(self, index, value): self.requires.insert(index, value)
def replace_requires_at(self, index, value): self.requires[index] = value
requiresProp = property(get_requires, set_requires)
def hasContent_(self):
if (
self.requires
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='deployerrequires', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('deployerrequires')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='deployerrequires')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='deployerrequires', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='deployerrequires'):
pass
def exportChildren(self, outfile, level, namespace_='', name_='deployerrequires', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for requires_ in self.requires:
requires_.export(outfile, level, namespace_, name_='requires', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'requires':
obj_ = idvalue.factory()
obj_.build(child_)
self.requires.append(obj_)
obj_.original_tagname_ = 'requires'
# end class deployerrequires
class idvalue(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, id_=None, value=None):
self.original_tagname_ = None
self.id = _cast(None, id_)
self.value = _cast(None, value)
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, idvalue)
if subclass is not None:
return subclass(*args_, **kwargs_)
if idvalue.subclass:
return idvalue.subclass(*args_, **kwargs_)
else:
return idvalue(*args_, **kwargs_)
factory = staticmethod(factory)
def get_id(self): return self.id
def set_id(self, id_): self.id = id_
idProp = property(get_id, set_id)
def get_value(self): return self.value
def set_value(self, value): self.value = value
valueProp = property(get_value, set_value)
def hasContent_(self):
if (
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='idvalue', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('idvalue')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='idvalue')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='idvalue', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='idvalue'):
if self.id is not None and 'id' not in already_processed:
already_processed.add('id')
outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
if self.value is not None and 'value' not in already_processed:
already_processed.add('value')
outfile.write(' value=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.value), input_name='value')), ))
def exportChildren(self, outfile, level, namespace_='', name_='idvalue', fromsubclass_=False, pretty_print=True):
pass
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('id', node)
if value is not None and 'id' not in already_processed:
already_processed.add('id')
self.id = value
value = find_attr_value_('value', node)
if value is not None and 'value' not in already_processed:
already_processed.add('value')
self.value = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class idvalue
class componentproperties(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, simpleref=None, simplesequenceref=None, structref=None, structsequenceref=None):
self.original_tagname_ = None
if simpleref is None:
self.simpleref = []
else:
self.simpleref = simpleref
if simplesequenceref is None:
self.simplesequenceref = []
else:
self.simplesequenceref = simplesequenceref
if structref is None:
self.structref = []
else:
self.structref = structref
if structsequenceref is None:
self.structsequenceref = []
else:
self.structsequenceref = structsequenceref
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, componentproperties)
if subclass is not None:
return subclass(*args_, **kwargs_)
if componentproperties.subclass:
return componentproperties.subclass(*args_, **kwargs_)
else:
return componentproperties(*args_, **kwargs_)
factory = staticmethod(factory)
def get_simpleref(self): return self.simpleref
def set_simpleref(self, simpleref): self.simpleref = simpleref
def add_simpleref(self, value): self.simpleref.append(value)
def insert_simpleref_at(self, index, value): self.simpleref.insert(index, value)
def replace_simpleref_at(self, index, value): self.simpleref[index] = value
simplerefProp = property(get_simpleref, set_simpleref)
def get_simplesequenceref(self): return self.simplesequenceref
def set_simplesequenceref(self, simplesequenceref): self.simplesequenceref = simplesequenceref
def add_simplesequenceref(self, value): self.simplesequenceref.append(value)
def insert_simplesequenceref_at(self, index, value): self.simplesequenceref.insert(index, value)
def replace_simplesequenceref_at(self, index, value): self.simplesequenceref[index] = value
simplesequencerefProp = property(get_simplesequenceref, set_simplesequenceref)
def get_structref(self): return self.structref
def set_structref(self, structref): self.structref = structref
def add_structref(self, value): self.structref.append(value)
def insert_structref_at(self, index, value): self.structref.insert(index, value)
def replace_structref_at(self, index, value): self.structref[index] = value
structrefProp = property(get_structref, set_structref)
def get_structsequenceref(self): return self.structsequenceref
def set_structsequenceref(self, structsequenceref): self.structsequenceref = structsequenceref
def add_structsequenceref(self, value): self.structsequenceref.append(value)
def insert_structsequenceref_at(self, index, value): self.structsequenceref.insert(index, value)
def replace_structsequenceref_at(self, index, value): self.structsequenceref[index] = value
structsequencerefProp = property(get_structsequenceref, set_structsequenceref)
def hasContent_(self):
if (
self.simpleref or
self.simplesequenceref or
self.structref or
self.structsequenceref
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='componentproperties', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('componentproperties')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='componentproperties')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='componentproperties', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='componentproperties'):
pass
def exportChildren(self, outfile, level, namespace_='', name_='componentproperties', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for simpleref_ in self.simpleref:
simpleref_.export(outfile, level, namespace_, name_='simpleref', pretty_print=pretty_print)
for simplesequenceref_ in self.simplesequenceref:
simplesequenceref_.export(outfile, level, namespace_, name_='simplesequenceref', pretty_print=pretty_print)
for structref_ in self.structref:
structref_.export(outfile, level, namespace_, name_='structref', pretty_print=pretty_print)
for structsequenceref_ in self.structsequenceref:
structsequenceref_.export(outfile, level, namespace_, name_='structsequenceref', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
pass
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'simpleref':
obj_ = simpleref.factory()
obj_.build(child_)
self.simpleref.append(obj_)
obj_.original_tagname_ = 'simpleref'
elif nodeName_ == 'simplesequenceref':
obj_ = simplesequenceref.factory()
obj_.build(child_)
self.simplesequenceref.append(obj_)
obj_.original_tagname_ = 'simplesequenceref'
elif nodeName_ == 'structref':
obj_ = structref.factory()
obj_.build(child_)
self.structref.append(obj_)
obj_.original_tagname_ = 'structref'
elif nodeName_ == 'structsequenceref':
obj_ = structsequenceref.factory()
obj_.build(child_)
self.structsequenceref.append(obj_)
obj_.original_tagname_ = 'structsequenceref'
# end class componentproperties
class devicethatloadedthiscomponentref(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, refid=None):
self.original_tagname_ = None
self.refid = _cast(None, refid)
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, devicethatloadedthiscomponentref)
if subclass is not None:
return subclass(*args_, **kwargs_)
if devicethatloadedthiscomponentref.subclass:
return devicethatloadedthiscomponentref.subclass(*args_, **kwargs_)
else:
return devicethatloadedthiscomponentref(*args_, **kwargs_)
factory = staticmethod(factory)
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
refidProp = property(get_refid, set_refid)
def hasContent_(self):
if (
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='devicethatloadedthiscomponentref', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('devicethatloadedthiscomponentref')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='devicethatloadedthiscomponentref')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='devicethatloadedthiscomponentref', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='devicethatloadedthiscomponentref'):
if self.refid is not None and 'refid' not in already_processed:
already_processed.add('refid')
outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
def exportChildren(self, outfile, level, namespace_='', name_='devicethatloadedthiscomponentref', fromsubclass_=False, pretty_print=True):
pass
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('refid', node)
if value is not None and 'refid' not in already_processed:
already_processed.add('refid')
self.refid = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class devicethatloadedthiscomponentref
class deviceusedbythiscomponentref(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, refid=None, usesrefid=None):
self.original_tagname_ = None
self.refid = _cast(None, refid)
self.usesrefid = _cast(None, usesrefid)
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, deviceusedbythiscomponentref)
if subclass is not None:
return subclass(*args_, **kwargs_)
if deviceusedbythiscomponentref.subclass:
return deviceusedbythiscomponentref.subclass(*args_, **kwargs_)
else:
return deviceusedbythiscomponentref(*args_, **kwargs_)
factory = staticmethod(factory)
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
refidProp = property(get_refid, set_refid)
def get_usesrefid(self): return self.usesrefid
def set_usesrefid(self, usesrefid): self.usesrefid = usesrefid
usesrefidProp = property(get_usesrefid, set_usesrefid)
def hasContent_(self):
if (
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='deviceusedbythiscomponentref', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('deviceusedbythiscomponentref')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='deviceusedbythiscomponentref')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='deviceusedbythiscomponentref', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='deviceusedbythiscomponentref'):
if self.refid is not None and 'refid' not in already_processed:
already_processed.add('refid')
outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
if self.usesrefid is not None and 'usesrefid' not in already_processed:
already_processed.add('usesrefid')
outfile.write(' usesrefid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.usesrefid), input_name='usesrefid')), ))
def exportChildren(self, outfile, level, namespace_='', name_='deviceusedbythiscomponentref', fromsubclass_=False, pretty_print=True):
pass
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('refid', node)
if value is not None and 'refid' not in already_processed:
already_processed.add('refid')
self.refid = value
value = find_attr_value_('usesrefid', node)
if value is not None and 'usesrefid' not in already_processed:
already_processed.add('usesrefid')
self.usesrefid = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class deviceusedbythiscomponentref
class simpleref(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, refid=None, value=None):
self.original_tagname_ = None
self.refid = _cast(None, refid)
self.value = _cast(None, value)
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, simpleref)
if subclass is not None:
return subclass(*args_, **kwargs_)
if simpleref.subclass:
return simpleref.subclass(*args_, **kwargs_)
else:
return simpleref(*args_, **kwargs_)
factory = staticmethod(factory)
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
refidProp = property(get_refid, set_refid)
def get_value(self): return self.value
def set_value(self, value): self.value = value
valueProp = property(get_value, set_value)
def hasContent_(self):
if (
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='simpleref', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('simpleref')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='simpleref')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='simpleref', pretty_print=pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='simpleref'):
if self.refid is not None and 'refid' not in already_processed:
already_processed.add('refid')
outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
if self.value is not None and 'value' not in already_processed:
already_processed.add('value')
outfile.write(' value=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.value), input_name='value')), ))
def exportChildren(self, outfile, level, namespace_='', name_='simpleref', fromsubclass_=False, pretty_print=True):
pass
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('refid', node)
if value is not None and 'refid' not in already_processed:
already_processed.add('refid')
self.refid = value
value = find_attr_value_('value', node)
if value is not None and 'value' not in already_processed:
already_processed.add('value')
self.value = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
pass
# end class simpleref
class simplesequenceref(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, refid=None, values=None):
self.original_tagname_ = None
self.refid = _cast(None, refid)
self.values = values
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, simplesequenceref)
if subclass is not None:
return subclass(*args_, **kwargs_)
if simplesequenceref.subclass:
return simplesequenceref.subclass(*args_, **kwargs_)
else:
return simplesequenceref(*args_, **kwargs_)
factory = staticmethod(factory)
def get_values(self): return self.values
def set_values(self, values): self.values = values
valuesProp = property(get_values, set_values)
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
refidProp = property(get_refid, set_refid)
def hasContent_(self):
if (
self.values is not None
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='simplesequenceref', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('simplesequenceref')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='simplesequenceref')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='simplesequenceref', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='simplesequenceref'):
if self.refid is not None and 'refid' not in already_processed:
already_processed.add('refid')
outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
def exportChildren(self, outfile, level, namespace_='', name_='simplesequenceref', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.values is not None:
self.values.export(outfile, level, namespace_, name_='values', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('refid', node)
if value is not None and 'refid' not in already_processed:
already_processed.add('refid')
self.refid = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'values':
obj_ = values.factory()
obj_.build(child_)
self.values = obj_
obj_.original_tagname_ = 'values'
# end class simplesequenceref
class structref(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, refid=None, simpleref=None, simplesequenceref=None):
self.original_tagname_ = None
self.refid = _cast(None, refid)
if simpleref is None:
self.simpleref = []
else:
self.simpleref = simpleref
if simplesequenceref is None:
self.simplesequenceref = []
else:
self.simplesequenceref = simplesequenceref
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, structref)
if subclass is not None:
return subclass(*args_, **kwargs_)
if structref.subclass:
return structref.subclass(*args_, **kwargs_)
else:
return structref(*args_, **kwargs_)
factory = staticmethod(factory)
def get_simpleref(self): return self.simpleref
def set_simpleref(self, simpleref): self.simpleref = simpleref
def add_simpleref(self, value): self.simpleref.append(value)
def insert_simpleref_at(self, index, value): self.simpleref.insert(index, value)
def replace_simpleref_at(self, index, value): self.simpleref[index] = value
simplerefProp = property(get_simpleref, set_simpleref)
def get_simplesequenceref(self): return self.simplesequenceref
def set_simplesequenceref(self, simplesequenceref): self.simplesequenceref = simplesequenceref
def add_simplesequenceref(self, value): self.simplesequenceref.append(value)
def insert_simplesequenceref_at(self, index, value): self.simplesequenceref.insert(index, value)
def replace_simplesequenceref_at(self, index, value): self.simplesequenceref[index] = value
simplesequencerefProp = property(get_simplesequenceref, set_simplesequenceref)
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
refidProp = property(get_refid, set_refid)
def hasContent_(self):
if (
self.simpleref or
self.simplesequenceref
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='structref', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('structref')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='structref')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='structref', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='structref'):
if self.refid is not None and 'refid' not in already_processed:
already_processed.add('refid')
outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
def exportChildren(self, outfile, level, namespace_='', name_='structref', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for simpleref_ in self.simpleref:
simpleref_.export(outfile, level, namespace_, name_='simpleref', pretty_print=pretty_print)
for simplesequenceref_ in self.simplesequenceref:
simplesequenceref_.export(outfile, level, namespace_, name_='simplesequenceref', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('refid', node)
if value is not None and 'refid' not in already_processed:
already_processed.add('refid')
self.refid = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'simpleref':
obj_ = simpleref.factory()
obj_.build(child_)
self.simpleref.append(obj_)
obj_.original_tagname_ = 'simpleref'
elif nodeName_ == 'simplesequenceref':
obj_ = simplesequenceref.factory()
obj_.build(child_)
self.simplesequenceref.append(obj_)
obj_.original_tagname_ = 'simplesequenceref'
# end class structref
class structsequenceref(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, refid=None, structvalue=None):
self.original_tagname_ = None
self.refid = _cast(None, refid)
if structvalue is None:
self.structvalue = []
else:
self.structvalue = structvalue
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, structsequenceref)
if subclass is not None:
return subclass(*args_, **kwargs_)
if structsequenceref.subclass:
return structsequenceref.subclass(*args_, **kwargs_)
else:
return structsequenceref(*args_, **kwargs_)
factory = staticmethod(factory)
def get_structvalue(self): return self.structvalue
def set_structvalue(self, structvalue): self.structvalue = structvalue
def add_structvalue(self, value): self.structvalue.append(value)
def insert_structvalue_at(self, index, value): self.structvalue.insert(index, value)
def replace_structvalue_at(self, index, value): self.structvalue[index] = value
structvalueProp = property(get_structvalue, set_structvalue)
def get_refid(self): return self.refid
def set_refid(self, refid): self.refid = refid
refidProp = property(get_refid, set_refid)
def hasContent_(self):
if (
self.structvalue
):
return True
else:
return False
def export(self, outfile, level, namespace_='', name_='structsequenceref', namespacedef_='', pretty_print=True):
imported_ns_def_ = GenerateDSNamespaceDefs_.get('structsequenceref')
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
if self.original_tagname_ is not None:
name_ = self.original_tagname_
showIndent(outfile, level, pretty_print)
outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
already_processed = set()
self.exportAttributes(outfile, level, already_processed, namespace_, name_='structsequenceref')
if self.hasContent_():
outfile.write('>%s' % (eol_, ))
self.exportChildren(outfile, level + 1, namespace_='', name_='structsequenceref', pretty_print=pretty_print)
showIndent(outfile, level, pretty_print)
outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
else:
outfile.write('/>%s' % (eol_, ))
def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='structsequenceref'):
if self.refid is not None and 'refid' not in already_processed:
already_processed.add('refid')
outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
def exportChildren(self, outfile, level, namespace_='', name_='structsequenceref', fromsubclass_=False, pretty_print=True):
if pretty_print:
eol_ = '\n'
else:
eol_ = ''
for structvalue_ in self.structvalue:
structvalue_.export(outfile, level, namespace_, name_='structvalue', pretty_print=pretty_print)
def build(self, node):
already_processed = set()
self.buildAttributes(node, node.attrib, already_processed)
for child in node:
nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
self.buildChildren(child, node, nodeName_)
return self
def buildAttributes(self, node, attrs, already_processed):
value = find_attr_value_('refid', node)
if value is not None and 'refid' not in already_processed:
already_processed.add('refid')
self.refid = value
def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
if nodeName_ == 'structvalue':
obj_ = structvalue.factory()
obj_.build(child_)
self.structvalue.append(obj_)
obj_.original_tagname_ = 'structvalue'
# end class structsequenceref
class structvalue(GeneratedsSuper):
subclass = None
superclass = None
def __init__(self, simpleref=None, simplesequenceref=None):
self.original_tagname_ = None
if simpleref is None:
self.simpleref = []
else:
self.simpleref = simpleref
if simplesequenceref is None:
self.simplesequenceref = []
else:
self.simplesequenceref = simplesequenceref
def factory(*args_, **kwargs_):
if CurrentSubclassModule_ is not None:
subclass = getSubclassFromModule_(
CurrentSubclassModule_, structvalue)
if subclass is not None:
return subclass(*args_, **kwargs_)
if structvalue.subclass: