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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI03-DataExtractor/branches/old_stuff/dx_source/for_usr_local/dx/doc/errorHandler.html@793
Revision 793, 10.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 errorHandler</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>errorHandler</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/errorHandler.py">/usr/local/dx-0.1.1/errorHandler.py</a></font></td></tr></table>
12    <p><tt>errorHandler.py<br>
13===============<br>
14&nbsp;<br>
15Module&nbsp;to&nbsp;hold&nbsp;a&nbsp;suitable&nbsp;classes&nbsp;for&nbsp;displaying&nbsp;errors&nbsp;and&nbsp;mailing<br>
16the&nbsp;administrator&nbsp;when&nbsp;these&nbsp;occur.</tt></p>
17<p>
18<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
19<tr bgcolor="#aa55cc">
20<td colspan=3 valign=bottom>&nbsp;<br>
21<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
22   
23<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
24<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="os.html">os</a><br>
25</td><td width="25%" valign=top><a href="smtplib.html">smtplib</a><br>
26</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
27</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
28<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
29<tr bgcolor="#ee77aa">
30<td colspan=3 valign=bottom>&nbsp;<br>
31<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
32   
33<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
34<td width="100%"><dl>
35<dt><font face="helvetica, arial"><a href="errorHandler.html#ErrorHandler">ErrorHandler</a>
36</font></dt><dd>
37<dl>
38<dt><font face="helvetica, arial"><a href="errorHandler.html#CGIErrorHandler">CGIErrorHandler</a>
39</font></dt></dl>
40</dd>
41<dt><font face="helvetica, arial"><a href="errorHandler.html#MailAdministrator">MailAdministrator</a>
42</font></dt></dl>
43 <p>
44<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
45<tr bgcolor="#ffc8d8">
46<td colspan=3 valign=bottom>&nbsp;<br>
47<font color="#000000" face="helvetica, arial"><a name="CGIErrorHandler">class <strong>CGIErrorHandler</strong></a>(<a href="errorHandler.html#ErrorHandler">ErrorHandler</a>)</font></td></tr>
48   
49<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
50<td colspan=2><tt>Class&nbsp;to&nbsp;handle&nbsp;errors&nbsp;when&nbsp;dx&nbsp;is&nbsp;called&nbsp;via&nbsp;a&nbsp;CGI&nbsp;interface.<br>&nbsp;</tt></td></tr>
51<tr><td>&nbsp;</td>
52<td width="100%">Methods inherited from <a href="errorHandler.html#ErrorHandler">ErrorHandler</a>:<br>
53<dl><dt><a name="CGIErrorHandler-__init__"><strong>__init__</strong></a>(self, msg, noheader<font color="#909090">=0</font>, request_id<font color="#909090">=None</font>, user<font color="#909090">=None</font>)</dt><dd><tt>Method&nbsp;to&nbsp;build&nbsp;the&nbsp;instance&nbsp;variables&nbsp;required&nbsp;in&nbsp;the&nbsp;class&nbsp;and<br>
54calls&nbsp;the&nbsp;appropriate&nbsp;internal&nbsp;methods.&nbsp;Used&nbsp;to&nbsp;handle&nbsp;errors&nbsp;by&nbsp;calling&nbsp;displayError&nbsp;and<br>
55<a href="#MailAdministrator">MailAdministrator</a>&nbsp;class.</tt></dd></dl>
56
57<dl><dt><a name="CGIErrorHandler-displayError"><strong>displayError</strong></a>(self, msg, noheader<font color="#909090">=0</font>)</dt><dd><tt>displayError&nbsp;method&nbsp;-&nbsp;used&nbsp;to&nbsp;display&nbsp;a&nbsp;clean&nbsp;error&nbsp;to&nbsp;the&nbsp;user&nbsp;via<br>
58the&nbsp;main&nbsp;dx&nbsp;web&nbsp;interface&nbsp;page.&nbsp;The&nbsp;noheader&nbsp;argument&nbsp;tells&nbsp;the&nbsp;function<br>
59whether&nbsp;or&nbsp;not&nbsp;to&nbsp;display&nbsp;the&nbsp;full&nbsp;header&nbsp;before&nbsp;the&nbsp;error&nbsp;message.</tt></dd></dl>
60
61</td></tr></table> <p>
62<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
63<tr bgcolor="#ffc8d8">
64<td colspan=3 valign=bottom>&nbsp;<br>
65<font color="#000000" face="helvetica, arial"><a name="ErrorHandler">class <strong>ErrorHandler</strong></a></font></td></tr>
66   
67<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
68<td colspan=2><tt><a href="#ErrorHandler">ErrorHandler</a>&nbsp;class&nbsp;-&nbsp;used&nbsp;to&nbsp;handle&nbsp;errors&nbsp;sensibly&nbsp;by&nbsp;reporting&nbsp;on-screen<br>
69to&nbsp;the&nbsp;user&nbsp;and&nbsp;sending&nbsp;a&nbsp;message&nbsp;to&nbsp;the&nbsp;administrator.<br>&nbsp;</tt></td></tr>
70<tr><td>&nbsp;</td>
71<td width="100%">Methods defined here:<br>
72<dl><dt><a name="ErrorHandler-__init__"><strong>__init__</strong></a>(self, msg, noheader<font color="#909090">=0</font>, request_id<font color="#909090">=None</font>, user<font color="#909090">=None</font>)</dt><dd><tt>Method&nbsp;to&nbsp;build&nbsp;the&nbsp;instance&nbsp;variables&nbsp;required&nbsp;in&nbsp;the&nbsp;class&nbsp;and<br>
73calls&nbsp;the&nbsp;appropriate&nbsp;internal&nbsp;methods.&nbsp;Used&nbsp;to&nbsp;handle&nbsp;errors&nbsp;by&nbsp;calling&nbsp;displayError&nbsp;and<br>
74<a href="#MailAdministrator">MailAdministrator</a>&nbsp;class.</tt></dd></dl>
75
76<dl><dt><a name="ErrorHandler-displayError"><strong>displayError</strong></a>(self, msg, noheader<font color="#909090">=0</font>)</dt><dd><tt>displayError&nbsp;method&nbsp;-&nbsp;used&nbsp;to&nbsp;display&nbsp;a&nbsp;clean&nbsp;error&nbsp;to&nbsp;the&nbsp;user&nbsp;via<br>
77the&nbsp;main&nbsp;dx&nbsp;web&nbsp;interface&nbsp;page.&nbsp;The&nbsp;noheader&nbsp;argument&nbsp;tells&nbsp;the&nbsp;function<br>
78whether&nbsp;or&nbsp;not&nbsp;to&nbsp;display&nbsp;the&nbsp;full&nbsp;header&nbsp;before&nbsp;the&nbsp;error&nbsp;message.</tt></dd></dl>
79
80</td></tr></table> <p>
81<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
82<tr bgcolor="#ffc8d8">
83<td colspan=3 valign=bottom>&nbsp;<br>
84<font color="#000000" face="helvetica, arial"><a name="MailAdministrator">class <strong>MailAdministrator</strong></a></font></td></tr>
85   
86<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
87<td colspan=2><tt><a href="#MailAdministrator">MailAdministrator</a>&nbsp;class&nbsp;-&nbsp;used&nbsp;to&nbsp;e-mail&nbsp;information&nbsp;to&nbsp;the&nbsp;administrator.<br>&nbsp;</tt></td></tr>
88<tr><td>&nbsp;</td>
89<td width="100%">Methods defined here:<br>
90<dl><dt><a name="MailAdministrator-__init__"><strong>__init__</strong></a>(self, subject, adminEmail<font color="#909090">='yourmail@yourhost'</font>)</dt><dd><tt>__init__&nbsp;method&nbsp;-&nbsp;takes&nbsp;a&nbsp;subject&nbsp;and&nbsp;administrator's&nbsp;e-mail&nbsp;address&nbsp;and<br>
91constructs&nbsp;instance&nbsp;variables&nbsp;to&nbsp;be&nbsp;used&nbsp;in&nbsp;the&nbsp;mailing.</tt></dd></dl>
92
93<dl><dt><a name="MailAdministrator-sendMail"><strong>sendMail</strong></a>(self, msg)</dt><dd><tt>sendMail&nbsp;method&nbsp;-&nbsp;actually&nbsp;send&nbsp;out&nbsp;the&nbsp;e-mail&nbsp;to&nbsp;the&nbsp;administrator<br>
94with&nbsp;the&nbsp;message&nbsp;given&nbsp;in&nbsp;the&nbsp;msg&nbsp;argument.</tt></dd></dl>
95
96</td></tr></table></td></tr></table><p>
97<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
98<tr bgcolor="#55aa55">
99<td colspan=3 valign=bottom>&nbsp;<br>
100<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
101   
102<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
103<td width="100%"><strong>ADMIN_MAIL_ADDRESS</strong> = 'yourmail@yourhost'<br>
104<strong>ADMIN_NOTIFICATION</strong> = 0<br>
105<strong>BASEDIR</strong> = '/usr/local/dx'<br>
106<strong>CDAT_BIN_PATH</strong> = '/usr/local/cdat/bin'<br>
107<strong>CF_METADATA_GLOBAL_ATTRIBUTES</strong> = {'comments': 'Created by test data extractor.'}<br>
108<strong>CF_METADATA_GLOBAL_ATTRIBUTE_KEYS</strong> = ['Conventions', 'title', 'source', 'institution', 'history', 'references', 'comment']<br>
109<strong>CGI_NAME</strong> = 'http://localhost/cgi-bin/dxui.py'<br>
110<strong>CONFIRMATION_PAGE</strong> = 1<br>
111<strong>DEBUG</strong> = 1<br>
112<strong>DOMAIN_PARAMS</strong> = ('start_time', 'end_time', 'time_interval', 'horiz_domain', 'resolution', 'vertical_units', 'vertical_domain', 'outputFormat')<br>
113<strong>EXTRAS_DIR</strong> = '/dx_extra'<br>
114<strong>HORIZ_KEYS</strong> = ['northernExtent', 'easternExtent', 'southernExtent', 'westernExtent']<br>
115<strong>HTML_DIR</strong> = '/usr/local/dx/html'<br>
116<strong>HTTP_HEADER</strong> = 'Content-Type: text/html<font color="#c040c0">\n\n</font>'<br>
117<strong>HTTP_OUTPUT_DIR</strong> = 'http://localhost/output'<br>
118<strong>HTTP_REQUEST_XML_DIR</strong> = 'http://localhost/request_xmls'<br>
119<strong>INPUT_DATASETS_FILE</strong> = '/usr/local/dx/datasets/inputDatasets.xml'<br>
120<strong>LEFT_LOGO</strong> = 'dx_logo.jpg'<br>
121<strong>LOCAL_CGI_NAME</strong> = '/srv/www/cgi-bin/cgiInterface.py'<br>
122<strong>LOCAL_MAIL_HOST</strong> = 'youroutbox.yourdomain'<br>
123<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>
124<strong>LOCAL_RULES</strong> = 0<br>
125<strong>LOGO_DIR</strong> = '/dx_extra/logos'<br>
126<strong>MAP_APPLET</strong> = '/dx_extra/LiveMap_30/extractorMap.html'<br>
127<strong>MAX_FILE_SIZE</strong> = 1<br>
128<strong>MAX_NUM_DATASETS</strong> = 2<br>
129<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>
130<strong>NAPPY_PATH</strong> = '/usr/local/nappy'<br>
131<strong>OUTPUT_DIR</strong> = '/srv/www/htdocs/output'<br>
132<strong>OUTPUT_DIR_PERMISSION</strong> = 493<br>
133<strong>OUTPUT_FILE_GROUP</strong> = 'users'<br>
134<strong>OUTPUT_FILE_PERMISSION</strong> = 420<br>
135<strong>OUTPUT_FILE_USER</strong> = 'wwwrun'<br>
136<strong>OUTPUT_FORMATS</strong> = ['NetCDF', 'NASA Ames']<br>
137<strong>PACKAGE_NAME</strong> = 'Data Extractor'<br>
138<strong>PROCESS_LIST_DIR</strong> = '/usr/local/dx/processes'<br>
139<strong>REGISTRATION_PAGE</strong> = 'http://yourhost/your_link.html'<br>
140<strong>REQUEST_DIR</strong> = '/usr/local/dx/requests'<br>
141<strong>REQUEST_SIZE_LIMIT</strong> = 100<br>
142<strong>REQUEST_XML_DIR</strong> = '/srv/www/htdocs/request_xmls'<br>
143<strong>RESTRICTED_DATA</strong> = 0<br>
144<strong>RIGHT_LOGO</strong> = 'dx_logo.jpg'<br>
145<strong>STAGES</strong> = ['DatasetGroupPage', 'DatasetPage', 'VariablesPage', 'DomainPage', 'ResultsPage']<br>
146<strong>TIME_KEYS</strong> = ['Year', 'Month', 'Day', 'Hour', 'Minute', 'Second']<br>
147<strong>TIMING_SCALE_FACTOR</strong> = 1.0000000000000001e-05<br>
148<strong>TOP_LEVEL</strong> = 'datasetGroup'<br>
149<strong>USER_HOMEDIR</strong> = '/var/lib/wwwrun'<br>
150<strong>VISUALISOR_NAME</strong> = '/cgi-bin/splatui-0.1.1.py'</td></tr></table>
151</body></html>
Note: See TracBrowser for help on using the repository browser.