#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Fri Jan 20 09:57:08 2017 by generateDS.py version 2.24a. # # Command line options: # ('-f', '') # ('--external-encoding', 'utf-8') # ('-o', 'kiwi/xml_parse.py') # # Command line arguments: # kiwi/schema/kiwi.xsd # # Command line: # /home/ms/Project/kiwi/.tox/2.7/bin/generateDS.py -f --external-encoding="utf-8" -o "kiwi/xml_parse.py" kiwi/schema/kiwi.xsd # # Current working directory (os.getcwd()): # kiwi # 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.major == 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 # # User methods # # 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.major == 2: return instring.encode(ExternalEncoding) else: return instring 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(' -- Entering ipshell.\nHit Ctrl-D to exit') # # Globals # ExternalEncoding = 'utf-8' 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"", 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('&', '&') s1 = s1.replace('<', '<') s1 = s1.replace('>', '>') return s1 def quote_attrib(inStr): s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr) s1 = s1.replace('&', '&') s1 = s1.replace('<', '<') s1 = s1.replace('>', '>') if '"' in s1: if "'" in s1: s1 = '"%s"' % s1.replace('"', """) 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' % ( self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeInteger or \ self.content_type == MixedContainer.TypeBoolean: outfile.write('<%s>%d' % ( self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeFloat or \ self.content_type == MixedContainer.TypeDecimal: outfile.write('<%s>%f' % ( self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeDouble: outfile.write('<%s>%g' % ( self.name, self.value, self.name)) elif self.content_type == MixedContainer.TypeBase64: outfile.write('<%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): self.name = name self.data_type = data_type self.container = container 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 _cast(typ, value): if typ is None or value is None: return value return typ(value) # # Data representation classes. # class k_source(GeneratedsSuper): subclass = None superclass = None def __init__(self, source=None): self.original_tagname_ = None self.source = source def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, k_source) if subclass is not None: return subclass(*args_, **kwargs_) if k_source.subclass: return k_source.subclass(*args_, **kwargs_) else: return k_source(*args_, **kwargs_) factory = staticmethod(factory) def get_source(self): return self.source def set_source(self, source): self.source = source def hasContent_(self): if ( self.source is not None ): return True else: return False def export(self, outfile, level, namespace_='', name_='k.source', namespacedef_='', pretty_print=True): 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_='k.source') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='k.source', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='k.source'): pass def exportChildren(self, outfile, level, namespace_='', name_='k.source', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' if self.source is not None: self.source.export(outfile, level, namespace_, name_='source', 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_ == 'source': obj_ = source.factory() obj_.build(child_) self.source = obj_ obj_.original_tagname_ = 'source' # end class k_source class image(GeneratedsSuper): """The root element of the configuration file""" subclass = None superclass = None def __init__(self, name=None, displayname=None, kiwirevision=None, id=None, schemaversion=None, noNamespaceSchemaLocation=None, schemaLocation=None, description=None, preferences=None, profiles=None, instsource=None, users=None, drivers=None, strip=None, repository=None, packages=None, extension=None): self.original_tagname_ = None self.name = _cast(None, name) self.displayname = _cast(None, displayname) self.kiwirevision = _cast(None, kiwirevision) self.id = _cast(None, id) self.schemaversion = _cast(None, schemaversion) self.noNamespaceSchemaLocation = _cast(None, noNamespaceSchemaLocation) self.schemaLocation = _cast(None, schemaLocation) if description is None: self.description = [] else: self.description = description if preferences is None: self.preferences = [] else: self.preferences = preferences if profiles is None: self.profiles = [] else: self.profiles = profiles if instsource is None: self.instsource = [] else: self.instsource = instsource if users is None: self.users = [] else: self.users = users if drivers is None: self.drivers = [] else: self.drivers = drivers if strip is None: self.strip = [] else: self.strip = strip if repository is None: self.repository = [] else: self.repository = repository if packages is None: self.packages = [] else: self.packages = packages if extension is None: self.extension = [] else: self.extension = extension def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, image) if subclass is not None: return subclass(*args_, **kwargs_) if image.subclass: return image.subclass(*args_, **kwargs_) else: return image(*args_, **kwargs_) factory = staticmethod(factory) def get_description(self): return self.description def set_description(self, description): self.description = description def add_description(self, value): self.description.append(value) def insert_description_at(self, index, value): self.description.insert(index, value) def replace_description_at(self, index, value): self.description[index] = value def get_preferences(self): return self.preferences def set_preferences(self, preferences): self.preferences = preferences def add_preferences(self, value): self.preferences.append(value) def insert_preferences_at(self, index, value): self.preferences.insert(index, value) def replace_preferences_at(self, index, value): self.preferences[index] = value def get_profiles(self): return self.profiles def set_profiles(self, profiles): self.profiles = profiles def add_profiles(self, value): self.profiles.append(value) def insert_profiles_at(self, index, value): self.profiles.insert(index, value) def replace_profiles_at(self, index, value): self.profiles[index] = value def get_instsource(self): return self.instsource def set_instsource(self, instsource): self.instsource = instsource def add_instsource(self, value): self.instsource.append(value) def insert_instsource_at(self, index, value): self.instsource.insert(index, value) def replace_instsource_at(self, index, value): self.instsource[index] = value def get_users(self): return self.users def set_users(self, users): self.users = users def add_users(self, value): self.users.append(value) def insert_users_at(self, index, value): self.users.insert(index, value) def replace_users_at(self, index, value): self.users[index] = value def get_drivers(self): return self.drivers def set_drivers(self, drivers): self.drivers = drivers def add_drivers(self, value): self.drivers.append(value) def insert_drivers_at(self, index, value): self.drivers.insert(index, value) def replace_drivers_at(self, index, value): self.drivers[index] = value def get_strip(self): return self.strip def set_strip(self, strip): self.strip = strip def add_strip(self, value): self.strip.append(value) def insert_strip_at(self, index, value): self.strip.insert(index, value) def replace_strip_at(self, index, value): self.strip[index] = value def get_repository(self): return self.repository def set_repository(self, repository): self.repository = repository def add_repository(self, value): self.repository.append(value) def insert_repository_at(self, index, value): self.repository.insert(index, value) def replace_repository_at(self, index, value): self.repository[index] = value def get_packages(self): return self.packages def set_packages(self, packages): self.packages = packages def add_packages(self, value): self.packages.append(value) def insert_packages_at(self, index, value): self.packages.insert(index, value) def replace_packages_at(self, index, value): self.packages[index] = value def get_extension(self): return self.extension def set_extension(self, extension): self.extension = extension def add_extension(self, value): self.extension.append(value) def insert_extension_at(self, index, value): self.extension.insert(index, value) def replace_extension_at(self, index, value): self.extension[index] = value def get_name(self): return self.name def set_name(self, name): self.name = name def get_displayname(self): return self.displayname def set_displayname(self, displayname): self.displayname = displayname def get_kiwirevision(self): return self.kiwirevision def set_kiwirevision(self, kiwirevision): self.kiwirevision = kiwirevision def get_id(self): return self.id def set_id(self, id): self.id = id def get_schemaversion(self): return self.schemaversion def set_schemaversion(self, schemaversion): self.schemaversion = schemaversion def get_noNamespaceSchemaLocation(self): return self.noNamespaceSchemaLocation def set_noNamespaceSchemaLocation(self, noNamespaceSchemaLocation): self.noNamespaceSchemaLocation = noNamespaceSchemaLocation def get_schemaLocation(self): return self.schemaLocation def set_schemaLocation(self, schemaLocation): self.schemaLocation = schemaLocation def validate_image_name(self, value): # Validate type image-name, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_image_name_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_image_name_patterns_, )) validate_image_name_patterns_ = [['^[a-zA-Z0-9_\\-\\.]+$']] def hasContent_(self): if ( self.description or self.preferences or self.profiles or self.instsource or self.users or self.drivers or self.strip or self.repository or self.packages or self.extension ): return True else: return False def export(self, outfile, level, namespace_='', name_='image', namespacedef_='', pretty_print=True): 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_='image') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='image', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='image'): if self.name is not None and 'name' not in already_processed: already_processed.add('name') outfile.write(' name=%s' % (quote_attrib(self.name), )) if self.displayname is not None and 'displayname' not in already_processed: already_processed.add('displayname') outfile.write(' displayname=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.displayname), input_name='displayname')), )) if self.kiwirevision is not None and 'kiwirevision' not in already_processed: already_processed.add('kiwirevision') outfile.write(' kiwirevision=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.kiwirevision), input_name='kiwirevision')), )) 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.schemaversion is not None and 'schemaversion' not in already_processed: already_processed.add('schemaversion') outfile.write(' schemaversion=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.schemaversion), input_name='schemaversion')), )) if self.noNamespaceSchemaLocation is not None and 'noNamespaceSchemaLocation' not in already_processed: already_processed.add('noNamespaceSchemaLocation') outfile.write(' noNamespaceSchemaLocation=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.noNamespaceSchemaLocation), input_name='noNamespaceSchemaLocation')), )) if self.schemaLocation is not None and 'schemaLocation' not in already_processed: already_processed.add('schemaLocation') outfile.write(' schemaLocation=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.schemaLocation), input_name='schemaLocation')), )) def exportChildren(self, outfile, level, namespace_='', name_='image', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for description_ in self.description: description_.export(outfile, level, namespace_, name_='description', pretty_print=pretty_print) for preferences_ in self.preferences: preferences_.export(outfile, level, namespace_, name_='preferences', pretty_print=pretty_print) for profiles_ in self.profiles: profiles_.export(outfile, level, namespace_, name_='profiles', pretty_print=pretty_print) for instsource_ in self.instsource: instsource_.export(outfile, level, namespace_, name_='instsource', pretty_print=pretty_print) for users_ in self.users: users_.export(outfile, level, namespace_, name_='users', pretty_print=pretty_print) for drivers_ in self.drivers: drivers_.export(outfile, level, namespace_, name_='drivers', pretty_print=pretty_print) for strip_ in self.strip: strip_.export(outfile, level, namespace_, name_='strip', pretty_print=pretty_print) for repository_ in self.repository: repository_.export(outfile, level, namespace_, name_='repository', pretty_print=pretty_print) for packages_ in self.packages: packages_.export(outfile, level, namespace_, name_='packages', pretty_print=pretty_print) for extension_ in self.extension: extension_.export(outfile, level, namespace_, name_='extension', 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_('name', node) if value is not None and 'name' not in already_processed: already_processed.add('name') self.name = value self.name = ' '.join(self.name.split()) self.validate_image_name(self.name) # validate type image-name value = find_attr_value_('displayname', node) if value is not None and 'displayname' not in already_processed: already_processed.add('displayname') self.displayname = value value = find_attr_value_('kiwirevision', node) if value is not None and 'kiwirevision' not in already_processed: already_processed.add('kiwirevision') self.kiwirevision = value 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_('schemaversion', node) if value is not None and 'schemaversion' not in already_processed: already_processed.add('schemaversion') self.schemaversion = value self.schemaversion = ' '.join(self.schemaversion.split()) value = find_attr_value_('noNamespaceSchemaLocation', node) if value is not None and 'noNamespaceSchemaLocation' not in already_processed: already_processed.add('noNamespaceSchemaLocation') self.noNamespaceSchemaLocation = value value = find_attr_value_('schemaLocation', node) if value is not None and 'schemaLocation' not in already_processed: already_processed.add('schemaLocation') self.schemaLocation = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'description': obj_ = description.factory() obj_.build(child_) self.description.append(obj_) obj_.original_tagname_ = 'description' elif nodeName_ == 'preferences': obj_ = preferences.factory() obj_.build(child_) self.preferences.append(obj_) obj_.original_tagname_ = 'preferences' elif nodeName_ == 'profiles': obj_ = profiles.factory() obj_.build(child_) self.profiles.append(obj_) obj_.original_tagname_ = 'profiles' elif nodeName_ == 'instsource': obj_ = instsource.factory() obj_.build(child_) self.instsource.append(obj_) obj_.original_tagname_ = 'instsource' elif nodeName_ == 'users': obj_ = users.factory() obj_.build(child_) self.users.append(obj_) obj_.original_tagname_ = 'users' elif nodeName_ == 'drivers': obj_ = drivers.factory() obj_.build(child_) self.drivers.append(obj_) obj_.original_tagname_ = 'drivers' elif nodeName_ == 'strip': obj_ = strip.factory() obj_.build(child_) self.strip.append(obj_) obj_.original_tagname_ = 'strip' elif nodeName_ == 'repository': obj_ = repository.factory() obj_.build(child_) self.repository.append(obj_) obj_.original_tagname_ = 'repository' elif nodeName_ == 'packages': obj_ = packages.factory() obj_.build(child_) self.packages.append(obj_) obj_.original_tagname_ = 'packages' elif nodeName_ == 'extension': obj_ = extension.factory() obj_.build(child_) self.extension.append(obj_) obj_.original_tagname_ = 'extension' # end class image class extension(GeneratedsSuper): """Define custom XML extensions""" subclass = None superclass = None def __init__(self, anytypeobjs_=None): self.original_tagname_ = None if anytypeobjs_ is None: self.anytypeobjs_ = [] else: self.anytypeobjs_ = anytypeobjs_ def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, extension) if subclass is not None: return subclass(*args_, **kwargs_) if extension.subclass: return extension.subclass(*args_, **kwargs_) else: return extension(*args_, **kwargs_) factory = staticmethod(factory) def get_anytypeobjs_(self): return self.anytypeobjs_ def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_ def add_anytypeobjs_(self, value): self.anytypeobjs_.append(value) def insert_anytypeobjs_(self, index, value): self._anytypeobjs_[index] = value def hasContent_(self): if ( self.anytypeobjs_ ): return True else: return False def export(self, outfile, level, namespace_='', name_='extension', namespacedef_='', pretty_print=True): 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_='extension') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='extension', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='extension'): pass def exportChildren(self, outfile, level, namespace_='', name_='extension', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for obj_ in self.anytypeobjs_: obj_.export(outfile, level, namespace_, 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): obj_ = self.gds_build_any(child_, 'extension') if obj_ is not None: self.add_anytypeobjs_(obj_) # end class extension class archive(GeneratedsSuper): """Name of an image archive file (tarball)""" subclass = None superclass = None def __init__(self, name=None, bootinclude=None): self.original_tagname_ = None self.name = _cast(None, name) self.bootinclude = _cast(bool, bootinclude) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, archive) if subclass is not None: return subclass(*args_, **kwargs_) if archive.subclass: return archive.subclass(*args_, **kwargs_) else: return archive(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_bootinclude(self): return self.bootinclude def set_bootinclude(self, bootinclude): self.bootinclude = bootinclude def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='archive', namespacedef_='', pretty_print=True): 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_='archive') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='archive', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='archive'): 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')), )) if self.bootinclude is not None and 'bootinclude' not in already_processed: already_processed.add('bootinclude') outfile.write(' bootinclude="%s"' % self.gds_format_boolean(self.bootinclude, input_name='bootinclude')) def exportChildren(self, outfile, level, namespace_='', name_='archive', 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 value = find_attr_value_('bootinclude', node) if value is not None and 'bootinclude' not in already_processed: already_processed.add('bootinclude') if value in ('true', '1'): self.bootinclude = True elif value in ('false', '0'): self.bootinclude = False else: raise_parse_error(node, 'Bad boolean attribute') def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class archive class configuration(GeneratedsSuper): """Specifies Configuration files""" subclass = None superclass = None def __init__(self, source=None, dest=None, arch=None): self.original_tagname_ = None self.source = _cast(None, source) self.dest = _cast(None, dest) self.arch = _cast(None, arch) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, configuration) if subclass is not None: return subclass(*args_, **kwargs_) if configuration.subclass: return configuration.subclass(*args_, **kwargs_) else: return configuration(*args_, **kwargs_) factory = staticmethod(factory) def get_source(self): return self.source def set_source(self, source): self.source = source def get_dest(self): return self.dest def set_dest(self, dest): self.dest = dest def get_arch(self): return self.arch def set_arch(self, arch): self.arch = arch def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='configuration', namespacedef_='', pretty_print=True): 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_='configuration') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='configuration', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='configuration'): if self.source is not None and 'source' not in already_processed: already_processed.add('source') outfile.write(' source=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.source), input_name='source')), )) if self.dest is not None and 'dest' not in already_processed: already_processed.add('dest') outfile.write(' dest=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.dest), input_name='dest')), )) if self.arch is not None and 'arch' not in already_processed: already_processed.add('arch') outfile.write(' arch=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.arch), input_name='arch')), )) def exportChildren(self, outfile, level, namespace_='', name_='configuration', 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_('source', node) if value is not None and 'source' not in already_processed: already_processed.add('source') self.source = value value = find_attr_value_('dest', node) if value is not None and 'dest' not in already_processed: already_processed.add('dest') self.dest = value value = find_attr_value_('arch', node) if value is not None and 'arch' not in already_processed: already_processed.add('arch') self.arch = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class configuration class file(GeneratedsSuper): """A Pointer to a File""" subclass = None superclass = None def __init__(self, name=None, arch=None): self.original_tagname_ = None self.name = _cast(None, name) self.arch = _cast(None, arch) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, file) if subclass is not None: return subclass(*args_, **kwargs_) if file.subclass: return file.subclass(*args_, **kwargs_) else: return file(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_arch(self): return self.arch def set_arch(self, arch): self.arch = arch def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='file', namespacedef_='', pretty_print=True): 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_='file') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='file', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='file'): 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')), )) if self.arch is not None and 'arch' not in already_processed: already_processed.add('arch') outfile.write(' arch=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.arch), input_name='arch')), )) def exportChildren(self, outfile, level, namespace_='', name_='file', 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 value = find_attr_value_('arch', node) if value is not None and 'arch' not in already_processed: already_processed.add('arch') self.arch = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class file class ignore(GeneratedsSuper): """Ignores a Package""" 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_, ignore) if subclass is not None: return subclass(*args_, **kwargs_) if ignore.subclass: return ignore.subclass(*args_, **kwargs_) else: return ignore(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='ignore', namespacedef_='', pretty_print=True): 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_='ignore') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='ignore', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ignore'): 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_='ignore', 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 ignore class instrepo(k_source): """Name of a Installation Repository""" subclass = None superclass = k_source def __init__(self, source=None, local=None, name=None, password=None, priority=None, username=None): self.original_tagname_ = None super(instrepo, self).__init__(source, ) self.local = _cast(bool, local) self.name = _cast(None, name) self.password = _cast(None, password) self.priority = _cast(None, priority) self.username = _cast(None, username) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, instrepo) if subclass is not None: return subclass(*args_, **kwargs_) if instrepo.subclass: return instrepo.subclass(*args_, **kwargs_) else: return instrepo(*args_, **kwargs_) factory = staticmethod(factory) def get_local(self): return self.local def set_local(self, local): self.local = local def get_name(self): return self.name def set_name(self, name): self.name = name def get_password(self): return self.password def set_password(self, password): self.password = password def get_priority(self): return self.priority def set_priority(self, priority): self.priority = priority def get_username(self): return self.username def set_username(self, username): self.username = username def hasContent_(self): if ( super(instrepo, self).hasContent_() ): return True else: return False def export(self, outfile, level, namespace_='', name_='instrepo', namespacedef_='', pretty_print=True): 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_='instrepo') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='instrepo', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='instrepo'): super(instrepo, self).exportAttributes(outfile, level, already_processed, namespace_, name_='instrepo') if self.local is not None and 'local' not in already_processed: already_processed.add('local') outfile.write(' local="%s"' % self.gds_format_boolean(self.local, input_name='local')) 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')), )) if self.password is not None and 'password' not in already_processed: already_processed.add('password') outfile.write(' password=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.password), input_name='password')), )) if self.priority is not None and 'priority' not in already_processed: already_processed.add('priority') outfile.write(' priority=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.priority), input_name='priority')), )) if self.username is not None and 'username' not in already_processed: already_processed.add('username') outfile.write(' username=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.username), input_name='username')), )) def exportChildren(self, outfile, level, namespace_='', name_='instrepo', fromsubclass_=False, pretty_print=True): super(instrepo, self).exportChildren(outfile, level, namespace_, name_, True, 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_('local', node) if value is not None and 'local' not in already_processed: already_processed.add('local') if value in ('true', '1'): self.local = True elif value in ('false', '0'): self.local = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('name', node) if value is not None and 'name' not in already_processed: already_processed.add('name') self.name = value value = find_attr_value_('password', node) if value is not None and 'password' not in already_processed: already_processed.add('password') self.password = value value = find_attr_value_('priority', node) if value is not None and 'priority' not in already_processed: already_processed.add('priority') self.priority = value value = find_attr_value_('username', node) if value is not None and 'username' not in already_processed: already_processed.add('username') self.username = value super(instrepo, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(instrepo, self).buildChildren(child_, node, nodeName_, True) pass # end class instrepo class metadata(GeneratedsSuper): """Contains Metadata""" subclass = None superclass = None def __init__(self, repopackage=None, metafile=None, chroot=None): self.original_tagname_ = None if repopackage is None: self.repopackage = [] else: self.repopackage = repopackage if metafile is None: self.metafile = [] else: self.metafile = metafile if chroot is None: self.chroot = [] else: self.chroot = chroot def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, metadata) if subclass is not None: return subclass(*args_, **kwargs_) if metadata.subclass: return metadata.subclass(*args_, **kwargs_) else: return metadata(*args_, **kwargs_) factory = staticmethod(factory) def get_repopackage(self): return self.repopackage def set_repopackage(self, repopackage): self.repopackage = repopackage def add_repopackage(self, value): self.repopackage.append(value) def insert_repopackage_at(self, index, value): self.repopackage.insert(index, value) def replace_repopackage_at(self, index, value): self.repopackage[index] = value def get_metafile(self): return self.metafile def set_metafile(self, metafile): self.metafile = metafile def add_metafile(self, value): self.metafile.append(value) def insert_metafile_at(self, index, value): self.metafile.insert(index, value) def replace_metafile_at(self, index, value): self.metafile[index] = value def get_chroot(self): return self.chroot def set_chroot(self, chroot): self.chroot = chroot def add_chroot(self, value): self.chroot.append(value) def insert_chroot_at(self, index, value): self.chroot.insert(index, value) def replace_chroot_at(self, index, value): self.chroot[index] = value def hasContent_(self): if ( self.repopackage or self.metafile or self.chroot ): return True else: return False def export(self, outfile, level, namespace_='', name_='metadata', namespacedef_='', pretty_print=True): 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_='metadata') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='metadata', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='metadata'): pass def exportChildren(self, outfile, level, namespace_='', name_='metadata', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for repopackage_ in self.repopackage: repopackage_.export(outfile, level, namespace_, name_='repopackage', pretty_print=pretty_print) for metafile_ in self.metafile: metafile_.export(outfile, level, namespace_, name_='metafile', pretty_print=pretty_print) for chroot_ in self.chroot: chroot_.export(outfile, level, namespace_, name_='chroot', 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_ == 'repopackage': obj_ = repopackage.factory() obj_.build(child_) self.repopackage.append(obj_) obj_.original_tagname_ = 'repopackage' elif nodeName_ == 'metafile': obj_ = metafile.factory() obj_.build(child_) self.metafile.append(obj_) obj_.original_tagname_ = 'metafile' elif nodeName_ == 'chroot': obj_ = chroot.factory() obj_.build(child_) self.chroot.append(obj_) obj_.original_tagname_ = 'chroot' # end class metadata class metafile(GeneratedsSuper): """A file Pointer Optionally Bundled With a Script""" subclass = None superclass = None def __init__(self, url=None, script=None, target=None): self.original_tagname_ = None self.url = _cast(None, url) self.script = _cast(None, script) self.target = _cast(None, target) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, metafile) if subclass is not None: return subclass(*args_, **kwargs_) if metafile.subclass: return metafile.subclass(*args_, **kwargs_) else: return metafile(*args_, **kwargs_) factory = staticmethod(factory) def get_url(self): return self.url def set_url(self, url): self.url = url def get_script(self): return self.script def set_script(self, script): self.script = script def get_target(self): return self.target def set_target(self, target): self.target = target def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='metafile', namespacedef_='', pretty_print=True): 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_='metafile') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='metafile', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='metafile'): if self.url is not None and 'url' not in already_processed: already_processed.add('url') outfile.write(' url=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.url), input_name='url')), )) if self.script is not None and 'script' not in already_processed: already_processed.add('script') outfile.write(' script=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.script), input_name='script')), )) if self.target is not None and 'target' not in already_processed: already_processed.add('target') outfile.write(' target=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.target), input_name='target')), )) def exportChildren(self, outfile, level, namespace_='', name_='metafile', 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_('url', node) if value is not None and 'url' not in already_processed: already_processed.add('url') self.url = value value = find_attr_value_('script', node) if value is not None and 'script' not in already_processed: already_processed.add('script') self.script = value value = find_attr_value_('target', node) if value is not None and 'target' not in already_processed: already_processed.add('target') self.target = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class metafile class namedCollection(GeneratedsSuper): """Name of a Pattern for SUSE or a Group for RH""" subclass = None superclass = None def __init__(self, name=None, arch=None): self.original_tagname_ = None self.name = _cast(None, name) self.arch = _cast(None, arch) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, namedCollection) if subclass is not None: return subclass(*args_, **kwargs_) if namedCollection.subclass: return namedCollection.subclass(*args_, **kwargs_) else: return namedCollection(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_arch(self): return self.arch def set_arch(self, arch): self.arch = arch def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='namedCollection', namespacedef_='', pretty_print=True): 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_='namedCollection') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='namedCollection', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='namedCollection'): 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')), )) if self.arch is not None and 'arch' not in already_processed: already_processed.add('arch') outfile.write(' arch=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.arch), input_name='arch')), )) def exportChildren(self, outfile, level, namespace_='', name_='namedCollection', 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 value = find_attr_value_('arch', node) if value is not None and 'arch' not in already_processed: already_processed.add('arch') self.arch = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class namedCollection class product(GeneratedsSuper): """Name of a Product From openSUSE""" subclass = None superclass = None def __init__(self, name=None, arch=None): self.original_tagname_ = None self.name = _cast(None, name) self.arch = _cast(None, arch) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, product) if subclass is not None: return subclass(*args_, **kwargs_) if product.subclass: return product.subclass(*args_, **kwargs_) else: return product(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_arch(self): return self.arch def set_arch(self, arch): self.arch = arch def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='product', namespacedef_='', pretty_print=True): 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_='product') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='product', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='product'): 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')), )) if self.arch is not None and 'arch' not in already_processed: already_processed.add('arch') outfile.write(' arch=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.arch), input_name='arch')), )) def exportChildren(self, outfile, level, namespace_='', name_='product', 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 value = find_attr_value_('arch', node) if value is not None and 'arch' not in already_processed: already_processed.add('arch') self.arch = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class product class package(GeneratedsSuper): """Name of an image Package""" subclass = None superclass = None def __init__(self, name=None, arch=None, replaces=None, bootdelete=None, bootinclude=None): self.original_tagname_ = None self.name = _cast(None, name) self.arch = _cast(None, arch) self.replaces = _cast(None, replaces) self.bootdelete = _cast(bool, bootdelete) self.bootinclude = _cast(bool, bootinclude) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, package) if subclass is not None: return subclass(*args_, **kwargs_) if package.subclass: return package.subclass(*args_, **kwargs_) else: return package(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_arch(self): return self.arch def set_arch(self, arch): self.arch = arch def get_replaces(self): return self.replaces def set_replaces(self, replaces): self.replaces = replaces def get_bootdelete(self): return self.bootdelete def set_bootdelete(self, bootdelete): self.bootdelete = bootdelete def get_bootinclude(self): return self.bootinclude def set_bootinclude(self, bootinclude): self.bootinclude = bootinclude def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='package', namespacedef_='', pretty_print=True): 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_='package') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='package', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='package'): 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')), )) if self.arch is not None and 'arch' not in already_processed: already_processed.add('arch') outfile.write(' arch=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.arch), input_name='arch')), )) if self.replaces is not None and 'replaces' not in already_processed: already_processed.add('replaces') outfile.write(' replaces=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.replaces), input_name='replaces')), )) if self.bootdelete is not None and 'bootdelete' not in already_processed: already_processed.add('bootdelete') outfile.write(' bootdelete="%s"' % self.gds_format_boolean(self.bootdelete, input_name='bootdelete')) if self.bootinclude is not None and 'bootinclude' not in already_processed: already_processed.add('bootinclude') outfile.write(' bootinclude="%s"' % self.gds_format_boolean(self.bootinclude, input_name='bootinclude')) def exportChildren(self, outfile, level, namespace_='', name_='package', 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 value = find_attr_value_('arch', node) if value is not None and 'arch' not in already_processed: already_processed.add('arch') self.arch = value value = find_attr_value_('replaces', node) if value is not None and 'replaces' not in already_processed: already_processed.add('replaces') self.replaces = value value = find_attr_value_('bootdelete', node) if value is not None and 'bootdelete' not in already_processed: already_processed.add('bootdelete') if value in ('true', '1'): self.bootdelete = True elif value in ('false', '0'): self.bootdelete = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('bootinclude', node) if value is not None and 'bootinclude' not in already_processed: already_processed.add('bootinclude') if value in ('true', '1'): self.bootinclude = True elif value in ('false', '0'): self.bootinclude = False else: raise_parse_error(node, 'Bad boolean attribute') def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class package class partition(GeneratedsSuper): """A Partition""" subclass = None superclass = None def __init__(self, type_=None, number=None, size=None, mountpoint=None, target=None): self.original_tagname_ = None self.type_ = _cast(None, type_) self.number = _cast(None, number) self.size = _cast(None, size) self.mountpoint = _cast(None, mountpoint) self.target = _cast(bool, target) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, partition) if subclass is not None: return subclass(*args_, **kwargs_) if partition.subclass: return partition.subclass(*args_, **kwargs_) else: return partition(*args_, **kwargs_) factory = staticmethod(factory) def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def get_number(self): return self.number def set_number(self, number): self.number = number def get_size(self): return self.size def set_size(self, size): self.size = size def get_mountpoint(self): return self.mountpoint def set_mountpoint(self, mountpoint): self.mountpoint = mountpoint def get_target(self): return self.target def set_target(self, target): self.target = target def validate_size_type(self, value): # Validate type size-type, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_size_type_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_size_type_patterns_, )) validate_size_type_patterns_ = [['^\\d*|image$']] def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='partition', namespacedef_='', pretty_print=True): 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_='partition') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='partition', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='partition'): 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')), )) if self.number is not None and 'number' not in already_processed: already_processed.add('number') outfile.write(' number=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.number), input_name='number')), )) if self.size is not None and 'size' not in already_processed: already_processed.add('size') outfile.write(' size=%s' % (quote_attrib(self.size), )) if self.mountpoint is not None and 'mountpoint' not in already_processed: already_processed.add('mountpoint') outfile.write(' mountpoint=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.mountpoint), input_name='mountpoint')), )) if self.target is not None and 'target' not in already_processed: already_processed.add('target') outfile.write(' target="%s"' % self.gds_format_boolean(self.target, input_name='target')) def exportChildren(self, outfile, level, namespace_='', name_='partition', 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_('type', node) if value is not None and 'type' not in already_processed: already_processed.add('type') self.type_ = value value = find_attr_value_('number', node) if value is not None and 'number' not in already_processed: already_processed.add('number') self.number = value value = find_attr_value_('size', node) if value is not None and 'size' not in already_processed: already_processed.add('size') self.size = value self.size = ' '.join(self.size.split()) self.validate_size_type(self.size) # validate type size-type value = find_attr_value_('mountpoint', node) if value is not None and 'mountpoint' not in already_processed: already_processed.add('mountpoint') self.mountpoint = value value = find_attr_value_('target', node) if value is not None and 'target' not in already_processed: already_processed.add('target') if value in ('true', '1'): self.target = True elif value in ('false', '0'): self.target = False else: raise_parse_error(node, 'Bad boolean attribute') def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class partition class partitions(GeneratedsSuper): """A List of Partitions""" subclass = None superclass = None def __init__(self, device=None, partition=None): self.original_tagname_ = None self.device = _cast(None, device) if partition is None: self.partition = [] else: self.partition = partition def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, partitions) if subclass is not None: return subclass(*args_, **kwargs_) if partitions.subclass: return partitions.subclass(*args_, **kwargs_) else: return partitions(*args_, **kwargs_) factory = staticmethod(factory) def get_partition(self): return self.partition def set_partition(self, partition): self.partition = partition def add_partition(self, value): self.partition.append(value) def insert_partition_at(self, index, value): self.partition.insert(index, value) def replace_partition_at(self, index, value): self.partition[index] = value def get_device(self): return self.device def set_device(self, device): self.device = device def hasContent_(self): if ( self.partition ): return True else: return False def export(self, outfile, level, namespace_='', name_='partitions', namespacedef_='', pretty_print=True): 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_='partitions') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='partitions', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='partitions'): if self.device is not None and 'device' not in already_processed: already_processed.add('device') outfile.write(' device=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.device), input_name='device')), )) def exportChildren(self, outfile, level, namespace_='', name_='partitions', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for partition_ in self.partition: partition_.export(outfile, level, namespace_, name_='partition', 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_('device', node) if value is not None and 'device' not in already_processed: already_processed.add('device') self.device = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'partition': obj_ = partition.factory() obj_.build(child_) self.partition.append(obj_) obj_.original_tagname_ = 'partition' # end class partitions class profile(GeneratedsSuper): """Creates Profiles""" subclass = None superclass = None def __init__(self, name=None, description=None, import_=None): self.original_tagname_ = None self.name = _cast(None, name) self.description = _cast(None, description) self.import_ = _cast(bool, import_) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, profile) if subclass is not None: return subclass(*args_, **kwargs_) if profile.subclass: return profile.subclass(*args_, **kwargs_) else: return profile(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_description(self): return self.description def set_description(self, description): self.description = description def get_import(self): return self.import_ def set_import(self, import_): self.import_ = import_ def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='profile', namespacedef_='', pretty_print=True): 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_='profile') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='profile', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='profile'): 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')), )) if self.description is not None and 'description' not in already_processed: already_processed.add('description') outfile.write(' description=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.description), input_name='description')), )) if self.import_ is not None and 'import_' not in already_processed: already_processed.add('import_') outfile.write(' import="%s"' % self.gds_format_boolean(self.import_, input_name='import')) def exportChildren(self, outfile, level, namespace_='', name_='profile', 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 value = find_attr_value_('description', node) if value is not None and 'description' not in already_processed: already_processed.add('description') self.description = value value = find_attr_value_('import', node) if value is not None and 'import' not in already_processed: already_processed.add('import') if value in ('true', '1'): self.import_ = True elif value in ('false', '0'): self.import_ = False else: raise_parse_error(node, 'Bad boolean attribute') def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class profile class repopackage(GeneratedsSuper): """Name of an instsource Package""" subclass = None superclass = None def __init__(self, name=None, arch=None, forcerepo=None, addarch=None, removearch=None, onlyarch=None, source=None, script=None, medium=None): self.original_tagname_ = None self.name = _cast(None, name) self.arch = _cast(None, arch) self.forcerepo = _cast(None, forcerepo) self.addarch = _cast(None, addarch) self.removearch = _cast(None, removearch) self.onlyarch = _cast(None, onlyarch) self.source = _cast(None, source) self.script = _cast(None, script) self.medium = _cast(int, medium) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, repopackage) if subclass is not None: return subclass(*args_, **kwargs_) if repopackage.subclass: return repopackage.subclass(*args_, **kwargs_) else: return repopackage(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_arch(self): return self.arch def set_arch(self, arch): self.arch = arch def get_forcerepo(self): return self.forcerepo def set_forcerepo(self, forcerepo): self.forcerepo = forcerepo def get_addarch(self): return self.addarch def set_addarch(self, addarch): self.addarch = addarch def get_removearch(self): return self.removearch def set_removearch(self, removearch): self.removearch = removearch def get_onlyarch(self): return self.onlyarch def set_onlyarch(self, onlyarch): self.onlyarch = onlyarch def get_source(self): return self.source def set_source(self, source): self.source = source def get_script(self): return self.script def set_script(self, script): self.script = script def get_medium(self): return self.medium def set_medium(self, medium): self.medium = medium def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='repopackage', namespacedef_='', pretty_print=True): 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_='repopackage') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='repopackage', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='repopackage'): 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')), )) if self.arch is not None and 'arch' not in already_processed: already_processed.add('arch') outfile.write(' arch=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.arch), input_name='arch')), )) if self.forcerepo is not None and 'forcerepo' not in already_processed: already_processed.add('forcerepo') outfile.write(' forcerepo=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.forcerepo), input_name='forcerepo')), )) if self.addarch is not None and 'addarch' not in already_processed: already_processed.add('addarch') outfile.write(' addarch=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.addarch), input_name='addarch')), )) if self.removearch is not None and 'removearch' not in already_processed: already_processed.add('removearch') outfile.write(' removearch=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.removearch), input_name='removearch')), )) if self.onlyarch is not None and 'onlyarch' not in already_processed: already_processed.add('onlyarch') outfile.write(' onlyarch=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.onlyarch), input_name='onlyarch')), )) if self.source is not None and 'source' not in already_processed: already_processed.add('source') outfile.write(' source=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.source), input_name='source')), )) if self.script is not None and 'script' not in already_processed: already_processed.add('script') outfile.write(' script=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.script), input_name='script')), )) if self.medium is not None and 'medium' not in already_processed: already_processed.add('medium') outfile.write(' medium="%s"' % self.gds_format_integer(self.medium, input_name='medium')) def exportChildren(self, outfile, level, namespace_='', name_='repopackage', 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 value = find_attr_value_('arch', node) if value is not None and 'arch' not in already_processed: already_processed.add('arch') self.arch = value value = find_attr_value_('forcerepo', node) if value is not None and 'forcerepo' not in already_processed: already_processed.add('forcerepo') self.forcerepo = value value = find_attr_value_('addarch', node) if value is not None and 'addarch' not in already_processed: already_processed.add('addarch') self.addarch = value value = find_attr_value_('removearch', node) if value is not None and 'removearch' not in already_processed: already_processed.add('removearch') self.removearch = value value = find_attr_value_('onlyarch', node) if value is not None and 'onlyarch' not in already_processed: already_processed.add('onlyarch') self.onlyarch = value value = find_attr_value_('source', node) if value is not None and 'source' not in already_processed: already_processed.add('source') self.source = value value = find_attr_value_('script', node) if value is not None and 'script' not in already_processed: already_processed.add('script') self.script = value value = find_attr_value_('medium', node) if value is not None and 'medium' not in already_processed: already_processed.add('medium') try: self.medium = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.medium < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class repopackage class repository(k_source): """The Name of the Repository""" subclass = None superclass = k_source def __init__(self, source=None, type_=None, profiles=None, status=None, alias=None, components=None, distribution=None, imageinclude=None, prefer_license=None, priority=None, password=None, username=None): self.original_tagname_ = None super(repository, self).__init__(source, ) self.type_ = _cast(None, type_) self.profiles = _cast(None, profiles) self.status = _cast(None, status) self.alias = _cast(None, alias) self.components = _cast(None, components) self.distribution = _cast(None, distribution) self.imageinclude = _cast(bool, imageinclude) self.prefer_license = _cast(bool, prefer_license) self.priority = _cast(int, priority) self.password = _cast(None, password) self.username = _cast(None, username) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, repository) if subclass is not None: return subclass(*args_, **kwargs_) if repository.subclass: return repository.subclass(*args_, **kwargs_) else: return repository(*args_, **kwargs_) factory = staticmethod(factory) def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def get_profiles(self): return self.profiles def set_profiles(self, profiles): self.profiles = profiles def get_status(self): return self.status def set_status(self, status): self.status = status def get_alias(self): return self.alias def set_alias(self, alias): self.alias = alias def get_components(self): return self.components def set_components(self, components): self.components = components def get_distribution(self): return self.distribution def set_distribution(self, distribution): self.distribution = distribution def get_imageinclude(self): return self.imageinclude def set_imageinclude(self, imageinclude): self.imageinclude = imageinclude def get_prefer_license(self): return self.prefer_license def set_prefer_license(self, prefer_license): self.prefer_license = prefer_license def get_priority(self): return self.priority def set_priority(self, priority): self.priority = priority def get_password(self): return self.password def set_password(self, password): self.password = password def get_username(self): return self.username def set_username(self, username): self.username = username def hasContent_(self): if ( super(repository, self).hasContent_() ): return True else: return False def export(self, outfile, level, namespace_='', name_='repository', namespacedef_='', pretty_print=True): 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_='repository') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='repository', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='repository'): super(repository, self).exportAttributes(outfile, level, already_processed, namespace_, name_='repository') 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')), )) if self.profiles is not None and 'profiles' not in already_processed: already_processed.add('profiles') outfile.write(' profiles=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.profiles), input_name='profiles')), )) if self.status is not None and 'status' not in already_processed: already_processed.add('status') outfile.write(' status=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.status), input_name='status')), )) if self.alias is not None and 'alias' not in already_processed: already_processed.add('alias') outfile.write(' alias=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.alias), input_name='alias')), )) if self.components is not None and 'components' not in already_processed: already_processed.add('components') outfile.write(' components=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.components), input_name='components')), )) if self.distribution is not None and 'distribution' not in already_processed: already_processed.add('distribution') outfile.write(' distribution=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.distribution), input_name='distribution')), )) if self.imageinclude is not None and 'imageinclude' not in already_processed: already_processed.add('imageinclude') outfile.write(' imageinclude="%s"' % self.gds_format_boolean(self.imageinclude, input_name='imageinclude')) if self.prefer_license is not None and 'prefer_license' not in already_processed: already_processed.add('prefer_license') outfile.write(' prefer-license="%s"' % self.gds_format_boolean(self.prefer_license, input_name='prefer-license')) if self.priority is not None and 'priority' not in already_processed: already_processed.add('priority') outfile.write(' priority="%s"' % self.gds_format_integer(self.priority, input_name='priority')) if self.password is not None and 'password' not in already_processed: already_processed.add('password') outfile.write(' password=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.password), input_name='password')), )) if self.username is not None and 'username' not in already_processed: already_processed.add('username') outfile.write(' username=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.username), input_name='username')), )) def exportChildren(self, outfile, level, namespace_='', name_='repository', fromsubclass_=False, pretty_print=True): super(repository, self).exportChildren(outfile, level, namespace_, name_, True, 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 self.type_ = ' '.join(self.type_.split()) value = find_attr_value_('profiles', node) if value is not None and 'profiles' not in already_processed: already_processed.add('profiles') self.profiles = value value = find_attr_value_('status', node) if value is not None and 'status' not in already_processed: already_processed.add('status') self.status = value self.status = ' '.join(self.status.split()) value = find_attr_value_('alias', node) if value is not None and 'alias' not in already_processed: already_processed.add('alias') self.alias = value value = find_attr_value_('components', node) if value is not None and 'components' not in already_processed: already_processed.add('components') self.components = value value = find_attr_value_('distribution', node) if value is not None and 'distribution' not in already_processed: already_processed.add('distribution') self.distribution = value value = find_attr_value_('imageinclude', node) if value is not None and 'imageinclude' not in already_processed: already_processed.add('imageinclude') if value in ('true', '1'): self.imageinclude = True elif value in ('false', '0'): self.imageinclude = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('prefer-license', node) if value is not None and 'prefer-license' not in already_processed: already_processed.add('prefer-license') if value in ('true', '1'): self.prefer_license = True elif value in ('false', '0'): self.prefer_license = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('priority', node) if value is not None and 'priority' not in already_processed: already_processed.add('priority') try: self.priority = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) value = find_attr_value_('password', node) if value is not None and 'password' not in already_processed: already_processed.add('password') self.password = value value = find_attr_value_('username', node) if value is not None and 'username' not in already_processed: already_processed.add('username') self.username = value super(repository, self).buildAttributes(node, attrs, already_processed) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): super(repository, self).buildChildren(child_, node, nodeName_, True) pass # end class repository class size(GeneratedsSuper): """Specifies the Size of an Image in (M)egabyte or (G)igabyte If the attribute additive is set the value will be added to the required size of the image""" subclass = None superclass = None def __init__(self, unit=None, additive=None, valueOf_=None): self.original_tagname_ = None self.unit = _cast(None, unit) self.additive = _cast(bool, additive) self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, size) if subclass is not None: return subclass(*args_, **kwargs_) if size.subclass: return size.subclass(*args_, **kwargs_) else: return size(*args_, **kwargs_) factory = staticmethod(factory) def get_unit(self): return self.unit def set_unit(self, unit): self.unit = unit def get_additive(self): return self.additive def set_additive(self, additive): self.additive = additive def get_valueOf_(self): return self.valueOf_ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False def export(self, outfile, level, namespace_='', name_='size', namespacedef_='', pretty_print=True): 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_='size') if self.hasContent_(): outfile.write('>') outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) self.exportChildren(outfile, level + 1, namespace_='', name_='size', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='size'): if self.unit is not None and 'unit' not in already_processed: already_processed.add('unit') outfile.write(' unit=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.unit), input_name='unit')), )) if self.additive is not None and 'additive' not in already_processed: already_processed.add('additive') outfile.write(' additive="%s"' % self.gds_format_boolean(self.additive, input_name='additive')) def exportChildren(self, outfile, level, namespace_='', name_='size', fromsubclass_=False, pretty_print=True): pass def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = 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_('unit', node) if value is not None and 'unit' not in already_processed: already_processed.add('unit') self.unit = value self.unit = ' '.join(self.unit.split()) value = find_attr_value_('additive', node) if value is not None and 'additive' not in already_processed: already_processed.add('additive') if value in ('true', '1'): self.additive = True elif value in ('false', '0'): self.additive = False else: raise_parse_error(node, 'Bad boolean attribute') def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class size class source(GeneratedsSuper): """A Pointer to a Repository/Package Source""" subclass = None superclass = None def __init__(self, path=None): self.original_tagname_ = None self.path = _cast(None, path) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, source) if subclass is not None: return subclass(*args_, **kwargs_) if source.subclass: return source.subclass(*args_, **kwargs_) else: return source(*args_, **kwargs_) factory = staticmethod(factory) def get_path(self): return self.path def set_path(self, path): self.path = path def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='source', namespacedef_='', pretty_print=True): 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_='source') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='source', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='source'): if self.path is not None and 'path' not in already_processed: already_processed.add('path') outfile.write(' path=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.path), input_name='path')), )) def exportChildren(self, outfile, level, namespace_='', name_='source', 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_('path', node) if value is not None and 'path' not in already_processed: already_processed.add('path') self.path = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class source class systemdisk(GeneratedsSuper): """Specify volumes and size attributes""" subclass = None superclass = None def __init__(self, name=None, preferlvm=None, volume=None): self.original_tagname_ = None self.name = _cast(None, name) self.preferlvm = _cast(bool, preferlvm) if volume is None: self.volume = [] else: self.volume = volume def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, systemdisk) if subclass is not None: return subclass(*args_, **kwargs_) if systemdisk.subclass: return systemdisk.subclass(*args_, **kwargs_) else: return systemdisk(*args_, **kwargs_) factory = staticmethod(factory) def get_volume(self): return self.volume def set_volume(self, volume): self.volume = volume def add_volume(self, value): self.volume.append(value) def insert_volume_at(self, index, value): self.volume.insert(index, value) def replace_volume_at(self, index, value): self.volume[index] = value def get_name(self): return self.name def set_name(self, name): self.name = name def get_preferlvm(self): return self.preferlvm def set_preferlvm(self, preferlvm): self.preferlvm = preferlvm def hasContent_(self): if ( self.volume ): return True else: return False def export(self, outfile, level, namespace_='', name_='systemdisk', namespacedef_='', pretty_print=True): 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_='systemdisk') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='systemdisk', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='systemdisk'): 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')), )) if self.preferlvm is not None and 'preferlvm' not in already_processed: already_processed.add('preferlvm') outfile.write(' preferlvm="%s"' % self.gds_format_boolean(self.preferlvm, input_name='preferlvm')) def exportChildren(self, outfile, level, namespace_='', name_='systemdisk', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for volume_ in self.volume: volume_.export(outfile, level, namespace_, name_='volume', 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_('name', node) if value is not None and 'name' not in already_processed: already_processed.add('name') self.name = value value = find_attr_value_('preferlvm', node) if value is not None and 'preferlvm' not in already_processed: already_processed.add('preferlvm') if value in ('true', '1'): self.preferlvm = True elif value in ('false', '0'): self.preferlvm = False else: raise_parse_error(node, 'Bad boolean attribute') def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'volume': obj_ = volume.factory() obj_.build(child_) self.volume.append(obj_) obj_.original_tagname_ = 'volume' # end class systemdisk class type_(GeneratedsSuper): """The Image Type of the Logical Extend""" subclass = None superclass = None def __init__(self, boot=None, bootfilesystem=None, firmware=None, bootkernel=None, bootloader=None, bootloader_console=None, zipl_targettype=None, bootpartition=None, bootpartsize=None, bootprofile=None, boottimeout=None, btrfs_root_is_snapshot=None, btrfs_root_is_readonly_snapshot=None, checkprebuilt=None, compressed=None, devicepersistency=None, editbootconfig=None, editbootinstall=None, filesystem=None, flags=None, format=None, formatoptions=None, fsnocheck=None, fsmountoptions=None, gcelicense=None, hybrid=None, hybridpersistent=None, hybridpersistent_filesystem=None, gpt_hybrid_mbr=None, initrd_system=None, image=None, installboot=None, installprovidefailsafe=None, installiso=None, installstick=None, installpxe=None, kernelcmdline=None, luks=None, luksOS=None, mdraid=None, overlayroot=None, primary=None, ramonly=None, rootfs_label=None, target_blocksize=None, target_removable=None, vbootsize=None, vga=None, vhdfixedtag=None, volid=None, wwid_wait_timeout=None, containerconfig=None, machine=None, oemconfig=None, pxedeploy=None, size=None, systemdisk=None, vagrantconfig=None): self.original_tagname_ = None self.boot = _cast(None, boot) self.bootfilesystem = _cast(None, bootfilesystem) self.firmware = _cast(None, firmware) self.bootkernel = _cast(None, bootkernel) self.bootloader = _cast(None, bootloader) self.bootloader_console = _cast(None, bootloader_console) self.zipl_targettype = _cast(None, zipl_targettype) self.bootpartition = _cast(bool, bootpartition) self.bootpartsize = _cast(int, bootpartsize) self.bootprofile = _cast(None, bootprofile) self.boottimeout = _cast(int, boottimeout) self.btrfs_root_is_snapshot = _cast(bool, btrfs_root_is_snapshot) self.btrfs_root_is_readonly_snapshot = _cast(bool, btrfs_root_is_readonly_snapshot) self.checkprebuilt = _cast(bool, checkprebuilt) self.compressed = _cast(bool, compressed) self.devicepersistency = _cast(None, devicepersistency) self.editbootconfig = _cast(None, editbootconfig) self.editbootinstall = _cast(None, editbootinstall) self.filesystem = _cast(None, filesystem) self.flags = _cast(None, flags) self.format = _cast(None, format) self.formatoptions = _cast(None, formatoptions) self.fsnocheck = _cast(bool, fsnocheck) self.fsmountoptions = _cast(None, fsmountoptions) self.gcelicense = _cast(None, gcelicense) self.hybrid = _cast(bool, hybrid) self.hybridpersistent = _cast(bool, hybridpersistent) self.hybridpersistent_filesystem = _cast(None, hybridpersistent_filesystem) self.gpt_hybrid_mbr = _cast(bool, gpt_hybrid_mbr) self.initrd_system = _cast(None, initrd_system) self.image = _cast(None, image) self.installboot = _cast(None, installboot) self.installprovidefailsafe = _cast(bool, installprovidefailsafe) self.installiso = _cast(bool, installiso) self.installstick = _cast(bool, installstick) self.installpxe = _cast(bool, installpxe) self.kernelcmdline = _cast(None, kernelcmdline) self.luks = _cast(None, luks) self.luksOS = _cast(None, luksOS) self.mdraid = _cast(None, mdraid) self.overlayroot = _cast(bool, overlayroot) self.primary = _cast(bool, primary) self.ramonly = _cast(bool, ramonly) self.rootfs_label = _cast(None, rootfs_label) self.target_blocksize = _cast(int, target_blocksize) self.target_removable = _cast(bool, target_removable) self.vbootsize = _cast(int, vbootsize) self.vga = _cast(None, vga) self.vhdfixedtag = _cast(None, vhdfixedtag) self.volid = _cast(None, volid) self.wwid_wait_timeout = _cast(int, wwid_wait_timeout) if containerconfig is None: self.containerconfig = [] else: self.containerconfig = containerconfig if machine is None: self.machine = [] else: self.machine = machine if oemconfig is None: self.oemconfig = [] else: self.oemconfig = oemconfig if pxedeploy is None: self.pxedeploy = [] else: self.pxedeploy = pxedeploy if size is None: self.size = [] else: self.size = size if systemdisk is None: self.systemdisk = [] else: self.systemdisk = systemdisk if vagrantconfig is None: self.vagrantconfig = [] else: self.vagrantconfig = vagrantconfig def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, type_) if subclass is not None: return subclass(*args_, **kwargs_) if type_.subclass: return type_.subclass(*args_, **kwargs_) else: return type_(*args_, **kwargs_) factory = staticmethod(factory) def get_containerconfig(self): return self.containerconfig def set_containerconfig(self, containerconfig): self.containerconfig = containerconfig def add_containerconfig(self, value): self.containerconfig.append(value) def insert_containerconfig_at(self, index, value): self.containerconfig.insert(index, value) def replace_containerconfig_at(self, index, value): self.containerconfig[index] = value def get_machine(self): return self.machine def set_machine(self, machine): self.machine = machine def add_machine(self, value): self.machine.append(value) def insert_machine_at(self, index, value): self.machine.insert(index, value) def replace_machine_at(self, index, value): self.machine[index] = value def get_oemconfig(self): return self.oemconfig def set_oemconfig(self, oemconfig): self.oemconfig = oemconfig def add_oemconfig(self, value): self.oemconfig.append(value) def insert_oemconfig_at(self, index, value): self.oemconfig.insert(index, value) def replace_oemconfig_at(self, index, value): self.oemconfig[index] = value def get_pxedeploy(self): return self.pxedeploy def set_pxedeploy(self, pxedeploy): self.pxedeploy = pxedeploy def add_pxedeploy(self, value): self.pxedeploy.append(value) def insert_pxedeploy_at(self, index, value): self.pxedeploy.insert(index, value) def replace_pxedeploy_at(self, index, value): self.pxedeploy[index] = value def get_size(self): return self.size def set_size(self, size): self.size = size def add_size(self, value): self.size.append(value) def insert_size_at(self, index, value): self.size.insert(index, value) def replace_size_at(self, index, value): self.size[index] = value def get_systemdisk(self): return self.systemdisk def set_systemdisk(self, systemdisk): self.systemdisk = systemdisk def add_systemdisk(self, value): self.systemdisk.append(value) def insert_systemdisk_at(self, index, value): self.systemdisk.insert(index, value) def replace_systemdisk_at(self, index, value): self.systemdisk[index] = value def get_vagrantconfig(self): return self.vagrantconfig def set_vagrantconfig(self, vagrantconfig): self.vagrantconfig = vagrantconfig def add_vagrantconfig(self, value): self.vagrantconfig.append(value) def insert_vagrantconfig_at(self, index, value): self.vagrantconfig.insert(index, value) def replace_vagrantconfig_at(self, index, value): self.vagrantconfig[index] = value def get_boot(self): return self.boot def set_boot(self, boot): self.boot = boot def get_bootfilesystem(self): return self.bootfilesystem def set_bootfilesystem(self, bootfilesystem): self.bootfilesystem = bootfilesystem def get_firmware(self): return self.firmware def set_firmware(self, firmware): self.firmware = firmware def get_bootkernel(self): return self.bootkernel def set_bootkernel(self, bootkernel): self.bootkernel = bootkernel def get_bootloader(self): return self.bootloader def set_bootloader(self, bootloader): self.bootloader = bootloader def get_bootloader_console(self): return self.bootloader_console def set_bootloader_console(self, bootloader_console): self.bootloader_console = bootloader_console def get_zipl_targettype(self): return self.zipl_targettype def set_zipl_targettype(self, zipl_targettype): self.zipl_targettype = zipl_targettype def get_bootpartition(self): return self.bootpartition def set_bootpartition(self, bootpartition): self.bootpartition = bootpartition def get_bootpartsize(self): return self.bootpartsize def set_bootpartsize(self, bootpartsize): self.bootpartsize = bootpartsize def get_bootprofile(self): return self.bootprofile def set_bootprofile(self, bootprofile): self.bootprofile = bootprofile def get_boottimeout(self): return self.boottimeout def set_boottimeout(self, boottimeout): self.boottimeout = boottimeout def get_btrfs_root_is_snapshot(self): return self.btrfs_root_is_snapshot def set_btrfs_root_is_snapshot(self, btrfs_root_is_snapshot): self.btrfs_root_is_snapshot = btrfs_root_is_snapshot def get_btrfs_root_is_readonly_snapshot(self): return self.btrfs_root_is_readonly_snapshot def set_btrfs_root_is_readonly_snapshot(self, btrfs_root_is_readonly_snapshot): self.btrfs_root_is_readonly_snapshot = btrfs_root_is_readonly_snapshot def get_checkprebuilt(self): return self.checkprebuilt def set_checkprebuilt(self, checkprebuilt): self.checkprebuilt = checkprebuilt def get_compressed(self): return self.compressed def set_compressed(self, compressed): self.compressed = compressed def get_devicepersistency(self): return self.devicepersistency def set_devicepersistency(self, devicepersistency): self.devicepersistency = devicepersistency def get_editbootconfig(self): return self.editbootconfig def set_editbootconfig(self, editbootconfig): self.editbootconfig = editbootconfig def get_editbootinstall(self): return self.editbootinstall def set_editbootinstall(self, editbootinstall): self.editbootinstall = editbootinstall def get_filesystem(self): return self.filesystem def set_filesystem(self, filesystem): self.filesystem = filesystem def get_flags(self): return self.flags def set_flags(self, flags): self.flags = flags def get_format(self): return self.format def set_format(self, format): self.format = format def get_formatoptions(self): return self.formatoptions def set_formatoptions(self, formatoptions): self.formatoptions = formatoptions def get_fsnocheck(self): return self.fsnocheck def set_fsnocheck(self, fsnocheck): self.fsnocheck = fsnocheck def get_fsmountoptions(self): return self.fsmountoptions def set_fsmountoptions(self, fsmountoptions): self.fsmountoptions = fsmountoptions def get_gcelicense(self): return self.gcelicense def set_gcelicense(self, gcelicense): self.gcelicense = gcelicense def get_hybrid(self): return self.hybrid def set_hybrid(self, hybrid): self.hybrid = hybrid def get_hybridpersistent(self): return self.hybridpersistent def set_hybridpersistent(self, hybridpersistent): self.hybridpersistent = hybridpersistent def get_hybridpersistent_filesystem(self): return self.hybridpersistent_filesystem def set_hybridpersistent_filesystem(self, hybridpersistent_filesystem): self.hybridpersistent_filesystem = hybridpersistent_filesystem def get_gpt_hybrid_mbr(self): return self.gpt_hybrid_mbr def set_gpt_hybrid_mbr(self, gpt_hybrid_mbr): self.gpt_hybrid_mbr = gpt_hybrid_mbr def get_initrd_system(self): return self.initrd_system def set_initrd_system(self, initrd_system): self.initrd_system = initrd_system def get_image(self): return self.image def set_image(self, image): self.image = image def get_installboot(self): return self.installboot def set_installboot(self, installboot): self.installboot = installboot def get_installprovidefailsafe(self): return self.installprovidefailsafe def set_installprovidefailsafe(self, installprovidefailsafe): self.installprovidefailsafe = installprovidefailsafe def get_installiso(self): return self.installiso def set_installiso(self, installiso): self.installiso = installiso def get_installstick(self): return self.installstick def set_installstick(self, installstick): self.installstick = installstick def get_installpxe(self): return self.installpxe def set_installpxe(self, installpxe): self.installpxe = installpxe def get_kernelcmdline(self): return self.kernelcmdline def set_kernelcmdline(self, kernelcmdline): self.kernelcmdline = kernelcmdline def get_luks(self): return self.luks def set_luks(self, luks): self.luks = luks def get_luksOS(self): return self.luksOS def set_luksOS(self, luksOS): self.luksOS = luksOS def get_mdraid(self): return self.mdraid def set_mdraid(self, mdraid): self.mdraid = mdraid def get_overlayroot(self): return self.overlayroot def set_overlayroot(self, overlayroot): self.overlayroot = overlayroot def get_primary(self): return self.primary def set_primary(self, primary): self.primary = primary def get_ramonly(self): return self.ramonly def set_ramonly(self, ramonly): self.ramonly = ramonly def get_rootfs_label(self): return self.rootfs_label def set_rootfs_label(self, rootfs_label): self.rootfs_label = rootfs_label def get_target_blocksize(self): return self.target_blocksize def set_target_blocksize(self, target_blocksize): self.target_blocksize = target_blocksize def get_target_removable(self): return self.target_removable def set_target_removable(self, target_removable): self.target_removable = target_removable def get_vbootsize(self): return self.vbootsize def set_vbootsize(self, vbootsize): self.vbootsize = vbootsize def get_vga(self): return self.vga def set_vga(self, vga): self.vga = vga def get_vhdfixedtag(self): return self.vhdfixedtag def set_vhdfixedtag(self, vhdfixedtag): self.vhdfixedtag = vhdfixedtag def get_volid(self): return self.volid def set_volid(self, volid): self.volid = volid def get_wwid_wait_timeout(self): return self.wwid_wait_timeout def set_wwid_wait_timeout(self, wwid_wait_timeout): self.wwid_wait_timeout = wwid_wait_timeout def validate_vhd_tag_type(self, value): # Validate type vhd-tag-type, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_vhd_tag_type_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_vhd_tag_type_patterns_, )) validate_vhd_tag_type_patterns_ = [['^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$']] def hasContent_(self): if ( self.containerconfig or self.machine or self.oemconfig or self.pxedeploy or self.size or self.systemdisk or self.vagrantconfig ): return True else: return False def export(self, outfile, level, namespace_='', name_='type', namespacedef_='', pretty_print=True): 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_='type') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='type', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='type'): if self.boot is not None and 'boot' not in already_processed: already_processed.add('boot') outfile.write(' boot=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.boot), input_name='boot')), )) if self.bootfilesystem is not None and 'bootfilesystem' not in already_processed: already_processed.add('bootfilesystem') outfile.write(' bootfilesystem=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.bootfilesystem), input_name='bootfilesystem')), )) if self.firmware is not None and 'firmware' not in already_processed: already_processed.add('firmware') outfile.write(' firmware=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.firmware), input_name='firmware')), )) if self.bootkernel is not None and 'bootkernel' not in already_processed: already_processed.add('bootkernel') outfile.write(' bootkernel=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.bootkernel), input_name='bootkernel')), )) if self.bootloader is not None and 'bootloader' not in already_processed: already_processed.add('bootloader') outfile.write(' bootloader=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.bootloader), input_name='bootloader')), )) if self.bootloader_console is not None and 'bootloader_console' not in already_processed: already_processed.add('bootloader_console') outfile.write(' bootloader_console=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.bootloader_console), input_name='bootloader_console')), )) if self.zipl_targettype is not None and 'zipl_targettype' not in already_processed: already_processed.add('zipl_targettype') outfile.write(' zipl_targettype=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.zipl_targettype), input_name='zipl_targettype')), )) if self.bootpartition is not None and 'bootpartition' not in already_processed: already_processed.add('bootpartition') outfile.write(' bootpartition="%s"' % self.gds_format_boolean(self.bootpartition, input_name='bootpartition')) if self.bootpartsize is not None and 'bootpartsize' not in already_processed: already_processed.add('bootpartsize') outfile.write(' bootpartsize="%s"' % self.gds_format_integer(self.bootpartsize, input_name='bootpartsize')) if self.bootprofile is not None and 'bootprofile' not in already_processed: already_processed.add('bootprofile') outfile.write(' bootprofile=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.bootprofile), input_name='bootprofile')), )) if self.boottimeout is not None and 'boottimeout' not in already_processed: already_processed.add('boottimeout') outfile.write(' boottimeout="%s"' % self.gds_format_integer(self.boottimeout, input_name='boottimeout')) if self.btrfs_root_is_snapshot is not None and 'btrfs_root_is_snapshot' not in already_processed: already_processed.add('btrfs_root_is_snapshot') outfile.write(' btrfs_root_is_snapshot="%s"' % self.gds_format_boolean(self.btrfs_root_is_snapshot, input_name='btrfs_root_is_snapshot')) if self.btrfs_root_is_readonly_snapshot is not None and 'btrfs_root_is_readonly_snapshot' not in already_processed: already_processed.add('btrfs_root_is_readonly_snapshot') outfile.write(' btrfs_root_is_readonly_snapshot="%s"' % self.gds_format_boolean(self.btrfs_root_is_readonly_snapshot, input_name='btrfs_root_is_readonly_snapshot')) if self.checkprebuilt is not None and 'checkprebuilt' not in already_processed: already_processed.add('checkprebuilt') outfile.write(' checkprebuilt="%s"' % self.gds_format_boolean(self.checkprebuilt, input_name='checkprebuilt')) if self.compressed is not None and 'compressed' not in already_processed: already_processed.add('compressed') outfile.write(' compressed="%s"' % self.gds_format_boolean(self.compressed, input_name='compressed')) if self.devicepersistency is not None and 'devicepersistency' not in already_processed: already_processed.add('devicepersistency') outfile.write(' devicepersistency=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.devicepersistency), input_name='devicepersistency')), )) if self.editbootconfig is not None and 'editbootconfig' not in already_processed: already_processed.add('editbootconfig') outfile.write(' editbootconfig=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.editbootconfig), input_name='editbootconfig')), )) if self.editbootinstall is not None and 'editbootinstall' not in already_processed: already_processed.add('editbootinstall') outfile.write(' editbootinstall=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.editbootinstall), input_name='editbootinstall')), )) if self.filesystem is not None and 'filesystem' not in already_processed: already_processed.add('filesystem') outfile.write(' filesystem=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.filesystem), input_name='filesystem')), )) if self.flags is not None and 'flags' not in already_processed: already_processed.add('flags') outfile.write(' flags=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.flags), input_name='flags')), )) if self.format is not None and 'format' not in already_processed: already_processed.add('format') outfile.write(' format=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.format), input_name='format')), )) if self.formatoptions is not None and 'formatoptions' not in already_processed: already_processed.add('formatoptions') outfile.write(' formatoptions=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.formatoptions), input_name='formatoptions')), )) if self.fsnocheck is not None and 'fsnocheck' not in already_processed: already_processed.add('fsnocheck') outfile.write(' fsnocheck="%s"' % self.gds_format_boolean(self.fsnocheck, input_name='fsnocheck')) if self.fsmountoptions is not None and 'fsmountoptions' not in already_processed: already_processed.add('fsmountoptions') outfile.write(' fsmountoptions=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.fsmountoptions), input_name='fsmountoptions')), )) if self.gcelicense is not None and 'gcelicense' not in already_processed: already_processed.add('gcelicense') outfile.write(' gcelicense=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.gcelicense), input_name='gcelicense')), )) if self.hybrid is not None and 'hybrid' not in already_processed: already_processed.add('hybrid') outfile.write(' hybrid="%s"' % self.gds_format_boolean(self.hybrid, input_name='hybrid')) if self.hybridpersistent is not None and 'hybridpersistent' not in already_processed: already_processed.add('hybridpersistent') outfile.write(' hybridpersistent="%s"' % self.gds_format_boolean(self.hybridpersistent, input_name='hybridpersistent')) if self.hybridpersistent_filesystem is not None and 'hybridpersistent_filesystem' not in already_processed: already_processed.add('hybridpersistent_filesystem') outfile.write(' hybridpersistent_filesystem=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.hybridpersistent_filesystem), input_name='hybridpersistent_filesystem')), )) if self.gpt_hybrid_mbr is not None and 'gpt_hybrid_mbr' not in already_processed: already_processed.add('gpt_hybrid_mbr') outfile.write(' gpt_hybrid_mbr="%s"' % self.gds_format_boolean(self.gpt_hybrid_mbr, input_name='gpt_hybrid_mbr')) if self.initrd_system is not None and 'initrd_system' not in already_processed: already_processed.add('initrd_system') outfile.write(' initrd_system=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.initrd_system), input_name='initrd_system')), )) if self.image is not None and 'image' not in already_processed: already_processed.add('image') outfile.write(' image=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.image), input_name='image')), )) if self.installboot is not None and 'installboot' not in already_processed: already_processed.add('installboot') outfile.write(' installboot=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.installboot), input_name='installboot')), )) if self.installprovidefailsafe is not None and 'installprovidefailsafe' not in already_processed: already_processed.add('installprovidefailsafe') outfile.write(' installprovidefailsafe="%s"' % self.gds_format_boolean(self.installprovidefailsafe, input_name='installprovidefailsafe')) if self.installiso is not None and 'installiso' not in already_processed: already_processed.add('installiso') outfile.write(' installiso="%s"' % self.gds_format_boolean(self.installiso, input_name='installiso')) if self.installstick is not None and 'installstick' not in already_processed: already_processed.add('installstick') outfile.write(' installstick="%s"' % self.gds_format_boolean(self.installstick, input_name='installstick')) if self.installpxe is not None and 'installpxe' not in already_processed: already_processed.add('installpxe') outfile.write(' installpxe="%s"' % self.gds_format_boolean(self.installpxe, input_name='installpxe')) if self.kernelcmdline is not None and 'kernelcmdline' not in already_processed: already_processed.add('kernelcmdline') outfile.write(' kernelcmdline=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.kernelcmdline), input_name='kernelcmdline')), )) if self.luks is not None and 'luks' not in already_processed: already_processed.add('luks') outfile.write(' luks=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.luks), input_name='luks')), )) if self.luksOS is not None and 'luksOS' not in already_processed: already_processed.add('luksOS') outfile.write(' luksOS=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.luksOS), input_name='luksOS')), )) if self.mdraid is not None and 'mdraid' not in already_processed: already_processed.add('mdraid') outfile.write(' mdraid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.mdraid), input_name='mdraid')), )) if self.overlayroot is not None and 'overlayroot' not in already_processed: already_processed.add('overlayroot') outfile.write(' overlayroot="%s"' % self.gds_format_boolean(self.overlayroot, input_name='overlayroot')) if self.primary is not None and 'primary' not in already_processed: already_processed.add('primary') outfile.write(' primary="%s"' % self.gds_format_boolean(self.primary, input_name='primary')) if self.ramonly is not None and 'ramonly' not in already_processed: already_processed.add('ramonly') outfile.write(' ramonly="%s"' % self.gds_format_boolean(self.ramonly, input_name='ramonly')) if self.rootfs_label is not None and 'rootfs_label' not in already_processed: already_processed.add('rootfs_label') outfile.write(' rootfs_label=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.rootfs_label), input_name='rootfs_label')), )) if self.target_blocksize is not None and 'target_blocksize' not in already_processed: already_processed.add('target_blocksize') outfile.write(' target_blocksize="%s"' % self.gds_format_integer(self.target_blocksize, input_name='target_blocksize')) if self.target_removable is not None and 'target_removable' not in already_processed: already_processed.add('target_removable') outfile.write(' target_removable="%s"' % self.gds_format_boolean(self.target_removable, input_name='target_removable')) if self.vbootsize is not None and 'vbootsize' not in already_processed: already_processed.add('vbootsize') outfile.write(' vbootsize="%s"' % self.gds_format_integer(self.vbootsize, input_name='vbootsize')) if self.vga is not None and 'vga' not in already_processed: already_processed.add('vga') outfile.write(' vga=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.vga), input_name='vga')), )) if self.vhdfixedtag is not None and 'vhdfixedtag' not in already_processed: already_processed.add('vhdfixedtag') outfile.write(' vhdfixedtag=%s' % (quote_attrib(self.vhdfixedtag), )) if self.volid is not None and 'volid' not in already_processed: already_processed.add('volid') outfile.write(' volid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.volid), input_name='volid')), )) if self.wwid_wait_timeout is not None and 'wwid_wait_timeout' not in already_processed: already_processed.add('wwid_wait_timeout') outfile.write(' wwid_wait_timeout="%s"' % self.gds_format_integer(self.wwid_wait_timeout, input_name='wwid_wait_timeout')) def exportChildren(self, outfile, level, namespace_='', name_='type', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for containerconfig_ in self.containerconfig: containerconfig_.export(outfile, level, namespace_, name_='containerconfig', pretty_print=pretty_print) for machine_ in self.machine: machine_.export(outfile, level, namespace_, name_='machine', pretty_print=pretty_print) for oemconfig_ in self.oemconfig: oemconfig_.export(outfile, level, namespace_, name_='oemconfig', pretty_print=pretty_print) for pxedeploy_ in self.pxedeploy: pxedeploy_.export(outfile, level, namespace_, name_='pxedeploy', pretty_print=pretty_print) for size_ in self.size: size_.export(outfile, level, namespace_, name_='size', pretty_print=pretty_print) for systemdisk_ in self.systemdisk: systemdisk_.export(outfile, level, namespace_, name_='systemdisk', pretty_print=pretty_print) for vagrantconfig_ in self.vagrantconfig: vagrantconfig_.export(outfile, level, namespace_, name_='vagrantconfig', 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_('boot', node) if value is not None and 'boot' not in already_processed: already_processed.add('boot') self.boot = value value = find_attr_value_('bootfilesystem', node) if value is not None and 'bootfilesystem' not in already_processed: already_processed.add('bootfilesystem') self.bootfilesystem = value self.bootfilesystem = ' '.join(self.bootfilesystem.split()) value = find_attr_value_('firmware', node) if value is not None and 'firmware' not in already_processed: already_processed.add('firmware') self.firmware = value self.firmware = ' '.join(self.firmware.split()) value = find_attr_value_('bootkernel', node) if value is not None and 'bootkernel' not in already_processed: already_processed.add('bootkernel') self.bootkernel = value value = find_attr_value_('bootloader', node) if value is not None and 'bootloader' not in already_processed: already_processed.add('bootloader') self.bootloader = value self.bootloader = ' '.join(self.bootloader.split()) value = find_attr_value_('bootloader_console', node) if value is not None and 'bootloader_console' not in already_processed: already_processed.add('bootloader_console') self.bootloader_console = value self.bootloader_console = ' '.join(self.bootloader_console.split()) value = find_attr_value_('zipl_targettype', node) if value is not None and 'zipl_targettype' not in already_processed: already_processed.add('zipl_targettype') self.zipl_targettype = value self.zipl_targettype = ' '.join(self.zipl_targettype.split()) value = find_attr_value_('bootpartition', node) if value is not None and 'bootpartition' not in already_processed: already_processed.add('bootpartition') if value in ('true', '1'): self.bootpartition = True elif value in ('false', '0'): self.bootpartition = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('bootpartsize', node) if value is not None and 'bootpartsize' not in already_processed: already_processed.add('bootpartsize') try: self.bootpartsize = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.bootpartsize < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') value = find_attr_value_('bootprofile', node) if value is not None and 'bootprofile' not in already_processed: already_processed.add('bootprofile') self.bootprofile = value value = find_attr_value_('boottimeout', node) if value is not None and 'boottimeout' not in already_processed: already_processed.add('boottimeout') try: self.boottimeout = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.boottimeout < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') value = find_attr_value_('btrfs_root_is_snapshot', node) if value is not None and 'btrfs_root_is_snapshot' not in already_processed: already_processed.add('btrfs_root_is_snapshot') if value in ('true', '1'): self.btrfs_root_is_snapshot = True elif value in ('false', '0'): self.btrfs_root_is_snapshot = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('btrfs_root_is_readonly_snapshot', node) if value is not None and 'btrfs_root_is_readonly_snapshot' not in already_processed: already_processed.add('btrfs_root_is_readonly_snapshot') if value in ('true', '1'): self.btrfs_root_is_readonly_snapshot = True elif value in ('false', '0'): self.btrfs_root_is_readonly_snapshot = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('checkprebuilt', node) if value is not None and 'checkprebuilt' not in already_processed: already_processed.add('checkprebuilt') if value in ('true', '1'): self.checkprebuilt = True elif value in ('false', '0'): self.checkprebuilt = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('compressed', node) if value is not None and 'compressed' not in already_processed: already_processed.add('compressed') if value in ('true', '1'): self.compressed = True elif value in ('false', '0'): self.compressed = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('devicepersistency', node) if value is not None and 'devicepersistency' not in already_processed: already_processed.add('devicepersistency') self.devicepersistency = value self.devicepersistency = ' '.join(self.devicepersistency.split()) value = find_attr_value_('editbootconfig', node) if value is not None and 'editbootconfig' not in already_processed: already_processed.add('editbootconfig') self.editbootconfig = value value = find_attr_value_('editbootinstall', node) if value is not None and 'editbootinstall' not in already_processed: already_processed.add('editbootinstall') self.editbootinstall = value value = find_attr_value_('filesystem', node) if value is not None and 'filesystem' not in already_processed: already_processed.add('filesystem') self.filesystem = value self.filesystem = ' '.join(self.filesystem.split()) value = find_attr_value_('flags', node) if value is not None and 'flags' not in already_processed: already_processed.add('flags') self.flags = value self.flags = ' '.join(self.flags.split()) value = find_attr_value_('format', node) if value is not None and 'format' not in already_processed: already_processed.add('format') self.format = value self.format = ' '.join(self.format.split()) value = find_attr_value_('formatoptions', node) if value is not None and 'formatoptions' not in already_processed: already_processed.add('formatoptions') self.formatoptions = value value = find_attr_value_('fsnocheck', node) if value is not None and 'fsnocheck' not in already_processed: already_processed.add('fsnocheck') if value in ('true', '1'): self.fsnocheck = True elif value in ('false', '0'): self.fsnocheck = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('fsmountoptions', node) if value is not None and 'fsmountoptions' not in already_processed: already_processed.add('fsmountoptions') self.fsmountoptions = value value = find_attr_value_('gcelicense', node) if value is not None and 'gcelicense' not in already_processed: already_processed.add('gcelicense') self.gcelicense = value value = find_attr_value_('hybrid', node) if value is not None and 'hybrid' not in already_processed: already_processed.add('hybrid') if value in ('true', '1'): self.hybrid = True elif value in ('false', '0'): self.hybrid = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('hybridpersistent', node) if value is not None and 'hybridpersistent' not in already_processed: already_processed.add('hybridpersistent') if value in ('true', '1'): self.hybridpersistent = True elif value in ('false', '0'): self.hybridpersistent = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('hybridpersistent_filesystem', node) if value is not None and 'hybridpersistent_filesystem' not in already_processed: already_processed.add('hybridpersistent_filesystem') self.hybridpersistent_filesystem = value self.hybridpersistent_filesystem = ' '.join(self.hybridpersistent_filesystem.split()) value = find_attr_value_('gpt_hybrid_mbr', node) if value is not None and 'gpt_hybrid_mbr' not in already_processed: already_processed.add('gpt_hybrid_mbr') if value in ('true', '1'): self.gpt_hybrid_mbr = True elif value in ('false', '0'): self.gpt_hybrid_mbr = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('initrd_system', node) if value is not None and 'initrd_system' not in already_processed: already_processed.add('initrd_system') self.initrd_system = value self.initrd_system = ' '.join(self.initrd_system.split()) value = find_attr_value_('image', node) if value is not None and 'image' not in already_processed: already_processed.add('image') self.image = value self.image = ' '.join(self.image.split()) value = find_attr_value_('installboot', node) if value is not None and 'installboot' not in already_processed: already_processed.add('installboot') self.installboot = value self.installboot = ' '.join(self.installboot.split()) value = find_attr_value_('installprovidefailsafe', node) if value is not None and 'installprovidefailsafe' not in already_processed: already_processed.add('installprovidefailsafe') if value in ('true', '1'): self.installprovidefailsafe = True elif value in ('false', '0'): self.installprovidefailsafe = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('installiso', node) if value is not None and 'installiso' not in already_processed: already_processed.add('installiso') if value in ('true', '1'): self.installiso = True elif value in ('false', '0'): self.installiso = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('installstick', node) if value is not None and 'installstick' not in already_processed: already_processed.add('installstick') if value in ('true', '1'): self.installstick = True elif value in ('false', '0'): self.installstick = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('installpxe', node) if value is not None and 'installpxe' not in already_processed: already_processed.add('installpxe') if value in ('true', '1'): self.installpxe = True elif value in ('false', '0'): self.installpxe = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('kernelcmdline', node) if value is not None and 'kernelcmdline' not in already_processed: already_processed.add('kernelcmdline') self.kernelcmdline = value value = find_attr_value_('luks', node) if value is not None and 'luks' not in already_processed: already_processed.add('luks') self.luks = value value = find_attr_value_('luksOS', node) if value is not None and 'luksOS' not in already_processed: already_processed.add('luksOS') self.luksOS = value self.luksOS = ' '.join(self.luksOS.split()) value = find_attr_value_('mdraid', node) if value is not None and 'mdraid' not in already_processed: already_processed.add('mdraid') self.mdraid = value self.mdraid = ' '.join(self.mdraid.split()) value = find_attr_value_('overlayroot', node) if value is not None and 'overlayroot' not in already_processed: already_processed.add('overlayroot') if value in ('true', '1'): self.overlayroot = True elif value in ('false', '0'): self.overlayroot = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('primary', node) if value is not None and 'primary' not in already_processed: already_processed.add('primary') if value in ('true', '1'): self.primary = True elif value in ('false', '0'): self.primary = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('ramonly', node) if value is not None and 'ramonly' not in already_processed: already_processed.add('ramonly') if value in ('true', '1'): self.ramonly = True elif value in ('false', '0'): self.ramonly = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('rootfs_label', node) if value is not None and 'rootfs_label' not in already_processed: already_processed.add('rootfs_label') self.rootfs_label = value value = find_attr_value_('target_blocksize', node) if value is not None and 'target_blocksize' not in already_processed: already_processed.add('target_blocksize') try: self.target_blocksize = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.target_blocksize < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') value = find_attr_value_('target_removable', node) if value is not None and 'target_removable' not in already_processed: already_processed.add('target_removable') if value in ('true', '1'): self.target_removable = True elif value in ('false', '0'): self.target_removable = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('vbootsize', node) if value is not None and 'vbootsize' not in already_processed: already_processed.add('vbootsize') try: self.vbootsize = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.vbootsize < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') value = find_attr_value_('vga', node) if value is not None and 'vga' not in already_processed: already_processed.add('vga') self.vga = value value = find_attr_value_('vhdfixedtag', node) if value is not None and 'vhdfixedtag' not in already_processed: already_processed.add('vhdfixedtag') self.vhdfixedtag = value self.vhdfixedtag = ' '.join(self.vhdfixedtag.split()) self.validate_vhd_tag_type(self.vhdfixedtag) # validate type vhd-tag-type value = find_attr_value_('volid', node) if value is not None and 'volid' not in already_processed: already_processed.add('volid') self.volid = value value = find_attr_value_('wwid_wait_timeout', node) if value is not None and 'wwid_wait_timeout' not in already_processed: already_processed.add('wwid_wait_timeout') try: self.wwid_wait_timeout = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.wwid_wait_timeout < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'containerconfig': obj_ = containerconfig.factory() obj_.build(child_) self.containerconfig.append(obj_) obj_.original_tagname_ = 'containerconfig' elif nodeName_ == 'machine': obj_ = machine.factory() obj_.build(child_) self.machine.append(obj_) obj_.original_tagname_ = 'machine' elif nodeName_ == 'oemconfig': obj_ = oemconfig.factory() obj_.build(child_) self.oemconfig.append(obj_) obj_.original_tagname_ = 'oemconfig' elif nodeName_ == 'pxedeploy': obj_ = pxedeploy.factory() obj_.build(child_) self.pxedeploy.append(obj_) obj_.original_tagname_ = 'pxedeploy' elif nodeName_ == 'size': obj_ = size.factory() obj_.build(child_) self.size.append(obj_) obj_.original_tagname_ = 'size' elif nodeName_ == 'systemdisk': obj_ = systemdisk.factory() obj_.build(child_) self.systemdisk.append(obj_) obj_.original_tagname_ = 'systemdisk' elif nodeName_ == 'vagrantconfig': obj_ = vagrantconfig.factory() obj_.build(child_) self.vagrantconfig.append(obj_) obj_.original_tagname_ = 'vagrantconfig' # end class type_ class union(GeneratedsSuper): """Specifies the Overlay Filesystem""" subclass = None superclass = None def __init__(self, ro=None, rw=None, type_=None): self.original_tagname_ = None self.ro = _cast(None, ro) self.rw = _cast(None, rw) self.type_ = _cast(None, type_) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, union) if subclass is not None: return subclass(*args_, **kwargs_) if union.subclass: return union.subclass(*args_, **kwargs_) else: return union(*args_, **kwargs_) factory = staticmethod(factory) def get_ro(self): return self.ro def set_ro(self, ro): self.ro = ro def get_rw(self): return self.rw def set_rw(self, rw): self.rw = rw def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='union', namespacedef_='', pretty_print=True): 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_='union') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='union', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='union'): if self.ro is not None and 'ro' not in already_processed: already_processed.add('ro') outfile.write(' ro=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ro), input_name='ro')), )) if self.rw is not None and 'rw' not in already_processed: already_processed.add('rw') outfile.write(' rw=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.rw), input_name='rw')), )) 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_='union', 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_('ro', node) if value is not None and 'ro' not in already_processed: already_processed.add('ro') self.ro = value value = find_attr_value_('rw', node) if value is not None and 'rw' not in already_processed: already_processed.add('rw') self.rw = 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 self.type_ = ' '.join(self.type_.split()) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class union class user(GeneratedsSuper): """A User with Name, Password, Path to Its Home And Shell""" subclass = None superclass = None def __init__(self, groups=None, home=None, id=None, name=None, password=None, pwdformat=None, realname=None, shell=None): self.original_tagname_ = None self.groups = _cast(None, groups) self.home = _cast(None, home) self.id = _cast(int, id) self.name = _cast(None, name) self.password = _cast(None, password) self.pwdformat = _cast(None, pwdformat) self.realname = _cast(None, realname) self.shell = _cast(None, shell) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, user) if subclass is not None: return subclass(*args_, **kwargs_) if user.subclass: return user.subclass(*args_, **kwargs_) else: return user(*args_, **kwargs_) factory = staticmethod(factory) def get_groups(self): return self.groups def set_groups(self, groups): self.groups = groups def get_home(self): return self.home def set_home(self, home): self.home = home def get_id(self): return self.id def set_id(self, id): self.id = id def get_name(self): return self.name def set_name(self, name): self.name = name def get_password(self): return self.password def set_password(self, password): self.password = password def get_pwdformat(self): return self.pwdformat def set_pwdformat(self, pwdformat): self.pwdformat = pwdformat def get_realname(self): return self.realname def set_realname(self, realname): self.realname = realname def get_shell(self): return self.shell def set_shell(self, shell): self.shell = shell def validate_groups_list(self, value): # Validate type groups-list, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_groups_list_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_groups_list_patterns_, )) validate_groups_list_patterns_ = [['^[a-zA-Z0-9_\\-\\.]+(,[a-zA-Z0-9_\\-\\.]+)*$']] def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='user', namespacedef_='', pretty_print=True): 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_='user') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='user', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='user'): if self.groups is not None and 'groups' not in already_processed: already_processed.add('groups') outfile.write(' groups=%s' % (quote_attrib(self.groups), )) if self.home is not None and 'home' not in already_processed: already_processed.add('home') outfile.write(' home=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.home), input_name='home')), )) if self.id is not None and 'id' not in already_processed: already_processed.add('id') outfile.write(' id="%s"' % self.gds_format_integer(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')), )) if self.password is not None and 'password' not in already_processed: already_processed.add('password') outfile.write(' password=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.password), input_name='password')), )) if self.pwdformat is not None and 'pwdformat' not in already_processed: already_processed.add('pwdformat') outfile.write(' pwdformat=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.pwdformat), input_name='pwdformat')), )) if self.realname is not None and 'realname' not in already_processed: already_processed.add('realname') outfile.write(' realname=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.realname), input_name='realname')), )) if self.shell is not None and 'shell' not in already_processed: already_processed.add('shell') outfile.write(' shell=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.shell), input_name='shell')), )) def exportChildren(self, outfile, level, namespace_='', name_='user', 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_('groups', node) if value is not None and 'groups' not in already_processed: already_processed.add('groups') self.groups = value self.groups = ' '.join(self.groups.split()) self.validate_groups_list(self.groups) # validate type groups-list value = find_attr_value_('home', node) if value is not None and 'home' not in already_processed: already_processed.add('home') self.home = value value = find_attr_value_('id', node) if value is not None and 'id' not in already_processed: already_processed.add('id') try: self.id = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.id < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') value = find_attr_value_('name', node) if value is not None and 'name' not in already_processed: already_processed.add('name') self.name = value value = find_attr_value_('password', node) if value is not None and 'password' not in already_processed: already_processed.add('password') self.password = value value = find_attr_value_('pwdformat', node) if value is not None and 'pwdformat' not in already_processed: already_processed.add('pwdformat') self.pwdformat = value self.pwdformat = ' '.join(self.pwdformat.split()) value = find_attr_value_('realname', node) if value is not None and 'realname' not in already_processed: already_processed.add('realname') self.realname = value value = find_attr_value_('shell', node) if value is not None and 'shell' not in already_processed: already_processed.add('shell') self.shell = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class user class vmdisk(GeneratedsSuper): """The VM disk definition.""" subclass = None superclass = None def __init__(self, disktype=None, controller=None, id=None, device=None, diskmode=None): self.original_tagname_ = None self.disktype = _cast(None, disktype) self.controller = _cast(None, controller) self.id = _cast(int, id) self.device = _cast(None, device) self.diskmode = _cast(None, diskmode) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, vmdisk) if subclass is not None: return subclass(*args_, **kwargs_) if vmdisk.subclass: return vmdisk.subclass(*args_, **kwargs_) else: return vmdisk(*args_, **kwargs_) factory = staticmethod(factory) def get_disktype(self): return self.disktype def set_disktype(self, disktype): self.disktype = disktype def get_controller(self): return self.controller def set_controller(self, controller): self.controller = controller def get_id(self): return self.id def set_id(self, id): self.id = id def get_device(self): return self.device def set_device(self, device): self.device = device def get_diskmode(self): return self.diskmode def set_diskmode(self, diskmode): self.diskmode = diskmode def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='vmdisk', namespacedef_='', pretty_print=True): 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_='vmdisk') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='vmdisk', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='vmdisk'): if self.disktype is not None and 'disktype' not in already_processed: already_processed.add('disktype') outfile.write(' disktype=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.disktype), input_name='disktype')), )) if self.controller is not None and 'controller' not in already_processed: already_processed.add('controller') outfile.write(' controller=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.controller), input_name='controller')), )) if self.id is not None and 'id' not in already_processed: already_processed.add('id') outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id')) if self.device is not None and 'device' not in already_processed: already_processed.add('device') outfile.write(' device=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.device), input_name='device')), )) if self.diskmode is not None and 'diskmode' not in already_processed: already_processed.add('diskmode') outfile.write(' diskmode=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.diskmode), input_name='diskmode')), )) def exportChildren(self, outfile, level, namespace_='', name_='vmdisk', 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_('disktype', node) if value is not None and 'disktype' not in already_processed: already_processed.add('disktype') self.disktype = value value = find_attr_value_('controller', node) if value is not None and 'controller' not in already_processed: already_processed.add('controller') self.controller = value self.controller = ' '.join(self.controller.split()) value = find_attr_value_('id', node) if value is not None and 'id' not in already_processed: already_processed.add('id') try: self.id = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.id < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') value = find_attr_value_('device', node) if value is not None and 'device' not in already_processed: already_processed.add('device') self.device = value value = find_attr_value_('diskmode', node) if value is not None and 'diskmode' not in already_processed: already_processed.add('diskmode') self.diskmode = value self.diskmode = ' '.join(self.diskmode.split()) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class vmdisk class vmdvd(GeneratedsSuper): """The VM CD/DVD drive definition. You can setup either a scsi CD or an ide CD drive""" subclass = None superclass = None def __init__(self, controller=None, id=None): self.original_tagname_ = None self.controller = _cast(None, controller) self.id = _cast(int, id) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, vmdvd) if subclass is not None: return subclass(*args_, **kwargs_) if vmdvd.subclass: return vmdvd.subclass(*args_, **kwargs_) else: return vmdvd(*args_, **kwargs_) factory = staticmethod(factory) def get_controller(self): return self.controller def set_controller(self, controller): self.controller = controller def get_id(self): return self.id def set_id(self, id): self.id = id def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='vmdvd', namespacedef_='', pretty_print=True): 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_='vmdvd') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='vmdvd', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='vmdvd'): if self.controller is not None and 'controller' not in already_processed: already_processed.add('controller') outfile.write(' controller=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.controller), input_name='controller')), )) if self.id is not None and 'id' not in already_processed: already_processed.add('id') outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id')) def exportChildren(self, outfile, level, namespace_='', name_='vmdvd', 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_('controller', node) if value is not None and 'controller' not in already_processed: already_processed.add('controller') self.controller = value self.controller = ' '.join(self.controller.split()) value = find_attr_value_('id', node) if value is not None and 'id' not in already_processed: already_processed.add('id') try: self.id = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.id < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class vmdvd class vmnic(GeneratedsSuper): """The VM network interface definition""" subclass = None superclass = None def __init__(self, driver=None, interface=None, mode=None, mac=None): self.original_tagname_ = None self.driver = _cast(None, driver) self.interface = _cast(None, interface) self.mode = _cast(None, mode) self.mac = _cast(None, mac) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, vmnic) if subclass is not None: return subclass(*args_, **kwargs_) if vmnic.subclass: return vmnic.subclass(*args_, **kwargs_) else: return vmnic(*args_, **kwargs_) factory = staticmethod(factory) def get_driver(self): return self.driver def set_driver(self, driver): self.driver = driver def get_interface(self): return self.interface def set_interface(self, interface): self.interface = interface def get_mode(self): return self.mode def set_mode(self, mode): self.mode = mode def get_mac(self): return self.mac def set_mac(self, mac): self.mac = mac def validate_mac_address_type(self, value): # Validate type mac-address-type, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_mac_address_type_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_mac_address_type_patterns_, )) validate_mac_address_type_patterns_ = [['^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$']] def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='vmnic', namespacedef_='', pretty_print=True): 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_='vmnic') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='vmnic', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='vmnic'): if self.driver is not None and 'driver' not in already_processed: already_processed.add('driver') outfile.write(' driver=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.driver), input_name='driver')), )) if self.interface is not None and 'interface' not in already_processed: already_processed.add('interface') outfile.write(' interface=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.interface), input_name='interface')), )) if self.mode is not None and 'mode' not in already_processed: already_processed.add('mode') outfile.write(' mode=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.mode), input_name='mode')), )) if self.mac is not None and 'mac' not in already_processed: already_processed.add('mac') outfile.write(' mac=%s' % (quote_attrib(self.mac), )) def exportChildren(self, outfile, level, namespace_='', name_='vmnic', 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_('driver', node) if value is not None and 'driver' not in already_processed: already_processed.add('driver') self.driver = value value = find_attr_value_('interface', node) if value is not None and 'interface' not in already_processed: already_processed.add('interface') self.interface = value value = find_attr_value_('mode', node) if value is not None and 'mode' not in already_processed: already_processed.add('mode') self.mode = value value = find_attr_value_('mac', node) if value is not None and 'mac' not in already_processed: already_processed.add('mac') self.mac = value self.mac = ' '.join(self.mac.split()) self.validate_mac_address_type(self.mac) # validate type mac-address-type def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class vmnic class volume(GeneratedsSuper): """Specify which parts of the filesystem should be on an extra volume.""" subclass = None superclass = None def __init__(self, copy_on_write=None, freespace=None, mountpoint=None, name=None, size=None): self.original_tagname_ = None self.copy_on_write = _cast(bool, copy_on_write) self.freespace = _cast(None, freespace) self.mountpoint = _cast(None, mountpoint) self.name = _cast(None, name) self.size = _cast(None, size) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, volume) if subclass is not None: return subclass(*args_, **kwargs_) if volume.subclass: return volume.subclass(*args_, **kwargs_) else: return volume(*args_, **kwargs_) factory = staticmethod(factory) def get_copy_on_write(self): return self.copy_on_write def set_copy_on_write(self, copy_on_write): self.copy_on_write = copy_on_write def get_freespace(self): return self.freespace def set_freespace(self, freespace): self.freespace = freespace def get_mountpoint(self): return self.mountpoint def set_mountpoint(self, mountpoint): self.mountpoint = mountpoint def get_name(self): return self.name def set_name(self, name): self.name = name def get_size(self): return self.size def set_size(self, size): self.size = size def validate_volume_size_type(self, value): # Validate type volume-size-type, a restriction on xs:token. if value is not None and Validate_simpletypes_: if not self.gds_validate_simple_patterns( self.validate_volume_size_type_patterns_, value): warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_volume_size_type_patterns_, )) validate_volume_size_type_patterns_ = [['^\\d+|\\d+M|\\d+G|all$']] def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='volume', namespacedef_='', pretty_print=True): 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_='volume') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='volume', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='volume'): if self.copy_on_write is not None and 'copy_on_write' not in already_processed: already_processed.add('copy_on_write') outfile.write(' copy_on_write="%s"' % self.gds_format_boolean(self.copy_on_write, input_name='copy_on_write')) if self.freespace is not None and 'freespace' not in already_processed: already_processed.add('freespace') outfile.write(' freespace=%s' % (quote_attrib(self.freespace), )) if self.mountpoint is not None and 'mountpoint' not in already_processed: already_processed.add('mountpoint') outfile.write(' mountpoint=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.mountpoint), input_name='mountpoint')), )) 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')), )) if self.size is not None and 'size' not in already_processed: already_processed.add('size') outfile.write(' size=%s' % (quote_attrib(self.size), )) def exportChildren(self, outfile, level, namespace_='', name_='volume', 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_('copy_on_write', node) if value is not None and 'copy_on_write' not in already_processed: already_processed.add('copy_on_write') if value in ('true', '1'): self.copy_on_write = True elif value in ('false', '0'): self.copy_on_write = False else: raise_parse_error(node, 'Bad boolean attribute') value = find_attr_value_('freespace', node) if value is not None and 'freespace' not in already_processed: already_processed.add('freespace') self.freespace = value self.freespace = ' '.join(self.freespace.split()) self.validate_volume_size_type(self.freespace) # validate type volume-size-type value = find_attr_value_('mountpoint', node) if value is not None and 'mountpoint' not in already_processed: already_processed.add('mountpoint') self.mountpoint = 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 value = find_attr_value_('size', node) if value is not None and 'size' not in already_processed: already_processed.add('size') self.size = value self.size = ' '.join(self.size.split()) self.validate_volume_size_type(self.size) # validate type volume-size-type def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class volume class pxedeploy(GeneratedsSuper): """Controls the Image Deploy Process""" subclass = None superclass = None def __init__(self, server=None, blocksize=None, timeout=None, kernel=None, initrd=None, partitions=None, union=None, configuration=None): self.original_tagname_ = None self.server = _cast(None, server) self.blocksize = _cast(int, blocksize) if timeout is None: self.timeout = [] else: self.timeout = timeout if kernel is None: self.kernel = [] else: self.kernel = kernel if initrd is None: self.initrd = [] else: self.initrd = initrd if partitions is None: self.partitions = [] else: self.partitions = partitions if union is None: self.union = [] else: self.union = union if configuration is None: self.configuration = [] else: self.configuration = configuration def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, pxedeploy) if subclass is not None: return subclass(*args_, **kwargs_) if pxedeploy.subclass: return pxedeploy.subclass(*args_, **kwargs_) else: return pxedeploy(*args_, **kwargs_) factory = staticmethod(factory) def get_timeout(self): return self.timeout def set_timeout(self, timeout): self.timeout = timeout def add_timeout(self, value): self.timeout.append(value) def insert_timeout_at(self, index, value): self.timeout.insert(index, value) def replace_timeout_at(self, index, value): self.timeout[index] = value def get_kernel(self): return self.kernel def set_kernel(self, kernel): self.kernel = kernel def add_kernel(self, value): self.kernel.append(value) def insert_kernel_at(self, index, value): self.kernel.insert(index, value) def replace_kernel_at(self, index, value): self.kernel[index] = value def get_initrd(self): return self.initrd def set_initrd(self, initrd): self.initrd = initrd def add_initrd(self, value): self.initrd.append(value) def insert_initrd_at(self, index, value): self.initrd.insert(index, value) def replace_initrd_at(self, index, value): self.initrd[index] = value def get_partitions(self): return self.partitions def set_partitions(self, partitions): self.partitions = partitions def add_partitions(self, value): self.partitions.append(value) def insert_partitions_at(self, index, value): self.partitions.insert(index, value) def replace_partitions_at(self, index, value): self.partitions[index] = value def get_union(self): return self.union def set_union(self, union): self.union = union def add_union(self, value): self.union.append(value) def insert_union_at(self, index, value): self.union.insert(index, value) def replace_union_at(self, index, value): self.union[index] = value def get_configuration(self): return self.configuration def set_configuration(self, configuration): self.configuration = configuration def add_configuration(self, value): self.configuration.append(value) def insert_configuration_at(self, index, value): self.configuration.insert(index, value) def replace_configuration_at(self, index, value): self.configuration[index] = value def get_server(self): return self.server def set_server(self, server): self.server = server def get_blocksize(self): return self.blocksize def set_blocksize(self, blocksize): self.blocksize = blocksize def hasContent_(self): if ( self.timeout or self.kernel or self.initrd or self.partitions or self.union or self.configuration ): return True else: return False def export(self, outfile, level, namespace_='', name_='pxedeploy', namespacedef_='', pretty_print=True): 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_='pxedeploy') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='pxedeploy', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='pxedeploy'): if self.server is not None and 'server' not in already_processed: already_processed.add('server') outfile.write(' server=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.server), input_name='server')), )) if self.blocksize is not None and 'blocksize' not in already_processed: already_processed.add('blocksize') outfile.write(' blocksize="%s"' % self.gds_format_integer(self.blocksize, input_name='blocksize')) def exportChildren(self, outfile, level, namespace_='', name_='pxedeploy', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for timeout_ in self.timeout: showIndent(outfile, level, pretty_print) outfile.write('<%stimeout>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(timeout_), input_name='timeout')), namespace_, eol_)) for kernel_ in self.kernel: showIndent(outfile, level, pretty_print) outfile.write('<%skernel>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(kernel_), input_name='kernel')), namespace_, eol_)) for initrd_ in self.initrd: showIndent(outfile, level, pretty_print) outfile.write('<%sinitrd>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(initrd_), input_name='initrd')), namespace_, eol_)) for partitions_ in self.partitions: partitions_.export(outfile, level, namespace_, name_='partitions', pretty_print=pretty_print) for union_ in self.union: union_.export(outfile, level, namespace_, name_='union', pretty_print=pretty_print) for configuration_ in self.configuration: configuration_.export(outfile, level, namespace_, name_='configuration', 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_('server', node) if value is not None and 'server' not in already_processed: already_processed.add('server') self.server = value value = find_attr_value_('blocksize', node) if value is not None and 'blocksize' not in already_processed: already_processed.add('blocksize') try: self.blocksize = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.blocksize < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'timeout': timeout_ = child_.text timeout_ = self.gds_validate_string(timeout_, node, 'timeout') self.timeout.append(timeout_) elif nodeName_ == 'kernel': kernel_ = child_.text kernel_ = self.gds_validate_string(kernel_, node, 'kernel') self.kernel.append(kernel_) elif nodeName_ == 'initrd': initrd_ = child_.text initrd_ = self.gds_validate_string(initrd_, node, 'initrd') self.initrd.append(initrd_) elif nodeName_ == 'partitions': obj_ = partitions.factory() obj_.build(child_) self.partitions.append(obj_) obj_.original_tagname_ = 'partitions' elif nodeName_ == 'union': obj_ = union.factory() obj_.build(child_) self.union.append(obj_) obj_.original_tagname_ = 'union' elif nodeName_ == 'configuration': obj_ = configuration.factory() obj_.build(child_) self.configuration.append(obj_) obj_.original_tagname_ = 'configuration' # end class pxedeploy class description(GeneratedsSuper): """A Short Description""" subclass = None superclass = None def __init__(self, type_=None, author=None, contact=None, specification=None): self.original_tagname_ = None self.type_ = _cast(None, type_) if author is None: self.author = [] else: self.author = author if contact is None: self.contact = [] else: self.contact = contact if specification is None: self.specification = [] else: self.specification = specification def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, description) if subclass is not None: return subclass(*args_, **kwargs_) if description.subclass: return description.subclass(*args_, **kwargs_) else: return description(*args_, **kwargs_) factory = staticmethod(factory) def get_author(self): return self.author def set_author(self, author): self.author = author def add_author(self, value): self.author.append(value) def insert_author_at(self, index, value): self.author.insert(index, value) def replace_author_at(self, index, value): self.author[index] = value def get_contact(self): return self.contact def set_contact(self, contact): self.contact = contact def add_contact(self, value): self.contact.append(value) def insert_contact_at(self, index, value): self.contact.insert(index, value) def replace_contact_at(self, index, value): self.contact[index] = value def get_specification(self): return self.specification def set_specification(self, specification): self.specification = specification def add_specification(self, value): self.specification.append(value) def insert_specification_at(self, index, value): self.specification.insert(index, value) def replace_specification_at(self, index, value): self.specification[index] = value def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def hasContent_(self): if ( self.author or self.contact or self.specification ): return True else: return False def export(self, outfile, level, namespace_='', name_='description', namespacedef_='', pretty_print=True): 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_='description') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='description', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='description'): 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_='description', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for author_ in self.author: showIndent(outfile, level, pretty_print) outfile.write('<%sauthor>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(author_), input_name='author')), namespace_, eol_)) for contact_ in self.contact: showIndent(outfile, level, pretty_print) outfile.write('<%scontact>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(contact_), input_name='contact')), namespace_, eol_)) for specification_ in self.specification: showIndent(outfile, level, pretty_print) outfile.write('<%sspecification>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(specification_), input_name='specification')), namespace_, eol_)) 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 self.type_ = ' '.join(self.type_.split()) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'author': author_ = child_.text author_ = self.gds_validate_string(author_, node, 'author') self.author.append(author_) elif nodeName_ == 'contact': contact_ = child_.text contact_ = self.gds_validate_string(contact_, node, 'contact') self.contact.append(contact_) elif nodeName_ == 'specification': specification_ = child_.text specification_ = self.gds_validate_string(specification_, node, 'specification') self.specification.append(specification_) # end class description class drivers(GeneratedsSuper): """A Collection of Driver Files""" subclass = None superclass = None def __init__(self, profiles=None, file=None): self.original_tagname_ = None self.profiles = _cast(None, profiles) if file is None: self.file = [] else: self.file = file def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, drivers) if subclass is not None: return subclass(*args_, **kwargs_) if drivers.subclass: return drivers.subclass(*args_, **kwargs_) else: return drivers(*args_, **kwargs_) factory = staticmethod(factory) def get_file(self): return self.file def set_file(self, file): self.file = file def add_file(self, value): self.file.append(value) def insert_file_at(self, index, value): self.file.insert(index, value) def replace_file_at(self, index, value): self.file[index] = value def get_profiles(self): return self.profiles def set_profiles(self, profiles): self.profiles = profiles def hasContent_(self): if ( self.file ): return True else: return False def export(self, outfile, level, namespace_='', name_='drivers', namespacedef_='', pretty_print=True): 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_='drivers') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='drivers', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='drivers'): if self.profiles is not None and 'profiles' not in already_processed: already_processed.add('profiles') outfile.write(' profiles=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.profiles), input_name='profiles')), )) def exportChildren(self, outfile, level, namespace_='', name_='drivers', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for file_ in self.file: file_.export(outfile, level, namespace_, name_='file', 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_('profiles', node) if value is not None and 'profiles' not in already_processed: already_processed.add('profiles') self.profiles = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'file': obj_ = file.factory() obj_.build(child_) self.file.append(obj_) obj_.original_tagname_ = 'file' # end class drivers class strip(GeneratedsSuper): """A Collection of files to strip""" subclass = None superclass = None def __init__(self, type_=None, profiles=None, file=None): self.original_tagname_ = None self.type_ = _cast(None, type_) self.profiles = _cast(None, profiles) if file is None: self.file = [] else: self.file = file def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, strip) if subclass is not None: return subclass(*args_, **kwargs_) if strip.subclass: return strip.subclass(*args_, **kwargs_) else: return strip(*args_, **kwargs_) factory = staticmethod(factory) def get_file(self): return self.file def set_file(self, file): self.file = file def add_file(self, value): self.file.append(value) def insert_file_at(self, index, value): self.file.insert(index, value) def replace_file_at(self, index, value): self.file[index] = value def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def get_profiles(self): return self.profiles def set_profiles(self, profiles): self.profiles = profiles def hasContent_(self): if ( self.file ): return True else: return False def export(self, outfile, level, namespace_='', name_='strip', namespacedef_='', pretty_print=True): 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_='strip') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='strip', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='strip'): 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')), )) if self.profiles is not None and 'profiles' not in already_processed: already_processed.add('profiles') outfile.write(' profiles=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.profiles), input_name='profiles')), )) def exportChildren(self, outfile, level, namespace_='', name_='strip', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for file_ in self.file: file_.export(outfile, level, namespace_, name_='file', 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 self.type_ = ' '.join(self.type_.split()) value = find_attr_value_('profiles', node) if value is not None and 'profiles' not in already_processed: already_processed.add('profiles') self.profiles = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'file': obj_ = file.factory() obj_.build(child_) self.file.append(obj_) obj_.original_tagname_ = 'file' # end class strip class instsource(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, architectures=None, productoptions=None, instrepo=None, metadata=None, repopackages=None, driverupdate=None): self.original_tagname_ = None if architectures is None: self.architectures = [] else: self.architectures = architectures if productoptions is None: self.productoptions = [] else: self.productoptions = productoptions if instrepo is None: self.instrepo = [] else: self.instrepo = instrepo if metadata is None: self.metadata = [] else: self.metadata = metadata if repopackages is None: self.repopackages = [] else: self.repopackages = repopackages if driverupdate is None: self.driverupdate = [] else: self.driverupdate = driverupdate def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, instsource) if subclass is not None: return subclass(*args_, **kwargs_) if instsource.subclass: return instsource.subclass(*args_, **kwargs_) else: return instsource(*args_, **kwargs_) factory = staticmethod(factory) def get_architectures(self): return self.architectures def set_architectures(self, architectures): self.architectures = architectures def add_architectures(self, value): self.architectures.append(value) def insert_architectures_at(self, index, value): self.architectures.insert(index, value) def replace_architectures_at(self, index, value): self.architectures[index] = value def get_productoptions(self): return self.productoptions def set_productoptions(self, productoptions): self.productoptions = productoptions def add_productoptions(self, value): self.productoptions.append(value) def insert_productoptions_at(self, index, value): self.productoptions.insert(index, value) def replace_productoptions_at(self, index, value): self.productoptions[index] = value def get_instrepo(self): return self.instrepo def set_instrepo(self, instrepo): self.instrepo = instrepo def add_instrepo(self, value): self.instrepo.append(value) def insert_instrepo_at(self, index, value): self.instrepo.insert(index, value) def replace_instrepo_at(self, index, value): self.instrepo[index] = value def get_metadata(self): return self.metadata def set_metadata(self, metadata): self.metadata = metadata def add_metadata(self, value): self.metadata.append(value) def insert_metadata_at(self, index, value): self.metadata.insert(index, value) def replace_metadata_at(self, index, value): self.metadata[index] = value def get_repopackages(self): return self.repopackages def set_repopackages(self, repopackages): self.repopackages = repopackages def add_repopackages(self, value): self.repopackages.append(value) def insert_repopackages_at(self, index, value): self.repopackages.insert(index, value) def replace_repopackages_at(self, index, value): self.repopackages[index] = value def get_driverupdate(self): return self.driverupdate def set_driverupdate(self, driverupdate): self.driverupdate = driverupdate def add_driverupdate(self, value): self.driverupdate.append(value) def insert_driverupdate_at(self, index, value): self.driverupdate.insert(index, value) def replace_driverupdate_at(self, index, value): self.driverupdate[index] = value def hasContent_(self): if ( self.architectures or self.productoptions or self.instrepo or self.metadata or self.repopackages or self.driverupdate ): return True else: return False def export(self, outfile, level, namespace_='', name_='instsource', namespacedef_='', pretty_print=True): 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_='instsource') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='instsource', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='instsource'): pass def exportChildren(self, outfile, level, namespace_='', name_='instsource', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for architectures_ in self.architectures: architectures_.export(outfile, level, namespace_, name_='architectures', pretty_print=pretty_print) for productoptions_ in self.productoptions: productoptions_.export(outfile, level, namespace_, name_='productoptions', pretty_print=pretty_print) for instrepo_ in self.instrepo: instrepo_.export(outfile, level, namespace_, name_='instrepo', pretty_print=pretty_print) for metadata_ in self.metadata: metadata_.export(outfile, level, namespace_, name_='metadata', pretty_print=pretty_print) for repopackages_ in self.repopackages: repopackages_.export(outfile, level, namespace_, name_='repopackages', pretty_print=pretty_print) for driverupdate_ in self.driverupdate: driverupdate_.export(outfile, level, namespace_, name_='driverupdate', 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_ == 'architectures': obj_ = architectures.factory() obj_.build(child_) self.architectures.append(obj_) obj_.original_tagname_ = 'architectures' elif nodeName_ == 'productoptions': obj_ = productoptions.factory() obj_.build(child_) self.productoptions.append(obj_) obj_.original_tagname_ = 'productoptions' elif nodeName_ == 'instrepo': obj_ = instrepo.factory() obj_.build(child_) self.instrepo.append(obj_) obj_.original_tagname_ = 'instrepo' elif nodeName_ == 'metadata': obj_ = metadata.factory() obj_.build(child_) self.metadata.append(obj_) obj_.original_tagname_ = 'metadata' elif nodeName_ == 'repopackages': obj_ = repopackages.factory() obj_.build(child_) self.repopackages.append(obj_) obj_.original_tagname_ = 'repopackages' elif nodeName_ == 'driverupdate': obj_ = driverupdate.factory() obj_.build(child_) self.driverupdate.append(obj_) obj_.original_tagname_ = 'driverupdate' # end class instsource class architectures(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, arch=None, requiredarch=None): self.original_tagname_ = None if arch is None: self.arch = [] else: self.arch = arch if requiredarch is None: self.requiredarch = [] else: self.requiredarch = requiredarch def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, architectures) if subclass is not None: return subclass(*args_, **kwargs_) if architectures.subclass: return architectures.subclass(*args_, **kwargs_) else: return architectures(*args_, **kwargs_) factory = staticmethod(factory) def get_arch(self): return self.arch def set_arch(self, arch): self.arch = arch def add_arch(self, value): self.arch.append(value) def insert_arch_at(self, index, value): self.arch.insert(index, value) def replace_arch_at(self, index, value): self.arch[index] = value def get_requiredarch(self): return self.requiredarch def set_requiredarch(self, requiredarch): self.requiredarch = requiredarch def add_requiredarch(self, value): self.requiredarch.append(value) def insert_requiredarch_at(self, index, value): self.requiredarch.insert(index, value) def replace_requiredarch_at(self, index, value): self.requiredarch[index] = value def hasContent_(self): if ( self.arch or self.requiredarch ): return True else: return False def export(self, outfile, level, namespace_='', name_='architectures', namespacedef_='', pretty_print=True): 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_='architectures') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='architectures', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='architectures'): pass def exportChildren(self, outfile, level, namespace_='', name_='architectures', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for arch_ in self.arch: arch_.export(outfile, level, namespace_, name_='arch', pretty_print=pretty_print) for requiredarch_ in self.requiredarch: requiredarch_.export(outfile, level, namespace_, name_='requiredarch', 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_ == 'arch': obj_ = arch.factory() obj_.build(child_) self.arch.append(obj_) obj_.original_tagname_ = 'arch' elif nodeName_ == 'requiredarch': obj_ = requiredarch.factory() obj_.build(child_) self.requiredarch.append(obj_) obj_.original_tagname_ = 'requiredarch' # end class architectures class productoptions(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, productoption=None, productinfo=None, productvar=None): self.original_tagname_ = None if productoption is None: self.productoption = [] else: self.productoption = productoption if productinfo is None: self.productinfo = [] else: self.productinfo = productinfo if productvar is None: self.productvar = [] else: self.productvar = productvar def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, productoptions) if subclass is not None: return subclass(*args_, **kwargs_) if productoptions.subclass: return productoptions.subclass(*args_, **kwargs_) else: return productoptions(*args_, **kwargs_) factory = staticmethod(factory) def get_productoption(self): return self.productoption def set_productoption(self, productoption): self.productoption = productoption def add_productoption(self, value): self.productoption.append(value) def insert_productoption_at(self, index, value): self.productoption.insert(index, value) def replace_productoption_at(self, index, value): self.productoption[index] = value def get_productinfo(self): return self.productinfo def set_productinfo(self, productinfo): self.productinfo = productinfo def add_productinfo(self, value): self.productinfo.append(value) def insert_productinfo_at(self, index, value): self.productinfo.insert(index, value) def replace_productinfo_at(self, index, value): self.productinfo[index] = value def get_productvar(self): return self.productvar def set_productvar(self, productvar): self.productvar = productvar def add_productvar(self, value): self.productvar.append(value) def insert_productvar_at(self, index, value): self.productvar.insert(index, value) def replace_productvar_at(self, index, value): self.productvar[index] = value def hasContent_(self): if ( self.productoption or self.productinfo or self.productvar ): return True else: return False def export(self, outfile, level, namespace_='', name_='productoptions', namespacedef_='', pretty_print=True): 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_='productoptions') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='productoptions', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='productoptions'): pass def exportChildren(self, outfile, level, namespace_='', name_='productoptions', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for productoption_ in self.productoption: productoption_.export(outfile, level, namespace_, name_='productoption', pretty_print=pretty_print) for productinfo_ in self.productinfo: productinfo_.export(outfile, level, namespace_, name_='productinfo', pretty_print=pretty_print) for productvar_ in self.productvar: productvar_.export(outfile, level, namespace_, name_='productvar', 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_ == 'productoption': obj_ = productoption.factory() obj_.build(child_) self.productoption.append(obj_) obj_.original_tagname_ = 'productoption' elif nodeName_ == 'productinfo': obj_ = productinfo.factory() obj_.build(child_) self.productinfo.append(obj_) obj_.original_tagname_ = 'productinfo' elif nodeName_ == 'productvar': obj_ = productvar.factory() obj_.build(child_) self.productvar.append(obj_) obj_.original_tagname_ = 'productvar' # end class productoptions class productoption(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, name=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.name = _cast(None, name) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, productoption) if subclass is not None: return subclass(*args_, **kwargs_) if productoption.subclass: return productoption.subclass(*args_, **kwargs_) else: return productoption(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_valueOf_(self): return self.valueOf_ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False def export(self, outfile, level, namespace_='', name_='productoption', namespacedef_='', pretty_print=True): 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_='productoption') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='productoption'): 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_='productoption', fromsubclass_=False, pretty_print=True): pass def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) 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): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass # end class productoption class arch(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, id=None, name=None, fallback=None): self.original_tagname_ = None self.id = _cast(None, id) self.name = _cast(None, name) self.fallback = _cast(None, fallback) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, arch) if subclass is not None: return subclass(*args_, **kwargs_) if arch.subclass: return arch.subclass(*args_, **kwargs_) else: return arch(*args_, **kwargs_) factory = staticmethod(factory) def get_id(self): return self.id def set_id(self, id): self.id = id def get_name(self): return self.name def set_name(self, name): self.name = name def get_fallback(self): return self.fallback def set_fallback(self, fallback): self.fallback = fallback def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='arch', namespacedef_='', pretty_print=True): 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_='arch') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='arch', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='arch'): 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')), )) if self.fallback is not None and 'fallback' not in already_processed: already_processed.add('fallback') outfile.write(' fallback=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.fallback), input_name='fallback')), )) def exportChildren(self, outfile, level, namespace_='', name_='arch', 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_('name', node) if value is not None and 'name' not in already_processed: already_processed.add('name') self.name = value value = find_attr_value_('fallback', node) if value is not None and 'fallback' not in already_processed: already_processed.add('fallback') self.fallback = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class arch class requiredarch(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, ref=None): self.original_tagname_ = None self.ref = _cast(None, ref) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, requiredarch) if subclass is not None: return subclass(*args_, **kwargs_) if requiredarch.subclass: return requiredarch.subclass(*args_, **kwargs_) else: return requiredarch(*args_, **kwargs_) factory = staticmethod(factory) def get_ref(self): return self.ref def set_ref(self, ref): self.ref = ref def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='requiredarch', namespacedef_='', pretty_print=True): 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_='requiredarch') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='requiredarch', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='requiredarch'): if self.ref is not None and 'ref' not in already_processed: already_processed.add('ref') outfile.write(' ref=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ref), input_name='ref')), )) def exportChildren(self, outfile, level, namespace_='', name_='requiredarch', 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_('ref', node) if value is not None and 'ref' not in already_processed: already_processed.add('ref') self.ref = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class requiredarch class productinfo(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, name=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.name = _cast(None, name) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, productinfo) if subclass is not None: return subclass(*args_, **kwargs_) if productinfo.subclass: return productinfo.subclass(*args_, **kwargs_) else: return productinfo(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_valueOf_(self): return self.valueOf_ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False def export(self, outfile, level, namespace_='', name_='productinfo', namespacedef_='', pretty_print=True): 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_='productinfo') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='productinfo'): 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_='productinfo', fromsubclass_=False, pretty_print=True): pass def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) 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): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass # end class productinfo class productvar(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, name=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.name = _cast(None, name) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, productvar) if subclass is not None: return subclass(*args_, **kwargs_) if productvar.subclass: return productvar.subclass(*args_, **kwargs_) else: return productvar(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_valueOf_(self): return self.valueOf_ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False def export(self, outfile, level, namespace_='', name_='productvar', namespacedef_='', pretty_print=True): 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_='productvar') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='productvar'): 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_='productvar', fromsubclass_=False, pretty_print=True): pass def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) 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): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass # end class productvar class chroot(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, requires=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.requires = _cast(None, requires) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, chroot) if subclass is not None: return subclass(*args_, **kwargs_) if chroot.subclass: return chroot.subclass(*args_, **kwargs_) else: return chroot(*args_, **kwargs_) factory = staticmethod(factory) def get_requires(self): return self.requires def set_requires(self, requires): self.requires = requires def get_valueOf_(self): return self.valueOf_ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False def export(self, outfile, level, namespace_='', name_='chroot', namespacedef_='', pretty_print=True): 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_='chroot') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='chroot'): if self.requires is not None and 'requires' not in already_processed: already_processed.add('requires') outfile.write(' requires=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.requires), input_name='requires')), )) def exportChildren(self, outfile, level, namespace_='', name_='chroot', fromsubclass_=False, pretty_print=True): pass def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) 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_('requires', node) if value is not None and 'requires' not in already_processed: already_processed.add('requires') self.requires = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass # end class chroot class repopackages(GeneratedsSuper): """Specifies Packages for Installation Source""" subclass = None superclass = None def __init__(self, repopackage=None): self.original_tagname_ = None if repopackage is None: self.repopackage = [] else: self.repopackage = repopackage def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, repopackages) if subclass is not None: return subclass(*args_, **kwargs_) if repopackages.subclass: return repopackages.subclass(*args_, **kwargs_) else: return repopackages(*args_, **kwargs_) factory = staticmethod(factory) def get_repopackage(self): return self.repopackage def set_repopackage(self, repopackage): self.repopackage = repopackage def add_repopackage(self, value): self.repopackage.append(value) def insert_repopackage_at(self, index, value): self.repopackage.insert(index, value) def replace_repopackage_at(self, index, value): self.repopackage[index] = value def hasContent_(self): if ( self.repopackage ): return True else: return False def export(self, outfile, level, namespace_='', name_='repopackages', namespacedef_='', pretty_print=True): 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_='repopackages') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='repopackages', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='repopackages'): pass def exportChildren(self, outfile, level, namespace_='', name_='repopackages', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for repopackage_ in self.repopackage: repopackage_.export(outfile, level, namespace_, name_='repopackage', 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_ == 'repopackage': obj_ = repopackage.factory() obj_.build(child_) self.repopackage.append(obj_) obj_.original_tagname_ = 'repopackage' # end class repopackages class driverupdate(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, target=None, install=None, modules=None, instsys=None): self.original_tagname_ = None if target is None: self.target = [] else: self.target = target if install is None: self.install = [] else: self.install = install if modules is None: self.modules = [] else: self.modules = modules if instsys is None: self.instsys = [] else: self.instsys = instsys def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, driverupdate) if subclass is not None: return subclass(*args_, **kwargs_) if driverupdate.subclass: return driverupdate.subclass(*args_, **kwargs_) else: return driverupdate(*args_, **kwargs_) factory = staticmethod(factory) def get_target(self): return self.target def set_target(self, target): self.target = target def add_target(self, value): self.target.append(value) def insert_target_at(self, index, value): self.target.insert(index, value) def replace_target_at(self, index, value): self.target[index] = value def get_install(self): return self.install def set_install(self, install): self.install = install def add_install(self, value): self.install.append(value) def insert_install_at(self, index, value): self.install.insert(index, value) def replace_install_at(self, index, value): self.install[index] = value def get_modules(self): return self.modules def set_modules(self, modules): self.modules = modules def add_modules(self, value): self.modules.append(value) def insert_modules_at(self, index, value): self.modules.insert(index, value) def replace_modules_at(self, index, value): self.modules[index] = value def get_instsys(self): return self.instsys def set_instsys(self, instsys): self.instsys = instsys def add_instsys(self, value): self.instsys.append(value) def insert_instsys_at(self, index, value): self.instsys.insert(index, value) def replace_instsys_at(self, index, value): self.instsys[index] = value def hasContent_(self): if ( self.target or self.install or self.modules or self.instsys ): return True else: return False def export(self, outfile, level, namespace_='', name_='driverupdate', namespacedef_='', pretty_print=True): 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_='driverupdate') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='driverupdate', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='driverupdate'): pass def exportChildren(self, outfile, level, namespace_='', name_='driverupdate', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for target_ in self.target: target_.export(outfile, level, namespace_, name_='target', pretty_print=pretty_print) for install_ in self.install: install_.export(outfile, level, namespace_, name_='install', pretty_print=pretty_print) for modules_ in self.modules: modules_.export(outfile, level, namespace_, name_='modules', pretty_print=pretty_print) for instsys_ in self.instsys: instsys_.export(outfile, level, namespace_, name_='instsys', 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_ == 'target': obj_ = target.factory() obj_.build(child_) self.target.append(obj_) obj_.original_tagname_ = 'target' elif nodeName_ == 'install': obj_ = install.factory() obj_.build(child_) self.install.append(obj_) obj_.original_tagname_ = 'install' elif nodeName_ == 'modules': obj_ = modules.factory() obj_.build(child_) self.modules.append(obj_) obj_.original_tagname_ = 'modules' elif nodeName_ == 'instsys': obj_ = instsys.factory() obj_.build(child_) self.instsys.append(obj_) obj_.original_tagname_ = 'instsys' # end class driverupdate class target(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, arch=None, valueOf_=None, mixedclass_=None, content_=None): self.original_tagname_ = None self.arch = _cast(None, arch) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, target) if subclass is not None: return subclass(*args_, **kwargs_) if target.subclass: return target.subclass(*args_, **kwargs_) else: return target(*args_, **kwargs_) factory = staticmethod(factory) def get_arch(self): return self.arch def set_arch(self, arch): self.arch = arch def get_valueOf_(self): return self.valueOf_ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_ def hasContent_(self): if ( 1 if type(self.valueOf_) in [int,float] else self.valueOf_ ): return True else: return False def export(self, outfile, level, namespace_='', name_='target', namespacedef_='', pretty_print=True): 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_='target') outfile.write('>') self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='target'): if self.arch is not None and 'arch' not in already_processed: already_processed.add('arch') outfile.write(' arch=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.arch), input_name='arch')), )) def exportChildren(self, outfile, level, namespace_='', name_='target', fromsubclass_=False, pretty_print=True): pass def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) self.valueOf_ = get_all_text_(node) if node.text is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', node.text) self.content_.append(obj_) 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_('arch', node) if value is not None and 'arch' not in already_processed: already_processed.add('arch') self.arch = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if not fromsubclass_ and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) pass # end class target class install(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, repopackage=None): self.original_tagname_ = None if repopackage is None: self.repopackage = [] else: self.repopackage = repopackage def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, install) if subclass is not None: return subclass(*args_, **kwargs_) if install.subclass: return install.subclass(*args_, **kwargs_) else: return install(*args_, **kwargs_) factory = staticmethod(factory) def get_repopackage(self): return self.repopackage def set_repopackage(self, repopackage): self.repopackage = repopackage def add_repopackage(self, value): self.repopackage.append(value) def insert_repopackage_at(self, index, value): self.repopackage.insert(index, value) def replace_repopackage_at(self, index, value): self.repopackage[index] = value def hasContent_(self): if ( self.repopackage ): return True else: return False def export(self, outfile, level, namespace_='', name_='install', namespacedef_='', pretty_print=True): 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_='install') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='install', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='install'): pass def exportChildren(self, outfile, level, namespace_='', name_='install', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for repopackage_ in self.repopackage: repopackage_.export(outfile, level, namespace_, name_='repopackage', 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_ == 'repopackage': obj_ = repopackage.factory() obj_.build(child_) self.repopackage.append(obj_) obj_.original_tagname_ = 'repopackage' # end class install class modules(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, repopackage=None): self.original_tagname_ = None if repopackage is None: self.repopackage = [] else: self.repopackage = repopackage def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, modules) if subclass is not None: return subclass(*args_, **kwargs_) if modules.subclass: return modules.subclass(*args_, **kwargs_) else: return modules(*args_, **kwargs_) factory = staticmethod(factory) def get_repopackage(self): return self.repopackage def set_repopackage(self, repopackage): self.repopackage = repopackage def add_repopackage(self, value): self.repopackage.append(value) def insert_repopackage_at(self, index, value): self.repopackage.insert(index, value) def replace_repopackage_at(self, index, value): self.repopackage[index] = value def hasContent_(self): if ( self.repopackage ): return True else: return False def export(self, outfile, level, namespace_='', name_='modules', namespacedef_='', pretty_print=True): 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_='modules') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='modules', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='modules'): pass def exportChildren(self, outfile, level, namespace_='', name_='modules', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for repopackage_ in self.repopackage: repopackage_.export(outfile, level, namespace_, name_='repopackage', 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_ == 'repopackage': obj_ = repopackage.factory() obj_.build(child_) self.repopackage.append(obj_) obj_.original_tagname_ = 'repopackage' # end class modules class instsys(GeneratedsSuper): """Describe Packages and Metadata""" subclass = None superclass = None def __init__(self, repopackage=None): self.original_tagname_ = None if repopackage is None: self.repopackage = [] else: self.repopackage = repopackage def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, instsys) if subclass is not None: return subclass(*args_, **kwargs_) if instsys.subclass: return instsys.subclass(*args_, **kwargs_) else: return instsys(*args_, **kwargs_) factory = staticmethod(factory) def get_repopackage(self): return self.repopackage def set_repopackage(self, repopackage): self.repopackage = repopackage def add_repopackage(self, value): self.repopackage.append(value) def insert_repopackage_at(self, index, value): self.repopackage.insert(index, value) def replace_repopackage_at(self, index, value): self.repopackage[index] = value def hasContent_(self): if ( self.repopackage ): return True else: return False def export(self, outfile, level, namespace_='', name_='instsys', namespacedef_='', pretty_print=True): 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_='instsys') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='instsys', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='instsys'): pass def exportChildren(self, outfile, level, namespace_='', name_='instsys', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for repopackage_ in self.repopackage: repopackage_.export(outfile, level, namespace_, name_='repopackage', 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_ == 'repopackage': obj_ = repopackage.factory() obj_.build(child_) self.repopackage.append(obj_) obj_.original_tagname_ = 'repopackage' # end class instsys class containerconfig(GeneratedsSuper): """Provides metadata information for containers""" subclass = None superclass = None def __init__(self, name=None, entry_command=None): self.original_tagname_ = None self.name = _cast(None, name) self.entry_command = _cast(None, entry_command) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, containerconfig) if subclass is not None: return subclass(*args_, **kwargs_) if containerconfig.subclass: return containerconfig.subclass(*args_, **kwargs_) else: return containerconfig(*args_, **kwargs_) factory = staticmethod(factory) def get_name(self): return self.name def set_name(self, name): self.name = name def get_entry_command(self): return self.entry_command def set_entry_command(self, entry_command): self.entry_command = entry_command def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='containerconfig', namespacedef_='', pretty_print=True): 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_='containerconfig') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='containerconfig', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='containerconfig'): 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')), )) if self.entry_command is not None and 'entry_command' not in already_processed: already_processed.add('entry_command') outfile.write(' entry_command=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.entry_command), input_name='entry_command')), )) def exportChildren(self, outfile, level, namespace_='', name_='containerconfig', 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 value = find_attr_value_('entry_command', node) if value is not None and 'entry_command' not in already_processed: already_processed.add('entry_command') self.entry_command = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class containerconfig class oemconfig(GeneratedsSuper): """Specifies the OEM configuration section""" subclass = None superclass = None def __init__(self, oem_ataraid_scan=None, oem_boot_title=None, oem_bootwait=None, oem_device_filter=None, oem_inplace_recovery=None, oem_kiwi_initrd=None, oem_multipath_scan=None, oem_vmcp_parmfile=None, oem_partition_install=None, oem_reboot=None, oem_reboot_interactive=None, oem_recovery=None, oem_recoveryID=None, oem_recovery_part_size=None, oem_shutdown=None, oem_shutdown_interactive=None, oem_silent_boot=None, oem_silent_install=None, oem_silent_verify=None, oem_skip_verify=None, oem_swap=None, oem_swapsize=None, oem_systemsize=None, oem_unattended=None, oem_unattended_id=None): self.original_tagname_ = None if oem_ataraid_scan is None: self.oem_ataraid_scan = [] else: self.oem_ataraid_scan = oem_ataraid_scan if oem_boot_title is None: self.oem_boot_title = [] else: self.oem_boot_title = oem_boot_title if oem_bootwait is None: self.oem_bootwait = [] else: self.oem_bootwait = oem_bootwait if oem_device_filter is None: self.oem_device_filter = [] else: self.oem_device_filter = oem_device_filter if oem_inplace_recovery is None: self.oem_inplace_recovery = [] else: self.oem_inplace_recovery = oem_inplace_recovery if oem_kiwi_initrd is None: self.oem_kiwi_initrd = [] else: self.oem_kiwi_initrd = oem_kiwi_initrd if oem_multipath_scan is None: self.oem_multipath_scan = [] else: self.oem_multipath_scan = oem_multipath_scan if oem_vmcp_parmfile is None: self.oem_vmcp_parmfile = [] else: self.oem_vmcp_parmfile = oem_vmcp_parmfile if oem_partition_install is None: self.oem_partition_install = [] else: self.oem_partition_install = oem_partition_install if oem_reboot is None: self.oem_reboot = [] else: self.oem_reboot = oem_reboot if oem_reboot_interactive is None: self.oem_reboot_interactive = [] else: self.oem_reboot_interactive = oem_reboot_interactive if oem_recovery is None: self.oem_recovery = [] else: self.oem_recovery = oem_recovery if oem_recoveryID is None: self.oem_recoveryID = [] else: self.oem_recoveryID = oem_recoveryID if oem_recovery_part_size is None: self.oem_recovery_part_size = [] else: self.oem_recovery_part_size = oem_recovery_part_size if oem_shutdown is None: self.oem_shutdown = [] else: self.oem_shutdown = oem_shutdown if oem_shutdown_interactive is None: self.oem_shutdown_interactive = [] else: self.oem_shutdown_interactive = oem_shutdown_interactive if oem_silent_boot is None: self.oem_silent_boot = [] else: self.oem_silent_boot = oem_silent_boot if oem_silent_install is None: self.oem_silent_install = [] else: self.oem_silent_install = oem_silent_install if oem_silent_verify is None: self.oem_silent_verify = [] else: self.oem_silent_verify = oem_silent_verify if oem_skip_verify is None: self.oem_skip_verify = [] else: self.oem_skip_verify = oem_skip_verify if oem_swap is None: self.oem_swap = [] else: self.oem_swap = oem_swap if oem_swapsize is None: self.oem_swapsize = [] else: self.oem_swapsize = oem_swapsize if oem_systemsize is None: self.oem_systemsize = [] else: self.oem_systemsize = oem_systemsize if oem_unattended is None: self.oem_unattended = [] else: self.oem_unattended = oem_unattended if oem_unattended_id is None: self.oem_unattended_id = [] else: self.oem_unattended_id = oem_unattended_id def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, oemconfig) if subclass is not None: return subclass(*args_, **kwargs_) if oemconfig.subclass: return oemconfig.subclass(*args_, **kwargs_) else: return oemconfig(*args_, **kwargs_) factory = staticmethod(factory) def get_oem_ataraid_scan(self): return self.oem_ataraid_scan def set_oem_ataraid_scan(self, oem_ataraid_scan): self.oem_ataraid_scan = oem_ataraid_scan def add_oem_ataraid_scan(self, value): self.oem_ataraid_scan.append(value) def insert_oem_ataraid_scan_at(self, index, value): self.oem_ataraid_scan.insert(index, value) def replace_oem_ataraid_scan_at(self, index, value): self.oem_ataraid_scan[index] = value def get_oem_boot_title(self): return self.oem_boot_title def set_oem_boot_title(self, oem_boot_title): self.oem_boot_title = oem_boot_title def add_oem_boot_title(self, value): self.oem_boot_title.append(value) def insert_oem_boot_title_at(self, index, value): self.oem_boot_title.insert(index, value) def replace_oem_boot_title_at(self, index, value): self.oem_boot_title[index] = value def get_oem_bootwait(self): return self.oem_bootwait def set_oem_bootwait(self, oem_bootwait): self.oem_bootwait = oem_bootwait def add_oem_bootwait(self, value): self.oem_bootwait.append(value) def insert_oem_bootwait_at(self, index, value): self.oem_bootwait.insert(index, value) def replace_oem_bootwait_at(self, index, value): self.oem_bootwait[index] = value def get_oem_device_filter(self): return self.oem_device_filter def set_oem_device_filter(self, oem_device_filter): self.oem_device_filter = oem_device_filter def add_oem_device_filter(self, value): self.oem_device_filter.append(value) def insert_oem_device_filter_at(self, index, value): self.oem_device_filter.insert(index, value) def replace_oem_device_filter_at(self, index, value): self.oem_device_filter[index] = value def get_oem_inplace_recovery(self): return self.oem_inplace_recovery def set_oem_inplace_recovery(self, oem_inplace_recovery): self.oem_inplace_recovery = oem_inplace_recovery def add_oem_inplace_recovery(self, value): self.oem_inplace_recovery.append(value) def insert_oem_inplace_recovery_at(self, index, value): self.oem_inplace_recovery.insert(index, value) def replace_oem_inplace_recovery_at(self, index, value): self.oem_inplace_recovery[index] = value def get_oem_kiwi_initrd(self): return self.oem_kiwi_initrd def set_oem_kiwi_initrd(self, oem_kiwi_initrd): self.oem_kiwi_initrd = oem_kiwi_initrd def add_oem_kiwi_initrd(self, value): self.oem_kiwi_initrd.append(value) def insert_oem_kiwi_initrd_at(self, index, value): self.oem_kiwi_initrd.insert(index, value) def replace_oem_kiwi_initrd_at(self, index, value): self.oem_kiwi_initrd[index] = value def get_oem_multipath_scan(self): return self.oem_multipath_scan def set_oem_multipath_scan(self, oem_multipath_scan): self.oem_multipath_scan = oem_multipath_scan def add_oem_multipath_scan(self, value): self.oem_multipath_scan.append(value) def insert_oem_multipath_scan_at(self, index, value): self.oem_multipath_scan.insert(index, value) def replace_oem_multipath_scan_at(self, index, value): self.oem_multipath_scan[index] = value def get_oem_vmcp_parmfile(self): return self.oem_vmcp_parmfile def set_oem_vmcp_parmfile(self, oem_vmcp_parmfile): self.oem_vmcp_parmfile = oem_vmcp_parmfile def add_oem_vmcp_parmfile(self, value): self.oem_vmcp_parmfile.append(value) def insert_oem_vmcp_parmfile_at(self, index, value): self.oem_vmcp_parmfile.insert(index, value) def replace_oem_vmcp_parmfile_at(self, index, value): self.oem_vmcp_parmfile[index] = value def get_oem_partition_install(self): return self.oem_partition_install def set_oem_partition_install(self, oem_partition_install): self.oem_partition_install = oem_partition_install def add_oem_partition_install(self, value): self.oem_partition_install.append(value) def insert_oem_partition_install_at(self, index, value): self.oem_partition_install.insert(index, value) def replace_oem_partition_install_at(self, index, value): self.oem_partition_install[index] = value def get_oem_reboot(self): return self.oem_reboot def set_oem_reboot(self, oem_reboot): self.oem_reboot = oem_reboot def add_oem_reboot(self, value): self.oem_reboot.append(value) def insert_oem_reboot_at(self, index, value): self.oem_reboot.insert(index, value) def replace_oem_reboot_at(self, index, value): self.oem_reboot[index] = value def get_oem_reboot_interactive(self): return self.oem_reboot_interactive def set_oem_reboot_interactive(self, oem_reboot_interactive): self.oem_reboot_interactive = oem_reboot_interactive def add_oem_reboot_interactive(self, value): self.oem_reboot_interactive.append(value) def insert_oem_reboot_interactive_at(self, index, value): self.oem_reboot_interactive.insert(index, value) def replace_oem_reboot_interactive_at(self, index, value): self.oem_reboot_interactive[index] = value def get_oem_recovery(self): return self.oem_recovery def set_oem_recovery(self, oem_recovery): self.oem_recovery = oem_recovery def add_oem_recovery(self, value): self.oem_recovery.append(value) def insert_oem_recovery_at(self, index, value): self.oem_recovery.insert(index, value) def replace_oem_recovery_at(self, index, value): self.oem_recovery[index] = value def get_oem_recoveryID(self): return self.oem_recoveryID def set_oem_recoveryID(self, oem_recoveryID): self.oem_recoveryID = oem_recoveryID def add_oem_recoveryID(self, value): self.oem_recoveryID.append(value) def insert_oem_recoveryID_at(self, index, value): self.oem_recoveryID.insert(index, value) def replace_oem_recoveryID_at(self, index, value): self.oem_recoveryID[index] = value def get_oem_recovery_part_size(self): return self.oem_recovery_part_size def set_oem_recovery_part_size(self, oem_recovery_part_size): self.oem_recovery_part_size = oem_recovery_part_size def add_oem_recovery_part_size(self, value): self.oem_recovery_part_size.append(value) def insert_oem_recovery_part_size_at(self, index, value): self.oem_recovery_part_size.insert(index, value) def replace_oem_recovery_part_size_at(self, index, value): self.oem_recovery_part_size[index] = value def get_oem_shutdown(self): return self.oem_shutdown def set_oem_shutdown(self, oem_shutdown): self.oem_shutdown = oem_shutdown def add_oem_shutdown(self, value): self.oem_shutdown.append(value) def insert_oem_shutdown_at(self, index, value): self.oem_shutdown.insert(index, value) def replace_oem_shutdown_at(self, index, value): self.oem_shutdown[index] = value def get_oem_shutdown_interactive(self): return self.oem_shutdown_interactive def set_oem_shutdown_interactive(self, oem_shutdown_interactive): self.oem_shutdown_interactive = oem_shutdown_interactive def add_oem_shutdown_interactive(self, value): self.oem_shutdown_interactive.append(value) def insert_oem_shutdown_interactive_at(self, index, value): self.oem_shutdown_interactive.insert(index, value) def replace_oem_shutdown_interactive_at(self, index, value): self.oem_shutdown_interactive[index] = value def get_oem_silent_boot(self): return self.oem_silent_boot def set_oem_silent_boot(self, oem_silent_boot): self.oem_silent_boot = oem_silent_boot def add_oem_silent_boot(self, value): self.oem_silent_boot.append(value) def insert_oem_silent_boot_at(self, index, value): self.oem_silent_boot.insert(index, value) def replace_oem_silent_boot_at(self, index, value): self.oem_silent_boot[index] = value def get_oem_silent_install(self): return self.oem_silent_install def set_oem_silent_install(self, oem_silent_install): self.oem_silent_install = oem_silent_install def add_oem_silent_install(self, value): self.oem_silent_install.append(value) def insert_oem_silent_install_at(self, index, value): self.oem_silent_install.insert(index, value) def replace_oem_silent_install_at(self, index, value): self.oem_silent_install[index] = value def get_oem_silent_verify(self): return self.oem_silent_verify def set_oem_silent_verify(self, oem_silent_verify): self.oem_silent_verify = oem_silent_verify def add_oem_silent_verify(self, value): self.oem_silent_verify.append(value) def insert_oem_silent_verify_at(self, index, value): self.oem_silent_verify.insert(index, value) def replace_oem_silent_verify_at(self, index, value): self.oem_silent_verify[index] = value def get_oem_skip_verify(self): return self.oem_skip_verify def set_oem_skip_verify(self, oem_skip_verify): self.oem_skip_verify = oem_skip_verify def add_oem_skip_verify(self, value): self.oem_skip_verify.append(value) def insert_oem_skip_verify_at(self, index, value): self.oem_skip_verify.insert(index, value) def replace_oem_skip_verify_at(self, index, value): self.oem_skip_verify[index] = value def get_oem_swap(self): return self.oem_swap def set_oem_swap(self, oem_swap): self.oem_swap = oem_swap def add_oem_swap(self, value): self.oem_swap.append(value) def insert_oem_swap_at(self, index, value): self.oem_swap.insert(index, value) def replace_oem_swap_at(self, index, value): self.oem_swap[index] = value def get_oem_swapsize(self): return self.oem_swapsize def set_oem_swapsize(self, oem_swapsize): self.oem_swapsize = oem_swapsize def add_oem_swapsize(self, value): self.oem_swapsize.append(value) def insert_oem_swapsize_at(self, index, value): self.oem_swapsize.insert(index, value) def replace_oem_swapsize_at(self, index, value): self.oem_swapsize[index] = value def get_oem_systemsize(self): return self.oem_systemsize def set_oem_systemsize(self, oem_systemsize): self.oem_systemsize = oem_systemsize def add_oem_systemsize(self, value): self.oem_systemsize.append(value) def insert_oem_systemsize_at(self, index, value): self.oem_systemsize.insert(index, value) def replace_oem_systemsize_at(self, index, value): self.oem_systemsize[index] = value def get_oem_unattended(self): return self.oem_unattended def set_oem_unattended(self, oem_unattended): self.oem_unattended = oem_unattended def add_oem_unattended(self, value): self.oem_unattended.append(value) def insert_oem_unattended_at(self, index, value): self.oem_unattended.insert(index, value) def replace_oem_unattended_at(self, index, value): self.oem_unattended[index] = value def get_oem_unattended_id(self): return self.oem_unattended_id def set_oem_unattended_id(self, oem_unattended_id): self.oem_unattended_id = oem_unattended_id def add_oem_unattended_id(self, value): self.oem_unattended_id.append(value) def insert_oem_unattended_id_at(self, index, value): self.oem_unattended_id.insert(index, value) def replace_oem_unattended_id_at(self, index, value): self.oem_unattended_id[index] = value def hasContent_(self): if ( self.oem_ataraid_scan or self.oem_boot_title or self.oem_bootwait or self.oem_device_filter or self.oem_inplace_recovery or self.oem_kiwi_initrd or self.oem_multipath_scan or self.oem_vmcp_parmfile or self.oem_partition_install or self.oem_reboot or self.oem_reboot_interactive or self.oem_recovery or self.oem_recoveryID or self.oem_recovery_part_size or self.oem_shutdown or self.oem_shutdown_interactive or self.oem_silent_boot or self.oem_silent_install or self.oem_silent_verify or self.oem_skip_verify or self.oem_swap or self.oem_swapsize or self.oem_systemsize or self.oem_unattended or self.oem_unattended_id ): return True else: return False def export(self, outfile, level, namespace_='', name_='oemconfig', namespacedef_='', pretty_print=True): 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_='oemconfig') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='oemconfig', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='oemconfig'): pass def exportChildren(self, outfile, level, namespace_='', name_='oemconfig', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for oem_ataraid_scan_ in self.oem_ataraid_scan: showIndent(outfile, level, pretty_print) outfile.write('<%soem-ataraid-scan>%s%s' % (namespace_, self.gds_format_boolean(oem_ataraid_scan_, input_name='oem-ataraid-scan'), namespace_, eol_)) for oem_boot_title_ in self.oem_boot_title: showIndent(outfile, level, pretty_print) outfile.write('<%soem-boot-title>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(oem_boot_title_), input_name='oem-boot-title')), namespace_, eol_)) for oem_bootwait_ in self.oem_bootwait: showIndent(outfile, level, pretty_print) outfile.write('<%soem-bootwait>%s%s' % (namespace_, self.gds_format_boolean(oem_bootwait_, input_name='oem-bootwait'), namespace_, eol_)) for oem_device_filter_ in self.oem_device_filter: showIndent(outfile, level, pretty_print) outfile.write('<%soem-device-filter>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(oem_device_filter_), input_name='oem-device-filter')), namespace_, eol_)) for oem_inplace_recovery_ in self.oem_inplace_recovery: showIndent(outfile, level, pretty_print) outfile.write('<%soem-inplace-recovery>%s%s' % (namespace_, self.gds_format_boolean(oem_inplace_recovery_, input_name='oem-inplace-recovery'), namespace_, eol_)) for oem_kiwi_initrd_ in self.oem_kiwi_initrd: showIndent(outfile, level, pretty_print) outfile.write('<%soem-kiwi-initrd>%s%s' % (namespace_, self.gds_format_boolean(oem_kiwi_initrd_, input_name='oem-kiwi-initrd'), namespace_, eol_)) for oem_multipath_scan_ in self.oem_multipath_scan: showIndent(outfile, level, pretty_print) outfile.write('<%soem-multipath-scan>%s%s' % (namespace_, self.gds_format_boolean(oem_multipath_scan_, input_name='oem-multipath-scan'), namespace_, eol_)) for oem_vmcp_parmfile_ in self.oem_vmcp_parmfile: showIndent(outfile, level, pretty_print) outfile.write('<%soem-vmcp-parmfile>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(oem_vmcp_parmfile_), input_name='oem-vmcp-parmfile')), namespace_, eol_)) for oem_partition_install_ in self.oem_partition_install: showIndent(outfile, level, pretty_print) outfile.write('<%soem-partition-install>%s%s' % (namespace_, self.gds_format_boolean(oem_partition_install_, input_name='oem-partition-install'), namespace_, eol_)) for oem_reboot_ in self.oem_reboot: showIndent(outfile, level, pretty_print) outfile.write('<%soem-reboot>%s%s' % (namespace_, self.gds_format_boolean(oem_reboot_, input_name='oem-reboot'), namespace_, eol_)) for oem_reboot_interactive_ in self.oem_reboot_interactive: showIndent(outfile, level, pretty_print) outfile.write('<%soem-reboot-interactive>%s%s' % (namespace_, self.gds_format_boolean(oem_reboot_interactive_, input_name='oem-reboot-interactive'), namespace_, eol_)) for oem_recovery_ in self.oem_recovery: showIndent(outfile, level, pretty_print) outfile.write('<%soem-recovery>%s%s' % (namespace_, self.gds_format_boolean(oem_recovery_, input_name='oem-recovery'), namespace_, eol_)) for oem_recoveryID_ in self.oem_recoveryID: showIndent(outfile, level, pretty_print) outfile.write('<%soem-recoveryID>%s%s' % (namespace_, self.gds_format_integer(oem_recoveryID_, input_name='oem-recoveryID'), namespace_, eol_)) for oem_recovery_part_size_ in self.oem_recovery_part_size: showIndent(outfile, level, pretty_print) outfile.write('<%soem-recovery-part-size>%s%s' % (namespace_, self.gds_format_integer(oem_recovery_part_size_, input_name='oem-recovery-part-size'), namespace_, eol_)) for oem_shutdown_ in self.oem_shutdown: showIndent(outfile, level, pretty_print) outfile.write('<%soem-shutdown>%s%s' % (namespace_, self.gds_format_boolean(oem_shutdown_, input_name='oem-shutdown'), namespace_, eol_)) for oem_shutdown_interactive_ in self.oem_shutdown_interactive: showIndent(outfile, level, pretty_print) outfile.write('<%soem-shutdown-interactive>%s%s' % (namespace_, self.gds_format_boolean(oem_shutdown_interactive_, input_name='oem-shutdown-interactive'), namespace_, eol_)) for oem_silent_boot_ in self.oem_silent_boot: showIndent(outfile, level, pretty_print) outfile.write('<%soem-silent-boot>%s%s' % (namespace_, self.gds_format_boolean(oem_silent_boot_, input_name='oem-silent-boot'), namespace_, eol_)) for oem_silent_install_ in self.oem_silent_install: showIndent(outfile, level, pretty_print) outfile.write('<%soem-silent-install>%s%s' % (namespace_, self.gds_format_boolean(oem_silent_install_, input_name='oem-silent-install'), namespace_, eol_)) for oem_silent_verify_ in self.oem_silent_verify: showIndent(outfile, level, pretty_print) outfile.write('<%soem-silent-verify>%s%s' % (namespace_, self.gds_format_boolean(oem_silent_verify_, input_name='oem-silent-verify'), namespace_, eol_)) for oem_skip_verify_ in self.oem_skip_verify: showIndent(outfile, level, pretty_print) outfile.write('<%soem-skip-verify>%s%s' % (namespace_, self.gds_format_boolean(oem_skip_verify_, input_name='oem-skip-verify'), namespace_, eol_)) for oem_swap_ in self.oem_swap: showIndent(outfile, level, pretty_print) outfile.write('<%soem-swap>%s%s' % (namespace_, self.gds_format_boolean(oem_swap_, input_name='oem-swap'), namespace_, eol_)) for oem_swapsize_ in self.oem_swapsize: showIndent(outfile, level, pretty_print) outfile.write('<%soem-swapsize>%s%s' % (namespace_, self.gds_format_integer(oem_swapsize_, input_name='oem-swapsize'), namespace_, eol_)) for oem_systemsize_ in self.oem_systemsize: showIndent(outfile, level, pretty_print) outfile.write('<%soem-systemsize>%s%s' % (namespace_, self.gds_format_integer(oem_systemsize_, input_name='oem-systemsize'), namespace_, eol_)) for oem_unattended_ in self.oem_unattended: showIndent(outfile, level, pretty_print) outfile.write('<%soem-unattended>%s%s' % (namespace_, self.gds_format_boolean(oem_unattended_, input_name='oem-unattended'), namespace_, eol_)) for oem_unattended_id_ in self.oem_unattended_id: showIndent(outfile, level, pretty_print) outfile.write('<%soem-unattended-id>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(oem_unattended_id_), input_name='oem-unattended-id')), namespace_, eol_)) 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_ == 'oem-ataraid-scan': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_ataraid_scan') self.oem_ataraid_scan.append(ival_) elif nodeName_ == 'oem-boot-title': oem_boot_title_ = child_.text oem_boot_title_ = self.gds_validate_string(oem_boot_title_, node, 'oem_boot_title') self.oem_boot_title.append(oem_boot_title_) elif nodeName_ == 'oem-bootwait': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_bootwait') self.oem_bootwait.append(ival_) elif nodeName_ == 'oem-device-filter': oem_device_filter_ = child_.text oem_device_filter_ = self.gds_validate_string(oem_device_filter_, node, 'oem_device_filter') self.oem_device_filter.append(oem_device_filter_) elif nodeName_ == 'oem-inplace-recovery': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_inplace_recovery') self.oem_inplace_recovery.append(ival_) elif nodeName_ == 'oem-kiwi-initrd': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_kiwi_initrd') self.oem_kiwi_initrd.append(ival_) elif nodeName_ == 'oem-multipath-scan': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_multipath_scan') self.oem_multipath_scan.append(ival_) elif nodeName_ == 'oem-vmcp-parmfile': oem_vmcp_parmfile_ = child_.text oem_vmcp_parmfile_ = self.gds_validate_string(oem_vmcp_parmfile_, node, 'oem_vmcp_parmfile') self.oem_vmcp_parmfile.append(oem_vmcp_parmfile_) elif nodeName_ == 'oem-partition-install': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_partition_install') self.oem_partition_install.append(ival_) elif nodeName_ == 'oem-reboot': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_reboot') self.oem_reboot.append(ival_) elif nodeName_ == 'oem-reboot-interactive': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_reboot_interactive') self.oem_reboot_interactive.append(ival_) elif nodeName_ == 'oem-recovery': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_recovery') self.oem_recovery.append(ival_) elif nodeName_ == 'oem-recoveryID': sval_ = child_.text try: ival_ = int(sval_) except (TypeError, ValueError) as exp: raise_parse_error(child_, 'requires integer: %s' % exp) if ival_ < 0: raise_parse_error(child_, 'requires nonNegativeInteger') ival_ = self.gds_validate_integer(ival_, node, 'oem_recoveryID') self.oem_recoveryID.append(ival_) elif nodeName_ == 'oem-recovery-part-size': sval_ = child_.text try: ival_ = int(sval_) except (TypeError, ValueError) as exp: raise_parse_error(child_, 'requires integer: %s' % exp) if ival_ < 0: raise_parse_error(child_, 'requires nonNegativeInteger') ival_ = self.gds_validate_integer(ival_, node, 'oem_recovery_part_size') self.oem_recovery_part_size.append(ival_) elif nodeName_ == 'oem-shutdown': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_shutdown') self.oem_shutdown.append(ival_) elif nodeName_ == 'oem-shutdown-interactive': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_shutdown_interactive') self.oem_shutdown_interactive.append(ival_) elif nodeName_ == 'oem-silent-boot': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_silent_boot') self.oem_silent_boot.append(ival_) elif nodeName_ == 'oem-silent-install': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_silent_install') self.oem_silent_install.append(ival_) elif nodeName_ == 'oem-silent-verify': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_silent_verify') self.oem_silent_verify.append(ival_) elif nodeName_ == 'oem-skip-verify': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_skip_verify') self.oem_skip_verify.append(ival_) elif nodeName_ == 'oem-swap': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_swap') self.oem_swap.append(ival_) elif nodeName_ == 'oem-swapsize': sval_ = child_.text try: ival_ = int(sval_) except (TypeError, ValueError) as exp: raise_parse_error(child_, 'requires integer: %s' % exp) if ival_ < 0: raise_parse_error(child_, 'requires nonNegativeInteger') ival_ = self.gds_validate_integer(ival_, node, 'oem_swapsize') self.oem_swapsize.append(ival_) elif nodeName_ == 'oem-systemsize': sval_ = child_.text try: ival_ = int(sval_) except (TypeError, ValueError) as exp: raise_parse_error(child_, 'requires integer: %s' % exp) if ival_ < 0: raise_parse_error(child_, 'requires nonNegativeInteger') ival_ = self.gds_validate_integer(ival_, node, 'oem_systemsize') self.oem_systemsize.append(ival_) elif nodeName_ == 'oem-unattended': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'oem_unattended') self.oem_unattended.append(ival_) elif nodeName_ == 'oem-unattended-id': oem_unattended_id_ = child_.text oem_unattended_id_ = self.gds_validate_string(oem_unattended_id_, node, 'oem_unattended_id') self.oem_unattended_id.append(oem_unattended_id_) # end class oemconfig class vagrantconfig(GeneratedsSuper): """Specifies the Vagrant configuration section""" subclass = None superclass = None def __init__(self, provider=None, virtualsize=None, boxname=None): self.original_tagname_ = None self.provider = _cast(None, provider) self.virtualsize = _cast(int, virtualsize) self.boxname = _cast(None, boxname) def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, vagrantconfig) if subclass is not None: return subclass(*args_, **kwargs_) if vagrantconfig.subclass: return vagrantconfig.subclass(*args_, **kwargs_) else: return vagrantconfig(*args_, **kwargs_) factory = staticmethod(factory) def get_provider(self): return self.provider def set_provider(self, provider): self.provider = provider def get_virtualsize(self): return self.virtualsize def set_virtualsize(self, virtualsize): self.virtualsize = virtualsize def get_boxname(self): return self.boxname def set_boxname(self, boxname): self.boxname = boxname def hasContent_(self): if ( ): return True else: return False def export(self, outfile, level, namespace_='', name_='vagrantconfig', namespacedef_='', pretty_print=True): 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_='vagrantconfig') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='vagrantconfig', pretty_print=pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='vagrantconfig'): if self.provider is not None and 'provider' not in already_processed: already_processed.add('provider') outfile.write(' provider=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.provider), input_name='provider')), )) if self.virtualsize is not None and 'virtualsize' not in already_processed: already_processed.add('virtualsize') outfile.write(' virtualsize="%s"' % self.gds_format_integer(self.virtualsize, input_name='virtualsize')) if self.boxname is not None and 'boxname' not in already_processed: already_processed.add('boxname') outfile.write(' boxname=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.boxname), input_name='boxname')), )) def exportChildren(self, outfile, level, namespace_='', name_='vagrantconfig', 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_('provider', node) if value is not None and 'provider' not in already_processed: already_processed.add('provider') self.provider = value self.provider = ' '.join(self.provider.split()) value = find_attr_value_('virtualsize', node) if value is not None and 'virtualsize' not in already_processed: already_processed.add('virtualsize') try: self.virtualsize = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.virtualsize < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') value = find_attr_value_('boxname', node) if value is not None and 'boxname' not in already_processed: already_processed.add('boxname') self.boxname = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): pass # end class vagrantconfig class machine(GeneratedsSuper): """specifies the VM configuration sections""" subclass = None superclass = None def __init__(self, min_memory=None, max_memory=None, min_cpu=None, max_cpu=None, ovftype=None, HWversion=None, arch=None, domain=None, guestOS=None, memory=None, ncpus=None, vmconfig_entry=None, vmdisk=None, vmdvd=None, vmnic=None): self.original_tagname_ = None self.min_memory = _cast(int, min_memory) self.max_memory = _cast(int, max_memory) self.min_cpu = _cast(int, min_cpu) self.max_cpu = _cast(int, max_cpu) self.ovftype = _cast(None, ovftype) self.HWversion = _cast(int, HWversion) self.arch = _cast(None, arch) self.domain = _cast(None, domain) self.guestOS = _cast(None, guestOS) self.memory = _cast(int, memory) self.ncpus = _cast(int, ncpus) if vmconfig_entry is None: self.vmconfig_entry = [] else: self.vmconfig_entry = vmconfig_entry if vmdisk is None: self.vmdisk = [] else: self.vmdisk = vmdisk if vmdvd is None: self.vmdvd = [] else: self.vmdvd = vmdvd if vmnic is None: self.vmnic = [] else: self.vmnic = vmnic def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, machine) if subclass is not None: return subclass(*args_, **kwargs_) if machine.subclass: return machine.subclass(*args_, **kwargs_) else: return machine(*args_, **kwargs_) factory = staticmethod(factory) def get_vmconfig_entry(self): return self.vmconfig_entry def set_vmconfig_entry(self, vmconfig_entry): self.vmconfig_entry = vmconfig_entry def add_vmconfig_entry(self, value): self.vmconfig_entry.append(value) def insert_vmconfig_entry_at(self, index, value): self.vmconfig_entry.insert(index, value) def replace_vmconfig_entry_at(self, index, value): self.vmconfig_entry[index] = value def get_vmdisk(self): return self.vmdisk def set_vmdisk(self, vmdisk): self.vmdisk = vmdisk def add_vmdisk(self, value): self.vmdisk.append(value) def insert_vmdisk_at(self, index, value): self.vmdisk.insert(index, value) def replace_vmdisk_at(self, index, value): self.vmdisk[index] = value def get_vmdvd(self): return self.vmdvd def set_vmdvd(self, vmdvd): self.vmdvd = vmdvd def add_vmdvd(self, value): self.vmdvd.append(value) def insert_vmdvd_at(self, index, value): self.vmdvd.insert(index, value) def replace_vmdvd_at(self, index, value): self.vmdvd[index] = value def get_vmnic(self): return self.vmnic def set_vmnic(self, vmnic): self.vmnic = vmnic def add_vmnic(self, value): self.vmnic.append(value) def insert_vmnic_at(self, index, value): self.vmnic.insert(index, value) def replace_vmnic_at(self, index, value): self.vmnic[index] = value def get_min_memory(self): return self.min_memory def set_min_memory(self, min_memory): self.min_memory = min_memory def get_max_memory(self): return self.max_memory def set_max_memory(self, max_memory): self.max_memory = max_memory def get_min_cpu(self): return self.min_cpu def set_min_cpu(self, min_cpu): self.min_cpu = min_cpu def get_max_cpu(self): return self.max_cpu def set_max_cpu(self, max_cpu): self.max_cpu = max_cpu def get_ovftype(self): return self.ovftype def set_ovftype(self, ovftype): self.ovftype = ovftype def get_HWversion(self): return self.HWversion def set_HWversion(self, HWversion): self.HWversion = HWversion def get_arch(self): return self.arch def set_arch(self, arch): self.arch = arch def get_domain(self): return self.domain def set_domain(self, domain): self.domain = domain def get_guestOS(self): return self.guestOS def set_guestOS(self, guestOS): self.guestOS = guestOS def get_memory(self): return self.memory def set_memory(self, memory): self.memory = memory def get_ncpus(self): return self.ncpus def set_ncpus(self, ncpus): self.ncpus = ncpus def hasContent_(self): if ( self.vmconfig_entry or self.vmdisk or self.vmdvd or self.vmnic ): return True else: return False def export(self, outfile, level, namespace_='', name_='machine', namespacedef_='', pretty_print=True): 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_='machine') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='machine', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='machine'): if self.min_memory is not None and 'min_memory' not in already_processed: already_processed.add('min_memory') outfile.write(' min_memory="%s"' % self.gds_format_integer(self.min_memory, input_name='min_memory')) if self.max_memory is not None and 'max_memory' not in already_processed: already_processed.add('max_memory') outfile.write(' max_memory="%s"' % self.gds_format_integer(self.max_memory, input_name='max_memory')) if self.min_cpu is not None and 'min_cpu' not in already_processed: already_processed.add('min_cpu') outfile.write(' min_cpu="%s"' % self.gds_format_integer(self.min_cpu, input_name='min_cpu')) if self.max_cpu is not None and 'max_cpu' not in already_processed: already_processed.add('max_cpu') outfile.write(' max_cpu="%s"' % self.gds_format_integer(self.max_cpu, input_name='max_cpu')) if self.ovftype is not None and 'ovftype' not in already_processed: already_processed.add('ovftype') outfile.write(' ovftype=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ovftype), input_name='ovftype')), )) if self.HWversion is not None and 'HWversion' not in already_processed: already_processed.add('HWversion') outfile.write(' HWversion="%s"' % self.gds_format_integer(self.HWversion, input_name='HWversion')) if self.arch is not None and 'arch' not in already_processed: already_processed.add('arch') outfile.write(' arch=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.arch), input_name='arch')), )) if self.domain is not None and 'domain' not in already_processed: already_processed.add('domain') outfile.write(' domain=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.domain), input_name='domain')), )) if self.guestOS is not None and 'guestOS' not in already_processed: already_processed.add('guestOS') outfile.write(' guestOS=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.guestOS), input_name='guestOS')), )) if self.memory is not None and 'memory' not in already_processed: already_processed.add('memory') outfile.write(' memory="%s"' % self.gds_format_integer(self.memory, input_name='memory')) if self.ncpus is not None and 'ncpus' not in already_processed: already_processed.add('ncpus') outfile.write(' ncpus="%s"' % self.gds_format_integer(self.ncpus, input_name='ncpus')) def exportChildren(self, outfile, level, namespace_='', name_='machine', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for vmconfig_entry_ in self.vmconfig_entry: showIndent(outfile, level, pretty_print) outfile.write('<%svmconfig-entry>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(vmconfig_entry_), input_name='vmconfig-entry')), namespace_, eol_)) for vmdisk_ in self.vmdisk: vmdisk_.export(outfile, level, namespace_, name_='vmdisk', pretty_print=pretty_print) for vmdvd_ in self.vmdvd: vmdvd_.export(outfile, level, namespace_, name_='vmdvd', pretty_print=pretty_print) for vmnic_ in self.vmnic: vmnic_.export(outfile, level, namespace_, name_='vmnic', 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_('min_memory', node) if value is not None and 'min_memory' not in already_processed: already_processed.add('min_memory') try: self.min_memory = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.min_memory < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') value = find_attr_value_('max_memory', node) if value is not None and 'max_memory' not in already_processed: already_processed.add('max_memory') try: self.max_memory = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.max_memory < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') value = find_attr_value_('min_cpu', node) if value is not None and 'min_cpu' not in already_processed: already_processed.add('min_cpu') try: self.min_cpu = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.min_cpu < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') value = find_attr_value_('max_cpu', node) if value is not None and 'max_cpu' not in already_processed: already_processed.add('max_cpu') try: self.max_cpu = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.max_cpu < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') value = find_attr_value_('ovftype', node) if value is not None and 'ovftype' not in already_processed: already_processed.add('ovftype') self.ovftype = value self.ovftype = ' '.join(self.ovftype.split()) value = find_attr_value_('HWversion', node) if value is not None and 'HWversion' not in already_processed: already_processed.add('HWversion') try: self.HWversion = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) value = find_attr_value_('arch', node) if value is not None and 'arch' not in already_processed: already_processed.add('arch') self.arch = value self.arch = ' '.join(self.arch.split()) value = find_attr_value_('domain', node) if value is not None and 'domain' not in already_processed: already_processed.add('domain') self.domain = value self.domain = ' '.join(self.domain.split()) value = find_attr_value_('guestOS', node) if value is not None and 'guestOS' not in already_processed: already_processed.add('guestOS') self.guestOS = value value = find_attr_value_('memory', node) if value is not None and 'memory' not in already_processed: already_processed.add('memory') try: self.memory = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.memory < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') value = find_attr_value_('ncpus', node) if value is not None and 'ncpus' not in already_processed: already_processed.add('ncpus') try: self.ncpus = int(value) except ValueError as exp: raise_parse_error(node, 'Bad integer attribute: %s' % exp) if self.ncpus < 0: raise_parse_error(node, 'Invalid NonNegativeInteger') def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'vmconfig-entry': vmconfig_entry_ = child_.text vmconfig_entry_ = self.gds_validate_string(vmconfig_entry_, node, 'vmconfig_entry') self.vmconfig_entry.append(vmconfig_entry_) elif nodeName_ == 'vmdisk': obj_ = vmdisk.factory() obj_.build(child_) self.vmdisk.append(obj_) obj_.original_tagname_ = 'vmdisk' elif nodeName_ == 'vmdvd': obj_ = vmdvd.factory() obj_.build(child_) self.vmdvd.append(obj_) obj_.original_tagname_ = 'vmdvd' elif nodeName_ == 'vmnic': obj_ = vmnic.factory() obj_.build(child_) self.vmnic.append(obj_) obj_.original_tagname_ = 'vmnic' # end class machine class packages(GeneratedsSuper): """Specifies Packages/Patterns Used in Different Stages""" subclass = None superclass = None def __init__(self, type_=None, profiles=None, patternType=None, archive=None, ignore=None, namedCollection=None, product=None, package=None): self.original_tagname_ = None self.type_ = _cast(None, type_) self.profiles = _cast(None, profiles) self.patternType = _cast(None, patternType) if archive is None: self.archive = [] else: self.archive = archive if ignore is None: self.ignore = [] else: self.ignore = ignore if namedCollection is None: self.namedCollection = [] else: self.namedCollection = namedCollection if product is None: self.product = [] else: self.product = product if package is None: self.package = [] else: self.package = package def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, packages) if subclass is not None: return subclass(*args_, **kwargs_) if packages.subclass: return packages.subclass(*args_, **kwargs_) else: return packages(*args_, **kwargs_) factory = staticmethod(factory) def get_archive(self): return self.archive def set_archive(self, archive): self.archive = archive def add_archive(self, value): self.archive.append(value) def insert_archive_at(self, index, value): self.archive.insert(index, value) def replace_archive_at(self, index, value): self.archive[index] = value def get_ignore(self): return self.ignore def set_ignore(self, ignore): self.ignore = ignore def add_ignore(self, value): self.ignore.append(value) def insert_ignore_at(self, index, value): self.ignore.insert(index, value) def replace_ignore_at(self, index, value): self.ignore[index] = value def get_namedCollection(self): return self.namedCollection def set_namedCollection(self, namedCollection): self.namedCollection = namedCollection def add_namedCollection(self, value): self.namedCollection.append(value) def insert_namedCollection_at(self, index, value): self.namedCollection.insert(index, value) def replace_namedCollection_at(self, index, value): self.namedCollection[index] = value def get_product(self): return self.product def set_product(self, product): self.product = product def add_product(self, value): self.product.append(value) def insert_product_at(self, index, value): self.product.insert(index, value) def replace_product_at(self, index, value): self.product[index] = value def get_package(self): return self.package def set_package(self, package): self.package = package def add_package(self, value): self.package.append(value) def insert_package_at(self, index, value): self.package.insert(index, value) def replace_package_at(self, index, value): self.package[index] = value def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def get_profiles(self): return self.profiles def set_profiles(self, profiles): self.profiles = profiles def get_patternType(self): return self.patternType def set_patternType(self, patternType): self.patternType = patternType def hasContent_(self): if ( self.archive or self.ignore or self.namedCollection or self.product or self.package ): return True else: return False def export(self, outfile, level, namespace_='', name_='packages', namespacedef_='', pretty_print=True): 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_='packages') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='packages', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='packages'): 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')), )) if self.profiles is not None and 'profiles' not in already_processed: already_processed.add('profiles') outfile.write(' profiles=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.profiles), input_name='profiles')), )) if self.patternType is not None and 'patternType' not in already_processed: already_processed.add('patternType') outfile.write(' patternType=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.patternType), input_name='patternType')), )) def exportChildren(self, outfile, level, namespace_='', name_='packages', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for archive_ in self.archive: archive_.export(outfile, level, namespace_, name_='archive', pretty_print=pretty_print) for ignore_ in self.ignore: ignore_.export(outfile, level, namespace_, name_='ignore', pretty_print=pretty_print) for namedCollection_ in self.namedCollection: namedCollection_.export(outfile, level, namespace_, name_='namedCollection', pretty_print=pretty_print) for product_ in self.product: product_.export(outfile, level, namespace_, name_='product', pretty_print=pretty_print) for package_ in self.package: package_.export(outfile, level, namespace_, name_='package', 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 self.type_ = ' '.join(self.type_.split()) value = find_attr_value_('profiles', node) if value is not None and 'profiles' not in already_processed: already_processed.add('profiles') self.profiles = value value = find_attr_value_('patternType', node) if value is not None and 'patternType' not in already_processed: already_processed.add('patternType') self.patternType = value self.patternType = ' '.join(self.patternType.split()) def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'archive': obj_ = archive.factory() obj_.build(child_) self.archive.append(obj_) obj_.original_tagname_ = 'archive' elif nodeName_ == 'ignore': obj_ = ignore.factory() obj_.build(child_) self.ignore.append(obj_) obj_.original_tagname_ = 'ignore' elif nodeName_ == 'namedCollection': obj_ = namedCollection.factory() obj_.build(child_) self.namedCollection.append(obj_) obj_.original_tagname_ = 'namedCollection' elif nodeName_ == 'product': obj_ = product.factory() obj_.build(child_) self.product.append(obj_) obj_.original_tagname_ = 'product' elif nodeName_ == 'package': obj_ = package.factory() obj_.build(child_) self.package.append(obj_) obj_.original_tagname_ = 'package' # end class packages class preferences(GeneratedsSuper): """Configuration Information Needed for Logical Extend""" subclass = None superclass = None def __init__(self, profiles=None, bootsplash_theme=None, bootloader_theme=None, defaultdestination=None, defaultprebuilt=None, defaultroot=None, hwclock=None, keytable=None, locale=None, packagemanager=None, partitioner=None, rpm_check_signatures=None, rpm_excludedocs=None, rpm_force=None, showlicense=None, timezone=None, type_=None, version=None): self.original_tagname_ = None self.profiles = _cast(None, profiles) if bootsplash_theme is None: self.bootsplash_theme = [] else: self.bootsplash_theme = bootsplash_theme if bootloader_theme is None: self.bootloader_theme = [] else: self.bootloader_theme = bootloader_theme if defaultdestination is None: self.defaultdestination = [] else: self.defaultdestination = defaultdestination if defaultprebuilt is None: self.defaultprebuilt = [] else: self.defaultprebuilt = defaultprebuilt if defaultroot is None: self.defaultroot = [] else: self.defaultroot = defaultroot if hwclock is None: self.hwclock = [] else: self.hwclock = hwclock if keytable is None: self.keytable = [] else: self.keytable = keytable if locale is None: self.locale = [] else: self.locale = locale if packagemanager is None: self.packagemanager = [] else: self.packagemanager = packagemanager if partitioner is None: self.partitioner = [] else: self.partitioner = partitioner if rpm_check_signatures is None: self.rpm_check_signatures = [] else: self.rpm_check_signatures = rpm_check_signatures if rpm_excludedocs is None: self.rpm_excludedocs = [] else: self.rpm_excludedocs = rpm_excludedocs if rpm_force is None: self.rpm_force = [] else: self.rpm_force = rpm_force if showlicense is None: self.showlicense = [] else: self.showlicense = showlicense if timezone is None: self.timezone = [] else: self.timezone = timezone if type_ is None: self.type_ = [] else: self.type_ = type_ if version is None: self.version = [] else: self.version = version def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, preferences) if subclass is not None: return subclass(*args_, **kwargs_) if preferences.subclass: return preferences.subclass(*args_, **kwargs_) else: return preferences(*args_, **kwargs_) factory = staticmethod(factory) def get_bootsplash_theme(self): return self.bootsplash_theme def set_bootsplash_theme(self, bootsplash_theme): self.bootsplash_theme = bootsplash_theme def add_bootsplash_theme(self, value): self.bootsplash_theme.append(value) def insert_bootsplash_theme_at(self, index, value): self.bootsplash_theme.insert(index, value) def replace_bootsplash_theme_at(self, index, value): self.bootsplash_theme[index] = value def get_bootloader_theme(self): return self.bootloader_theme def set_bootloader_theme(self, bootloader_theme): self.bootloader_theme = bootloader_theme def add_bootloader_theme(self, value): self.bootloader_theme.append(value) def insert_bootloader_theme_at(self, index, value): self.bootloader_theme.insert(index, value) def replace_bootloader_theme_at(self, index, value): self.bootloader_theme[index] = value def get_defaultdestination(self): return self.defaultdestination def set_defaultdestination(self, defaultdestination): self.defaultdestination = defaultdestination def add_defaultdestination(self, value): self.defaultdestination.append(value) def insert_defaultdestination_at(self, index, value): self.defaultdestination.insert(index, value) def replace_defaultdestination_at(self, index, value): self.defaultdestination[index] = value def get_defaultprebuilt(self): return self.defaultprebuilt def set_defaultprebuilt(self, defaultprebuilt): self.defaultprebuilt = defaultprebuilt def add_defaultprebuilt(self, value): self.defaultprebuilt.append(value) def insert_defaultprebuilt_at(self, index, value): self.defaultprebuilt.insert(index, value) def replace_defaultprebuilt_at(self, index, value): self.defaultprebuilt[index] = value def get_defaultroot(self): return self.defaultroot def set_defaultroot(self, defaultroot): self.defaultroot = defaultroot def add_defaultroot(self, value): self.defaultroot.append(value) def insert_defaultroot_at(self, index, value): self.defaultroot.insert(index, value) def replace_defaultroot_at(self, index, value): self.defaultroot[index] = value def get_hwclock(self): return self.hwclock def set_hwclock(self, hwclock): self.hwclock = hwclock def add_hwclock(self, value): self.hwclock.append(value) def insert_hwclock_at(self, index, value): self.hwclock.insert(index, value) def replace_hwclock_at(self, index, value): self.hwclock[index] = value def get_keytable(self): return self.keytable def set_keytable(self, keytable): self.keytable = keytable def add_keytable(self, value): self.keytable.append(value) def insert_keytable_at(self, index, value): self.keytable.insert(index, value) def replace_keytable_at(self, index, value): self.keytable[index] = value def get_locale(self): return self.locale def set_locale(self, locale): self.locale = locale def add_locale(self, value): self.locale.append(value) def insert_locale_at(self, index, value): self.locale.insert(index, value) def replace_locale_at(self, index, value): self.locale[index] = value def get_packagemanager(self): return self.packagemanager def set_packagemanager(self, packagemanager): self.packagemanager = packagemanager def add_packagemanager(self, value): self.packagemanager.append(value) def insert_packagemanager_at(self, index, value): self.packagemanager.insert(index, value) def replace_packagemanager_at(self, index, value): self.packagemanager[index] = value def get_partitioner(self): return self.partitioner def set_partitioner(self, partitioner): self.partitioner = partitioner def add_partitioner(self, value): self.partitioner.append(value) def insert_partitioner_at(self, index, value): self.partitioner.insert(index, value) def replace_partitioner_at(self, index, value): self.partitioner[index] = value def get_rpm_check_signatures(self): return self.rpm_check_signatures def set_rpm_check_signatures(self, rpm_check_signatures): self.rpm_check_signatures = rpm_check_signatures def add_rpm_check_signatures(self, value): self.rpm_check_signatures.append(value) def insert_rpm_check_signatures_at(self, index, value): self.rpm_check_signatures.insert(index, value) def replace_rpm_check_signatures_at(self, index, value): self.rpm_check_signatures[index] = value def get_rpm_excludedocs(self): return self.rpm_excludedocs def set_rpm_excludedocs(self, rpm_excludedocs): self.rpm_excludedocs = rpm_excludedocs def add_rpm_excludedocs(self, value): self.rpm_excludedocs.append(value) def insert_rpm_excludedocs_at(self, index, value): self.rpm_excludedocs.insert(index, value) def replace_rpm_excludedocs_at(self, index, value): self.rpm_excludedocs[index] = value def get_rpm_force(self): return self.rpm_force def set_rpm_force(self, rpm_force): self.rpm_force = rpm_force def add_rpm_force(self, value): self.rpm_force.append(value) def insert_rpm_force_at(self, index, value): self.rpm_force.insert(index, value) def replace_rpm_force_at(self, index, value): self.rpm_force[index] = value def get_showlicense(self): return self.showlicense def set_showlicense(self, showlicense): self.showlicense = showlicense def add_showlicense(self, value): self.showlicense.append(value) def insert_showlicense_at(self, index, value): self.showlicense.insert(index, value) def replace_showlicense_at(self, index, value): self.showlicense[index] = value def get_timezone(self): return self.timezone def set_timezone(self, timezone): self.timezone = timezone def add_timezone(self, value): self.timezone.append(value) def insert_timezone_at(self, index, value): self.timezone.insert(index, value) def replace_timezone_at(self, index, value): self.timezone[index] = value def get_type(self): return self.type_ def set_type(self, type_): self.type_ = type_ def add_type(self, value): self.type_.append(value) def insert_type_at(self, index, value): self.type_.insert(index, value) def replace_type_at(self, index, value): self.type_[index] = value def get_version(self): return self.version def set_version(self, version): self.version = version def add_version(self, value): self.version.append(value) def insert_version_at(self, index, value): self.version.insert(index, value) def replace_version_at(self, index, value): self.version[index] = value def get_profiles(self): return self.profiles def set_profiles(self, profiles): self.profiles = profiles def hasContent_(self): if ( self.bootsplash_theme or self.bootloader_theme or self.defaultdestination or self.defaultprebuilt or self.defaultroot or self.hwclock or self.keytable or self.locale or self.packagemanager or self.partitioner or self.rpm_check_signatures or self.rpm_excludedocs or self.rpm_force or self.showlicense or self.timezone or self.type_ or self.version ): return True else: return False def export(self, outfile, level, namespace_='', name_='preferences', namespacedef_='', pretty_print=True): 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_='preferences') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='preferences', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='preferences'): if self.profiles is not None and 'profiles' not in already_processed: already_processed.add('profiles') outfile.write(' profiles=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.profiles), input_name='profiles')), )) def exportChildren(self, outfile, level, namespace_='', name_='preferences', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for bootsplash_theme_ in self.bootsplash_theme: showIndent(outfile, level, pretty_print) outfile.write('<%sbootsplash-theme>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(bootsplash_theme_), input_name='bootsplash-theme')), namespace_, eol_)) for bootloader_theme_ in self.bootloader_theme: showIndent(outfile, level, pretty_print) outfile.write('<%sbootloader-theme>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(bootloader_theme_), input_name='bootloader-theme')), namespace_, eol_)) for defaultdestination_ in self.defaultdestination: showIndent(outfile, level, pretty_print) outfile.write('<%sdefaultdestination>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(defaultdestination_), input_name='defaultdestination')), namespace_, eol_)) for defaultprebuilt_ in self.defaultprebuilt: showIndent(outfile, level, pretty_print) outfile.write('<%sdefaultprebuilt>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(defaultprebuilt_), input_name='defaultprebuilt')), namespace_, eol_)) for defaultroot_ in self.defaultroot: showIndent(outfile, level, pretty_print) outfile.write('<%sdefaultroot>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(defaultroot_), input_name='defaultroot')), namespace_, eol_)) for hwclock_ in self.hwclock: showIndent(outfile, level, pretty_print) outfile.write('<%shwclock>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(hwclock_), input_name='hwclock')), namespace_, eol_)) for keytable_ in self.keytable: showIndent(outfile, level, pretty_print) outfile.write('<%skeytable>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(keytable_), input_name='keytable')), namespace_, eol_)) for locale_ in self.locale: showIndent(outfile, level, pretty_print) outfile.write('<%slocale>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(locale_), input_name='locale')), namespace_, eol_)) for packagemanager_ in self.packagemanager: showIndent(outfile, level, pretty_print) outfile.write('<%spackagemanager>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(packagemanager_), input_name='packagemanager')), namespace_, eol_)) for partitioner_ in self.partitioner: showIndent(outfile, level, pretty_print) outfile.write('<%spartitioner>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(partitioner_), input_name='partitioner')), namespace_, eol_)) for rpm_check_signatures_ in self.rpm_check_signatures: showIndent(outfile, level, pretty_print) outfile.write('<%srpm-check-signatures>%s%s' % (namespace_, self.gds_format_boolean(rpm_check_signatures_, input_name='rpm-check-signatures'), namespace_, eol_)) for rpm_excludedocs_ in self.rpm_excludedocs: showIndent(outfile, level, pretty_print) outfile.write('<%srpm-excludedocs>%s%s' % (namespace_, self.gds_format_boolean(rpm_excludedocs_, input_name='rpm-excludedocs'), namespace_, eol_)) for rpm_force_ in self.rpm_force: showIndent(outfile, level, pretty_print) outfile.write('<%srpm-force>%s%s' % (namespace_, self.gds_format_boolean(rpm_force_, input_name='rpm-force'), namespace_, eol_)) for showlicense_ in self.showlicense: showIndent(outfile, level, pretty_print) outfile.write('<%sshowlicense>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(showlicense_), input_name='showlicense')), namespace_, eol_)) for timezone_ in self.timezone: showIndent(outfile, level, pretty_print) outfile.write('<%stimezone>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(timezone_), input_name='timezone')), namespace_, eol_)) for type_ in self.type_: type_.export(outfile, level, namespace_, name_='type', pretty_print=pretty_print) for version_ in self.version: showIndent(outfile, level, pretty_print) outfile.write('<%sversion>%s%s' % (namespace_, self.gds_encode(self.gds_format_string(quote_xml(version_), input_name='version')), namespace_, eol_)) 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_('profiles', node) if value is not None and 'profiles' not in already_processed: already_processed.add('profiles') self.profiles = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'bootsplash-theme': bootsplash_theme_ = child_.text bootsplash_theme_ = self.gds_validate_string(bootsplash_theme_, node, 'bootsplash_theme') self.bootsplash_theme.append(bootsplash_theme_) elif nodeName_ == 'bootloader-theme': bootloader_theme_ = child_.text bootloader_theme_ = self.gds_validate_string(bootloader_theme_, node, 'bootloader_theme') self.bootloader_theme.append(bootloader_theme_) elif nodeName_ == 'defaultdestination': defaultdestination_ = child_.text defaultdestination_ = self.gds_validate_string(defaultdestination_, node, 'defaultdestination') self.defaultdestination.append(defaultdestination_) elif nodeName_ == 'defaultprebuilt': defaultprebuilt_ = child_.text defaultprebuilt_ = self.gds_validate_string(defaultprebuilt_, node, 'defaultprebuilt') self.defaultprebuilt.append(defaultprebuilt_) elif nodeName_ == 'defaultroot': defaultroot_ = child_.text defaultroot_ = self.gds_validate_string(defaultroot_, node, 'defaultroot') self.defaultroot.append(defaultroot_) elif nodeName_ == 'hwclock': hwclock_ = child_.text if hwclock_: hwclock_ = re_.sub(String_cleanup_pat_, " ", hwclock_).strip() else: hwclock_ = "" hwclock_ = self.gds_validate_string(hwclock_, node, 'hwclock') self.hwclock.append(hwclock_) elif nodeName_ == 'keytable': keytable_ = child_.text keytable_ = self.gds_validate_string(keytable_, node, 'keytable') self.keytable.append(keytable_) elif nodeName_ == 'locale': locale_ = child_.text if locale_: locale_ = re_.sub(String_cleanup_pat_, " ", locale_).strip() else: locale_ = "" locale_ = self.gds_validate_string(locale_, node, 'locale') self.locale.append(locale_) elif nodeName_ == 'packagemanager': packagemanager_ = child_.text if packagemanager_: packagemanager_ = re_.sub(String_cleanup_pat_, " ", packagemanager_).strip() else: packagemanager_ = "" packagemanager_ = self.gds_validate_string(packagemanager_, node, 'packagemanager') self.packagemanager.append(packagemanager_) elif nodeName_ == 'partitioner': partitioner_ = child_.text if partitioner_: partitioner_ = re_.sub(String_cleanup_pat_, " ", partitioner_).strip() else: partitioner_ = "" partitioner_ = self.gds_validate_string(partitioner_, node, 'partitioner') self.partitioner.append(partitioner_) elif nodeName_ == 'rpm-check-signatures': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'rpm_check_signatures') self.rpm_check_signatures.append(ival_) elif nodeName_ == 'rpm-excludedocs': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'rpm_excludedocs') self.rpm_excludedocs.append(ival_) elif nodeName_ == 'rpm-force': sval_ = child_.text if sval_ in ('true', '1'): ival_ = True elif sval_ in ('false', '0'): ival_ = False else: raise_parse_error(child_, 'requires boolean') ival_ = self.gds_validate_boolean(ival_, node, 'rpm_force') self.rpm_force.append(ival_) elif nodeName_ == 'showlicense': showlicense_ = child_.text showlicense_ = self.gds_validate_string(showlicense_, node, 'showlicense') self.showlicense.append(showlicense_) elif nodeName_ == 'timezone': timezone_ = child_.text timezone_ = self.gds_validate_string(timezone_, node, 'timezone') self.timezone.append(timezone_) elif nodeName_ == 'type': obj_ = type_.factory() obj_.build(child_) self.type_.append(obj_) obj_.original_tagname_ = 'type' elif nodeName_ == 'version': version_ = child_.text version_ = self.gds_validate_string(version_, node, 'version') self.version.append(version_) # end class preferences class profiles(GeneratedsSuper): """Creates Namespace Section for Drivers""" subclass = None superclass = None def __init__(self, profile=None): self.original_tagname_ = None if profile is None: self.profile = [] else: self.profile = profile def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, profiles) if subclass is not None: return subclass(*args_, **kwargs_) if profiles.subclass: return profiles.subclass(*args_, **kwargs_) else: return profiles(*args_, **kwargs_) factory = staticmethod(factory) def get_profile(self): return self.profile def set_profile(self, profile): self.profile = profile def add_profile(self, value): self.profile.append(value) def insert_profile_at(self, index, value): self.profile.insert(index, value) def replace_profile_at(self, index, value): self.profile[index] = value def hasContent_(self): if ( self.profile ): return True else: return False def export(self, outfile, level, namespace_='', name_='profiles', namespacedef_='', pretty_print=True): 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_='profiles') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='profiles', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='profiles'): pass def exportChildren(self, outfile, level, namespace_='', name_='profiles', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for profile_ in self.profile: profile_.export(outfile, level, namespace_, name_='profile', 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_ == 'profile': obj_ = profile.factory() obj_.build(child_) self.profile.append(obj_) obj_.original_tagname_ = 'profile' # end class profiles class users(GeneratedsSuper): """A List of Users""" subclass = None superclass = None def __init__(self, profiles=None, user=None): self.original_tagname_ = None self.profiles = _cast(None, profiles) if user is None: self.user = [] else: self.user = user def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( CurrentSubclassModule_, users) if subclass is not None: return subclass(*args_, **kwargs_) if users.subclass: return users.subclass(*args_, **kwargs_) else: return users(*args_, **kwargs_) factory = staticmethod(factory) def get_user(self): return self.user def set_user(self, user): self.user = user def add_user(self, value): self.user.append(value) def insert_user_at(self, index, value): self.user.insert(index, value) def replace_user_at(self, index, value): self.user[index] = value def get_profiles(self): return self.profiles def set_profiles(self, profiles): self.profiles = profiles def hasContent_(self): if ( self.user ): return True else: return False def export(self, outfile, level, namespace_='', name_='users', namespacedef_='', pretty_print=True): 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_='users') if self.hasContent_(): outfile.write('>%s' % (eol_, )) self.exportChildren(outfile, level + 1, namespace_='', name_='users', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespace_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='users'): if self.profiles is not None and 'profiles' not in already_processed: already_processed.add('profiles') outfile.write(' profiles=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.profiles), input_name='profiles')), )) def exportChildren(self, outfile, level, namespace_='', name_='users', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' for user_ in self.user: user_.export(outfile, level, namespace_, name_='user', 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_('profiles', node) if value is not None and 'profiles' not in already_processed: already_processed.add('profiles') self.profiles = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): if nodeName_ == 'user': obj_ = user.factory() obj_.build(child_) self.user.append(obj_) obj_.original_tagname_ = 'user' # end class users GDSClassesMapping = { } USAGE_TEXT = """ Usage: python .py [ -s ] """ def usage(): print(USAGE_TEXT) sys.exit(1) def get_root_tag(node): tag = Tag_pattern_.match(node.tag).groups()[-1] rootClass = GDSClassesMapping.get(tag) if rootClass is None: rootClass = globals().get(tag) return tag, rootClass def parse(inFileName, silence=False): parser = None doc = parsexml_(inFileName, parser) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'k_source' rootClass = k_source rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None if not silence: sys.stdout.write('\n') rootObj.export( sys.stdout, 0, name_=rootTag, namespacedef_='', pretty_print=True) return rootObj def parseEtree(inFileName, silence=False): parser = None doc = parsexml_(inFileName, parser) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'k_source' rootClass = k_source rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None mapping = {} rootElement = rootObj.to_etree(None, name_=rootTag, mapping_=mapping) reverse_mapping = rootObj.gds_reverse_node_mapping(mapping) if not silence: content = etree_.tostring( rootElement, pretty_print=True, xml_declaration=True, encoding="utf-8") sys.stdout.write(content) sys.stdout.write('\n') return rootObj, rootElement, mapping, reverse_mapping def parseString(inString, silence=False): from StringIO import StringIO parser = None doc = parsexml_(StringIO(inString), parser) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'k_source' rootClass = k_source rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None if not silence: sys.stdout.write('\n') rootObj.export( sys.stdout, 0, name_=rootTag, namespacedef_='') return rootObj def parseLiteral(inFileName, silence=False): parser = None doc = parsexml_(inFileName, parser) rootNode = doc.getroot() rootTag, rootClass = get_root_tag(rootNode) if rootClass is None: rootTag = 'k_source' rootClass = k_source rootObj = rootClass.factory() rootObj.build(rootNode) # Enable Python to collect the space used by the DOM. doc = None if not silence: sys.stdout.write('#from xml_parse import *\n\n') sys.stdout.write('import xml_parse as model_\n\n') sys.stdout.write('rootObj = model_.rootClass(\n') rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) sys.stdout.write(')\n') return rootObj def main(): args = sys.argv[1:] if len(args) == 1: parse(args[0]) else: usage() if __name__ == '__main__': #import pdb; pdb.set_trace() main() __all__ = [ "arch", "architectures", "archive", "chroot", "configuration", "containerconfig", "description", "drivers", "driverupdate", "extension", "file", "ignore", "image", "install", "instrepo", "instsource", "instsys", "k_source", "machine", "metadata", "metafile", "modules", "namedCollection", "oemconfig", "package", "packages", "partition", "partitions", "preferences", "product", "productinfo", "productoption", "productoptions", "productvar", "profile", "profiles", "pxedeploy", "repopackage", "repopackages", "repository", "requiredarch", "size", "source", "strip", "systemdisk", "target", "type_", "union", "user", "users", "vagrantconfig", "vmdisk", "vmdvd", "vmnic", "volume" ]