Hello Scott,
i think this is the best way,
and also it should be localized because in my german environment the is no
result
because of die localized output of ifconfig.
My workaround is to call LC_ALL=C ifconfig
so I changed to
def net_get_ip(): # by Whise
"""Returns ip if it can"""
ip = commands.getoutput("LC_ALL=C ifconfig")
x = 0
while True:
ip = ip[ip.find("inet addr:"):]
ip = ip[10:]
ipc = ip[:ip.find(chr(32))]
if ipc != '127.0.0.1' and ipc != None and ipc !='1':
return ipc
return _('Cannot get ip')
--
screenlets.sensors.net_get_ip() doesn't necessarily return the correct value
https://bugs.launchpad.net/bugs/241557
You received this bug notification because you are a member of
Screenlets Dev Team, which is subscribed to Screenlets.
_______________________________________________
Mailing list: https://launchpad.net/~screenlets-dev
Post to : [email protected]
Unsubscribe : https://launchpad.net/~screenlets-dev
More help : https://help.launchpad.net/ListHelp