X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/ed94aebfba0372444928338ef479b399aa9bcbfc..db545998ecbe01bfd3fd13a8b274da869958e0f5:/lib/python/Components/Network.py?ds=sidebyside diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index 3ee76298..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 * @@ -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