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

◆ __init__()

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

◆ __getattr__()

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__.

◆ __repr__()

def atlas.Object.__repr__ (   self)

Definition at line 185 of file __init__.py.

◆ __setattr__()

def atlas.Object.__setattr__ (   self,
  name,
  value 
)

Definition at line 49 of file __init__.py.

◆ __str__()

def atlas.Object.__str__ (   self)

Definition at line 192 of file __init__.py.

◆ attribute_definition()

def atlas.Object.attribute_definition (   self,
  name 
)

◆ get_all_attributes()

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.__dict__, atlas.Object.get_all_attributes(), atlas.Object.get_attributes(), and atlas.Object.items().

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

◆ get_attr_pos()

def atlas.Object.get_attr_pos (   self,
  a 
)

Definition at line 106 of file __init__.py.

Referenced by atlas.Object.get_plain_attribute().

◆ get_attributes()

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__, and atlas.Object.items().

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

◆ get_objtype()

def atlas.Object.get_objtype (   self)

Definition at line 179 of file __init__.py.

◆ get_plain_attribute()

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().

◆ has_parent()

def atlas.Object.has_parent (   self,
  parent 
)

Definition at line 170 of file __init__.py.

◆ is_plain_attribute()

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

Definition at line 96 of file __init__.py.

◆ items()

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 122 of file __init__.py.

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

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

◆ key_func()

def atlas.Object.key_func (   self,
  value 
)

Definition at line 119 of file __init__.py.

Referenced by atlas.Object.items().

Member Data Documentation

◆ id

atlas.Object.id

Definition at line 172 of file __init__.py.

Referenced by atlas.Object.attribute_definition().


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