Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/interactive.py
diff options
context:
space:
mode:
authorSebastian Silva (icarito) <sebastian@sugarlabs.org>2012-10-09 07:26:25 (GMT)
committer Sebastian Silva (icarito) <sebastian@sugarlabs.org>2012-10-09 07:26:25 (GMT)
commit8cbaa8059b39256f7b6be01beb64580176b0db95 (patch)
treea310d41e120440e5a4916e95d34641b44912d7d2 /interactive.py
parentd454e5f59d17982cb146053df1395948ef9b1d0e (diff)
Make possible to run from command line again. Ninja IDE project file.
Diffstat (limited to 'interactive.py')
-rw-r--r--interactive.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/interactive.py b/interactive.py
new file mode 100644
index 0000000..264a592
--- /dev/null
+++ b/interactive.py
@@ -0,0 +1,32 @@
+from os.path import join, abspath, exists
+from sugar_network import toolkit, local, node
+from sugar_network.toolkit import sugar, sneakernet
+from sugar_network.local.mounts import HomeMount, RemoteMount
+from sugar_network.local.mountset import Mountset
+from sugar_network.resources.volume import Volume
+from active_toolkit import util, printf, application, coroutine, enforce
+import gevent
+
+def _mountset():
+ toolkit.ensure_dsa_pubkey(sugar.profile_path('owner.key'))
+
+ _db_path = join(local.local_root.value, 'local')
+ volume = Volume(_db_path, lazy_open=local.lazy_open.value)
+ mountset = Mountset(volume)
+ mountset['~'] = HomeMount(volume)
+ mountset['/'] = RemoteMount(volume)
+
+ return mountset
+
+mountset = _mountset()
+
+import sugar_network_webui as webui
+
+from gevent.wsgi import WSGIServer
+
+host = '0.0.0.0' # '0.0.0.0' for all
+http_server = WSGIServer((host, 5000), webui.get_app(mountset))
+
+import webbrowser
+webbrowser.open_new_tab('localhost:5000')
+http_server.serve_forever()