Home | Trees | Indices | Help |
---|
|
1 # $Id: gp_mac.py,v 2.17 2003/04/21 09:44:09 mhagger Exp $ 2 3 # Copyright (C) 1999-2003 Michael Haggerty <mhagger@alum.mit.edu> 4 # Thanks to Tony Ingraldi and Noboru Yamamoto for their contributions. 5 # 6 # This file is licensed under the GNU Lesser General Public License 7 # (LGPL). See LICENSE.txt for details. 8 9 """gp_mac -- an interface to gnuplot for the Macintosh. 10 11 """ 12 13 __cvs_version__ = '$Revision: 2.17 $' 14 15 import os, string 16 17 import Errors 18 19 20 # ############ Configuration variables: ################################ 2123 """The configuration options for gnuplot on the Macintosh. 24 25 See gp.py for details about the meaning of these options. Please 26 let me know if you know better choices for these settings.""" 27 28 # The '-persist' option is not supported on the Mac: 29 recognizes_persist = 0 30 31 # Apparently the Mac can use binary data: 32 recognizes_binary_splot = 1 33 34 # Apparently the Mac can not use inline data: 35 prefer_inline_data = 0 36 37 # os.mkfifo is not supported on the Mac. 38 support_fifo = 0 39 prefer_fifo_data = 0 40 41 # The default choice for the 'set term' command (to display on screen). 42 # Terminal types are different in Gnuplot 3.7.1c. 43 # For earlier versions, this was default_term = 'macintosh' 44 default_term = 'pict' 45 46 # I don't know how to print directly to a printer on the Mac: 47 default_lpr = '| lpr' 48 49 # Used the 'enhanced' option of postscript by default? Set to 50 # None (*not* 0!) if your version of gnuplot doesn't support 51 # enhanced postscript. 52 prefer_enhanced_postscript = 153 54 # ############ End of configuration options ############################ 55 56 57 # The Macintosh doesn't support pipes so communication is via 58 # AppleEvents. 59 60 import gnuplot_Suites 61 import Required_Suite 62 import aetools 63 64 65 # Mac doesn't recognize persist.67 return 068 6970 -class _GNUPLOT(aetools.TalkTo, 71 Required_Suite.Required_Suite, 72 gnuplot_Suites.gnuplot_Suite, 73 gnuplot_Suites.odds_and_ends, 74 gnuplot_Suites.Standard_Suite, 75 gnuplot_Suites.Miscellaneous_Events):80 8183 """Unsophisticated interface to a running gnuplot program. 84 85 See gp_unix.GnuplotProcess for usage information. 86 87 """ 8812590 """Start a gnuplot process. 91 92 Create a 'GnuplotProcess' object. This starts a gnuplot 93 program and prepares to write commands to it. 94 95 Keyword arguments: 96 97 'persist' -- the '-persist' option is not supported on the 98 Macintosh so this argument must be zero. 99 100 """ 101 102 if persist: 103 raise Errors.OptionError( 104 '-persist is not supported on the Macintosh!') 105 106 self.gnuplot = _GNUPLOT() 107 108 # forward close method: 109 self.close = self.gnuplot.quit110112 """Mac gnuplot apparently requires '\r' to end statements.""" 113 114 self.gnuplot.gnuexec(string.replace(s, '\n', os.linesep))115117 pass118
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0alpha3 on Fri Nov 23 23:44:44 2007 | http://epydoc.sourceforge.net |