CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
webApp.Server Class Reference

Public Member Functions

def index
 
def showLogs
 
def ShowTable
 

Detailed Description

Definition at line 8 of file webApp.py.

Member Function Documentation

def webApp.Server.index (   self,
  args 
)

Definition at line 72 of file webApp.py.

References web_results_display.GetLabels(), web_results_display.GetReleasesHeaders(), web_results_display.GetResultHeaders(), if(), and webApp.Server.ShowTable().

Referenced by BeautifulSoup.PageElement._invert().

72 
73  def index(self, **args):
74  print "Arguments :"
75  print args
76  selectRel = False
77  if 'reset' in args.keys():
78  cherrypy.session.clear()
79  it = 0
80  for row in web_results_display.GetLabels():
81  if not 'label' in cherrypy.session.keys():
82  cherrypy.session['label'] = row[0]
83  break
84  if 'submit' in args.keys():
85  cherrypy.session['submit'] = args['submit']
86  cherrypy.session['label'] = args['label']
87  if 'release' in args.keys() and args['release'] != '':
88  cherrypy.session['release'] = args['release']
89  if 'release' in cherrypy.session.keys() and args['release'] != cherrypy.session['release']:
90  cherrypy.session['release'] = args['release']
91  if 'arch' in args.keys() and args['arch'] != '':
92  cherrypy.session['arch'] = args['arch']
93  if 'arch' in cherrypy.session.keys() and args['arch'] != cherrypy.session['arch']:
94  cherrypy.session['arch'] = args['arch']
95  if 'count' in args.keys() and args['count'].isdigit():
96  cherrypy.session['count'] = args['count']
97  print "Session :"
98  print cherrypy.session
99  if 'arch' in cherrypy.session.keys() and cherrypy.session['arch'] != '' or 'release' in cherrypy.session.keys() and cherrypy.session['release'] != '':
100  selectRel = True
101  if 'count' in cherrypy.session.keys() and cherrypy.session['count'].isdigit():
102  stCount = int(cherrypy.session['count'])
103  else:
104  stCount = 2;
105 
106  htmlCode = """
107  <html>
108  <META HTTP-EQUIV="REFRESH" CONTENT="60">
109  <head>
110  <style type="text/css">
111  button,
112  input,
113  select,
114  textarea {
115  font-size: 100%;
116  margin: 0;
117  vertical-align: baseline;
118  *vertical-align: middle;
119  }
120  button, input {
121  line-height: normal;
122  *overflow: visible;
123  }
124  button::-moz-focus-inner, input::-moz-focus-inner {
125  border: 0;
126  padding: 0;
127  }
128  select {
129  }
130  button,
131  input[type="submit"] {
132  cursor: pointer;
133  -webkit-appearance: button;
134  }
135  input[type="search"] {
136  -webkit-appearance: textfield;
137  -webkit-box-sizing: content-box;
138  -moz-box-sizing: content-box;
139  box-sizing: content-box;
140  }
141  a {
142  color: #bfbfbf;
143  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
144  text-decoration:none;
145  }
146  a:hover, .active a {
147  color: #ffffff;
148  text-decoration: none;
149  }
150  .links {
151  background-color: #222;
152  background-color: #222222;
153  background-repeat: repeat-x;
154  background-image: -khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222));
155  background-image: -moz-linear-gradient(top, #333333, #222222);
156  background-image: -ms-linear-gradient(top, #333333, #222222);
157  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222));
158  background-image: -webkit-linear-gradient(top, #333333, #222222);
159  background-image: -o-linear-gradient(top, #333333, #222222);
160  background-image: linear-gradient(top, #333333, #222222);
161  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);
162  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
163  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
164  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
165  }
166  #status, #header
167  {
168  font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
169  width:100%;
170  border-collapse:collapse;
171  }
172  #header td
173  {
174  font-size:1em;
175  border:1px solid #67645B;
176  padding:3px 7px 2px 7px;
177  text-align:left;
178  }
179  #status td
180  {
181  font-size:1em;
182  border:1px solid #67645B;
183  padding:3px 7px 2px 7px;
184  }
185  #status th
186  {
187  border:1px solid #67645B;
188  font-size:1.1em;
189  text-align:center;
190  padding-top:5px;
191  padding-bottom:4px;
192  background-color:#ECAE12;
193  color:#ffffff;
194  }
195  #controls
196  {
197  font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
198  width:100%;
199  border-collapse:collapse;
200  }
201  #controls td
202  {
203  font-size:1.1em;
204  border:none;
205  padding-top:5px;
206  padding-bottom:4px;
207  text-align:left;
208  background-color:#393333;
209  color:#ffffff;
210 
211  }
212  .topbar {
213  height: 40px;
214  position: fixed;
215  top: 0;
216  left: 0;
217  right: 0;
218  z-index: 10000;
219  overflow: visible;
220  color: #ffffff;
221  width: 100%;
222  }
223  .topbar form {
224  float: left;
225  margin: 5px 0 0 0;
226  position: relative;
227  filter: alpha(opacity=100);
228  -khtml-opacity: 1;
229  -moz-opacity: 1;
230  opacity: 1;
231  }
232  .topbar input {
233  background-color: #444;
234  background-color: rgba(255, 255, 255, 0.3);
235  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
236  font-size: 80%;
237  font-weight: 13px;
238  line-height: 1;
239  padding: 4px 9px;
240  color: #fff;
241  color: rgba(255, 255, 255, 0.75);
242  border: 1px solid #111;
243  -webkit-border-radius: 4px;
244  -moz-border-radius: 4px;
245  border-radius: 4px;
246  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.25);
247  -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.25);
248  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0px rgba(255, 255, 255, 0.25);
249  -webkit-transition: none;
250  -moz-transition: none;
251  transition: none;
252  }
253  .topbar input:-moz-placeholder {
254  color: #e6e6e6;
255  }
256  .topbar input::-webkit-input-placeholder {
257  color: #e6e6e6;
258  }
259  .topbar input:hover {
260  background-color: #bfbfbf;
261  background-color: rgba(255, 255, 255, 0.5);
262  color: #fff;
263  }
264  .topbar input:focus, .topbar input.focused {
265  outline: none;
266  background-color: #fff;
267  color: #404040;
268  text-shadow: 0 1px 0 #fff;
269  border: 0;
270  padding: 5px 10px;
271  -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
272  -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
273  box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
274  }
275  .topbar-inner, .topbar .fill {
276  background-color: #222;
277  background-color: #222222;
278  background-repeat: repeat-x;
279  background-image: -khtml-gradient(linear, left top, left bottom, from(#333333), to(#222222));
280  background-image: -moz-linear-gradient(top, #333333, #222222);
281  background-image: -ms-linear-gradient(top, #333333, #222222);
282  background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #333333), color-stop(100%, #222222));
283  background-image: -webkit-linear-gradient(top, #333333, #222222);
284  background-image: -o-linear-gradient(top, #333333, #222222);
285  background-image: linear-gradient(top, #333333, #222222);
286  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);
287  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
288  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
289  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
290  }
291  .buts {
292  float: right;
293  }
294  </style>
295  </head>
296  <body>
297  <form method="post" action="index" >
298  <div class="topbar">
299  <div class="fill">
300  <div class="container">
301  <select name = "label">"""
303  for row in curs:
304  if str(row[0]) == cherrypy.session['label']:
305  htmlCode += """<option value = """+str(row[0])+""" selected = "selected">"""+str(row[0])+"""</option>
306  """
307  else:
308  htmlCode += """<option value = """+str(row[0])+""">"""+str(row[0])+"""</option>
309  """
310  htmlCode+="""</select>
311  """
312  if 'release' in cherrypy.session.keys():
313  htmlCode += """Candidate Release:<input type="text" name="release" size="30" maxlength="50" value=\""""+str(cherrypy.session['release'])+""""\"/>
314  """
315  else:
316  htmlCode += """Candidate Release:<input type="text" name="release" size="30" maxlength="50"/>
317  """
318  if 'arch' in cherrypy.session.keys():
319  htmlCode += """Candidate Architecture:<input type="text" name="arch" size="15" maxlength="30" value=\""""+cherrypy.session['arch']+""""\"/>
320  """
321  else:
322  htmlCode += """Candidate Architecture:<input type="text" name="arch" size="15" maxlength="30" />
323  """
324  if 'count' in cherrypy.session.keys():
325  htmlCode += """Number of results:<input type="text" name="count" size="1" maxlength="4" value=\""""+cherrypy.session['count']+""""\"/>
326  """
327  else:
328  htmlCode += """Number of results:<input type="text" name="count" size="4" maxlength="4" />
329  """
330  htmlCode +="""<div class = "buts"><input type="submit" name="submit" value="Refresh"/>
331  <input type="submit" name="reset" value="Reset"/>
332  </div></div></div></div>
333  <br>
334  </form>
335  """
336  if(selectRel == True):
337  if 'arch' in cherrypy.session.keys() and 'release' in cherrypy.session.keys():
338  DBdata = web_results_display.GetReleasesHeaders(cherrypy.session['label'], cherrypy.session['release'], cherrypy.session['arch'])
339  elif 'release' in cherrypy.session.keys():
340  DBdata = web_results_display.GetReleasesHeaders(cherrypy.session['label'], cherrypy.session['release'])
341  elif 'arch' in cherrypy.session.keys():
342  DBdata = web_results_display.GetReleasesHeaders(cherrypy.session['label'], "", cherrypy.session['arch'])
343  counter =0
344  for data in DBdata:
345  counter += 1
346  if stCount != 0:
347  htmlCode += self.ShowTable( data, cherrypy.session['label'])
348  stCount = stCount -1
349  if (counter == 0):
350  htmlCode += """<h3> No entries found </h3>"""
351  else:
352  DBdata = web_results_display.GetResultHeaders(cherrypy.session['label'])
353  for data in DBdata:
354  if stCount != 0:
355  htmlCode += self.ShowTable(data, cherrypy.session['label'])
356  stCount = stCount -1
357  return htmlCode
def index
Definition: webApp.py:72
def ShowTable
Definition: webApp.py:10
if(conf.exists("allCellsPositionCalc"))
def webApp.Server.showLogs (   self,
  args 
)

Definition at line 359 of file webApp.py.

References web_results_display.GetReadLogStatus().

360  def showLogs(self, **args):
361  runID = int(args['runID'])
362  label = args['label']
363 
364  logInfo = "<html><head></head><body><pre>\n"
365  logInfo += web_results_display.GetReadLogStatus(label, runID)
366  logInfo += '\n</pre></body></html>'
367  return logInfo
def showLogs
Definition: webApp.py:359
def webApp.Server.ShowTable (   self,
  curs,
  label 
)

Definition at line 10 of file webApp.py.

References web_results_display.GetResultsList(), web_results_display.GetRunResults(), and if().

Referenced by webApp.Server.index().

10 
11  def ShowTable(self, curs, label):
12  res1 = web_results_display.GetRunResults(curs[0])
13  # only
14  for rows in res1:
15  res2, stCount = web_results_display.GetResultsList(rows[0])
16  break
17  #print stCount
18  Code ="""
19  <table id="header" bgcolor="#D8D8D8">
20  <tr>
21  <td colspan = "2">Test Sequence:
22  <b>"""+str(curs[2])+"""</b>&nbsp&nbsp&nbsp&nbsp
23  RunID:
24  """+str(curs[0])+"""&nbsp&nbsp&nbsp&nbsp
25  Time:
26  """+str(curs[1])+"""
27  </td>
28  <tr>
29  <td>
30  Candidate:
31  <b>"""+str(curs[3])+"""</b>&nbsp&nbsp&nbsp&nbsp
32  Architecture:
33  <b>"""+str(curs[4])+"""</b>
34  </td>
35  <td class="links"><a href="showLogs?runID="""+str(curs[0])+"""&label="""+label+"""">&gt&gt Logfile</a></td>
36  </tr>
37  </table>
38  <table id="status">
39  """
40  Code +="""
41  <tr>
42  <!--<th rowspan="2" colspan = "2">Reference releases</th>-->
43  <th>Reference release</th>
44  <th>Reference architecture</th>
45 
46  """
47  for i in range (0, stCount):
48  Code += """<th>"""+str(res2[i][2])+"""</th>
49  """
50  Code +="""</tr>"""
51  for rows in res1:
52  res2, stCount = web_results_display.GetResultsList(rows[0])
53  Code += """<tr>
54  <td align="left" >"""+str(rows[1])+"""</td>
55  <td>"""+str(rows[2])+"""</td>
56  """
57  for i in range (0, stCount):
58  if(res2[i][1] == 0):
59  Code +="""<td align="center" bgcolor ="#A7C942"><b>OK</b></td>
60  """
61  else:
62  Code +="""<td align="center" bgcolor ="#FF0000"><b>Failure</b></td>
63  """
64  Code += """</tr></tr>
65  """
66  Code += """</table><hr>
67  """
68  Code += """
69  </body>
70  </html>
71  """
return Code
def ShowTable
Definition: webApp.py:10
if(conf.exists("allCellsPositionCalc"))