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

Type Behavior

object --+
         |
        Behavior

Known Subclasses:
DateOrDateTimeBehavior, DateTimeBehavior, DaylightOrStandard, Duration, FreeBusy, MultiDateBehavior, MultiTextBehavior, RecurringBehavior, TextBehavior, Trigger, VAlarm, VCalendar2_0, VCardBehavior, VFreeBusy, VTimezone

Abstract class to describe vobject options, requirements and encodings.

Behaviors are used for root components like VCALENDAR, for subcomponents like VEVENT, and for individual lines in components.

Behavior subclasses are not meant to be instantiated, all methods should be classmethods.
Method Summary
  __init__(self)
  decode(cls, line)
(Class method)
  encode(cls, line)
(Class method)
  generateImplicitParameters(cls, obj)
Generate any required information that don't yet exist. (Class method)
  lineValidate(cls, line, raiseException, complainUnrecognized)
Examine a line's parameters and values, return True if valid. (Class method)
  serialize(cls, obj, buf, lineLength)
Set implicit parameters, do encoding, return unicode string. (Class method)
  transformFromNative(cls, obj)
Inverse of transformToNative. (Class method)
  transformToNative(cls, obj)
Turn a ContentLine or Component into a Python-native representation. (Class method)
  validate(cls, obj, raiseException, complainUnrecognized)
Check if the object satisfies this behavior's requirements. (Class method)
    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)

Class Variable Summary
bool allowGroup: Whether or not vCard style group prefixes are allowed.
str description: A brief excerpt from the RFC explaining the function of the component or line.
bool hasNative: A boolean describing whether the object can be transformed into a more Pythonic object.
bool isComponent: A boolean, True if the object should be a Component.
dict knownChildren: A dictionary with uppercased component/property names as keys and a tuple (min, max, id) as value, where id is the id used by registerBehavior, min and max are the limits on how many of this child must occur.
str name: The uppercase name of the object described by the class, or a generic name if the class defines behavior for many objects.
bool quotedPrintable: A boolean describing whether the object should be encoded and decoded using quoted printable line folding and character escaping.
list sortFirst: The lower-case list of children which should come first when sorting.
str versionString: The string associated with the component, for instance, 2.0 if there's a line like VERSION:2.0, an empty string otherwise.

Class Method Details

generateImplicitParameters(cls, obj)

Generate any required information that don't yet exist.

lineValidate(cls, line, raiseException, complainUnrecognized)

Examine a line's parameters and values, return True if valid.

serialize(cls, obj, buf, lineLength)

Set implicit parameters, do encoding, return unicode string.

If validate is True, raise VObjectError if the line doesn't validate after implicit parameters are generated.

Default is to call vobject.defaultSerialize.

transformFromNative(cls, obj)

Inverse of transformToNative.

transformToNative(cls, obj)

Turn a ContentLine or Component into a Python-native representation.

If appropriate, turn dates or datetime strings into Python objects. Components containing VTIMEZONEs turn into VtimezoneComponents.

validate(cls, obj, raiseException=False, complainUnrecognized=False)

Check if the object satisfies this behavior's requirements.
Parameters:
obj - The ContentLine or Component to be validated.
raiseException - If True, raise a vobject.ValidateError on validation failure. Otherwise return a boolean.
complainUnrecognized - If True, fail to validate if an uncrecognized parameter or child is found. Otherwise log the lack of recognition.

Class Variable Details

allowGroup

Whether or not vCard style group prefixes are allowed.
Type:
bool
Value:
False                                                                  

description

A brief excerpt from the RFC explaining the function of the component or line.
Type:
str
Value:
''                                                                     

hasNative

A boolean describing whether the object can be transformed into a more Pythonic object.
Type:
bool
Value:
False                                                                  

isComponent

A boolean, True if the object should be a Component.
Type:
bool
Value:
False                                                                  

knownChildren

A dictionary with uppercased component/property names as keys and a tuple (min, max, id) as value, where id is the id used by registerBehavior, min and max are the limits on how many of this child must occur. None is used to denote no max or no id.
Type:
dict
Value:
{}                                                                     

name

The uppercase name of the object described by the class, or a generic name if the class defines behavior for many objects.
Type:
str
Value:
''                                                                     

quotedPrintable

A boolean describing whether the object should be encoded and decoded using quoted printable line folding and character escaping.
Type:
bool
Value:
False                                                                  

sortFirst

The lower-case list of children which should come first when sorting.
Type:
list
Value:
[]                                                                     

versionString

The string associated with the component, for instance, 2.0 if there's a line like VERSION:2.0, an empty string otherwise.
Type:
str
Value:
''                                                                     

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