summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRefik Hadzialic2011-11-02 14:23:04 +0100
committerRefik Hadzialic2011-11-02 14:23:04 +0100
commit82fdb42c1ac984128d9a20cf79ee981958188100 (patch)
tree637504fab3bec86d1e9fdfc747efd5bbf9138ecb
parentReport writing, small change! (diff)
downloadgsm-selftest-82fdb42c1ac984128d9a20cf79ee981958188100.tar.gz
gsm-selftest-82fdb42c1ac984128d9a20cf79ee981958188100.tar.xz
gsm-selftest-82fdb42c1ac984128d9a20cf79ee981958188100.zip
Added in the startSoftware to reboot itself after it finishes starting the test software!
-rw-r--r--notFinishedCode/startSoftware.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/notFinishedCode/startSoftware.py b/notFinishedCode/startSoftware.py
new file mode 100644
index 0000000..3d48047
--- /dev/null
+++ b/notFinishedCode/startSoftware.py
@@ -0,0 +1,22 @@
+import ServerClass
+import subprocess
+import sys
+import os
+def restart_program():
+ """Restarts the current program.
+ Note: this function does not return. Any cleanup action (like
+ saving data) must be done before calling this function."""
+ python = sys.executable
+ os.execl(python, python, * sys.argv)
+
+while 1:
+ server = ServerClass.ServerHandler(34600)
+ tried = server.openSocket()
+
+ test = server.receiveData(2)
+ if test == 'START APP':
+ print 'start'
+ subprocess.Popen(args=['gnome-terminal','--command= python /home/gsmselftest/gsm-selftest/For\ Weekly\ Test/tricode/gsmselftest-website2.py'])
+ print server.closeConnection()
+ del server
+ restart_program()