X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e7b3db898270e6a6a252eee7697302fb0c1f7d38..2a8ecd871020fdd668cf5500460e5a6e7851b4b0:/lib/python/Components/Network.py diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index 37af0c98..d10163fb 100644 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -1,5 +1,3 @@ -from Components.config import config, ConfigYesNo, ConfigIP, NoSave, ConfigSubsection, ConfigMAC - import os import re from socket import * @@ -95,7 +93,7 @@ class Network: return data def writeNetworkConfig(self): - fp = file('/etc/network/interfaces.tmp', 'w') + fp = file('/etc/network/interfaces', 'w') fp.write("# automatically generated by enigma 2\n# do NOT change manually!\n\n") fp.write("auto lo\n") fp.write("iface lo inet loopback\n\n") @@ -134,7 +132,7 @@ class Network: interfaces = [] # parse the interfaces-file try: - fp = file('/etc/network/interfaces.tmp', 'r') + fp = file('/etc/network/interfaces', 'r') interfaces = fp.readlines() fp.close() except: @@ -190,7 +188,7 @@ class Network: def deactivateNetworkConfig(self): for iface in self.ifaces.keys(): - os.system("ip addr flush" + iface) + os.system("ip addr flush " + iface) os.system("/etc/init.d/networking stop") os.system("killall -9 udhcpc") os.system("rm /var/run/udhcpc*") @@ -200,7 +198,15 @@ class Network: def getNumberOfAdapters(self): return len(self.ifaces) - + + def getFriendlyAdapterName(self, x): + # maybe this needs to be replaced by an external list. + friendlyNames = { + "eth0": _("Integrated Ethernet"), + "wlan0": _("Wireless") + } + return friendlyNames.get(x, x) # when we have no friendly name, use adapter name + def getAdapterName(self, iface): return iface