diff options
author | Arturo FilastoĢ <hellais@torproject.org> | 2011-08-19 17:27:01 +0200 |
---|---|---|
committer | Arturo FilastoĢ <hellais@torproject.org> | 2011-08-19 17:27:01 +0200 |
commit | 0fb54f161f5344f5a7e764801e202337b6d0e451 (patch) | |
tree | 389d53a921e07810823cedc07702d5a934f2bb21 /packages/torouter-web/src/tui/controllers | |
parent | 107256ba90d51bd5c981cf0b167f68c8f64d652c (diff) | |
download | torouter-0fb54f161f5344f5a7e764801e202337b6d0e451.tar.gz torouter-0fb54f161f5344f5a7e764801e202337b6d0e451.zip |
Allow writing to network/interfaces file for wireless network settings
Diffstat (limited to 'packages/torouter-web/src/tui/controllers')
-rw-r--r-- | packages/torouter-web/src/tui/controllers/network.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/packages/torouter-web/src/tui/controllers/network.py b/packages/torouter-web/src/tui/controllers/network.py index bf48f54..690dc3f 100644 --- a/packages/torouter-web/src/tui/controllers/network.py +++ b/packages/torouter-web/src/tui/controllers/network.py @@ -2,7 +2,7 @@ import web from tui import config from tui import view from tui.view import render -from tui.utils import session,configuration,parsing +from tui.utils import session, configuration, parsing, fileio """ This function is used to generate the network @@ -75,6 +75,16 @@ Wireless network configuration page class wireless: # XXX do all the backend stuff def update_config(self, data): + itfc = parsing.interfaces(config.interfaces_file) + itfc.parse() + itfc.set_ssid(data.essid) + itfc.set_mac(data.mac) + itfc.wifi['netmask'] = data.netmask + itfc.wifi['address'] = data.address + filecontent = itfc.exclude_output("uap0") + itfc.output(itfc.wifi) + files = [('/etc/network/interfaces', filecontent)] + fileio.write(files) + #print itfc.output(itfc.wifi) return True def GET(self): |