summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-03-28 15:37:57 -0300
committerTomás Touceda <chiiph@leap.se>2013-03-28 15:37:57 -0300
commit1a39a8fa75494a05606312342d1cfa8d94035efa (patch)
tree30286599867e62baa0ab39a09b4847e5a9822636
parent14f3454afd92e1ae37950eb9d8bbb1bf750a1ed9 (diff)
Add python launcher that launches recurring updates
-rw-r--r--src/launcher.py30
-rw-r--r--src/main.cpp2
2 files changed, 31 insertions, 1 deletions
diff --git a/src/launcher.py b/src/launcher.py
new file mode 100644
index 0000000..61e2a7f
--- /dev/null
+++ b/src/launcher.py
@@ -0,0 +1,30 @@
+import time
+import threading
+
+from leap.app import main as leap_client
+from thandy.ClientCLI import update as thandy_update
+
+
+class Thandy(threading.Thread):
+ def run(self):
+ while True:
+ try:
+ args = [
+ "--repo=/home/chiiph/Code/leap/repo/",
+ "--debug",
+ "--install",
+ "/bundleinfo/LEAPClient/"
+ ]
+ thandy_update(args)
+ except Exception as e:
+ print "ERROR1:", e
+ finally:
+ time.sleep(60)
+
+
+if __name__ == "__main__":
+ thandy_thread = Thandy()
+ thandy_thread.daemon = True
+ thandy_thread.start()
+
+ leap_client()
diff --git a/src/main.cpp b/src/main.cpp
index 9db7a2d..d59a886 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -37,7 +37,7 @@ main(int argc, char** argv)
"import encodings.idna\n" // we need to make sure this is imported
"sys.argv.append('--standalone')\n", global, global);
- py::exec_file("apps/leap/app.py",
+ py::exec_file("apps/launcher.py",
global,
global);
} catch (py::error_already_set&) {