Package vobject :: Module vobject :: Class VBase
[show private | hide private]
[frames | no frames]

Type VBase

object --+
         |
        VBase

Known Subclasses:
Component, ContentLine

Base class for ContentLine and Component.
Method Summary
  __init__(self, group, *args, **kwds)
  autoBehavior(self, cascade)
Set behavior if name is in self.parentBehavior.knownChildren.
  clearBehavior(self, cascade)
Set behavior to None.
  getChildren(self)
Return an iterable containing the contents of the object.
  serialize(self, buf, lineLength, validate)
Serialize to buf if it exists, otherwise return a string.
  setBehavior(self, behavior, cascade)
Set behavior.
  transformChildrenFromNative(self, clearBehavior)
Recursively transform native children to vanilla representations.
  transformChildrenToNative(self)
Recursively replace children with their native representation.
  transformFromNative(self)
Return self transformed into a ContentLine or Component if needed.
  transformToNative(self)
Transform this object into a custom VBase subclass.
  validate(self, *args, **kwds)
Call the behavior's validate method, or return True.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Instance Variable Summary
  behavior: The Behavior class associated with this object, which controls validation, transformations, and encoding.
  group: An optional group prefix, should be used only to indicate sort order in vCards, according to RFC2426
  isNative: Boolean describing whether this component is a Native instance.
  parentBehavior: The object's parent's behavior, or None if no behaviored parent exists.

Method Details

autoBehavior(self, cascade=False)

Set behavior if name is in self.parentBehavior.knownChildren.

If cascade is True, unset behavior and parentBehavior for all descendants, then recalculate behavior and parentBehavior.

clearBehavior(self, cascade=True)

Set behavior to None. Do for all descendants if cascading.

getChildren(self)

Return an iterable containing the contents of the object.

serialize(self, buf=None, lineLength=75, validate=True)

Serialize to buf if it exists, otherwise return a string.

Use self.behavior.serialize if behavior exists.

setBehavior(self, behavior, cascade=True)

Set behavior. If cascade is True, autoBehavior all descendants.

transformChildrenFromNative(self, clearBehavior=True)

Recursively transform native children to vanilla representations.

transformChildrenToNative(self)

Recursively replace children with their native representation.

transformFromNative(self)

Return self transformed into a ContentLine or Component if needed.

May have side effects. If it does, transformFromNative and transformToNative MUST have perfectly inverse side effects. Allowing such side effects is convenient for objects whose transformations only change a few attributes.

Note that it isn't always possible for transformFromNative to be a perfect inverse of transformToNative, in such cases transformFromNative should return a new object, not self after modifications.

transformToNative(self)

Transform this object into a custom VBase subclass.

transformToNative should always return a representation of this object. It may do so by modifying self in place then returning self, or by creating a new object.

validate(self, *args, **kwds)

Call the behavior's validate method, or return True.

Instance Variable Details

behavior

The Behavior class associated with this object, which controls validation, transformations, and encoding.

group

An optional group prefix, should be used only to indicate sort order in vCards, according to RFC2426

isNative

Boolean describing whether this component is a Native instance.

parentBehavior

The object's parent's behavior, or None if no behaviored parent exists.

Generated by Epydoc 2.1 on Fri Dec 14 17:25:16 2007 http://epydoc.sf.net