1
# $Id: gnuplot_Suites.py,v 2.5 2001/01/07 21:35:13 mhagger Exp $
3
# This file is provided as part of the Gnuplot.py package for the
4
# convenience of Mac users. It was originally part of
5
# MacGnuplot.2.0b4. Thanks to Anthony M. Ingraldi and Noboru Yamamoto
6
# for helping with this.
12
# class Standard_Suite
13
# class Miscellaneous_Events
15
"""Suite gnuplot Suite: Events supplied by gnuplot
18
Generated from Power HD:Applications:Analysis/Plotting:gnuplot.2.0a34:gnuplot (PPC)
19
AETE/AEUT resource version 1/0, language 0, script 0
22
__cvs_version__ = '$Revision: 2.5 $'
30
'label' : 'labl', # label dialog
31
'offsets' : 'oset', # offsets dialog
32
'textformat' : 'text', # text format dialog
33
'gxtextformat' : 'gxtx', # gx text format dialog
34
'linestyles' : 'line', # line styles dialog
35
'preferences' : 'pref', # preferences dialog
39
'lines' : 'typ1', # lines
40
'points' : 'typ2', # points
41
'impulses' : 'typ3', # impulses
42
'linespoints' : 'typ4', # lines with points
43
'dots' : 'typ5', # dots
44
'steps' : 'typ6', # steps
45
'fsteps' : 'typ7', # use two line segments
46
'errorbars' : 'typ8', # error bars
47
'xerrorbars' : 'typ9', # horizontal error bars
48
'yerrorbars' : 'ty10', # vertical error bars
49
'xyerrorbars' : 'ty11', # horizontal and vertical error bars
50
'boxes' : 'ty12', # boxes
51
'boxerrorbars' : 'ty13', # boxes and error bars
52
'boxxyerrorbars' : 'ty14', # boxes and xy error bars
53
'vector' : 'ty19', # vector
59
'with_client' : 'CLIE',
60
'with_creator' : 'CREA',
64
def gnuexec(self, _object=None, _attributes={}, **_arguments):
65
"""gnuexec: execute a gnuplot command
66
Required argument: a gnuplot command
67
Keyword argument with_client: client application
68
Keyword argument with_creator: creator code for any output
69
Keyword argument with_type: file type for any output
70
Keyword argument _attributes: AppleEvent attribute dictionary
71
Returns: what gnuplot said
76
aetools.keysubst(_arguments, self._argmap_exec)
77
_arguments['----'] = _object
79
aetools.enumsubst(_arguments, 'with_client', self._argmap_exec)
80
aetools.enumsubst(_arguments, 'with_creator', self._argmap_exec)
81
aetools.enumsubst(_arguments, 'with_type', self._argmap_exec)
83
_reply, _arguments, _attributes = self.send(_code, _subcode,
84
_arguments, _attributes)
85
if _arguments.has_key('errn'):
86
raise aetools.Error, aetools.decodeerror(_arguments)
87
# XXXX Optionally decode result
88
if _arguments.has_key('----'):
89
# XXXX Should do enum remapping here...
90
return _arguments['----']
92
def halt(self, _no_object=None, _attributes={}, **_arguments):
93
"""halt: halt any processing
94
Keyword argument _attributes: AppleEvent attribute dictionary
99
if _arguments: raise TypeError, 'No optional args expected'
100
if _no_object != None: raise TypeError, 'No direct arg expected'
103
_reply, _arguments, _attributes = self.send(_code, _subcode,
104
_arguments, _attributes)
105
if _arguments.has_key('errn'):
106
raise aetools.Error, aetools.decodeerror(_arguments)
107
# XXXX Optionally decode result
108
if _arguments.has_key('----'):
109
# XXXX Should do enum remapping here...
110
return _arguments['----']
112
def open_dialog(self, _object=None, _attributes={}, **_arguments):
113
"""open dialog: open a gnuplot dialog
114
Required argument: the dialog to open
115
Keyword argument _attributes: AppleEvent attribute dictionary
120
if _arguments: raise TypeError, 'No optional args expected'
121
_arguments['----'] = _object
124
_reply, _arguments, _attributes = self.send(_code, _subcode,
125
_arguments, _attributes)
126
if _arguments.has_key('errn'):
127
raise aetools.Error, aetools.decodeerror(_arguments)
128
# XXXX Optionally decode result
129
if _arguments.has_key('----'):
130
# XXXX Should do enum remapping here...
131
return _arguments['----']
137
def plot(self, _object=None, _attributes={}, **_arguments):
138
"""plot: do a 2d plot of files or data
139
Required argument: the data to plot
140
Keyword argument with: line style
141
Keyword argument _attributes: AppleEvent attribute dictionary
142
Returns: what gnuplot said
147
aetools.keysubst(_arguments, self._argmap_plot)
148
_arguments['----'] = _object
150
aetools.enumsubst(_arguments, 'line', _Enum_lyty)
152
_reply, _arguments, _attributes = self.send(_code, _subcode,
153
_arguments, _attributes)
154
if _arguments.has_key('errn'):
155
raise aetools.Error, aetools.decodeerror(_arguments)
156
# XXXX Optionally decode result
157
if _arguments.has_key('----'):
158
# XXXX Should do enum remapping here...
159
return _arguments['----']
165
def splot(self, _object=None, _attributes={}, **_arguments):
166
"""splot: do a 3d plot files or data
167
Required argument: the data to plot
168
Keyword argument with: line style
169
Keyword argument _attributes: AppleEvent attribute dictionary
170
Returns: what gnuplot said
175
aetools.keysubst(_arguments, self._argmap_splot)
176
_arguments['----'] = _object
178
aetools.enumsubst(_arguments, 'line', _Enum_lyty)
180
_reply, _arguments, _attributes = self.send(_code, _subcode,
181
_arguments, _attributes)
182
if _arguments.has_key('errn'):
183
raise aetools.Error, aetools.decodeerror(_arguments)
184
# XXXX Optionally decode result
185
if _arguments.has_key('----'):
186
# XXXX Should do enum remapping here...
187
return _arguments['----']
190
# Class 'graph' ('cGRF') -- 'graph - subclass of window'
191
# property 'picture' ('PICT') 'PICT' -- 'the graph picture' [enum]
192
# property 'graph number' ('NUMB') 'shor' -- 'the number of the graph' [enum]
193
# property 'title' ('TITL') 'TEXT' -- 'the title of the graph' [enum]
194
"""Suite odds and ends: Things that should be in some standard suite, but aren't
197
Generated from Power HD:Applications:Analysis/Plotting:gnuplot.2.0a34:gnuplot (PPC)
198
AETE/AEUT resource version 1/0, language 0, script 0
205
def select(self, _object=None, _attributes={}, **_arguments):
206
"""select: select the specified object
207
Required argument: the object to select
208
Keyword argument _attributes: AppleEvent attribute dictionary
213
if _arguments: raise TypeError, 'No optional args expected'
214
_arguments['----'] = _object
217
_reply, _arguments, _attributes = self.send(_code, _subcode,
218
_arguments, _attributes)
219
if _arguments.has_key('errn'):
220
raise aetools.Error, aetools.decodeerror(_arguments)
221
# XXXX Optionally decode result
222
if _arguments.has_key('----'):
223
# XXXX Should do enum remapping here...
224
return _arguments['----']
226
"""Suite Standard Suite: Common terms for most applications
229
Generated from Power HD:Applications:Analysis/Plotting:gnuplot.2.0a34:gnuplot (PPC)
230
AETE/AEUT resource version 1/0, language 0, script 0
235
class Standard_Suite:
241
def save(self, _object, _attributes={}, **_arguments):
242
"""save: save an object
243
Required argument: the object to save
244
Keyword argument _in: the file in which to save the object
245
Keyword argument _attributes: AppleEvent attribute dictionary
250
aetools.keysubst(_arguments, self._argmap_save)
251
_arguments['----'] = _object
253
aetools.enumsubst(_arguments, 'kfil', _Enum_fss )
255
_reply, _arguments, _attributes = self.send(_code, _subcode,
256
_arguments, _attributes)
257
if _arguments.has_key('errn'):
258
raise aetools.Error, aetools.decodeerror(_arguments)
259
# XXXX Optionally decode result
260
if _arguments.has_key('----'):
261
# XXXX Should do enum remapping here...
262
return _arguments['----']
264
def get(self, _object, _attributes={}, **_arguments):
265
"""get: get the data for an object
266
Required argument: the object whose data is to be returned
267
Keyword argument _attributes: AppleEvent attribute dictionary
268
Returns: the data from the object
273
if _arguments: raise TypeError, 'No optional args expected'
274
_arguments['----'] = _object
277
_reply, _arguments, _attributes = self.send(_code, _subcode,
278
_arguments, _attributes)
279
if _arguments.has_key('errn'):
280
raise aetools.Error, aetools.decodeerror(_arguments)
281
# XXXX Optionally decode result
282
if _arguments.has_key('----'):
283
# XXXX Should do enum remapping here...
284
return _arguments['----']
290
def set(self, _object, _attributes={}, **_arguments):
291
"""set: set an objects data
292
Required argument: the object whose data is to be changed
293
Keyword argument to: the new value
294
Keyword argument _attributes: AppleEvent attribute dictionary
299
aetools.keysubst(_arguments, self._argmap_set)
300
_arguments['----'] = _object
303
_reply, _arguments, _attributes = self.send(_code, _subcode,
304
_arguments, _attributes)
305
if _arguments.has_key('errn'):
306
raise aetools.Error, aetools.decodeerror(_arguments)
307
# XXXX Optionally decode result
308
if _arguments.has_key('----'):
309
# XXXX Should do enum remapping here...
310
return _arguments['----']
313
# Class 'application' ('capp') -- 'application properties'
314
# property 'clipboard' ('clip') '****' -- "gnuplot's clipboard" [mutable]
315
# property 'terminals' ('TLST') 'TEXT' -- 'list of the currently available terminals' [list]
316
# property 'graph creator' ('QDCR') 'fltp' -- 'creator code for QuickDraw graphs' [mutable]
317
# property 'file creator' ('CREA') 'fltp' -- 'creator code for text plots' [mutable]
318
# property 'file type' ('TYPE') 'fltp' -- 'file type for text plots' [mutable]
319
# property 'working folder' ('wfdr') 'alis' -- 'the path to the default folder for the command\320line plot and load commands' [mutable]
320
# property 'current terminal' ('TERM') 'TEXT' -- 'the name of the current terminal' []
321
# property 'text font' ('FONT') 'TEXT' -- 'the font for graphs' [mutable]
322
# property 'text size' ('SIZE') 'shor' -- 'the text size for graphs' [mutable]
323
# property 'graph size' ('GSIZ') 'QDpt' -- 'dimensions of the next graph' [mutable]
324
# element 'cwin' as ['indx', 'name']
326
# Class 'window' ('cwin') -- 'a window'
327
# property 'bounds' ('pbnd') 'qdrt' -- 'the boundary rectangle for the window' [enum]
328
# property 'closeable' ('hclb') 'bool' -- 'does the window have a close box?' [enum]
329
# property 'index' ('pidx') 'shor' -- 'the number of the window' [enum]
330
# property 'floating' ('isfl') 'bool' -- 'does the window float?' [enum]
331
# property 'modal' ('pmod') 'bool' -- 'is the window modal?' [enum]
332
# property 'resizable' ('prsz') 'bool' -- 'is the window resizable?' [enum]
333
# property 'zoomable' ('iszm') 'bool' -- 'is the window zoomable?' [enum]
334
# property 'zoomed' ('pzum') 'bool' -- 'is the window zoomed?' [mutable enum]
335
# property 'name' ('pnam') 'TEXT' -- 'the title of the window' [enum]
336
# property 'visible' ('pvis') 'bool' -- 'is the window visible?' [mutable enum]
337
# property 'position' ('ppos') 'QDpt' -- 'upper left coordinates of window' [mutable enum]
339
"""Suite Miscelaneous Events: Some other events
342
Generated from Power HD:Applications:Analysis/Plotting:gnuplot.2.0a34:gnuplot (PPC)
343
AETE/AEUT resource version 1/0, language 0, script 0
348
class Miscellaneous_Events:
351
'with_client' : 'CLIE',
352
'with_creator' : 'CREA',
353
'with_type' : 'TYPE',
356
def DoScript(self, _object=None, _attributes={}, **_arguments):
357
"""DoScript: execute a gnuplot script
358
Required argument: a gnuplot script to execute
359
Keyword argument with_client: client application
360
Keyword argument with_creator: creator code for any output
361
Keyword argument with_type: file type for any output
362
Keyword argument _attributes: AppleEvent attribute dictionary
363
Returns: what gnuplot said
368
aetools.keysubst(_arguments, self._argmap_DoScript)
369
_arguments['----'] = _object
371
aetools.enumsubst(_arguments, 'with_client', self._argmap_DoScript)
372
aetools.enumsubst(_arguments, 'with_creator', self._argmap_DoScript)
373
aetools.enumsubst(_arguments, 'with_type', self._argmap_DoScript)
375
_reply, _arguments, _attributes = self.send(_code, _subcode,
376
_arguments, _attributes)
377
if _arguments.has_key('errn'):
378
raise aetools.Error, aetools.decodeerror(_arguments)
379
# XXXX Optionally decode result
380
if _arguments.has_key('----'):
381
# XXXX Should do enum remapping here...
382
return _arguments['----']