reset.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 """
4 usage: %(progname)s [args]
5 """
6 
7 import nstart
8 import config
9 
10 import os, sys, string, time, getopt, re
11 import subprocess
12 from pyclearsilver.log import *
13 
14 import neo_cgi, neo_util, neo_cs
15 
16 from pyclearsilver import CSPage
17 from pyclearsilver import odb
18 
19 import MBPage
20 import db_webui
21 
22 import webutil
23 
24 
26  def setup(self, hdf):
27  pass
28 
29  def display(self, hdf):
30  webutil.grabTopics(hdf, [])
31 
32  def Action_DoReset(self, hdf):
33  # do rosreset here -- rosreset init script, webui init script
34  warn("calling robot reset")
35  proc = subprocess.Popen(["sudo", "robot", "reset", "--force", "-u", self.username], stdout=subprocess.PIPE)
36  out, err = proc.communicate()
37  if out:
38  warn("out: " + out)
39  if err:
40  warn("err: " + err)
41 
42  time.sleep(5)
43  warn("starting webui")
44 
45  self.redirectUri(config.gBaseURL + "webui/reset.py")
46 
47  def Action_AjaxReset(self, hdf):
48  # do rosreset here -- rosreset init script, webui init script
49  warn("calling ajax robot reset")
50  proc = subprocess.Popen(["sudo", "robot", "reset", "--force", "-u", self.username], stdout=subprocess.PIPE)
51  out, err = proc.communicate()
52  if out:
53  warn("out: " + out)
54  if err:
55  warn("err: " + err)
56 
57  time.sleep(10)
58  warn("starting webui")
59 
60  hdf.setValue("CGI.result", "OK")
61 
62  hdf.setValue("Content", "ajax_result.cs")
63 
64 
65 def run(context):
66  return MyPage(context, pagename="reset", nologin=False)
67 
68 def main():
69  context = CSPage.Context()
70  run(context).start()
71 
72 if __name__ == "__main__":
73  main()
74 
def redirectUri(self, redirectTo)
def Action_AjaxReset(self, hdf)
Definition: reset.py:47
def Action_DoReset(self, hdf)
Definition: reset.py:32


webui
Author(s): Scott Hassan
autogenerated on Mon Jun 10 2019 15:51:24