• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

plplotcanvas.py

Go to the documentation of this file.
00001 """plplotcanvas.py - Python front-end for the plplotcanvas
00002 
00003   Copyright (C) 2004, 2005 Thomas J. Duck
00004   All rights reserved.
00005 
00006   Thomas J. Duck <tom.duck@dal.ca>
00007   Department of Physics and Atmospheric Science,
00008   Dalhousie University, Halifax, Nova Scotia, Canada, B3H 3J5
00009 
00010 
00011 NOTICE
00012 
00013   This library is free software; you can redistribute it and/or
00014   modify it under the terms of the GNU Lesser General Public
00015   License as published by the Free Software Foundation; either
00016   version 2.1 of the License, or (at your option) any later version.
00017 
00018   This library is distributed in the hope that it will be useful,
00019   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021   Lesser General Public License for more details.
00022 
00023   You should have received a copy of the GNU Lesser General Public
00024   License along with this library; if not, write to the Free Software
00025   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
00026   USA 
00027 """
00028 
00029 
00030 import plplot
00031 import cplplotcanvas
00032 import exceptions
00033 
00034 class Canvas(cplplotcanvas.Canvas):
00035 
00036     def __init__(self):
00037         cplplotcanvas.Canvas.__init__(self)
00038         self.devinit()
00039 
00040     def __getattr__(self,name):
00041 
00042         # Select the stream
00043         Nstream = self.get_stream_number()
00044         plplot.plsstrm(Nstream)
00045 
00046         # Try to get the function using all of the available prefixes
00047         if 'pl'+name in dir(plplot):
00048             return eval('plplot.' + 'pl' + name)
00049         elif '' + name in dir(plplot):
00050             return eval('plplot.' + '' + name)
00051         elif 'pl_' + name in dir(plplot):
00052             return eval('plplot.' + 'pl_' + name)
00053         else:
00054             msg = "'Canvas' object has no attribute '%s'" % (name)
00055             raise exceptions.AttributeError, msg

Generated on Wed Oct 12 2011 20:42:22 for PLplot by  doxygen 1.7.1