aboutsummaryrefslogtreecommitdiffstats
path: root/packages/torouter-web/src/tui/controllers
diff options
context:
space:
mode:
authorJacob Appelbaum <jacob@appelbaum.net>2011-08-19 15:09:45 +0200
committerJacob Appelbaum <jacob@appelbaum.net>2011-08-19 15:09:45 +0200
commit254d2d3f6d1dfc01481ae4158302aae306bef793 (patch)
tree909f1798e9218eec51fe2689b61c5e397a16b588 /packages/torouter-web/src/tui/controllers
parentd891a6dc8241809863eb53794d9028f75ac5362b (diff)
parent21472ffb02bb44782d232ce5efe79042c8cb27c6 (diff)
downloadtorouter-254d2d3f6d1dfc01481ae4158302aae306bef793.tar.gz
torouter-254d2d3f6d1dfc01481ae4158302aae306bef793.zip
Merge branch 'master' of ssh://git-rw.torproject.org/torouter
Diffstat (limited to 'packages/torouter-web/src/tui/controllers')
-rw-r--r--packages/torouter-web/src/tui/controllers/main.py5
-rw-r--r--packages/torouter-web/src/tui/controllers/network.py5
-rw-r--r--packages/torouter-web/src/tui/controllers/tor.py21
3 files changed, 22 insertions, 9 deletions
diff --git a/packages/torouter-web/src/tui/controllers/main.py b/packages/torouter-web/src/tui/controllers/main.py
index 060caa6..fb925d3 100644
--- a/packages/torouter-web/src/tui/controllers/main.py
+++ b/packages/torouter-web/src/tui/controllers/main.py
@@ -1,6 +1,7 @@
import web
-import view, config
-from view import render
+from tui import config
+from tui import view
+from tui.view import render
from tui.utils import session
"""
diff --git a/packages/torouter-web/src/tui/controllers/network.py b/packages/torouter-web/src/tui/controllers/network.py
index cc46643..bf48f54 100644
--- a/packages/torouter-web/src/tui/controllers/network.py
+++ b/packages/torouter-web/src/tui/controllers/network.py
@@ -1,6 +1,7 @@
import web
-import view, config
-from view import render
+from tui import config
+from tui import view
+from tui.view import render
from tui.utils import session,configuration,parsing
"""
diff --git a/packages/torouter-web/src/tui/controllers/tor.py b/packages/torouter-web/src/tui/controllers/tor.py
index af8678c..bc66623 100644
--- a/packages/torouter-web/src/tui/controllers/tor.py
+++ b/packages/torouter-web/src/tui/controllers/tor.py
@@ -1,7 +1,8 @@
import web
-import view, config
-from view import render
-from tui.utils import session, parsing
+from tui import config
+from tui import view
+from tui.view import render
+from tui.utils import session, parsing, fileio
"""
The main Tor status page
@@ -24,12 +25,22 @@ Tor configuration page
"""
class torrc:
def update_config(self, data):
+ # Now it will just write to /tmp/torrc
+ files = [('/tmp/torrc',data.torrc)]
+ fileio.write(files)
+
return True
def GET(self):
- return render.base(render.torconfig())
+ trc = parsing.torrc(config.torrc_file)
+ output = trc.output()
+ return render.base(render.torconfig(output))
def POST(self):
self.update_config(web.input())
- return render.base(render.torconfig())
+ trc = parsing.torrc(config.torrc_file)
+ trc.parse()
+ output = trc.html_output()
+ return render.base(render.torstatus(output,config.torrc_file))
+