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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI03-DataExtractor/branches/old_stuff/dx_source/for_usr_local/dx/doc/processList.html@793
Revision 793, 5.5 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 processList</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>processList</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/processList.py">/usr/local/dx-0.1.1/processList.py</a></font></td></tr></table>
12    <p><tt>processList.py<br>
13==============<br>
14&nbsp;<br>
15Module&nbsp;holding&nbsp;the&nbsp;<a href="#ProcessList">ProcessList</a>&nbsp;class&nbsp;which&nbsp;maps&nbsp;jobs&nbsp;run&nbsp;by&nbsp;users<br>
16to&nbsp;a&nbsp;simple&nbsp;database&nbsp;of&nbsp;process&nbsp;IDs.&nbsp;You&nbsp;can&nbsp;access&nbsp;methods&nbsp;to&nbsp;<br>
17check&nbsp;if&nbsp;the&nbsp;user&nbsp;has&nbsp;a&nbsp;process&nbsp;running&nbsp;and&nbsp;update&nbsp;the&nbsp;list.</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="commands.html">commands</a><br>
26<a href="os.html">os</a><br>
27</td><td width="25%" valign=top><a href="shelve.html">shelve</a><br>
28<a href="sys.html">sys</a><br>
29</td><td width="25%" valign=top><a href="time.html">time</a><br>
30</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
31<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
32<tr bgcolor="#ee77aa">
33<td colspan=3 valign=bottom>&nbsp;<br>
34<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
35   
36<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
37<td width="100%"><dl>
38<dt><font face="helvetica, arial"><a href="processList.html#ProcessList">ProcessList</a>
39</font></dt></dl>
40 <p>
41<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
42<tr bgcolor="#ffc8d8">
43<td colspan=3 valign=bottom>&nbsp;<br>
44<font color="#000000" face="helvetica, arial"><a name="ProcessList">class <strong>ProcessList</strong></a></font></td></tr>
45   
46<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
47<td colspan=2><tt><a href="#ProcessList">ProcessList</a>&nbsp;class&nbsp;-&nbsp;used&nbsp;to&nbsp;manage&nbsp;a&nbsp;list&nbsp;of&nbsp;username:process_id&nbsp;<br>
48pairs&nbsp;to&nbsp;check&nbsp;if&nbsp;a&nbsp;user&nbsp;is&nbsp;running&nbsp;any&nbsp;jobs.&nbsp;The&nbsp;list&nbsp;is&nbsp;stored&nbsp;<br>
49in&nbsp;a&nbsp;simple&nbsp;python&nbsp;shelve&nbsp;database&nbsp;as&nbsp;a&nbsp;dictionary&nbsp;of&nbsp;username&nbsp;keys<br>
50and&nbsp;process&nbsp;ID&nbsp;values.<br>&nbsp;</tt></td></tr>
51<tr><td>&nbsp;</td>
52<td width="100%">Methods defined here:<br>
53<dl><dt><a name="ProcessList-__init__"><strong>__init__</strong></a>(self, process<font color="#909090">='/srv/www/cgi-bin'</font>)</dt><dd><tt>__init__&nbsp;method&nbsp;-&nbsp;reads&nbsp;in&nbsp;the&nbsp;current&nbsp;list&nbsp;or&nbsp;creates&nbsp;one&nbsp;(and<br>
54the&nbsp;required&nbsp;directory)&nbsp;if&nbsp;needed.</tt></dd></dl>
55
56<dl><dt><a name="ProcessList-addProcessToList"><strong>addProcessToList</strong></a>(self, username, processID)</dt><dd><tt>addProcessToList&nbsp;method&nbsp;-&nbsp;adds&nbsp;a&nbsp;username&nbsp;key&nbsp;to&nbsp;the&nbsp;process&nbsp;list&nbsp;shelve&nbsp;db&nbsp;holding<br>
57holding&nbsp;a&nbsp;list&nbsp;containing&nbsp;the&nbsp;process&nbsp;ID&nbsp;and&nbsp;process&nbsp;start&nbsp;time.</tt></dd></dl>
58
59<dl><dt><a name="ProcessList-getProcessList"><strong>getProcessList</strong></a>(self)</dt><dd><tt>getProcessList&nbsp;method&nbsp;-&nbsp;gets&nbsp;the&nbsp;list&nbsp;that&nbsp;we&nbsp;currently&nbsp;know&nbsp;about.</tt></dd></dl>
60
61<dl><dt><a name="ProcessList-isUserRunningProcess"><strong>isUserRunningProcess</strong></a>(self, username)</dt><dd><tt>isUserRunningProcess&nbsp;method&nbsp;-&nbsp;checks&nbsp;if&nbsp;the&nbsp;user&nbsp;is&nbsp;currently&nbsp;running&nbsp;a&nbsp;process.</tt></dd></dl>
62
63</td></tr></table></td></tr></table><p>
64<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
65<tr bgcolor="#eeaa77">
66<td colspan=3 valign=bottom>&nbsp;<br>
67<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
68   
69<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
70<td width="100%"><dl><dt><a name="-convertETimeToSeconds"><strong>convertETimeToSeconds</strong></a>(etime)</dt><dd><tt>Takes&nbsp;a&nbsp;time&nbsp;string&nbsp;one&nbsp;of&nbsp;the&nbsp;formats&nbsp;"HH:MM:SS",&nbsp;"MM:SS",&nbsp;or&nbsp;"SS"&nbsp;and&nbsp;<br>
71converts&nbsp;to&nbsp;number&nbsp;of&nbsp;seconds.</tt></dd></dl>
72</td></tr></table><p>
73<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
74<tr bgcolor="#55aa55">
75<td colspan=3 valign=bottom>&nbsp;<br>
76<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
77   
78<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
79<td width="100%"><strong>LOCAL_CGI_NAME</strong> = '/srv/www/cgi-bin/cgiInterface.py'<br>
80<strong>PROCESS_LIST_DIR</strong> = '/usr/local/dx/processes'</td></tr></table>
81</body></html>
Note: See TracBrowser for help on using the repository browser.