Atlas  0.7.0
Networking protocol for the Worldforge system.
atlas.Object Class Reference
Inheritance diagram for atlas.Object:
Collaboration diagram for atlas.Object:

Public Member Functions

def __init__ (self, kw)
 
def __setattr__ (self, name, value)
 
def __getattr__ (self, name)
 
def is_plain_attribute (self, name)
 
def get_plain_attribute (self, name)
 
def get_attr_pos (self, a)
 
def key_func (self, value)
 
def items (self, convert2plain_flag=1, original_order=1, all=0)
 
def get_attributes (self, convert2plain_flag=1)
 
def get_all_attributes (self, result_dict=None, convert2plain_flag=1)
 
def attribute_definition (self, name)
 
def has_parent (self, parent)
 
def get_objtype (self)
 
def __repr__ (self)
 
def __str__ (self)
 

Public Attributes

 id
 

Detailed Description

handles all Atlas objects

Definition at line 36 of file __init__.py.

Constructor & Destructor Documentation

def atlas.Object.__init__ (   self,
  kw 
)
usage: Object(id="human", objtype="class", parents=["living"])
   acts like normal python class and dictionary at the same time
   in addition looks for atributes from parent objects

Definition at line 39 of file __init__.py.

References atlas.Object.__dict__.

Member Function Documentation

def atlas.Object.__getattr__ (   self,
  name 
)
look first for attribute at this object
   if not available, then go trough all parent object looking
   for attrbiutes

Definition at line 57 of file __init__.py.

References atlas.Object.__dict__.

def atlas.Object.attribute_definition (   self,
  name 
)
give object that defines given attribute

Definition at line 161 of file __init__.py.

References atlas.Object.__dict__, atlas.Object.get_attributes(), atlas.Object.id, and atlas.Object.items().

def atlas.Object.get_all_attributes (   self,
  result_dict = None,
  convert2plain_flag = 1 
)
list all attributes including inherited ones:
   returns dictionary: use get_all_attributes().items() for list

Definition at line 150 of file __init__.py.

References atlas.Object.get_attributes().

Referenced by atlas.Object.items().

def atlas.Object.get_attributes (   self,
  convert2plain_flag = 1 
)
list all attributes defined in this object:
   returns dictionary: use items() for list

Definition at line 137 of file __init__.py.

References atlas.Object.__dict__.

Referenced by atlas.Object.attribute_definition(), atlas.Object.get_all_attributes(), and atlas.Object.items().

def atlas.Object.get_plain_attribute (   self,
  name 
)
convert all references to parents, etc.. objects to string ids

Definition at line 101 of file __init__.py.

References atlas.Object.get_attr_pos(), and atlas.Object.items().

def atlas.Object.is_plain_attribute (   self,
  name 
)
is attribute plain?

Definition at line 96 of file __init__.py.

def atlas.Object.items (   self,
  convert2plain_flag = 1,
  original_order = 1,
  all = 0 
)
like dictionary items method:
   original_order: tries to preserver specification order if possible
   all: list also inherited attributes (if possible)

Definition at line 123 of file __init__.py.

References atlas.Object.get_all_attributes(), atlas.Object.get_attributes(), and atlas.Object.key_func().

Referenced by atlas.Object.attribute_definition(), and atlas.Object.get_plain_attribute().


The documentation for this class was generated from the following file: