diff options
author | Arturo FilastoĢ <hellais@torproject.org> | 2011-08-25 01:57:59 +0200 |
---|---|---|
committer | Arturo FilastoĢ <hellais@torproject.org> | 2011-08-25 01:57:59 +0200 |
commit | 2da67986a68571789172cc1f469f2d010d8128de (patch) | |
tree | 9dd26d05d27049b90cda7870bee71d5b6d5f94b3 /packages/torouter-web/src/tui/utils | |
parent | 817713dc33ae88217b61c73d4b9b0446a1a89855 (diff) | |
download | torouter-2da67986a68571789172cc1f469f2d010d8128de.tar.gz torouter-2da67986a68571789172cc1f469f2d010d8128de.zip |
Make the network interfaces be inside config.py
Diffstat (limited to 'packages/torouter-web/src/tui/utils')
-rw-r--r-- | packages/torouter-web/src/tui/utils/parsing.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/torouter-web/src/tui/utils/parsing.py b/packages/torouter-web/src/tui/utils/parsing.py index 690d15d..310ea5c 100644 --- a/packages/torouter-web/src/tui/utils/parsing.py +++ b/packages/torouter-web/src/tui/utils/parsing.py @@ -2,6 +2,7 @@ # files, they will be used inside torouter to visualize # and edit configuration import os, re +from tui import config class interfaces: def __init__(self,filename): @@ -31,7 +32,7 @@ class interfaces: def parse_line(self, line, iface): name = line.split(" ")[0] values = " ".join(line.split(" ")[1:]).rstrip() - if iface == "wlan0": + if iface == config.network_interfaces[0]: if self.wifi.has_key(name): if type(self.wifi[name]) is list: self.wifi[name].append(values) @@ -39,7 +40,7 @@ class interfaces: self.wifi[name] = [self.wifi[name],values] else: self.wifi.update({name : values}) - elif iface == "eth1": + elif iface == config.network_interfaces[2]: if self.eth1.has_key(name): if type(self.eth1[name]) is list: self.eth1[name].append(values) @@ -47,7 +48,7 @@ class interfaces: self.eth1[name] = [self.eth1[name],values] else: self.eth1.update({name : values}) - elif iface == "eth0": + elif iface == config.network_interfaces[1]: if self.eth0.has_key(name): if type(self.eth0[name]) is list: self.eth0[name].append(values) @@ -103,7 +104,7 @@ class interfaces: # XXX currently works for one pre-up entry, must make it work also for arrays def set_mac(self, mac): - self.wifi['pre-up'] = 'ifconfig wlan0 hw ether ' + mac + self.wifi['pre-up'] = 'ifconfig ' + config.network_interfaces[0] + ' hw ether ' + mac class torrc: |