MiddleKit.Core.Klass | index /usr/local/share/webware/MiddleKit/Core/Klass.py

Classes
`` |  | MiddleKit.Core.MiddleDict.MiddleDict(UserDict.UserDict) Klass(MiddleKit.Core.MiddleDict.MiddleDict, MiddleKit.Core.ModelObject.ModelObject) MiddleKit.Core.ModelObject.ModelObject Klass(MiddleKit.Core.MiddleDict.MiddleDict, MiddleKit.Core.ModelObject.ModelObject)
class Klass(MiddleKit.Core.MiddleDict.MiddleDict, MiddleKit.Core.ModelObject.ModelObject)
`` | `A Klass represents a class specification. It is consisting primarily of a name and a list of attributes.`
| Method resolution order: Klass MiddleKit.Core.MiddleDict.MiddleDict UserDict.UserDict MiscUtils.NamedValueAccess.NamedValueAccess MiddleKit.Core.ModelObject.ModelObject Methods defined here: __cmp__(self, other) __hash__(self) __init__(self, klassContainer, dict=None) `Initialize a Klass definition with a raw dictionary. This is typically read from a file. The 'Class' field contains the name and can also contain the name of the superclass (like "Name : SuperName"). Multiple inheritance is not yet supported.` __str__(self) addAttr(self, attr) addSubklass(self, klass) allAttrs(self) `Returns a list of all attributes. This includes those attributes that are inherited and derived. The order is top down; that is, ancestor attributes come first.` allDataAttrs(self) `Return a list of all data attributes. This includes those attributes that are inherited. The order is top down; that is, ancestor attributes come first. Derived attributes are not included in the list.` allDataRefAttrs(self) `Return a list of all data referencing attributes. Returns a list of all data attributes that are obj refs or lists, including those that are inherited.` asShortString(self) attr(self, name, default=<class MiscUtils.NoDefault at 0x800ed2290>) `Return the attribute with the given name. If no such attribute exists, an exception is raised unless a default was provided (which is then returned).` attrs(self) `Return a list of all the klass' attributes not including inheritance.` awakeFromRead(self, klasses) `Perform further initialization. Invoked by Klasses after all basic Klass definitions have been read.` backObjRefAttrs(self) `Return a list of all potentially referencing attributes. Returns a list of all ObjRefAttrs in the given object model that can potentially refer to this object. The list does NOT include attributes inherited from superclasses.` buildDependencies(self) `Build dependencies of the klass. A klass' immediate dependencies are its ancestor classes (which may have auxilliary tables such as enums), the target klasses of all its obj ref attrs and their descendant classes.` descendants(self, init=1, memo=None) `Return all descendant klasses of this klass.` hasAttr(self, name) id(self) `Return the id of the class, which is an integer. Ids can be fundamental to storing object references in concrete object stores. This method will throw an exception if setId() was not previously invoked.` isAbstract(self) isKindOfKlassNamed(self, name) `Check whether the klass is from the given kind. Returns true if the klass is the same as, or inherits from, the klass with the given name.` klasses(self) lookupAncestorKlass(self, name, default=<class MiscUtils.NoDefault at 0x800ed2290>) `Search for and return the ancestor klass with the given name. Raises an exception if no such klass exists, unless a default is specified (in which case it is returned).` lookupAttr(self, name, default=<class MiscUtils.NoDefault at 0x800ed2290>) model(self) name(self) printWarnings(self, out) pyClass(self) `Return the Python class that corresponds to this class. This request will even result in the Python class' module being imported if necessary. It will also set the Python class attribute _mk_klass which is used by MiddleKit.Run.MiddleObject.` readDict(self, dict) recordDependencyOrder(self, order, visited, indent=0) setId(self, id) setKlasses(self, klasses) `Set the klasses object of the klass. This is the klass' owner.` setSuperklass(self, klass) setting(self, name, default=<class MiscUtils.NoDefault at 0x800ed2290>) `Return the value of a particular configuration setting taken from the model.` subklasses(self) superklass(self) supername(self) willBuildDependencies(self) `Preps the klass for buildDependencies().` Methods inherited from MiddleKit.Core.MiddleDict.MiddleDict: boolForKey(self, key, default=False) `Return True or False for the given key. Returns False if the key does not even exist. Raises a value error if the key exists, but cannot be parsed as a bool.` Methods inherited from UserDict.UserDict: __contains__(self, key) __delitem__(self, key) __getitem__(self, key) __len__(self) __repr__(self) __setitem__(self, key, item) clear(self) copy(self) get(self, key, failobj=None) hasValueForKey = _UserDict_hasValueForKey(self, key) has_key(self, key) items(self) iteritems(self) iterkeys(self) itervalues(self) keys(self) pop(self, key, *args) popitem(self) setdefault(self, key, failobj=None) update(self, dict=None, **kwargs) valueForKey = _UserDict_valueForKey(self, key, default=<class MiscUtils.NoDefault at 0x800ed2290>) values(self) Class methods inherited from UserDict.UserDict: fromkeys(cls, iterable, value=None) from __builtin__.classobj Methods inherited from MiscUtils.NamedValueAccess.NamedValueAccess: handleUnknownSetKey(self, key) hasValueForName(self, keysString) `Check whether name is available.` resetKeyBindings(self) `Rest all key bindings, releasing alreaedy referenced values.` setValueForKey(self, key, value) `Set value for a given key. Suppose key is 'foo'. This method sets the value with the following precedence: 1. Public attributes before private attributes 2. Methods before non-methods More specifically, this method then uses one of the following: @@ 2000-03-04 ce: fill in ... or invokes handleUnknownSetKey().` valueForKeySequence(self, listOfKeys, default=None) `Get the value for the given list of keys.` valueForName(self, keysString, default=None) `Get the value for the given keysString. This is the more advanced version of valueForKey(), which can only handle single names. This method can handle 'foo', 'foo1.foo2', 'a.b.c.d', etc. It will traverse dictionaries if needed.` valueForUnknownKey(self, key, default) valuesForNames(self, keys, default=None, defaults=None, forgive=0, includeNames=0) `Get all values for given names. Returns a list of values that match the given keys, each of which is passed through valueForName() and so could be of the form 'a.b.c'. keys and defaults are sequences. default is any kind of object. forgive and includeNames are flags. If default is not None, then it is substituted when a key is not found. Otherwise, if defaults is not None, then its corresponding/parallel value for the current key is substituted when a key is not found. Otherwise, if forgive is true, then unknown keys simply don't produce any values. Otherwise, if default and defaults are None, and forgive is false, then the unknown keys will probably raise an exception through valueForUnknownKey() although that method can always return a final, default value. if keys is None, then None is returned. If keys is an empty list, then None is returned. Often these last four arguments are specified by key. Examples: names = ['origin.x', 'origin.y', 'size.width', 'size.height'] obj.valuesForNames(names) obj.valuesForNames(names, default=0.0) obj.valuesForNames(names, defaults=[0.0, 0.0, 100.0, 100.0]) obj.valuesForNames(names, forgive=0) @@ 2000-03-04 ce: includeNames is only supported when forgive=1. It should be supported for the other cases. It should be documented. It should be included in the test cases.` Methods inherited from MiddleKit.Core.ModelObject.ModelObject: printAttrs(self, out=None)

Data
`` |  | StringTypes = (<type 'str'>, <type 'unicode'>)