<s> import swgpy <EOL> from swgpy . object import * <EOL> from swgpy . attributes import * <EOL> from attributes . AttributeHelpers import SetOptionalAttribute <EOL> class FactoryCrateAttributeTemplate ( BaseAttributeTemplate ) : <EOL> def buildAttributeTemplate ( self , object ) : <EOL> attribute_list_message = AttributeListMessage ( ) <EOL> attribute_list_message . object_id = object . id <EOL> attributes = AttributeList ( ) <EOL> if len ( object . custom_name ) > <NUM_LIT:0> : <EOL> attributes . append ( "<STR_LIT>" , "<STR_LIT:@>" + object . stf_file + "<STR_LIT::>" + object . stf_name ) <EOL> attributes . extend ( [ <EOL> Attribute ( "<STR_LIT>" , str ( object . volume ) ) <EOL> ] ) <EOL> SetOptionalAttribute ( attributes , '<STR_LIT>' , '<STR_LIT>' , object , False ) <EOL> SetOptionalAttribute ( attributes , '<STR_LIT>' , '<STR_LIT>' , object , False ) <EOL> attributes . extend ( [ <EOL> Attribute ( "<STR_LIT>" , object . getStringAttribute ( "<STR_LIT>" ) ) , <EOL> Attribute ( "<STR_LIT>" , object . getStringAttribute ( "<STR_LIT>" ) ) , <EOL> Attribute ( "<STR_LIT>" , object . getStringAttribute ( "<STR_LIT:type>" ) ) <EOL> ] ) <EOL> attribute_list_message . attributes = attributes <EOL> return attribute_list_message </s>
