Package pyscript :: Module base :: Class PsObj
[show private | hide private]
[frames | no frames]

Class PsObj

object --+
         |
        PsObj

Known Subclasses:
AffineObj, Color, Dash, P

Base Class that most pyscript objects should subclass
Method Summary
  __init__(self, **options)
can pass a dict of atributes to set
self __call__(self, **options)
Set a whole lot of attributes in one go
string __repr__(self)
Return a representation of this object
string __str__(self)
return actual postscript string to generate object
Bbox bbox(self)
return objects bounding box this can be a Null Bbox() if object doesn't draw anything on the page.)
string body(self)
subclasses should overide this for generating postscipt code
self copy(self, **options)
return a copy of this object with listed attributes modified
string postbody(self)
convenience function to allow clean subclassing
string prebody(self)
convenience function to allow clean subclassing
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
    Inherited from type
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T

Method Details

__init__(self, **options)
(Constructor)

can pass a dict of atributes to set
Overrides:
__builtin__.object.__init__

__call__(self, **options)
(Call operator)

Set a whole lot of attributes in one go

eg:
 obj.set(bg=Color(.3),linewidth=2)
Returns:
self
           (type=self)

__repr__(self)
(Representation operator)

Return a representation of this object
Returns:
string
Overrides:
__builtin__.object.__repr__

__str__(self)
(Informal representation operator)

return actual postscript string to generate object
Returns:
string
Overrides:
__builtin__.object.__str__

bbox(self)

return objects bounding box this can be a Null Bbox() if object doesn't draw anything on the page.)

NB that the bbox should be dynamically calculated and take into account the transformation matrix if it applies
Returns:
A bounding box object
           (type=Bbox)

body(self)

subclasses should overide this for generating postscipt code
Returns:
string

copy(self, **options)

return a copy of this object with listed attributes modified

eg:
 newobj=obj.copy(bg=Color(.3))
Returns:
self

postbody(self)

convenience function to allow clean subclassing
Returns:
string

prebody(self)

convenience function to allow clean subclassing
Returns:
string

Generated by Epydoc 2.0 on Mon Apr 24 17:02:37 2006 http://epydoc.sf.net