awips2/cave/com.raytheon.viz.gfe/help/SmartScriptClassPythonObjectMethods.html
2022-05-05 12:34:50 -05:00

54 lines
No EOL
1.5 KiB
HTML

<html>
<title>Smart Script Class - Python Object Methods</title>
<body>
<h1><a name="PyObject"></a>Python Object Methods</h1>
<br>
<a href="#saveObject">saveObject</a>
<br>
<a href="#getObject">getObject</a>
<br>
<a href="#deleteObject">deleteObject</a>
<!-- Leave this comment for formatting purposes -->
<hr width="100%">
These methods allow you to save, get, and delete Python objects to and
from the server.
<h2><a name="saveObject"></a>saveObject</h2>
def saveObject(self, name, object, category):
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Save a Python object (e.g. a Numeric
grid)
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # in the server under the given name
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Example:
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # self.saveObject("MyGrid", numericGrid,
"DiscrepancyValueGrids")
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #
<h2><a name="getObject"></a>getObject</h2>
def getObject(self, name, category):
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Returns the given object stored in
the server
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Example:
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # discrepancyValueGrid =
self.getObject("MyGrid","DiscrepancyValueGrids")
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #
<h2><a name="deleteObject"></a>deleteObject</h2>
def deleteObject(self, name, category):
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Delete the given object stored in
the server
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Example:
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # self.deleteObject("MyGrid",
"DiscrepancyValueGrids")
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #
<br>