Package fife :: Package extensions :: Package pychan :: Module attrs
[hide private]
[frames] | no frames]

Module attrs

source code

Simple error checking attributes.

This module defines a set of Attribute classes which you can use to define possible values an attribute of an object accepts.

Usage:

 class SomeObject:
     nameAttr, posAttr = [ Attr("name"), PointAttr("pos") ]

 obj =  SomeObject()
 obj.nameAttr.set(obj,"newName")
 obj.posAttr.set(obj,"89,89")

This is most useful for error checking parsing and defining accepted attributes in classes and is used by pychan internally.

Classes [hide private]
  Attr
A simple text attribute.
  UnicodeAttr
  PointAttr
  ColorAttr
  IntAttr
  BoolAttr
  FloatAttr