<s> import sys <EOL> from mixbox . binding_utils import * <EOL> from . import cybox_common <EOL> from . import address_object <EOL> class RouteType ( cybox_common . BaseObjectPropertyType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . BaseObjectPropertyType <EOL> def __init__ ( self , obfuscation_algorithm_ref = None , refanging_transform_type = None , has_changed = None , delimiter = '<STR_LIT>' , pattern_type = None , datatype = '<STR_LIT:string>' , refanging_transform = None , is_case_sensitive = True , bit_mask = None , appears_random = None , observed_encoding = None , defanging_algorithm_ref = None , is_obfuscated = None , regex_syntax = None , apply_condition = '<STR_LIT>' , trend = None , idref = None , is_defanged = None , id = None , condition = None , valueOf_ = None ) : <EOL> super ( RouteType , self ) . __init__ ( obfuscation_algorithm_ref , refanging_transform_type , has_changed , delimiter , pattern_type , datatype , refanging_transform , is_case_sensitive , bit_mask , appears_random , observed_encoding , defanging_algorithm_ref , is_obfuscated , regex_syntax , apply_condition , trend , idref , is_defanged , id , condition , valueOf_ ) <EOL> self . datatype = _cast ( None , datatype ) <EOL> self . valueOf_ = valueOf_ <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if RouteType . subclass : <EOL> return RouteType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return RouteType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_datatype ( self ) : return self . datatype <EOL> def set_datatype ( self , datatype ) : self . datatype = datatype <EOL> def get_valueOf_ ( self ) : return self . valueOf_ <EOL> def set_valueOf_ ( self , valueOf_ ) : self . valueOf_ = valueOf_ <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . valueOf_ or <EOL> super ( RouteType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , 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 ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT:>>' ) <EOL> lwrite ( quote_xml ( self . valueOf_ ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( RouteType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . datatype is not None : <EOL> lwrite ( '<STR_LIT>' % ( quote_attrib ( self . datatype ) , ) ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( RouteType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> pass <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <EOL> self . valueOf_ = get_all_text_ ( node ) <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 : <EOL> self . datatype = value <EOL> super ( RouteType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> pass <EOL> class NetworkRouteEntryObjectType ( cybox_common . ObjectPropertiesType ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = cybox_common . ObjectPropertiesType <EOL> def __init__ ( self , object_reference = None , Custom_Properties = None , xsi_type = None , is_publish = None , is_autoconfigure_address = None , is_loopback = None , is_immortal = None , is_ipv6 = None , Destination_Address = None , Origin = None , Netmask = None , Gateway_Address = None , Metric = None , Type = None , Protocol = None , Interface = None , Preferred_Lifetime = None , Valid_Lifetime = None , Route_Age = None ) : <EOL> super ( NetworkRouteEntryObjectType , self ) . __init__ ( object_reference , Custom_Properties , xsi_type ) <EOL> self . is_publish = _cast ( bool , is_publish ) <EOL> self . is_autoconfigure_address = _cast ( bool , is_autoconfigure_address ) <EOL> self . is_loopback = _cast ( bool , is_loopback ) <EOL> self . is_immortal = _cast ( bool , is_immortal ) <EOL> self . is_ipv6 = _cast ( bool , is_ipv6 ) <EOL> self . Destination_Address = Destination_Address <EOL> self . Origin = Origin <EOL> self . Netmask = Netmask <EOL> self . Gateway_Address = Gateway_Address <EOL> self . Metric = Metric <EOL> self . Type = Type <EOL> self . Protocol = Protocol <EOL> self . Interface = Interface <EOL> self . Preferred_Lifetime = Preferred_Lifetime <EOL> self . Valid_Lifetime = Valid_Lifetime <EOL> self . Route_Age = Route_Age <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if NetworkRouteEntryObjectType . subclass : <EOL> return NetworkRouteEntryObjectType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return NetworkRouteEntryObjectType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_Destination_Address ( self ) : return self . Destination_Address <EOL> def set_Destination_Address ( self , Destination_Address ) : self . Destination_Address = Destination_Address <EOL> def get_Origin ( self ) : return self . Origin <EOL> def set_Origin ( self , Origin ) : self . Origin = Origin <EOL> def get_Netmask ( self ) : return self . Netmask <EOL> def set_Netmask ( self , Netmask ) : self . Netmask = Netmask <EOL> def get_Gateway_Address ( self ) : return self . Gateway_Address <EOL> def set_Gateway_Address ( self , Gateway_Address ) : self . Gateway_Address = Gateway_Address <EOL> def get_Metric ( self ) : return self . Metric <EOL> def set_Metric ( self , Metric ) : self . Metric = Metric <EOL> def validate_UnsignedLongObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Type ( self ) : return self . Type <EOL> def set_Type ( self , Type ) : self . Type = Type <EOL> def validate_RouteType ( self , value ) : <EOL> pass <EOL> def get_Protocol ( self ) : return self . Protocol <EOL> def set_Protocol ( self , Protocol ) : self . Protocol = Protocol <EOL> def validate_StringObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Interface ( self ) : return self . Interface <EOL> def set_Interface ( self , Interface ) : self . Interface = Interface <EOL> def get_Preferred_Lifetime ( self ) : return self . Preferred_Lifetime <EOL> def set_Preferred_Lifetime ( self , Preferred_Lifetime ) : self . Preferred_Lifetime = Preferred_Lifetime <EOL> def validate_DurationObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Valid_Lifetime ( self ) : return self . Valid_Lifetime <EOL> def set_Valid_Lifetime ( self , Valid_Lifetime ) : self . Valid_Lifetime = Valid_Lifetime <EOL> def get_Route_Age ( self ) : return self . Route_Age <EOL> def set_Route_Age ( self , Route_Age ) : self . Route_Age = Route_Age <EOL> def get_is_publish ( self ) : return self . is_publish <EOL> def set_is_publish ( self , is_publish ) : self . is_publish = is_publish <EOL> def get_is_autoconfigure_address ( self ) : return self . is_autoconfigure_address <EOL> def set_is_autoconfigure_address ( self , is_autoconfigure_address ) : self . is_autoconfigure_address = is_autoconfigure_address <EOL> def get_is_loopback ( self ) : return self . is_loopback <EOL> def set_is_loopback ( self , is_loopback ) : self . is_loopback = is_loopback <EOL> def get_is_immortal ( self ) : return self . is_immortal <EOL> def set_is_immortal ( self , is_immortal ) : self . is_immortal = is_immortal <EOL> def get_is_ipv6 ( self ) : return self . is_ipv6 <EOL> def set_is_ipv6 ( self , is_ipv6 ) : self . is_ipv6 = is_ipv6 <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Destination_Address is not None or <EOL> self . Origin is not None or <EOL> self . Netmask is not None or <EOL> self . Gateway_Address is not None or <EOL> self . Metric is not None or <EOL> self . Type is not None or <EOL> self . Protocol is not None or <EOL> self . Interface is not None or <EOL> self . Preferred_Lifetime is not None or <EOL> self . Valid_Lifetime is not None or <EOL> self . Route_Age is not None or <EOL> super ( NetworkRouteEntryObjectType , self ) . hasContent_ ( ) <EOL> ) : <EOL> return True <EOL> else : <EOL> return False <EOL> def export ( self , lwrite , 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 ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , namespacedef_ and '<STR_LIT:U+0020>' + namespacedef_ or '<STR_LIT>' , ) ) <EOL> already_processed = set ( ) <EOL> self . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . hasContent_ ( ) : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> self . exportChildren ( lwrite , level + <NUM_LIT:1> , namespace_ , name_ , pretty_print = pretty_print ) <EOL> showIndent ( lwrite , level , pretty_print ) <EOL> lwrite ( '<STR_LIT>' % ( namespace_ , name_ , eol_ ) ) <EOL> else : <EOL> lwrite ( '<STR_LIT>' % ( eol_ , ) ) <EOL> def exportAttributes ( self , lwrite , level , already_processed , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' ) : <EOL> super ( NetworkRouteEntryObjectType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . is_publish is not None : <EOL> lwrite ( '<STR_LIT>' % self . gds_format_boolean ( self . is_publish , input_name = '<STR_LIT>' ) ) <EOL> if self . is_autoconfigure_address is not None : <EOL> lwrite ( '<STR_LIT>' % self . gds_format_boolean ( self . is_autoconfigure_address , input_name = '<STR_LIT>' ) ) <EOL> if self . is_loopback is not None : <EOL> lwrite ( '<STR_LIT>' % self . gds_format_boolean ( self . is_loopback , input_name = '<STR_LIT>' ) ) <EOL> if self . is_immortal is not None : <EOL> lwrite ( '<STR_LIT>' % self . gds_format_boolean ( self . is_immortal , input_name = '<STR_LIT>' ) ) <EOL> if self . is_ipv6 is not None : <EOL> lwrite ( '<STR_LIT>' % self . gds_format_boolean ( self . is_ipv6 , input_name = '<STR_LIT>' ) ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( NetworkRouteEntryObjectType , self ) . exportChildren ( lwrite , level , '<STR_LIT>' , name_ , True , pretty_print = pretty_print ) <EOL> if pretty_print : <EOL> eol_ = '<STR_LIT:\n>' <EOL> else : <EOL> eol_ = '<STR_LIT>' <EOL> if self . Destination_Address is not None : <EOL> self . Destination_Address . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Origin is not None : <EOL> self . Origin . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Netmask is not None : <EOL> self . Netmask . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Gateway_Address is not None : <EOL> self . Gateway_Address . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Metric is not None : <EOL> self . Metric . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Type is not None : <EOL> self . Type . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Protocol is not None : <EOL> self . Protocol . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Interface is not None : <EOL> self . Interface . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Preferred_Lifetime is not None : <EOL> self . Preferred_Lifetime . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Valid_Lifetime is not None : <EOL> self . Valid_Lifetime . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Route_Age is not None : <EOL> self . Route_Age . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> def build ( self , node ) : <EOL> already_processed = set ( ) <EOL> self . buildAttributes ( node , node . attrib , already_processed ) <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 : <EOL> if value in ( '<STR_LIT:true>' , '<STR_LIT:1>' ) : <EOL> self . is_publish = True <EOL> elif value in ( '<STR_LIT:false>' , '<STR_LIT:0>' ) : <EOL> self . is_publish = False <EOL> else : <EOL> raise_parse_error ( node , '<STR_LIT>' ) <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None : <EOL> if value in ( '<STR_LIT:true>' , '<STR_LIT:1>' ) : <EOL> self . is_autoconfigure_address = True <EOL> elif value in ( '<STR_LIT:false>' , '<STR_LIT:0>' ) : <EOL> self . is_autoconfigure_address = False <EOL> else : <EOL> raise_parse_error ( node , '<STR_LIT>' ) <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None : <EOL> if value in ( '<STR_LIT:true>' , '<STR_LIT:1>' ) : <EOL> self . is_loopback = True <EOL> elif value in ( '<STR_LIT:false>' , '<STR_LIT:0>' ) : <EOL> self . is_loopback = False <EOL> else : <EOL> raise_parse_error ( node , '<STR_LIT>' ) <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None : <EOL> if value in ( '<STR_LIT:true>' , '<STR_LIT:1>' ) : <EOL> self . is_immortal = True <EOL> elif value in ( '<STR_LIT:false>' , '<STR_LIT:0>' ) : <EOL> self . is_immortal = False <EOL> else : <EOL> raise_parse_error ( node , '<STR_LIT>' ) <EOL> value = find_attr_value_ ( '<STR_LIT>' , node ) <EOL> if value is not None : <EOL> if value in ( '<STR_LIT:true>' , '<STR_LIT:1>' ) : <EOL> self . is_ipv6 = True <EOL> elif value in ( '<STR_LIT:false>' , '<STR_LIT:0>' ) : <EOL> self . is_ipv6 = False <EOL> else : <EOL> raise_parse_error ( node , '<STR_LIT>' ) <EOL> super ( NetworkRouteEntryObjectType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = address_object . AddressObjectType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Destination_Address ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = address_object . AddressObjectType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Origin ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = address_object . AddressObjectType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Netmask ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = address_object . AddressObjectType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Gateway_Address ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . UnsignedLongObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Metric ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = RouteType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Type ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Protocol ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Interface ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . DurationObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Preferred_Lifetime ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . DurationObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Valid_Lifetime ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . DurationObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Route_Age ( obj_ ) <EOL> super ( NetworkRouteEntryObjectType , self ) . buildChildren ( child_ , node , nodeName_ , True ) <EOL> GDSClassesMapping = { <EOL> '<STR_LIT>' : cybox_common . BuildUtilityType , <EOL> '<STR_LIT>' : cybox_common . ErrorsType , <EOL> '<STR_LIT>' : cybox_common . TimeType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . MetadataType , <EOL> '<STR_LIT>' : address_object . AddressObjectType , <EOL> '<STR_LIT>' : address_object . AddressObjectType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . HashValueType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashStructureType , <EOL> '<STR_LIT>' : cybox_common . MetadataType , <EOL> '<STR_LIT>' : cybox_common . HashValueType , <EOL> '<STR_LIT>' : cybox_common . DigitalSignatureInfoType , <EOL> '<STR_LIT>' : cybox_common . CodeSnippetsType , <EOL> '<STR_LIT>' : cybox_common . DurationObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : address_object . AddressObjectType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . InternationalizationSettingsType , <EOL> '<STR_LIT>' : cybox_common . ToolConfigurationType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . FunctionsType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . CompilerInformalDescriptionType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . UsageContextAssumptionsType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . CompilersType , <EOL> '<STR_LIT>' : cybox_common . ControlledVocabularyStringType , <EOL> '<STR_LIT>' : cybox_common . ExtractedStringType , <EOL> '<STR_LIT>' : cybox_common . ToolInformationType , <EOL> '<STR_LIT>' : cybox_common . DurationObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . BuildInformationType , <EOL> '<STR_LIT>' : cybox_common . HashListType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ErrorInstancesType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashType , <EOL> '<STR_LIT>' : cybox_common . PropertyType , <EOL> '<STR_LIT>' : cybox_common . ExtractedStringsType , <EOL> '<STR_LIT>' : cybox_common . PersonnelType , <EOL> '<STR_LIT>' : cybox_common . UnsignedLongObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . ConfigurationSettingsType , <EOL> '<STR_LIT>' : cybox_common . SimpleHashValueType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformIdentifierType , <EOL> '<STR_LIT>' : cybox_common . ToolSpecificDataType , <EOL> '<STR_LIT>' : cybox_common . ExecutionEnvironmentType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DependenciesType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DateRangeType , <EOL> '<STR_LIT>' : cybox_common . HashListType , <EOL> '<STR_LIT>' : cybox_common . HashSegmentsType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashBlockType , <EOL> '<STR_LIT>' : cybox_common . DependencyType , <EOL> '<STR_LIT>' : cybox_common . ErrorType , <EOL> '<STR_LIT>' : cybox_common . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . EnvironmentVariableType , <EOL> '<STR_LIT>' : cybox_common . ByteRunType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . ImportsType , <EOL> '<STR_LIT>' : cybox_common . LibraryType , <EOL> '<STR_LIT>' : cybox_common . ToolReferencesType , <EOL> '<STR_LIT>' : cybox_common . InternalStringsType , <EOL> '<STR_LIT>' : cybox_common . ConfigurationSettingType , <EOL> '<STR_LIT>' : cybox_common . LibrariesType , <EOL> '<STR_LIT>' : address_object . AddressObjectType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . ObjectPropertiesType , <EOL> '<STR_LIT>' : cybox_common . BuildConfigurationType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : address_object . AddressObjectType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashSegmentType , <EOL> '<STR_LIT>' : cybox_common . CompilerType , <EOL> '<STR_LIT:Name>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DurationObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . PlatformSpecificationType , <EOL> '<STR_LIT>' : cybox_common . FuzzyHashValueType , <EOL> '<STR_LIT>' : cybox_common . DataSizeType , <EOL> '<STR_LIT>' : cybox_common . StructuredTextType , <EOL> '<STR_LIT>' : cybox_common . ContributorType , <EOL> '<STR_LIT>' : cybox_common . ToolsInformationType , <EOL> '<STR_LIT>' : cybox_common . CustomPropertiesType , <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 = NetworkRouteEntryObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> return rootObj <EOL> def parseEtree ( 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 = NetworkRouteEntryObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <EOL> rootElement = rootObj . to_etree ( None , name_ = rootTag ) <EOL> content = etree_ . tostring ( rootElement , pretty_print = True , <EOL> xml_declaration = True , encoding = "<STR_LIT:utf-8>" ) <EOL> sys . stdout . write ( content ) <EOL> sys . stdout . write ( '<STR_LIT:\n>' ) <EOL> return rootObj , rootElement <EOL> def parseString ( inString ) : <EOL> from mixbox . vendor . six 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 = NetworkRouteEntryObjectType <EOL> rootObj = rootClass . factory ( ) <EOL> rootObj . build ( rootNode ) <EOL> doc = None <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> ] </s>
