#NEWLINE# def __init__( self , predicate , attribute_type = rdfvalue . RDFString , description = '' , name = None , _copy = False , default = None , index = None , versioned = True , lock_protected = False , creates_new_object_version = True ) : #NEWLINE# #INDENT# 'Constructor.\n\n    Args:\n       predicate: The name of this attribute - must look like a URL\n             (e.g. aff4:contains). Will be used to store the attribute.\n       attribute_type: The RDFValue type of this attributes.\n       description: A one line description of what this attribute represents.\n       name: A human readable name for the attribute to be used in filters.\n       _copy: Used internally to create a copy of this object without\n          registering.\n       default: A default value will be returned if the attribute is not set on\n          an object. This can be a constant or a callback which receives the fd\n          itself as an arg.\n       index: The name of the index to use for this attribute. If None, the\n          attribute will not be indexed.\n       versioned: Should this attribute be versioned? Non-versioned attributes\n          always overwrite other versions of the same attribute.\n       lock_protected: If True, this attribute may only be set if the object was\n          opened via OpenWithLock().\n       creates_new_object_version: If this is set, a write to this attribute\n          will also write a new version of the parent attribute. This should be\n          False for attributes where lots of entries are collected like logs.\n    ' #NEWLINE# self . name = name #NEWLINE# self . predicate = predicate #NEWLINE# self . attribute_type = attribute_type #NEWLINE# self . description = description #NEWLINE# self . default = default #NEWLINE# self . index = index #NEWLINE# self . versioned = versioned #NEWLINE# self . lock_protected = lock_protected #NEWLINE# self . creates_new_object_version = creates_new_object_version #NEWLINE# self . field_names = [ ] #NEWLINE# if ( not _copy ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# old_attribute = Attribute . PREDICATES [ predicate ] #NEWLINE# if ( old_attribute . attribute_type != attribute_type ) : #NEWLINE# #INDENT# msg = ( 'Attribute %s defined with conflicting types (%s, %s)' % ( predicate , old_attribute . attribute_type . __class__ . __name__ , attribute_type . __class__ . __name__ ) ) #NEWLINE# logging . error ( msg ) #NEWLINE# raise RuntimeError ( msg ) #NEWLINE# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# self . PREDICATES [ description ] = self #NEWLINE# if name : #NEWLINE# #INDENT# self . NAMES [ name ] = self