<s> import sys <EOL> from mixbox . binding_utils import * <EOL> from . import cybox_common <EOL> class VolumeOptionsType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self ) : <EOL> pass <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if VolumeOptionsType . subclass : <EOL> return VolumeOptionsType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return VolumeOptionsType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def hasContent_ ( self ) : <EOL> if ( <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> 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> pass <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> pass <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> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> pass <EOL> class FileSystemFlagListType ( GeneratedsSuper ) : <EOL> """<STR_LIT>""" <EOL> subclass = None <EOL> superclass = None <EOL> def __init__ ( self , File_System_Flag = None ) : <EOL> if File_System_Flag is None : <EOL> self . File_System_Flag = [ ] <EOL> else : <EOL> self . File_System_Flag = File_System_Flag <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if FileSystemFlagListType . subclass : <EOL> return FileSystemFlagListType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return FileSystemFlagListType ( * args_ , ** kwargs_ ) <EOL> factory = staticmethod ( factory ) <EOL> def get_File_System_Flag ( self ) : return self . File_System_Flag <EOL> def set_File_System_Flag ( self , File_System_Flag ) : self . File_System_Flag = File_System_Flag <EOL> def add_File_System_Flag ( self , value ) : self . File_System_Flag . append ( value ) <EOL> def insert_File_System_Flag ( self , index , value ) : self . File_System_Flag [ index ] = value <EOL> def validate_VolumeFileSystemFlagType ( self , value ) : <EOL> pass <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . File_System_Flag <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> pass <EOL> def exportChildren ( self , lwrite , 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 File_System_Flag_ in self . File_System_Flag : <EOL> File_System_Flag_ . 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> pass <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT>' : <EOL> obj_ = VolumeFileSystemFlagType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . File_System_Flag . append ( obj_ ) <EOL> class VolumeFileSystemFlagType ( 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 ( VolumeFileSystemFlagType , 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 VolumeFileSystemFlagType . subclass : <EOL> return VolumeFileSystemFlagType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return VolumeFileSystemFlagType ( * 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 ( VolumeFileSystemFlagType , 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 ( VolumeFileSystemFlagType , 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 ( VolumeFileSystemFlagType , 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 ( VolumeFileSystemFlagType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> pass <EOL> class VolumeObjectType ( 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_mounted = None , Name = None , Device_Path = None , File_System_Type = None , Total_Allocation_Units = None , Sectors_Per_Allocation_Unit = None , Bytes_Per_Sector = None , Actual_Available_Allocation_Units = None , Creation_Time = None , File_System_Flag_List = None , Serial_Number = None ) : <EOL> super ( VolumeObjectType , self ) . __init__ ( object_reference , Custom_Properties , xsi_type ) <EOL> self . is_mounted = _cast ( bool , is_mounted ) <EOL> self . Name = Name <EOL> self . Device_Path = Device_Path <EOL> self . File_System_Type = File_System_Type <EOL> self . Total_Allocation_Units = Total_Allocation_Units <EOL> self . Sectors_Per_Allocation_Unit = Sectors_Per_Allocation_Unit <EOL> self . Bytes_Per_Sector = Bytes_Per_Sector <EOL> self . Actual_Available_Allocation_Units = Actual_Available_Allocation_Units <EOL> self . Creation_Time = Creation_Time <EOL> self . File_System_Flag_List = File_System_Flag_List <EOL> self . Serial_Number = Serial_Number <EOL> def factory ( * args_ , ** kwargs_ ) : <EOL> if VolumeObjectType . subclass : <EOL> return VolumeObjectType . subclass ( * args_ , ** kwargs_ ) <EOL> else : <EOL> return VolumeObjectType ( * 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 validate_StringObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Device_Path ( self ) : return self . Device_Path <EOL> def set_Device_Path ( self , Device_Path ) : self . Device_Path = Device_Path <EOL> def get_File_System_Type ( self ) : return self . File_System_Type <EOL> def set_File_System_Type ( self , File_System_Type ) : self . File_System_Type = File_System_Type <EOL> def get_Total_Allocation_Units ( self ) : return self . Total_Allocation_Units <EOL> def set_Total_Allocation_Units ( self , Total_Allocation_Units ) : self . Total_Allocation_Units = Total_Allocation_Units <EOL> def validate_UnsignedLongObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Sectors_Per_Allocation_Unit ( self ) : return self . Sectors_Per_Allocation_Unit <EOL> def set_Sectors_Per_Allocation_Unit ( self , Sectors_Per_Allocation_Unit ) : self . Sectors_Per_Allocation_Unit = Sectors_Per_Allocation_Unit <EOL> def validate_UnsignedIntegerObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Bytes_Per_Sector ( self ) : return self . Bytes_Per_Sector <EOL> def set_Bytes_Per_Sector ( self , Bytes_Per_Sector ) : self . Bytes_Per_Sector = Bytes_Per_Sector <EOL> def validate_PositiveIntegerObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_Actual_Available_Allocation_Units ( self ) : return self . Actual_Available_Allocation_Units <EOL> def set_Actual_Available_Allocation_Units ( self , Actual_Available_Allocation_Units ) : self . Actual_Available_Allocation_Units = Actual_Available_Allocation_Units <EOL> def get_Creation_Time ( self ) : return self . Creation_Time <EOL> def set_Creation_Time ( self , Creation_Time ) : self . Creation_Time = Creation_Time <EOL> def validate_DateTimeObjectPropertyType ( self , value ) : <EOL> pass <EOL> def get_File_System_Flag_List ( self ) : return self . File_System_Flag_List <EOL> def set_File_System_Flag_List ( self , File_System_Flag_List ) : self . File_System_Flag_List = File_System_Flag_List <EOL> def get_Serial_Number ( self ) : return self . Serial_Number <EOL> def set_Serial_Number ( self , Serial_Number ) : self . Serial_Number = Serial_Number <EOL> def get_is_mounted ( self ) : return self . is_mounted <EOL> def set_is_mounted ( self , is_mounted ) : self . is_mounted = is_mounted <EOL> def hasContent_ ( self ) : <EOL> if ( <EOL> self . Name is not None or <EOL> self . Device_Path is not None or <EOL> self . File_System_Type is not None or <EOL> self . Total_Allocation_Units is not None or <EOL> self . Sectors_Per_Allocation_Unit is not None or <EOL> self . Bytes_Per_Sector is not None or <EOL> self . Actual_Available_Allocation_Units is not None or <EOL> self . Creation_Time is not None or <EOL> self . File_System_Flag_List is not None or <EOL> self . Serial_Number is not None or <EOL> super ( VolumeObjectType , 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 ( VolumeObjectType , self ) . exportAttributes ( lwrite , level , already_processed , namespace_ , name_ = '<STR_LIT>' ) <EOL> if self . is_mounted is not None : <EOL> lwrite ( '<STR_LIT>' % self . gds_format_boolean ( self . is_mounted , input_name = '<STR_LIT>' ) ) <EOL> def exportChildren ( self , lwrite , level , namespace_ = '<STR_LIT>' , name_ = '<STR_LIT>' , fromsubclass_ = False , pretty_print = True ) : <EOL> super ( VolumeObjectType , 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 . Name is not None : <EOL> self . Name . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT:Name>' , pretty_print = pretty_print ) <EOL> if self . Device_Path is not None : <EOL> self . Device_Path . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . File_System_Type is not None : <EOL> self . File_System_Type . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Total_Allocation_Units is not None : <EOL> self . Total_Allocation_Units . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Sectors_Per_Allocation_Unit is not None : <EOL> self . Sectors_Per_Allocation_Unit . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Bytes_Per_Sector is not None : <EOL> self . Bytes_Per_Sector . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Actual_Available_Allocation_Units is not None : <EOL> self . Actual_Available_Allocation_Units . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Creation_Time is not None : <EOL> self . Creation_Time . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . File_System_Flag_List is not None : <EOL> self . File_System_Flag_List . export ( lwrite , level , '<STR_LIT>' , name_ = '<STR_LIT>' , pretty_print = pretty_print ) <EOL> if self . Serial_Number is not None : <EOL> self . Serial_Number . 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_mounted = True <EOL> elif value in ( '<STR_LIT:false>' , '<STR_LIT:0>' ) : <EOL> self . is_mounted = False <EOL> else : <EOL> raise_parse_error ( node , '<STR_LIT>' ) <EOL> super ( VolumeObjectType , self ) . buildAttributes ( node , attrs , already_processed ) <EOL> def buildChildren ( self , child_ , node , nodeName_ , fromsubclass_ = False ) : <EOL> if nodeName_ == '<STR_LIT:Name>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Name ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Device_Path ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_File_System_Type ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . UnsignedLongObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Total_Allocation_Units ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . UnsignedIntegerObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Sectors_Per_Allocation_Unit ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . PositiveIntegerObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Bytes_Per_Sector ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . UnsignedLongObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Actual_Available_Allocation_Units ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . DateTimeObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Creation_Time ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = FileSystemFlagListType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_File_System_Flag_List ( obj_ ) <EOL> elif nodeName_ == '<STR_LIT>' : <EOL> obj_ = cybox_common . StringObjectPropertyType . factory ( ) <EOL> obj_ . build ( child_ ) <EOL> self . set_Serial_Number ( obj_ ) <EOL> super ( VolumeObjectType , self ) . buildChildren ( child_ , node , nodeName_ , True ) <EOL> GDSClassesMapping = { <EOL> '<STR_LIT>' : cybox_common . BuildUtilityType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . TimeType , <EOL> '<STR_LIT>' : cybox_common . ErrorsType , <EOL> '<STR_LIT>' : cybox_common . MetadataType , <EOL> '<STR_LIT>' : cybox_common . HashType , <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 . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <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 . CompilerType , <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 . 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 . PropertyType , <EOL> '<STR_LIT>' : cybox_common . ExtractedStringsType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <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 . UnsignedIntegerObjectPropertyType , <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 . UnsignedLongObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashListType , <EOL> '<STR_LIT>' : cybox_common . HashSegmentsType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . DateTimeObjectPropertyType , <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 . PersonnelType , <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>' : 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 . HexBinaryObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . IntegerObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . HashSegmentType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT:Name>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . StringObjectPropertyType , <EOL> '<STR_LIT>' : cybox_common . UnsignedLongObjectPropertyType , <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 . PositiveIntegerObjectPropertyType , <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 = VolumeObjectType <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 = VolumeObjectType <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 = VolumeObjectType <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> "<STR_LIT>" , <EOL> "<STR_LIT>" <EOL> ] </s>
