source: TI03-DataExtractor/branches/old_stuff/dx_source/for_usr_local/dx/doc/optionHandler.html @ 793

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI03-DataExtractor/branches/old_stuff/dx_source/for_usr_local/dx/doc/optionHandler.html@793
Revision 793, 14.8 KB checked in by astephen, 13 years ago (diff)

Put all the old code in the old_stuff branch.

Line 
1
2<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3<html><head><title>Python: module optionHandler</title>
4</head><body bgcolor="#f0f0f8">
5
6<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
7<tr bgcolor="#7799ee">
8<td valign=bottom>&nbsp;<br>
9<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>optionHandler</strong></big></big></font></td
10><td align=right valign=bottom
11><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/dx-0.1.1/optionHandler.py">/usr/local/dx-0.1.1/optionHandler.py</a></font></td></tr></table>
12    <p><tt>optionHandler.py<br>
13================<br>
14&nbsp;<br>
15Holds&nbsp;the&nbsp;<a href="#OptionHandler">OptionHandler</a>&nbsp;class&nbsp;that&nbsp;is&nbsp;used&nbsp;to&nbsp;generate&nbsp;available<br>
16option&nbsp;lists&nbsp;to&nbsp;send&nbsp;to&nbsp;the&nbsp;user&nbsp;via&nbsp;whichever&nbsp;presentation&nbsp;layer<br>
17is&nbsp;being&nbsp;used.</tt></p>
18<p>
19<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
20<tr bgcolor="#aa55cc">
21<td colspan=3 valign=bottom>&nbsp;<br>
22<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
23   
24<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
25<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="cdms.html">cdms</a><br>
26<a href="cdtime.html">cdtime</a><br>
27</td><td width="25%" valign=top><a href="os.html">os</a><br>
28<a href="re.html">re</a><br>
29</td><td width="25%" valign=top><a href="shelve.html">shelve</a><br>
30<a href="sys.html">sys</a><br>
31</td><td width="25%" valign=top><a href="vcs.html">vcs</a><br>
32</td></tr></table></td></tr></table><p>
33<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
34<tr bgcolor="#ee77aa">
35<td colspan=3 valign=bottom>&nbsp;<br>
36<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
37   
38<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
39<td width="100%"><dl>
40<dt><font face="helvetica, arial"><a href="datasetdb.html#Datasetdb">datasetdb.Datasetdb</a>(<a href="dxdmlHandler.html#DXDMLHandler">dxdmlHandler.DXDMLHandler</a>)
41</font></dt><dd>
42<dl>
43<dt><font face="helvetica, arial"><a href="optionHandler.html#OptionHandler">OptionHandler</a>
44</font></dt></dl>
45</dd>
46</dl>
47 <p>
48<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
49<tr bgcolor="#ffc8d8">
50<td colspan=3 valign=bottom>&nbsp;<br>
51<font color="#000000" face="helvetica, arial"><a name="OptionHandler">class <strong>OptionHandler</strong></a>(<a href="datasetdb.html#Datasetdb">datasetdb.Datasetdb</a>)</font></td></tr>
52   
53<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
54<td colspan=2><tt>I&nbsp;think&nbsp;this&nbsp;should&nbsp;be&nbsp;a&nbsp;sub-class&nbsp;of&nbsp;<a href="datasetdb.html#Datasetdb">Datasetdb</a>&nbsp;so&nbsp;that&nbsp;you&nbsp;<br>
55wrap&nbsp;the&nbsp;functionality&nbsp;already&nbsp;in&nbsp;place&nbsp;but&nbsp;send&nbsp;it&nbsp;the&nbsp;userRoles&nbsp;and&nbsp;username<br>
56so&nbsp;that&nbsp;it&nbsp;can&nbsp;send&nbsp;back&nbsp;a&nbsp;list&nbsp;of&nbsp;everything&nbsp;available.<br>
57All&nbsp;lists&nbsp;are&nbsp;sorted&nbsp;alphanumerically&nbsp;here&nbsp;before&nbsp;being&nbsp;exported&nbsp;to<br>
58other&nbsp;parts&nbsp;of&nbsp;the&nbsp;dx&nbsp;package.<br>&nbsp;</tt></td></tr>
59<tr><td>&nbsp;</td>
60<td width="100%"><dl><dt>Method resolution order:</dt>
61<dd><a href="optionHandler.html#OptionHandler">OptionHandler</a></dd>
62<dd><a href="datasetdb.html#Datasetdb">datasetdb.Datasetdb</a></dd>
63<dd><a href="dxdmlHandler.html#DXDMLHandler">dxdmlHandler.DXDMLHandler</a></dd>
64</dl>
65<hr>
66Methods defined here:<br>
67<dl><dt><a name="OptionHandler-__init__"><strong>__init__</strong></a>(self, userRoles, username)</dt><dd><tt>Method&nbsp;to&nbsp;initialise&nbsp;class.&nbsp;Calls&nbsp;__init__&nbsp;method&nbsp;for&nbsp;parent&nbsp;class<br>
68and&nbsp;sets&nbsp;userRoles&nbsp;and&nbsp;username&nbsp;instance&nbsp;variable.</tt></dd></dl>
69
70<dl><dt><a name="OptionHandler-getDatasetGroupList"><strong>getDatasetGroupList</strong></a>(self)</dt><dd><tt>Method&nbsp;returning&nbsp;a&nbsp;sorted&nbsp;list&nbsp;of&nbsp;all&nbsp;the&nbsp;dataset&nbsp;groups&nbsp;available<br>
71to&nbsp;the&nbsp;particular&nbsp;user.</tt></dd></dl>
72
73<dl><dt><a name="OptionHandler-getDatasetList"><strong>getDatasetList</strong></a>(self, datasetGroup)</dt><dd><tt>Method&nbsp;to&nbsp;return&nbsp;the&nbsp;available&nbsp;datasets&nbsp;within&nbsp;a&nbsp;given&nbsp;dataset&nbsp;group&nbsp;as<br>
74a&nbsp;sorted&nbsp;list.</tt></dd></dl>
75
76<dl><dt><a name="OptionHandler-getVariableList"><strong>getVariableList</strong></a>(self, datasetGroup<font color="#909090">=None</font>, dataset<font color="#909090">=None</font>, datasetURI<font color="#909090">=None</font>)</dt><dd><tt>Method&nbsp;to&nbsp;return&nbsp;list&nbsp;of&nbsp;available&nbsp;variables&nbsp;for&nbsp;the&nbsp;given&nbsp;datasetGroup<br>
77and&nbsp;dataset/datasetURI.</tt></dd></dl>
78
79<hr>
80Methods inherited from <a href="datasetdb.html#Datasetdb">datasetdb.Datasetdb</a>:<br>
81<dl><dt><a name="OptionHandler-getCFGlobalAttributes"><strong>getCFGlobalAttributes</strong></a>(self, datafile)</dt><dd><tt>getCFGlobalAttributes&nbsp;method&nbsp;-&nbsp;gets&nbsp;any&nbsp;CF&nbsp;metadta&nbsp;global&nbsp;attributes&nbsp;that&nbsp;are&nbsp;available<br>
82from&nbsp;the&nbsp;source&nbsp;dataset/file.</tt></dd></dl>
83
84<dl><dt><a name="OptionHandler-getDomain"><strong>getDomain</strong></a>(self, datasetGroup<font color="#909090">=None</font>, dataset<font color="#909090">=None</font>, variable<font color="#909090">=None</font>, datasetURI<font color="#909090">=None</font>)</dt><dd><tt>getDomain&nbsp;method&nbsp;-&nbsp;returns&nbsp;the&nbsp;combined&nbsp;horizontal,&nbsp;vertical&nbsp;and&nbsp;temporal&nbsp;domains.</tt></dd></dl>
85
86<dl><dt><a name="OptionHandler-getHorizontalDomain"><strong>getHorizontalDomain</strong></a>(self, datasetGroup<font color="#909090">=None</font>, dataset<font color="#909090">=None</font>, variable<font color="#909090">=None</font>, datasetURI<font color="#909090">=None</font>)</dt></dl>
87
88<dl><dt><a name="OptionHandler-getTemporalDomain"><strong>getTemporalDomain</strong></a>(self, datasetGroup<font color="#909090">=None</font>, dataset<font color="#909090">=None</font>, variable<font color="#909090">=None</font>, datasetURI<font color="#909090">=None</font>)</dt><dd><tt>getTemporalDomain&nbsp;method&nbsp;-&nbsp;returns&nbsp;the&nbsp;temporal&nbsp;domain&nbsp;as&nbsp;a&nbsp;tuple&nbsp;of&nbsp;(start&nbsp;time,&nbsp;end&nbsp;time,&nbsp;<br>
89(interval&nbsp;value,&nbsp;interval&nbsp;units)).</tt></dd></dl>
90
91<dl><dt><a name="OptionHandler-getVariables"><strong>getVariables</strong></a>(self, datasetGroup<font color="#909090">=None</font>, dataset<font color="#909090">=None</font>, datasetURI<font color="#909090">=None</font>)</dt><dd><tt>getVariables&nbsp;method&nbsp;-&nbsp;returns&nbsp;a&nbsp;list&nbsp;of&nbsp;variables&nbsp;ior&nbsp;the&nbsp;given&nbsp;dataset<br>
92group/dataset&nbsp;combination&nbsp;or&nbsp;datasetURI.&nbsp;The&nbsp;variable&nbsp;name&nbsp;used&nbsp;is&nbsp;selected<br>
93hierarchically&nbsp;depending&nbsp;on&nbsp;the&nbsp;available&nbsp;attributes.</tt></dd></dl>
94
95<dl><dt><a name="OptionHandler-getVerticalSpatialDomain"><strong>getVerticalSpatialDomain</strong></a>(self, datasetGroup<font color="#909090">=None</font>, dataset<font color="#909090">=None</font>, variable<font color="#909090">=None</font>, datasetURI<font color="#909090">=None</font>)</dt><dd><tt>getVerticalSpatialDomain&nbsp;method&nbsp;-&nbsp;returns&nbsp;the&nbsp;vertical&nbsp;domain&nbsp;as&nbsp;a&nbsp;tuple&nbsp;containing<br>
96a&nbsp;list&nbsp;of&nbsp;levels&nbsp;(or&nbsp;"Single&nbsp;level"&nbsp;string)&nbsp;and&nbsp;the&nbsp;units.</tt></dd></dl>
97
98<hr>
99Methods inherited from <a href="dxdmlHandler.html#DXDMLHandler">dxdmlHandler.DXDMLHandler</a>:<br>
100<dl><dt><a name="OptionHandler-getDatasetGroupFromURI"><strong>getDatasetGroupFromURI</strong></a>(self, datasetURI)</dt><dd><tt>getDatasetGroupFromURI&nbsp;method&nbsp;-&nbsp;gets&nbsp;the&nbsp;id&nbsp;of&nbsp;the&nbsp;dataset&nbsp;group&nbsp;from&nbsp;a<br>
101datasetURI&nbsp;(if&nbsp;it&nbsp;is&nbsp;known&nbsp;to&nbsp;the&nbsp;dx).</tt></dd></dl>
102
103<dl><dt><a name="OptionHandler-getDatasetGroups"><strong>getDatasetGroups</strong></a>(self)</dt><dd><tt>Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;the&nbsp;Dataset&nbsp;Groups&nbsp;that&nbsp;the&nbsp;dx&nbsp;knows&nbsp;about.</tt></dd></dl>
104
105<dl><dt><a name="OptionHandler-getDatasetURI"><strong>getDatasetURI</strong></a>(self, datasetGroup, dataset)</dt><dd><tt>Returns&nbsp;a&nbsp;datasetURI&nbsp;from&nbsp;a&nbsp;known&nbsp;dataset&nbsp;group&nbsp;and&nbsp;dataset.</tt></dd></dl>
106
107<dl><dt><a name="OptionHandler-getDatasetURIList"><strong>getDatasetURIList</strong></a>(self)</dt><dd><tt>Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;all&nbsp;the&nbsp;datasetURIs&nbsp;visible&nbsp;to&nbsp;this&nbsp;version&nbsp;of&nbsp;dx.<br>
108NOTE:&nbsp;datasetURI&nbsp;maps&nbsp;to&nbsp;usageMetadataLink&nbsp;in&nbsp;the&nbsp;XML.</tt></dd></dl>
109
110<dl><dt><a name="OptionHandler-getDatasets"><strong>getDatasets</strong></a>(self, datasetGroup)</dt><dd><tt>Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;the&nbsp;Datasets&nbsp;available&nbsp;for&nbsp;the&nbsp;given&nbsp;Dataset&nbsp;Group.</tt></dd></dl>
111
112<dl><dt><a name="OptionHandler-getDatasetsAndDatasetURIs"><strong>getDatasetsAndDatasetURIs</strong></a>(self, datasetGroup)</dt><dd><tt>Returns&nbsp;a&nbsp;list&nbsp;of&nbsp;(dataset,&nbsp;datasetURI)&nbsp;tuples&nbsp;for&nbsp;each&nbsp;dataset&nbsp;availabe&nbsp;in&nbsp;the<br>
113fiven&nbsp;datasetGroup.</tt></dd></dl>
114
115<dl><dt><a name="OptionHandler-getFileNamePrefix"><strong>getFileNamePrefix</strong></a>(self, datasetGroup)</dt><dd><tt>Returns&nbsp;the&nbsp;filename&nbsp;prefix&nbsp;for&nbsp;the&nbsp;given&nbsp;Dataset&nbsp;Group.</tt></dd></dl>
116
117<dl><dt><a name="OptionHandler-getFileNameSection"><strong>getFileNameSection</strong></a>(self, datasetGroup, dataset)</dt><dd><tt>Return&nbsp;the&nbsp;filename&nbsp;section&nbsp;for&nbsp;the&nbsp;Dataset&nbsp;given&nbsp;(within&nbsp;the&nbsp;Dataset&nbsp;Group&nbsp;given).</tt></dd></dl>
118
119<dl><dt><a name="OptionHandler-getProtectID"><strong>getProtectID</strong></a>(self, datasetGroup<font color="#909090">=None</font>, dataset<font color="#909090">=None</font>, datasetURI<font color="#909090">=None</font>)</dt><dd><tt>getProtectID&nbsp;method&nbsp;-&nbsp;returns&nbsp;the&nbsp;(permittedRoles,&nbsp;permittedUsers)&nbsp;tuple&nbsp;for&nbsp;a&nbsp;given&nbsp;<br>
120dataset&nbsp;group,&nbsp;dataset&nbsp;or&nbsp;datasetURI&nbsp;(if&nbsp;known&nbsp;to&nbsp;the&nbsp;dx).&nbsp;This&nbsp;goes&nbsp;down&nbsp;to&nbsp;the&nbsp;level<br>
121provided&nbsp;by&nbsp;the&nbsp;caller.&nbsp;If&nbsp;just&nbsp;the&nbsp;dataset&nbsp;group&nbsp;is&nbsp;given&nbsp;then&nbsp;only&nbsp;the&nbsp;permissions<br>
122for&nbsp;that&nbsp;are&nbsp;returned.&nbsp;But&nbsp;if&nbsp;the&nbsp;dataset&nbsp;or&nbsp;datasetURI&nbsp;is&nbsp;given&nbsp;then&nbsp;the&nbsp;permissions<br>
123on&nbsp;that&nbsp;are&nbsp;returned.&nbsp;These&nbsp;should&nbsp;always&nbsp;be&nbsp;the&nbsp;same,&nbsp;but&nbsp;one&nbsp;day&nbsp;might&nbsp;not&nbsp;be.</tt></dd></dl>
124
125</td></tr></table></td></tr></table><p>
126<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
127<tr bgcolor="#55aa55">
128<td colspan=3 valign=bottom>&nbsp;<br>
129<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
130   
131<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
132<td width="100%"><strong>ADMIN_MAIL_ADDRESS</strong> = 'yourmail@yourhost'<br>
133<strong>ADMIN_NOTIFICATION</strong> = 0<br>
134<strong>BASEDIR</strong> = '/usr/local/dx'<br>
135<strong>CDAT_BIN_PATH</strong> = '/usr/local/cdat/bin'<br>
136<strong>CF_METADATA_GLOBAL_ATTRIBUTES</strong> = {'comments': 'Created by test data extractor.'}<br>
137<strong>CF_METADATA_GLOBAL_ATTRIBUTE_KEYS</strong> = ['Conventions', 'title', 'source', 'institution', 'history', 'references', 'comment']<br>
138<strong>CGI_NAME</strong> = 'http://localhost/cgi-bin/dxui.py'<br>
139<strong>CONFIRMATION_PAGE</strong> = 1<br>
140<strong>DEBUG</strong> = 1<br>
141<strong>DOMAIN_PARAMS</strong> = ('start_time', 'end_time', 'time_interval', 'horiz_domain', 'resolution', 'vertical_units', 'vertical_domain', 'outputFormat')<br>
142<strong>EXTRAS_DIR</strong> = '/dx_extra'<br>
143<strong>HORIZ_KEYS</strong> = ['northernExtent', 'easternExtent', 'southernExtent', 'westernExtent']<br>
144<strong>HTML_DIR</strong> = '/usr/local/dx/html'<br>
145<strong>HTTP_HEADER</strong> = 'Content-Type: text/html<font color="#c040c0">\n\n</font>'<br>
146<strong>HTTP_OUTPUT_DIR</strong> = 'http://localhost/output'<br>
147<strong>HTTP_REQUEST_XML_DIR</strong> = 'http://localhost/request_xmls'<br>
148<strong>INPUT_DATASETS_FILE</strong> = '/usr/local/dx/datasets/inputDatasets.xml'<br>
149<strong>LEFT_LOGO</strong> = 'dx_logo.jpg'<br>
150<strong>LOCAL_CGI_NAME</strong> = '/srv/www/cgi-bin/cgiInterface.py'<br>
151<strong>LOCAL_MAIL_HOST</strong> = 'youroutbox.yourdomain'<br>
152<strong>LOCAL_PYTHONPATH</strong> = ['YOUR_CDAT/lib/python2.4', 'YOUR_CDAT/lib/python2.4/site-packages', 'YOUR_CDAT/cdat/lib/python2.4/site-packages/Numeric', 'YOUR_CDAT/lib/python2.3', 'YOUR_CDAT/lib/python2.3/site-packages', 'YOUR_CDAT/cdat/lib/python2.3/site-packages/Numeric']<br>
153<strong>LOCAL_RULES</strong> = 0<br>
154<strong>LOGO_DIR</strong> = '/dx_extra/logos'<br>
155<strong>MAP_APPLET</strong> = '/dx_extra/LiveMap_30/extractorMap.html'<br>
156<strong>MAX_FILE_SIZE</strong> = 1<br>
157<strong>MAX_NUM_DATASETS</strong> = 2<br>
158<strong>MESSAGE_TO_USERS</strong> = 'This is a test version of the Data Extractor so ...error occurs so that we can improve this service.'<br>
159<strong>NAPPY_PATH</strong> = '/usr/local/nappy'<br>
160<strong>OUTPUT_DIR</strong> = '/srv/www/htdocs/output'<br>
161<strong>OUTPUT_DIR_PERMISSION</strong> = 493<br>
162<strong>OUTPUT_FILE_GROUP</strong> = 'users'<br>
163<strong>OUTPUT_FILE_PERMISSION</strong> = 420<br>
164<strong>OUTPUT_FILE_USER</strong> = 'wwwrun'<br>
165<strong>OUTPUT_FORMATS</strong> = ['NetCDF', 'NASA Ames']<br>
166<strong>PACKAGE_NAME</strong> = 'Data Extractor'<br>
167<strong>PROCESS_LIST_DIR</strong> = '/usr/local/dx/processes'<br>
168<strong>REGISTRATION_PAGE</strong> = 'http://yourhost/your_link.html'<br>
169<strong>REQUEST_DIR</strong> = '/usr/local/dx/requests'<br>
170<strong>REQUEST_SIZE_LIMIT</strong> = 100<br>
171<strong>REQUEST_XML_DIR</strong> = '/srv/www/htdocs/request_xmls'<br>
172<strong>RESTRICTED_DATA</strong> = 0<br>
173<strong>RIGHT_LOGO</strong> = 'dx_logo.jpg'<br>
174<strong>STAGES</strong> = ['DatasetGroupPage', 'DatasetPage', 'VariablesPage', 'DomainPage', 'ResultsPage']<br>
175<strong>TIME_KEYS</strong> = ['Year', 'Month', 'Day', 'Hour', 'Minute', 'Second']<br>
176<strong>TIMING_SCALE_FACTOR</strong> = 1.0000000000000001e-05<br>
177<strong>TOP_LEVEL</strong> = 'datasetGroup'<br>
178<strong>USER_HOMEDIR</strong> = '/var/lib/wwwrun'<br>
179<strong>VISUALISOR_NAME</strong> = '/cgi-bin/splatui-0.1.1.py'</td></tr></table>
180</body></html>
Note: See TracBrowser for help on using the repository browser.