- added new helper methods _distributeparams and _findnormpathitem to
[PyX/mjg.git] / pyx / base.py
blobb14ef56af955da96c8335927a9d2e0912d6977b9
1 #!/usr/bin/env python
2 # -*- coding: ISO-8859-1 -*-
5 # Copyright (C) 2002-2004 Jörg Lehmann <joergl@users.sourceforge.net>
6 # Copyright (C) 2002-2004 André Wobst <wobsta@users.sourceforge.net>
8 # This file is part of PyX (http://pyx.sourceforge.net/).
10 # PyX is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # PyX is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with PyX; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 # Postscript operators
28 __metaclass__ = type
30 class canvasitem:
32 """Base class for everything which can be inserted into a canvas"""
34 def outputPS(self, file):
35 """write PS code corresponding to canvasitem to file"""
36 pass
38 def outputPDF(self, file):
39 """write PDF code corresponding to canvasitem to file"""
40 pass
42 def prolog(self):
43 """return list of prolog items required by canvasitem"""
44 return []
46 def bbox(self):
47 """return bounding box of canvasitem or None"""
48 pass
52 # PyX Exception class
55 class PyXExcept(Exception):
57 """base class for all PyX Exceptions"""
59 pass