~ubuntu-branches/ubuntu/precise/python-chaco/precise

« back to all changes in this revision

Viewing changes to enthought/chaco2/tests/serializable_base.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2008-12-29 02:34:05 UTC
  • Revision ID: james.westby@ubuntu.com-20081229023405-x7i4kp9mdxzmdnvu
Tags: upstream-3.0.1
ImportĀ upstreamĀ versionĀ 3.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
from enthought.traits.api import Bool, HasTraits, Str, Float, Enum, List, Int
 
4
from enthought.chaco2.serializable import Serializable
 
5
 
 
6
class Root(HasTraits):
 
7
    name = Str
 
8
    x = Float(0.0)
 
9
    y = Float(0.0)
 
10
 
 
11
class Shape(Serializable, Root):
 
12
    color = Enum("red", "green", "blue")
 
13
    filled = Bool(True)
 
14
    tools = List
 
15
    _pickles = ("tools", "filled", "color", "x")
 
16
 
 
17
class Circle(Shape):
 
18
    radius = Float(10.0)
 
19
    _pickles = ("radius",)
 
20
 
 
21
class Poly(Shape):
 
22
    numsides = Int(5)
 
23
    length = Float(5.0)
 
24
    _pickles = ("numsides", "length")
 
25
 
 
26
# EOF