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

Type Component

object --+    
         |    
     VBase --+
             |
            Component

Known Subclasses:
RecurringComponent, TimezoneComponent

A complex property that can contain multiple ContentLines.

For our purposes, a component must start with a BEGIN:xxxx line and end with END:xxxx, or have a PROFILE:xxx line if a top-level component.
Method Summary
  __init__(self, name, *args, **kwds)
  __getattr__(self, name)
For convenience, make self.contents directly accessible.
  __repr__(self)
  __setattr__(self, name, value)
For convenience, make self.contents directly accessible.
  __str__(self)
  add(self, objOrName, group)
Add objOrName to contents, set behavior if it can be inferred.
  components(self)
Return an iterable of all Component children.
  getChildren(self)
Return an iterable of all children.
  getSortedChildren(self)
  lines(self)
Return an iterable of all ContentLine children.
  prettyPrint(self, level, tabwidth)
  setBehaviorFromVersionLine(self, versionLine)
Set behavior if one matches name, versionLine.value.
  setProfile(self, name)
Assign a PROFILE to this unnamed component.
  sortChildKeys(self)
  transformChildrenFromNative(self, clearBehavior)
Recursively transform native children to vanilla representations.
  transformChildrenToNative(self)
Recursively replace children with their native representation.
    Inherited from VBase
  autoBehavior(self, cascade)
Set behavior if name is in self.parentBehavior.knownChildren.
  clearBehavior(self, cascade)
Set behavior to None.
  serialize(self, buf, lineLength, validate)
Serialize to buf if it exists, otherwise return a string.
  setBehavior(self, behavior, cascade)
Set behavior.
  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

Instance Variable Summary
  contents: A dictionary of lists of Component or ContentLine instances.
  name: Uppercase string used to represent this Component, i.e VCARD if the serialized object starts with BEGIN:VCARD.
  useBegin: A boolean flag determining whether BEGIN: and END: lines should be serialized.
    Inherited from VBase
  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

__getattr__(self, name)
(Qualification operator)

For convenience, make self.contents directly accessible.

__setattr__(self, name, value)

For convenience, make self.contents directly accessible.

self.contents must contain lists, raise an error if value isn't a list.
Overrides:
__builtin__.object.__setattr__

add(self, objOrName, group=None)

Add objOrName to contents, set behavior if it can be inferred.

If objOrName is a string, create an empty component or line based on behavior. If no behavior is found for the object, add a ContentLine.

group is an optional prefix to the name of the object (see RFC 2425).

components(self)

Return an iterable of all Component children.

getChildren(self)

Return an iterable of all children.
Overrides:
vobject.vobject.VBase.getChildren

lines(self)

Return an iterable of all ContentLine children.

setBehaviorFromVersionLine(self, versionLine)

Set behavior if one matches name, versionLine.value.

setProfile(self, name)

Assign a PROFILE to this unnamed component.

Used by vCard, not by vCalendar.

transformChildrenFromNative(self, clearBehavior=True)

Recursively transform native children to vanilla representations.
Overrides:
vobject.vobject.VBase.transformChildrenFromNative

transformChildrenToNative(self)

Recursively replace children with their native representation.
Overrides:
vobject.vobject.VBase.transformChildrenToNative

Instance Variable Details

contents

A dictionary of lists of Component or ContentLine instances. The keys are the lowercased names of child ContentLines or Components. Note that BEGIN and END ContentLines are not included in contents.

name

Uppercase string used to represent this Component, i.e VCARD if the serialized object starts with BEGIN:VCARD.

useBegin

A boolean flag determining whether BEGIN: and END: lines should be serialized.

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