detect ips

This commit is contained in:
mdipierro
2012-07-26 17:37:51 -05:00
parent a13ba1bc63
commit 80a635f5ef
2 changed files with 8 additions and 2 deletions

View File

@@ -1 +1 @@
Version 2.00.0 (2012-07-26 09:41:33) dev
Version 2.00.0 (2012-07-26 17:37:45) dev

View File

@@ -223,7 +223,10 @@ class web2pyDialog(object):
self.ips = {}
self.selected_ip = Tkinter.StringVar()
row=0
for ip,legend in (('127.0.0.1','Local'),('0.0.0.0','Public')):
ips = [('127.0.0.1','Local')] + \
[(ip,'Public') for ip in options.ips] + \
[('0.0.0.0','Public')]
for ip,legend in ips:
self.ips[ip] = Tkinter.Radiobutton(
self.root,text='%s (%s)' % (legend,ip),
variable=self.selected_ip, value=ip)
@@ -797,6 +800,9 @@ def console():
global_settings.cmd_options = options
global_settings.cmd_args = args
options.ips = [ip for ip in socket.gethostbyname_ex(socket.getfqdn())[2]
if ip!='127.0.0.1']
if options.run_system_tests:
run_system_tests()