<s> import sys <EOL> import getopt <EOL> import re as re_ <EOL> import base64 <EOL> from datetime import datetime , tzinfo , timedelta <EOL> etree_ = None <EOL> Verbose_import_ = False <EOL> ( XMLParser_import_none , XMLParser_import_lxml , <EOL> XMLParser_import_elementtree <EOL> ) = range ( <NUM_LIT:3> ) <EOL> XMLParser_import_library = None <EOL> try : <EOL> from lxml import etree as etree_ <EOL> XMLParser_import_library = XMLParser_import_lxml <EOL> if Verbose_import_ : <EOL> print ( "<STR_LIT>" ) <EOL> except ImportError : <EOL> try : <EOL> import xml . etree . cElementTree as etree_ <EOL> XMLParser_import_library = XMLParser_import_elementtree <EOL> if Verbose_import_ : <EOL> print ( "<STR_LIT>" ) <EOL> except ImportError : <EOL> try : <EOL> import xml . etree . ElementTree as etree_ <EOL> XMLParser_import_library = XMLParser_import_elementtree <EOL> if Verbose_import_ : <EOL> print ( "<STR_LIT>" ) <EOL> except ImportError : <EOL> try : <EOL> import cElementTree as etree_ <EOL> XMLParser_import_library = XMLParser_import_elementtree <EOL> if Verbose_import_ : <EOL> print ( "<STR_LIT>" ) <EOL> except ImportError : <EOL> try : <EOL> import elementtree . ElementTree as etree_ <EOL> XMLParser_import_library = XMLParser_import_elementtree <EOL> if Verbose_import_ : <EOL> print ( "<STR_LIT>" ) <EOL> except ImportError : <EOL> raise ImportError ( <EOL> "<STR_LIT>" ) <EOL> def parsexml_ ( * args , ** kwargs ) : <EOL> if ( XMLParser_import_library == XMLParser_import_lxml and <EOL> '<STR_LIT>' not in kwargs ) : <EOL> kwargs [ '<STR_LIT>' ] = etree_ . ETCompatXMLParser ( ) <EOL> doc = etree_ . parse ( * args , ** kwargs ) <EOL> return doc <EOL> try : <EOL> from generatedssuper import GeneratedsSuper <EOL> except ImportError , exp : <EOL> class GeneratedsSuper ( object ) : <EOL> tzoff_pattern = re_ . compile ( r'<STR_LIT>' ) <EOL> class _FixedOffsetTZ ( tzinfo ) : <EOL> def __init__ ( self , offset , name ) : <EOL> self . __offset = timedelta ( minutes = offset ) <EOL> self . __name = name <EOL> def utcoffset ( self , dt ) : <EOL> return self . __offset <EOL> def tzname ( self , dt ) : <EOL> return self . __name <EOL> def dst ( self , dt ) : <EOL> return None <EOL> def gds_format_string ( self , input_data , input_name = '<STR_LIT>' ) : <EOL> return input_data <EOL> def gds_validate_string ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> return input_data <EOL> def gds_format_base64 ( self , input_data , input_name = '<STR_LIT>' ) : <EOL> return base64 . b64encode ( input_data ) <EOL> def gds_validate_base64 ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> return input_data <EOL> def gds_format_integer ( self , input_data , input_name = '<STR_LIT>' ) : <EOL> return '<STR_LIT>' % input_data <EOL> def gds_validate_integer ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> return input_data <EOL> def gds_format_integer_list ( self , input_data , input_name = '<STR_LIT>' ) : <EOL> return '<STR_LIT:%s>' % input_data <EOL> def gds_validate_integer_list ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> values = input_data . split ( ) <EOL> for value in values : <EOL> try : <EOL> fvalue = float ( value ) <EOL> except ( TypeError , ValueError ) , exp : <EOL> raise_parse_error ( node , '<STR_LIT>' ) <EOL> return input_data <EOL> def gds_format_float ( self , input_data , input_name = '<STR_LIT>' ) : <EOL> return '<STR_LIT>' % input_data <EOL> def gds_validate_float ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> return input_data <EOL> def gds_format_float_list ( self , input_data , input_name = '<STR_LIT>' ) : <EOL> return '<STR_LIT:%s>' % input_data <EOL> def gds_validate_float_list ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> values = input_data . split ( ) <EOL> for value in values : <EOL> try : <EOL> fvalue = float ( value ) <EOL> except ( TypeError , ValueError ) , exp : <EOL> raise_parse_error ( node , '<STR_LIT>' ) <EOL> return input_data <EOL> def gds_format_double ( self , input_data , input_name = '<STR_LIT>' ) : <EOL> return '<STR_LIT>' % input_data <EOL> def gds_validate_double ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> return input_data <EOL> def gds_format_double_list ( self , input_data , input_name = '<STR_LIT>' ) : <EOL> return '<STR_LIT:%s>' % input_data <EOL> def gds_validate_double_list ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> values = input_data . split ( ) <EOL> for value in values : <EOL> try : <EOL> fvalue = float ( value ) <EOL> except ( TypeError , ValueError ) , exp : <EOL> raise_parse_error ( node , '<STR_LIT>' ) <EOL> return input_data <EOL> def gds_format_boolean ( self , input_data , input_name = '<STR_LIT>' ) : <EOL> return '<STR_LIT:%s>' % input_data <EOL> def gds_validate_boolean ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> return input_data <EOL> def gds_format_boolean_list ( self , input_data , input_name = '<STR_LIT>' ) : <EOL> return '<STR_LIT:%s>' % input_data <EOL> def gds_validate_boolean_list ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> values = input_data . split ( ) <EOL> for value in values : <EOL> if value not in ( '<STR_LIT:true>' , '<STR_LIT:1>' , '<STR_LIT:false>' , '<STR_LIT:0>' , ) : <EOL> raise_parse_error ( node , <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> return input_data <EOL> def gds_validate_datetime ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> return input_data <EOL> def gds_format_datetime ( self , input_data , input_name = '<STR_LIT>' ) : <EOL> if input_data . microsecond == <NUM_LIT:0> : <EOL> _svalue = input_data . strftime ( '<STR_LIT>' ) <EOL> else : <EOL> _svalue = input_data . strftime ( '<STR_LIT>' ) <EOL> if input_data . tzinfo is not None : <EOL> tzoff = input_data . tzinfo . utcoffset ( input_data ) <EOL> if tzoff is not None : <EOL> total_seconds = tzoff . seconds + ( <NUM_LIT> * tzoff . days ) <EOL> if total_seconds == <NUM_LIT:0> : <EOL> _svalue += '<STR_LIT>' <EOL> else : <EOL> if total_seconds < <NUM_LIT:0> : <EOL> _svalue += '<STR_LIT:->' <EOL> total_seconds *= - <NUM_LIT:1> <EOL> else : <EOL> _svalue += '<STR_LIT:+>' <EOL> hours = total_seconds // <NUM_LIT> <EOL> minutes = ( total_seconds - ( hours * <NUM_LIT> ) ) // <NUM_LIT> <EOL> _svalue += '<STR_LIT>' . format ( hours , minutes ) <EOL> return _svalue <EOL> def gds_parse_datetime ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> tz = None <EOL> if input_data [ - <NUM_LIT:1> ] == '<STR_LIT>' : <EOL> tz = GeneratedsSuper . _FixedOffsetTZ ( <NUM_LIT:0> , '<STR_LIT>' ) <EOL> input_data = input_data [ : - <NUM_LIT:1> ] <EOL> else : <EOL> results = GeneratedsSuper . tzoff_pattern . search ( input_data ) <EOL> if results is not None : <EOL> tzoff_parts = results . group ( <NUM_LIT:2> ) . split ( '<STR_LIT::>' ) <EOL> tzoff = int ( tzoff_parts [ <NUM_LIT:0> ] ) * <NUM_LIT> + int ( tzoff_parts [ <NUM_LIT:1> ] ) <EOL> if results . group ( <NUM_LIT:1> ) == '<STR_LIT:->' : <EOL> tzoff *= - <NUM_LIT:1> <EOL> tz = GeneratedsSuper . _FixedOffsetTZ ( <EOL> tzoff , results . group ( <NUM_LIT:0> ) ) <EOL> input_data = input_data [ : - <NUM_LIT:6> ] <EOL> if len ( input_data . split ( '<STR_LIT:.>' ) ) > <NUM_LIT:1> : <EOL> dt = datetime . strptime ( <EOL> input_data , '<STR_LIT>' ) <EOL> else : <EOL> dt = datetime . strptime ( <EOL> input_data , '<STR_LIT>' ) <EOL> return dt . replace ( tzinfo = tz ) <EOL> def gds_validate_date ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> return input_data <EOL> def gds_format_date ( self , input_data , input_name = '<STR_LIT>' ) : <EOL> _svalue = input_data . strftime ( '<STR_LIT>' ) <EOL> if input_data . tzinfo is not None : <EOL> tzoff = input_data . tzinfo . utcoffset ( input_data ) <EOL> if tzoff is not None : <EOL> total_seconds = tzoff . seconds + ( <NUM_LIT> * tzoff . days ) <EOL> if total_seconds == <NUM_LIT:0> : <EOL> _svalue += '<STR_LIT>' <EOL> else : <EOL> if total_seconds < <NUM_LIT:0> : <EOL> _svalue += '<STR_LIT:->' <EOL> total_seconds *= - <NUM_LIT:1> <EOL> else : <EOL> _svalue += '<STR_LIT:+>' <EOL> hours = total_seconds // <NUM_LIT> <EOL> minutes = ( total_seconds - ( hours * <NUM_LIT> ) ) // <NUM_LIT> <EOL> _svalue += '<STR_LIT>' . format ( hours , minutes ) <EOL> return _svalue <EOL> def gds_parse_date ( self , input_data , node , input_name = '<STR_LIT>' ) : <EOL> tz = None <EOL> if input_data [ - <NUM_LIT:1> ] == '<STR_LIT>' : <EOL> tz = GeneratedsSuper . _FixedOffsetTZ ( <NUM_LIT:0> , '<STR_LIT>' ) <EOL> input_data = input_data [ : - <NUM_LIT:1> ] <EOL> else : <EOL> results = GeneratedsSuper . tzoff_pattern . search ( input_data ) <EOL> if results is not None : <EOL> tzoff_parts = results . group ( <NUM_LIT:2> ) . split ( '<STR_LIT::>' ) <EOL> tzoff = int ( tzoff_parts [ <NUM_LIT:0> ] ) * <NUM_LIT> + int ( tzoff_parts [ <NUM_LIT:1> ] ) <EOL> if results . group ( <NUM_LIT:1> ) == '<STR_LIT:->' : <EOL> tzoff *= - <NUM_LIT:1> <EOL> tz = GeneratedsSuper . _FixedOffsetTZ ( <EOL> tzoff , results . group ( <NUM_LIT:0> ) ) <EOL> input_data = input_data [ : - <NUM_LIT:6> ] <EOL> return datetime . strptime ( input_data , <EOL> '<STR_LIT>' ) . replace ( tzinfo = tz ) <EOL> def gds_str_lower ( self , instring ) : <EOL> return instring . lower ( ) <EOL> def get_path_ ( self , node ) : <EOL> path_list = [ ] <EOL> self . get_path_list_ ( node , path_list ) <EOL> path_list . reverse ( ) <EOL> path = '<STR_LIT:/>' . join ( path_list ) <EOL> return path <EOL> Tag_strip_pattern_ = re_ . compile ( r'<STR_LIT>' ) <EOL> def get_path_list_ ( self , node , path_list ) : <EOL> if node is None : <EOL> return <EOL> tag = GeneratedsSuper . Tag_strip_pattern_ . sub ( '<STR_LIT>' , node . tag ) <EOL> if tag : <EOL> path_list . append ( tag ) <EOL> self . get_path_list_ ( node . getparent ( ) , path_list ) <EOL> def get_class_obj_ ( self , node , default_class = None ) : <EOL> class_obj1 = default_class <EOL> if '<STR_LIT>' in node . nsmap : <EOL> classname = node . get ( '<STR_LIT>' % node . nsmap [ '<STR_LIT>' ] ) <EOL> if classname is not None : <EOL> names = classname . split ( '<STR_LIT::>' ) <EOL> if len ( names ) == <NUM_LIT:2> : <EOL> classname = names [ <NUM_LIT:1> ] <EOL> class_obj2 = globals ( ) . get ( classname ) <EOL> if class_obj2 is not None : <EOL> class_obj1 = class_obj2 <EOL> return class_obj1 <EOL> def gds_build_any ( self , node , type_name = None ) : <EOL> return None <EOL> ExternalEncoding = '<STR_LIT:ascii>' <EOL> Tag_pattern_ = re_ . compile ( r'<STR_LIT>' ) <EOL> String_cleanup_pat_ = re_ . compile ( r"<STR_LIT>" ) <EOL> Namespace_extract_pat_ = re_ . compile ( r'<STR_LIT>' ) <EOL> def showIndent ( outfile , level , pretty_print = True ) : <EOL> if pretty_print : <EOL> for idx in range ( level ) : <EOL> outfile . write ( '<STR_LIT:U+0020>' ) <EOL> def quote_xml ( inStr ) : <EOL> if not inStr : <EOL> return '<STR_LIT>' <EOL> s1 = ( isinstance ( inStr , basestring ) and inStr or <EOL> '<STR_LIT:%s>' % inStr ) <EOL> s1 = s1 . replace ( '<STR_LIT:&>' , '<STR_LIT>' ) <EOL> s1 = s1 . replace ( '<STR_LIT:<>' , '<STR_LIT>' ) <EOL> s1 = s1 . replace ( '<STR_LIT:>>' , '<STR_LIT>' ) <EOL> return s1 <EOL> def quote_attrib ( inStr ) : <EOL> s1 = ( isinstance ( inStr , basestring ) and inStr or <EOL> '<STR_LIT:%s>' % inStr ) <EOL> s1 = s1 . replace ( '<STR_LIT:&>' , '<STR_LIT>' ) <EOL> s1 = s1 . replace ( '<STR_LIT:<>' , '<STR_LIT>' ) <EOL> s1 = s1 . replace ( '<STR_LIT:>>' , '<STR_LIT>' ) <EOL> if '<STR_LIT:">' in s1 : <EOL> if "<STR_LIT:'>" in s1 : <EOL> s1 = '<STR_LIT>' % s1 . replace ( '<STR_LIT:">' , "<STR_LIT>" ) <EOL> else : <EOL> s1 = "<STR_LIT>" % s1 <EOL> else : <EOL> s1 = '<STR_LIT>' % s1 <EOL> return s1 <EOL> def quote_python ( inStr ) : <EOL> s1 = inStr <EOL> if s1 . find ( "<STR_LIT:'>" ) == - <NUM_LIT:1> : <EOL> if s1 . find ( '<STR_LIT:\n>' ) == - <NUM_LIT:1> : <EOL> return "<STR_LIT>" % s1 <EOL> else : <EOL> return "<STR_LIT>" % s1 <EOL> else : <EOL> if s1 . find ( '<STR_LIT:">' ) != - <NUM_LIT:1> : <EOL> s1 = s1 . replace ( '<STR_LIT:">' , '<STR_LIT>' ) <EOL> if s1 . find ( '<STR_LIT:\n>' ) == - <NUM_LIT:1> : <EOL> return '<STR_LIT>' % s1 <EOL> else : <EOL> return '<STR_LIT>' % s1 <EOL> def get_all_text_ ( node ) : <EOL> if node . text is not None : <EOL> text = node . text <EOL> else : <EOL> text = '<STR_LIT>' <EOL> for child in node : <EOL> if child . tail is not None : <EOL> text += child . tail <EOL> return text <EOL> def find_attr_value_ ( attr_name , node ) : <EOL> attrs = node . attrib <EOL> attr_parts = attr_name . split ( '<STR_LIT::>' ) <EOL> value = None <EOL> if len ( attr_parts ) == <NUM_LIT:1> : <EOL> value = attrs . get ( attr_name ) <EOL> elif len ( attr_parts ) == <NUM_LIT:2> : <EOL> prefix , name = attr_parts <EOL> namespace = node . nsmap . get ( prefix ) <EOL> if namespace is not None : <EOL> value = attrs . get ( '<STR_LIT>' % ( namespace , name , ) ) <EOL> return value <EOL> class GDSParseError ( Exception ) : <EOL> pass <EOL> def raise_parse_error ( node , msg ) : <EOL> if XMLParser_import_library == XMLParser_import_lxml : <EOL> msg = '<STR_LIT>' % ( <EOL> msg , node . tag , node . sourceline , ) <EOL> else : <EOL> msg = '<STR_LIT>' % ( msg , node . tag , ) <EOL> raise GDSParseError ( msg ) <EOL> class MixedContainer : <EOL> CategoryNone = <NUM_LIT:0> <EOL> CategoryText = <NUM_LIT:1> <EOL> CategorySimple = <NUM_LIT:2> <EOL> CategoryComplex = <NUM_LIT:3> <EOL> TypeNone = <NUM_LIT:0> <EOL> TypeText = <NUM_LIT:1> <EOL> TypeString = <NUM_LIT:2> <EOL> TypeInteger = <NUM_LIT:3> <EOL> TypeFloat = <NUM_LIT:4> <EOL> TypeDecimal = <NUM_LIT:5> <EOL> TypeDouble = <NUM_LIT:6> <EOL> TypeBoolean = <NUM_LIT:7> <EOL> TypeBase64 = <NUM_LIT:8> <EOL> def __init__ ( self , category , content_type , name , value ) : <EOL> self . category = category <EOL> self . content_type = content_type <EOL> self . name = name <EOL> self . value = value <EOL> def getCategory ( self ) : <EOL> return self . category <EOL> def getContenttype ( self , content_type ) : <EOL> return self . content_type <EOL> def getValue ( self ) : <EOL> return self . value <EOL> def getName ( self ) : <EOL> return self . name <EOL> def export ( self , outfile , level , name , namespace , pretty_print = True ) : <EOL> if self . category == MixedContainer . CategoryText : <EOL> if self . value . strip ( ) : <EOL> outfile . write ( self . value ) <EOL> elif self . category == MixedContainer . CategorySimple : <EOL> self . exportSimple ( outfile , level , name ) <EOL> else : <EOL> self . value . export ( outfile , level , namespace , name , pretty_print ) <EOL> def exportSimple ( self , outfile , level , name ) : <EOL> if self . content_type == MixedContainer . TypeString : <EOL> outfile . write ( '<STR_LIT>' % <EOL> ( self . name , self . value , self . name ) ) <EOL> elif self . content_type == MixedContainer . TypeInteger or self . content_type == MixedContainer . TypeBoolean : <EOL> outfile . write ( '<STR_LIT>' % <EOL> ( self . name , self . value , self . name ) ) <EOL> elif self . content_type == MixedContainer . TypeFloat or self . content_type == MixedContainer . TypeDecimal : <EOL> outfile . write ( '<STR_LIT>' % <EOL> ( self . name , self . value , self . name ) ) <EOL> elif self . content_type == MixedContainer . TypeDouble : <EOL> outfile . write ( '<STR_LIT>' % <EOL> ( self . name , self . value , self . name ) ) <EOL> elif self . content_type == MixedContainer . TypeBase64 : <EOL> outfile . write ( '<STR_LIT>' % <EOL> ( self . name , base64 . b64encode ( self . value ) , self . name ) ) <EOL> def exportLiteral ( self , outfile , level , name ) : <EOL> if self . category == MixedContainer . CategoryText : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' <EOL> % ( self . category , self . content_type , self . name , self . value ) ) <EOL> elif self . category == MixedContainer . CategorySimple : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' <EOL> % ( self . category , self . content_type , self . name , self . value ) ) <EOL> else : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % ( self . category , self . content_type , self . name , ) ) <EOL> self . value . exportLiteral ( outfile , level + <NUM_LIT:1> ) <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> class MemberSpec_ ( object ) : <EOL> def __init__ ( self , name = '<STR_LIT>' , data_type = '<STR_LIT>' , container = <NUM_LIT:0> ) : <EOL> self . name = name <EOL> self . data_type = data_type <EOL> self . container = container <EOL> def set_name ( self , name ) : self . name = name <EOL> def get_name ( self ) : return self . name <EOL> def set_data_type ( self , data_type ) : self . data_type = data_type <EOL> def get_data_type_chain ( self ) : return self . data_type <EOL> def get_data_type ( self ) : <EOL> if isinstance ( self . data_type , list ) : <EOL> if len ( self . data_type ) > <NUM_LIT:0> : <EOL> return self . data_type [ - <NUM_LIT:1> ] <EOL> else : <EOL> return '<STR_LIT>' <EOL> else : <EOL> return self . data_type <EOL> def set_container ( self , container ) : self . container = container <EOL> def get_container ( self ) : return self . container <EOL> def _cast ( typ , value ) : <EOL> if typ is None or value is None : <EOL> return value <EOL> return typ ( value ) <EOL> class scpd ( GeneratedsSuper ) : <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , specVersion = None , actionList = None , serviceStateTable = None ) : <EOL> self . specVersion = specVersion <EOL> self . actionList = actionList <EOL> self . serviceStateTable = serviceStateTable <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if scpd . subclass : <EOL> return scpd . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return scpd ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_specVersion ( self ) : return self . specVersion <EOL> def set_specVersion ( self , specVersion ) : self . specVersion = specVersion <EOL> def get_actionList ( self ) : return self . actionList <EOL> def set_actionList ( self , actionList ) : self . actionList = actionList <EOL> def get_serviceStateTable ( self ) : return self . serviceStateTable <EOL> def set_serviceStateTable ( self , serviceStateTable ) : self . serviceStateTable = serviceStateTable <EOL> def export ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = [ ] <EOL> self . exportAttributes ( outfile , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( outfile , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , outfile , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . specVersion is not None : <EOL> self . specVersion . export ( outfile , level , namespace_ , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . actionList is not None : <EOL> self . actionList . export ( outfile , level , namespace_ , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . serviceStateTable is not None : <EOL> self . serviceStateTable . export ( outfile , level , namespace_ , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . specVersion is not None or <EOL> self . actionList is not None or <EOL> self . serviceStateTable is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def exportLiteral ( self , outfile , level , name_ = '<STR_LIT>' ) : <EOL> level += <NUM_LIT:1> <EOL> self . exportLiteralAttributes ( outfile , level , [ ] , name_ ) <EOL> if self . hasContent_ ( ) : <EOL> self . exportLiteralChildren ( outfile , level , name_ ) <EOL> def exportLiteralAttributes ( self , outfile , level , already_processed , name_ ) : <EOL> pass <EOL> def exportLiteralChildren ( self , outfile , level , name_ ) : <EOL> if self . specVersion is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> self . specVersion . exportLiteral ( outfile , level , name_ = '<STR_LIT>' ) <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> if self . actionList is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> self . actionList . exportLiteral ( outfile , level , name_ = '<STR_LIT>' ) <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> if self . serviceStateTable is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> self . serviceStateTable . exportLiteral ( outfile , level , name_ = '<STR_LIT>' ) <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> def build ( self , node ) : <EOL> self . buildAttributes ( node , node . attrib , [ ] ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = SpecVersionType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_specVersion ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = ActionListType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_actionList ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = ServiceStateTableType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_serviceStateTable ( obj_ ) <EOL> class SpecVersionType ( GeneratedsSuper ) : <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , major = None , minor = None ) : <EOL> self . major = major <EOL> self . minor = minor <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if SpecVersionType . subclass : <EOL> return SpecVersionType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return SpecVersionType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_major ( self ) : return self . major <EOL> def set_major ( self , major ) : self . major = major <EOL> def get_minor ( self ) : return self . minor <EOL> def set_minor ( self , minor ) : self . minor = minor <EOL> def export ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = [ ] <EOL> self . exportAttributes ( outfile , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( outfile , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , outfile , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . major is not None : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_integer ( self . major , input_name = '<STR_LIT>' ) , namespace_ , eol_ ) ) <EOL> if self . minor is not None : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_integer ( self . minor , input_name = '<STR_LIT>' ) , namespace_ , eol_ ) ) <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . major is not None or <EOL> self . minor is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def exportLiteral ( self , outfile , level , name_ = '<STR_LIT>' ) : <EOL> level += <NUM_LIT:1> <EOL> self . exportLiteralAttributes ( outfile , level , [ ] , name_ ) <EOL> if self . hasContent_ ( ) : <EOL> self . exportLiteralChildren ( outfile , level , name_ ) <EOL> def exportLiteralAttributes ( self , outfile , level , already_processed , name_ ) : <EOL> pass <EOL> def exportLiteralChildren ( self , outfile , level , name_ ) : <EOL> if self . major is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % self . major ) <EOL> if self . minor is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % self . minor ) <EOL> def build ( self , node ) : <EOL> self . buildAttributes ( node , node . attrib , [ ] ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> sval_ = child_ . text <EOL> try : <EOL> ival_ = int ( sval_ ) <EOL> except ( TypeError , ValueError ) , exp : <EOL> raise_parse_error ( child_ , '<STR_LIT>' % exp ) <EOL> ival_ = self . gds_validate_integer ( ival_ , node , '<STR_LIT>' ) <EOL> self . major = ival_ <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> sval_ = child_ . text <EOL> try : <EOL> ival_ = int ( sval_ ) <EOL> except ( TypeError , ValueError ) , exp : <EOL> raise_parse_error ( child_ , '<STR_LIT>' % exp ) <EOL> ival_ = self . gds_validate_integer ( ival_ , node , '<STR_LIT>' ) <EOL> self . minor = ival_ <EOL> class ActionListType ( GeneratedsSuper ) : <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , action = None ) : <EOL> if action is None : <EOL> self . action = [ ] <EOL> else : <EOL> self . action = action <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if ActionListType . subclass : <EOL> return ActionListType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return ActionListType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_action ( self ) : return self . action <EOL> def set_action ( self , action ) : self . action = action <EOL> def add_action ( self , value ) : self . action . append ( value ) <EOL> def insert_action ( self , index , value ) : self . action [ index ] = value <EOL> def export ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = [ ] <EOL> self . exportAttributes ( outfile , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( outfile , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , outfile , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> for action_ in self . action : <EOL> action_ . export ( outfile , level , namespace_ , name_ = '<STR_LIT:action>' , pretty_print = pretty_print ) <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . action <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def exportLiteral ( self , outfile , level , name_ = '<STR_LIT>' ) : <EOL> level += <NUM_LIT:1> <EOL> self . exportLiteralAttributes ( outfile , level , [ ] , name_ ) <EOL> if self . hasContent_ ( ) : <EOL> self . exportLiteralChildren ( outfile , level , name_ ) <EOL> def exportLiteralAttributes ( self , outfile , level , already_processed , name_ ) : <EOL> pass <EOL> def exportLiteralChildren ( self , outfile , level , name_ ) : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> level += <NUM_LIT:1> <EOL> for action_ in self . action : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> action_ . exportLiteral ( outfile , level , name_ = '<STR_LIT>' ) <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> level -= <NUM_LIT:1> <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> def build ( self , node ) : <EOL> self . buildAttributes ( node , node . attrib , [ ] ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT:action>' : <EOL> obj_ = ActionType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . action . append ( obj_ ) <EOL> class ActionType ( GeneratedsSuper ) : <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , name = None , argumentList = None ) : <EOL> self . name = name <EOL> self . argumentList = argumentList <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if ActionType . subclass : <EOL> return ActionType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return ActionType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_name ( self ) : return self . name <EOL> def set_name ( self , name ) : self . name = name <EOL> def get_argumentList ( self ) : return self . argumentList <EOL> def set_argumentList ( self , argumentList ) : self . argumentList = argumentList <EOL> def export ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = [ ] <EOL> self . exportAttributes ( outfile , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( outfile , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , outfile , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . name is not None : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_string ( quote_xml ( self . name ) . encode ( ExternalEncoding ) , input_name = '<STR_LIT:name>' ) , namespace_ , eol_ ) ) <EOL> if self . argumentList is not None : <EOL> self . argumentList . export ( outfile , level , namespace_ , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . name is not None or <EOL> self . argumentList is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def exportLiteral ( self , outfile , level , name_ = '<STR_LIT>' ) : <EOL> level += <NUM_LIT:1> <EOL> self . exportLiteralAttributes ( outfile , level , [ ] , name_ ) <EOL> if self . hasContent_ ( ) : <EOL> self . exportLiteralChildren ( outfile , level , name_ ) <EOL> def exportLiteralAttributes ( self , outfile , level , already_processed , name_ ) : <EOL> pass <EOL> def exportLiteralChildren ( self , outfile , level , name_ ) : <EOL> if self . name is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % quote_python ( self . name ) . encode ( ExternalEncoding ) ) <EOL> if self . argumentList is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> self . argumentList . exportLiteral ( outfile , level , name_ = '<STR_LIT>' ) <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> def build ( self , node ) : <EOL> self . buildAttributes ( node , node . attrib , [ ] ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT:name>' : <EOL> name_ = child_ . text <EOL> name_ = self . gds_validate_string ( name_ , node , '<STR_LIT:name>' ) <EOL> self . name = name_ <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = ArgumentListType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_argumentList ( obj_ ) <EOL> class ArgumentListType ( GeneratedsSuper ) : <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , argument = None ) : <EOL> if argument is None : <EOL> self . argument = [ ] <EOL> else : <EOL> self . argument = argument <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if ArgumentListType . subclass : <EOL> return ArgumentListType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return ArgumentListType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_argument ( self ) : return self . argument <EOL> def set_argument ( self , argument ) : self . argument = argument <EOL> def add_argument ( self , value ) : self . argument . append ( value ) <EOL> def insert_argument ( self , index , value ) : self . argument [ index ] = value <EOL> def export ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = [ ] <EOL> self . exportAttributes ( outfile , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( outfile , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , outfile , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> for argument_ in self . argument : <EOL> argument_ . export ( outfile , level , namespace_ , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . argument <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def exportLiteral ( self , outfile , level , name_ = '<STR_LIT>' ) : <EOL> level += <NUM_LIT:1> <EOL> self . exportLiteralAttributes ( outfile , level , [ ] , name_ ) <EOL> if self . hasContent_ ( ) : <EOL> self . exportLiteralChildren ( outfile , level , name_ ) <EOL> def exportLiteralAttributes ( self , outfile , level , already_processed , name_ ) : <EOL> pass <EOL> def exportLiteralChildren ( self , outfile , level , name_ ) : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> level += <NUM_LIT:1> <EOL> for argument_ in self . argument : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> argument_ . exportLiteral ( outfile , level , name_ = '<STR_LIT>' ) <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> level -= <NUM_LIT:1> <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> def build ( self , node ) : <EOL> self . buildAttributes ( node , node . attrib , [ ] ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = ArgumentType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . argument . append ( obj_ ) <EOL> class ArgumentType ( GeneratedsSuper ) : <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , name = None , direction = None , relatedStateVariable = None , retval = None ) : <EOL> self . name = name <EOL> self . direction = direction <EOL> self . relatedStateVariable = relatedStateVariable <EOL> self . retval = retval <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if ArgumentType . subclass : <EOL> return ArgumentType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return ArgumentType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_name ( self ) : return self . name <EOL> def set_name ( self , name ) : self . name = name <EOL> def get_direction ( self ) : return self . direction <EOL> def set_direction ( self , direction ) : self . direction = direction <EOL> def get_relatedStateVariable ( self ) : return self . relatedStateVariable <EOL> def set_relatedStateVariable ( self , relatedStateVariable ) : self . relatedStateVariable = relatedStateVariable <EOL> def get_retval ( self ) : return self . retval <EOL> def set_retval ( self , retval ) : self . retval = retval <EOL> def export ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = [ ] <EOL> self . exportAttributes ( outfile , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( outfile , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , outfile , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . name is not None : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_string ( quote_xml ( self . name ) . encode ( ExternalEncoding ) , input_name = '<STR_LIT:name>' ) , namespace_ , eol_ ) ) <EOL> if self . direction is not None : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_string ( quote_xml ( self . direction ) . encode ( ExternalEncoding ) , input_name = '<STR_LIT>' ) , namespace_ , eol_ ) ) <EOL> if self . relatedStateVariable is not None : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_string ( quote_xml ( self . relatedStateVariable ) . encode ( ExternalEncoding ) , input_name = '<STR_LIT>' ) , namespace_ , eol_ ) ) <EOL> if self . retval is not None : <EOL> self . retval . export ( outfile , level , namespace_ , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . name is not None or <EOL> self . direction is not None or <EOL> self . relatedStateVariable is not None or <EOL> self . retval is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def exportLiteral ( self , outfile , level , name_ = '<STR_LIT>' ) : <EOL> level += <NUM_LIT:1> <EOL> self . exportLiteralAttributes ( outfile , level , [ ] , name_ ) <EOL> if self . hasContent_ ( ) : <EOL> self . exportLiteralChildren ( outfile , level , name_ ) <EOL> def exportLiteralAttributes ( self , outfile , level , already_processed , name_ ) : <EOL> pass <EOL> def exportLiteralChildren ( self , outfile , level , name_ ) : <EOL> if self . name is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % quote_python ( self . name ) . encode ( ExternalEncoding ) ) <EOL> if self . direction is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % quote_python ( self . direction ) . encode ( ExternalEncoding ) ) <EOL> if self . relatedStateVariable is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % quote_python ( self . relatedStateVariable ) . encode ( ExternalEncoding ) ) <EOL> if self . retval is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> self . retval . exportLiteral ( outfile , level , name_ = '<STR_LIT>' ) <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> def build ( self , node ) : <EOL> self . buildAttributes ( node , node . attrib , [ ] ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT:name>' : <EOL> name_ = child_ . text <EOL> name_ = self . gds_validate_string ( name_ , node , '<STR_LIT:name>' ) <EOL> self . name = name_ <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> direction_ = child_ . text <EOL> direction_ = self . gds_validate_string ( direction_ , node , '<STR_LIT>' ) <EOL> self . direction = direction_ <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> relatedStateVariable_ = child_ . text <EOL> relatedStateVariable_ = self . gds_validate_string ( relatedStateVariable_ , node , '<STR_LIT>' ) <EOL> self . relatedStateVariable = relatedStateVariable_ <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = retvalType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_retval ( obj_ ) <EOL> class ServiceStateTableType ( GeneratedsSuper ) : <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , stateVariable = None ) : <EOL> if stateVariable is None : <EOL> self . stateVariable = [ ] <EOL> else : <EOL> self . stateVariable = stateVariable <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if ServiceStateTableType . subclass : <EOL> return ServiceStateTableType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return ServiceStateTableType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_stateVariable ( self ) : return self . stateVariable <EOL> def set_stateVariable ( self , stateVariable ) : self . stateVariable = stateVariable <EOL> def add_stateVariable ( self , value ) : self . stateVariable . append ( value ) <EOL> def insert_stateVariable ( self , index , value ) : self . stateVariable [ index ] = value <EOL> def export ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = [ ] <EOL> self . exportAttributes ( outfile , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( outfile , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , outfile , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> for stateVariable_ in self . stateVariable : <EOL> stateVariable_ . export ( outfile , level , namespace_ , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . stateVariable <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def exportLiteral ( self , outfile , level , name_ = '<STR_LIT>' ) : <EOL> level += <NUM_LIT:1> <EOL> self . exportLiteralAttributes ( outfile , level , [ ] , name_ ) <EOL> if self . hasContent_ ( ) : <EOL> self . exportLiteralChildren ( outfile , level , name_ ) <EOL> def exportLiteralAttributes ( self , outfile , level , already_processed , name_ ) : <EOL> pass <EOL> def exportLiteralChildren ( self , outfile , level , name_ ) : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> level += <NUM_LIT:1> <EOL> for stateVariable_ in self . stateVariable : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> stateVariable_ . exportLiteral ( outfile , level , name_ = '<STR_LIT>' ) <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> level -= <NUM_LIT:1> <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> def build ( self , node ) : <EOL> self . buildAttributes ( node , node . attrib , [ ] ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = StateVariableType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . stateVariable . append ( obj_ ) <EOL> class StateVariableType ( GeneratedsSuper ) : <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , sendEvents = '<STR_LIT:yes>' , name = None , dataType = None , defaultValue = None , allowedValueList = None , allowedValueRange = None ) : <EOL> self . sendEvents = _cast ( None , sendEvents ) <EOL> self . name = name <EOL> self . dataType = dataType <EOL> self . defaultValue = defaultValue <EOL> self . allowedValueList = allowedValueList <EOL> self . allowedValueRange = allowedValueRange <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if StateVariableType . subclass : <EOL> return StateVariableType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return StateVariableType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_name ( self ) : return self . name <EOL> def set_name ( self , name ) : self . name = name <EOL> def get_dataType ( self ) : return self . dataType <EOL> def set_dataType ( self , dataType ) : self . dataType = dataType <EOL> def get_defaultValue ( self ) : return self . defaultValue <EOL> def set_defaultValue ( self , defaultValue ) : self . defaultValue = defaultValue <EOL> def get_allowedValueList ( self ) : return self . allowedValueList <EOL> def set_allowedValueList ( self , allowedValueList ) : self . allowedValueList = allowedValueList <EOL> def get_allowedValueRange ( self ) : return self . allowedValueRange <EOL> def set_allowedValueRange ( self , allowedValueRange ) : self . allowedValueRange = allowedValueRange <EOL> def get_sendEvents ( self ) : return self . sendEvents <EOL> def set_sendEvents ( self , sendEvents ) : self . sendEvents = sendEvents <EOL> def export ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = [ ] <EOL> self . exportAttributes ( outfile , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( outfile , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , outfile , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> if self . sendEvents is not None and '<STR_LIT>' not in already_processed : <EOL> already_processed . append ( '<STR_LIT>' ) <EOL> outfile . write ( '<STR_LIT>' % ( self . gds_format_string ( quote_attrib ( self . sendEvents ) . encode ( ExternalEncoding ) , input_name = '<STR_LIT>' ) , ) ) <EOL> def exportChildren ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . name is not None : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_string ( quote_xml ( self . name ) . encode ( ExternalEncoding ) , input_name = '<STR_LIT:name>' ) , namespace_ , eol_ ) ) <EOL> if self . dataType is not None : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_string ( quote_xml ( self . dataType ) . encode ( ExternalEncoding ) , input_name = '<STR_LIT>' ) , namespace_ , eol_ ) ) <EOL> if self . defaultValue is not None : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_string ( quote_xml ( self . defaultValue ) . encode ( ExternalEncoding ) , input_name = '<STR_LIT>' ) , namespace_ , eol_ ) ) <EOL> if self . allowedValueList is not None : <EOL> self . allowedValueList . export ( outfile , level , namespace_ , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . allowedValueRange is not None : <EOL> self . allowedValueRange . export ( outfile , level , namespace_ , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . name is not None or <EOL> self . dataType is not None or <EOL> self . defaultValue is not None or <EOL> self . allowedValueList is not None or <EOL> self . allowedValueRange is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def exportLiteral ( self , outfile , level , name_ = '<STR_LIT>' ) : <EOL> level += <NUM_LIT:1> <EOL> self . exportLiteralAttributes ( outfile , level , [ ] , name_ ) <EOL> if self . hasContent_ ( ) : <EOL> self . exportLiteralChildren ( outfile , level , name_ ) <EOL> def exportLiteralAttributes ( self , outfile , level , already_processed , name_ ) : <EOL> if self . sendEvents is not None and '<STR_LIT>' not in already_processed : <EOL> already_processed . append ( '<STR_LIT>' ) <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % ( self . sendEvents , ) ) <EOL> def exportLiteralChildren ( self , outfile , level , name_ ) : <EOL> if self . name is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % quote_python ( self . name ) . encode ( ExternalEncoding ) ) <EOL> if self . dataType is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % quote_python ( self . dataType ) . encode ( ExternalEncoding ) ) <EOL> if self . defaultValue is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % quote_python ( self . defaultValue ) . encode ( ExternalEncoding ) ) <EOL> if self . allowedValueList is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> self . allowedValueList . exportLiteral ( outfile , level , name_ = '<STR_LIT>' ) <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> if self . allowedValueRange is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> self . allowedValueRange . exportLiteral ( outfile , level , name_ = '<STR_LIT>' ) <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> def build ( self , node ) : <EOL> self . buildAttributes ( node , node . attrib , [ ] ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None and '<STR_LIT>' not in already_processed : <EOL> already_processed . append ( '<STR_LIT>' ) <EOL> self . sendEvents = value <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT:name>' : <EOL> name_ = child_ . text <EOL> name_ = self . gds_validate_string ( name_ , node , '<STR_LIT:name>' ) <EOL> self . name = name_ <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> dataType_ = child_ . text <EOL> dataType_ = self . gds_validate_string ( dataType_ , node , '<STR_LIT>' ) <EOL> self . dataType = dataType_ <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> defaultValue_ = child_ . text <EOL> defaultValue_ = self . gds_validate_string ( defaultValue_ , node , '<STR_LIT>' ) <EOL> self . defaultValue = defaultValue_ <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = AllowedValueListType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_allowedValueList ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = AllowedValueRangeType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_allowedValueRange ( obj_ ) <EOL> class AllowedValueListType ( GeneratedsSuper ) : <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , allowedValue = None ) : <EOL> if allowedValue is None : <EOL> self . allowedValue = [ ] <EOL> else : <EOL> self . allowedValue = allowedValue <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if AllowedValueListType . subclass : <EOL> return AllowedValueListType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return AllowedValueListType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_allowedValue ( self ) : return self . allowedValue <EOL> def set_allowedValue ( self , allowedValue ) : self . allowedValue = allowedValue <EOL> def add_allowedValue ( self , value ) : self . allowedValue . append ( value ) <EOL> def insert_allowedValue ( self , index , value ) : self . allowedValue [ index ] = value <EOL> def export ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = [ ] <EOL> self . exportAttributes ( outfile , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( outfile , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , outfile , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> for allowedValue_ in self . allowedValue : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_string ( quote_xml ( allowedValue_ ) . encode ( ExternalEncoding ) , input_name = '<STR_LIT>' ) , namespace_ , eol_ ) ) <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . allowedValue <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def exportLiteral ( self , outfile , level , name_ = '<STR_LIT>' ) : <EOL> level += <NUM_LIT:1> <EOL> self . exportLiteralAttributes ( outfile , level , [ ] , name_ ) <EOL> if self . hasContent_ ( ) : <EOL> self . exportLiteralChildren ( outfile , level , name_ ) <EOL> def exportLiteralAttributes ( self , outfile , level , already_processed , name_ ) : <EOL> pass <EOL> def exportLiteralChildren ( self , outfile , level , name_ ) : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> level += <NUM_LIT:1> <EOL> for allowedValue_ in self . allowedValue : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % quote_python ( allowedValue_ ) . encode ( ExternalEncoding ) ) <EOL> level -= <NUM_LIT:1> <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' ) <EOL> def build ( self , node ) : <EOL> self . buildAttributes ( node , node . attrib , [ ] ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> allowedValue_ = child_ . text <EOL> allowedValue_ = self . gds_validate_string ( allowedValue_ , node , '<STR_LIT>' ) <EOL> self . allowedValue . append ( allowedValue_ ) <EOL> class AllowedValueRangeType ( GeneratedsSuper ) : <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , minimum = None , maximum = None , step = None ) : <EOL> self . minimum = minimum <EOL> self . maximum = maximum <EOL> self . step = step <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if AllowedValueRangeType . subclass : <EOL> return AllowedValueRangeType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return AllowedValueRangeType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_minimum ( self ) : return self . minimum <EOL> def set_minimum ( self , minimum ) : self . minimum = minimum <EOL> def get_maximum ( self ) : return self . maximum <EOL> def set_maximum ( self , maximum ) : self . maximum = maximum <EOL> def get_step ( self ) : return self . step <EOL> def set_step ( self , step ) : self . step = step <EOL> def export ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = [ ] <EOL> self . exportAttributes ( outfile , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( outfile , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , outfile , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . minimum is not None : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_float ( self . minimum , input_name = '<STR_LIT>' ) , namespace_ , eol_ ) ) <EOL> if self . maximum is not None : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_float ( self . maximum , input_name = '<STR_LIT>' ) , namespace_ , eol_ ) ) <EOL> if self . step is not None : <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , self . gds_format_float ( self . step , input_name = '<STR_LIT>' ) , namespace_ , eol_ ) ) <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . minimum is not None or <EOL> self . maximum is not None or <EOL> self . step is not None <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def exportLiteral ( self , outfile , level , name_ = '<STR_LIT>' ) : <EOL> level += <NUM_LIT:1> <EOL> self . exportLiteralAttributes ( outfile , level , [ ] , name_ ) <EOL> if self . hasContent_ ( ) : <EOL> self . exportLiteralChildren ( outfile , level , name_ ) <EOL> def exportLiteralAttributes ( self , outfile , level , already_processed , name_ ) : <EOL> pass <EOL> def exportLiteralChildren ( self , outfile , level , name_ ) : <EOL> if self . minimum is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % self . minimum ) <EOL> if self . maximum is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % self . maximum ) <EOL> if self . step is not None : <EOL> showIndent ( outfile , level ) <EOL> outfile . write ( '<STR_LIT>' % self . step ) <EOL> def build ( self , node ) : <EOL> self . buildAttributes ( node , node . attrib , [ ] ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> sval_ = child_ . text <EOL> try : <EOL> fval_ = float ( sval_ ) <EOL> except ( TypeError , ValueError ) , exp : <EOL> raise_parse_error ( child_ , '<STR_LIT>' % exp ) <EOL> fval_ = self . gds_validate_float ( fval_ , node , '<STR_LIT>' ) <EOL> self . minimum = fval_ <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> sval_ = child_ . text <EOL> try : <EOL> fval_ = float ( sval_ ) <EOL> except ( TypeError , ValueError ) , exp : <EOL> raise_parse_error ( child_ , '<STR_LIT>' % exp ) <EOL> fval_ = self . gds_validate_float ( fval_ , node , '<STR_LIT>' ) <EOL> self . maximum = fval_ <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> sval_ = child_ . text <EOL> try : <EOL> fval_ = float ( sval_ ) <EOL> except ( TypeError , ValueError ) , exp : <EOL> raise_parse_error ( child_ , '<STR_LIT>' % exp ) <EOL> fval_ = self . gds_validate_float ( fval_ , node , '<STR_LIT>' ) <EOL> self . step = fval_ <EOL> class retvalType ( GeneratedsSuper ) : <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self ) : <EOL> pass <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if retvalType . subclass : <EOL> return retvalType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return retvalType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def export ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , namespacedef_ = '<STR_LIT>' , pretty_print = True ) : <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> showIndent ( outfile , level , pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = [ ] <EOL> self . exportAttributes ( outfile , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( outfile , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> outfile . write ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> outfile . write ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , outfile , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> pass <EOL> def exportChildren ( self , outfile , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> pass <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def exportLiteral ( self , outfile , level , name_ = '<STR_LIT>' ) : <EOL> level += <NUM_LIT:1> <EOL> self . exportLiteralAttributes ( outfile , level , [ ] , name_ ) <EOL> if self . hasContent_ ( ) : <EOL> self . exportLiteralChildren ( outfile , level , name_ ) <EOL> def exportLiteralAttributes ( self , outfile , level , already_processed , name_ ) : <EOL> pass <EOL> def exportLiteralChildren ( self , outfile , level , name_ ) : <EOL> pass <EOL> def build ( self , node ) : <EOL> self . buildAttributes ( node , node . attrib , [ ] ) <EOL> for child in node : <EOL> nodeName_ = Tag_pattern_ . match ( child . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> self . buildChildren ( child , node , nodeName_ ) <EOL> def buildAttributes ( self , node , attrs , already_processed ) : <EOL> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> pass <EOL> GDSClassesMapping = { <EOL> '<STR_LIT>' : ArgumentListType , <EOL> '<STR_LIT>' : ActionListType , <EOL> '<STR_LIT>' : retvalType , <EOL> '<STR_LIT>' : StateVariableType , <EOL> '<STR_LIT>' : ArgumentType , <EOL> '<STR_LIT:action>' : ActionType , <EOL> '<STR_LIT>' : ServiceStateTableType , <EOL> '<STR_LIT>' : AllowedValueRangeType , <EOL> '<STR_LIT>' : SpecVersionType , <EOL> '<STR_LIT>' : AllowedValueListType , <EOL> } <EOL> USAGE_TEXT = """<STR_LIT>""" <EOL> def usage ( ) : <EOL> print USAGE_TEXT <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> def get_root_tag ( node ) : <EOL> tag = Tag_pattern_ . match ( node . tag ) . groups ( ) [ - <NUM_LIT:1> ] <EOL> rootClass = GDSClassesMapping . get ( tag ) <EOL> if rootClass is None : <EOL> rootClass = globals ( ) . get ( tag ) <EOL> return tag , rootClass <EOL> def parse ( inFileName ) : <EOL> doc = parsexml_ ( inFileName ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = scpd <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> return rootObj <EOL> def parseString ( inString ) : <EOL> from StringIO import StringIO <EOL> doc = parsexml_ ( StringIO ( inString ) ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = scpd <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> return rootObj <EOL> def parseLiteral ( inFileName ) : <EOL> doc = parsexml_ ( inFileName ) <EOL> rootNode = doc . getroot ( ) <EOL> rootTag , rootClass = get_root_tag ( rootNode ) <EOL> if rootClass is None : <EOL> rootTag = '<STR_LIT>' <EOL> rootClass = scpd <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> sys . stdout . write ( '<STR_LIT>' ) <EOL> sys . stdout . write ( '<STR_LIT>' ) <EOL> sys . stdout . write ( '<STR_LIT>' ) <EOL> sys . stdout . write ( '<STR_LIT>' ) <EOL> rootObj . exportLiteral ( sys . stdout , <NUM_LIT:0> , name_ = rootTag ) <EOL> sys . stdout . write ( '<STR_LIT>' ) <EOL> return rootObj <EOL> def main ( ) : <EOL> args = sys . argv [ <NUM_LIT:1> : ] <EOL> if len ( args ) == <NUM_LIT:1> : <EOL> parse ( args [ <NUM_LIT:0> ] ) <EOL> else : <EOL> usage ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) <EOL> __all__ = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] </s>
