debug output more akin to dvitype
[PyX/mjg.git] / pyx / base.py
blob1726d466c8cddbf5fc533cd4045d2a22e2de2979
1 #!/usr/bin/env python
4 # Copyright (C) 2002 Jörg Lehmann <joergl@users.sourceforge.net>
5 # Copyright (C) 2002 André Wobst <wobsta@users.sourceforge.net>
7 # This file is part of PyX (http://pyx.sourceforge.net/).
9 # PyX is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # PyX is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with PyX; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 # Postscript operators
27 class PSOp:
29 """Poscript Operators
31 Everything, you can write in a (E)PS file
33 """
35 def write(self, file):
36 """writing into a file is the only routine, a PSOp has to supply"""
37 raise NotImplementedError, "cannot call virtual method write()"
40 # PSCmd class
43 class PSCmd(PSOp):
45 """ PSCmd is the base class of all visible elements
47 Visible elements are those, that can be embedded in the Canvas
48 and posses a bbox.
50 """
52 def bbox(self):
53 raise NotImplementedError, "cannot call virtual method bbox()"
56 # PSText class
59 class PSText(PSCmd):
61 """ PSText is the base class of all text elements
63 Text elements are those, that (may) contain text and thus provide a
64 writefontheader method.
66 """
68 def writefontheader(self, file, containsfonts):
69 raise NotImplementedError, "cannot call virtual method writefontheader()"
72 # Path style classes
74 # note that as usual in PyX most classes have default instances as members
76 class PathStyle(PSOp):
78 """style modifiers for paths
79 """
82 pass
87 # PyX Exception class
90 class PyXExcept(Exception):
92 """base class for all PyX Exceptions"""
94 pass