Changeset 956
- Timestamp:
- 09/05/08 11:14:00 (3 months ago)
- Location:
- trunk/tcos-configurator
- Files:
-
- 5 modified
-
Makefile (modified) (1 diff)
-
debian/changelog (modified) (1 diff)
-
debian/control (modified) (1 diff)
-
tcos-configurator (modified) (7 diffs)
-
tcos-configurator.glade (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tcos-configurator/Makefile
r903 r956 11 11 clean: 12 12 find -name "*~" | xargs rm -f 13 rm -f tcos-configurator.glade.bak tcos-configurator.gladep 13 14 14 15 test: -
trunk/tcos-configurator/debian/changelog
r945 r956 1 tcos-configurator (1.5) unstable; urgency=low 2 3 * Now Depends on python-netifaces 4 * Change ifaces detection code to use netifaces module 5 * Hide como_boot_mode (and label) if only one method is found 6 7 -- Mario Izquierdo (mariodebian) <mariodebian@gmail.com> Fri, 05 Sep 2008 11:13:31 +0200 8 1 9 tcos-configurator (1.4) unstable; urgency=low 2 10 -
trunk/tcos-configurator/debian/control
r890 r956 12 12 Package: tcos-configurator 13 13 Architecture: all 14 Depends: tcosconfig, gksu, python-gtk2, python-glade2, 14 Depends: tcosconfig, gksu, python-gtk2, python-glade2, python-netifaces, 15 15 python-configobj, ${misc:Depends}, ${shlibs:Depends}, ${python:Depends} 16 16 Description: PyGTK tool to configure some needed services to get a TCOS server -
trunk/tcos-configurator/tcos-configurator
r945 r956 49 49 from threading import Thread 50 50 51 import netifaces 52 51 53 import pwd 52 54 … … 222 224 for widget in ['img_logo', 'combo_interfaces', 'txt_serverip', 'txt_startip', 223 225 'txt_endip', 'btn_configure_dhcp', 'combo_boot_mode', 'hbox_dynamic', 224 'ck_static', 'btn_hostname_help', 'txt_hostname_prefix', 'lbl_dhcp' ]:226 'ck_static', 'btn_hostname_help', 'txt_hostname_prefix', 'lbl_dhcp', 'label_boot_mode']: 225 227 self.w[widget]=self.ui.get_widget(widget) 226 228 … … 235 237 self.populate_select(self.w['combo_boot_mode'], self.BOOT_MODES) 236 238 self.set_active_in_select(self.w['combo_boot_mode'], self.BOOT_MODES[0][0]) 239 if len(self.BOOT_MODES) < 2: 240 self.w['combo_boot_mode'].hide() 241 self.w['label_boot_mode'].hide() 237 242 238 243 self.interfaces=self.getNetInterfaces() … … 347 352 self.w['lbl_dhcp'].set_markup( _("WARNING:\n<b>Network interface don't have IP</b>") ) 348 353 self.w['lbl_dhcp'].show() 349 print_debug("iface=%s don't have ip" %iface) 354 self.w['txt_serverip'].set_text('') 355 self.w['txt_startip'].set_text('') 356 self.w['txt_endip'].set_text('') 357 print_debug("iface=%s DON'T HAVE IP" %iface) 350 358 if configured: 351 359 self.w['lbl_dhcp'].hide() 352 self.w['hbox_dynamic']. show()353 self.w['ck_static'].set_active( True)360 self.w['hbox_dynamic'].hide() 361 self.w['ck_static'].set_active(False) 354 362 355 363 def set_dhcp_modified(self, *args): … … 487 495 def get_ip_address(self, ifname): 488 496 print_debug("get_ip_address() ifname=%s" %(ifname) ) 497 if not ifname in netifaces.interfaces(): 498 return None 499 ip=netifaces.ifaddresses(ifname) 500 if ip.has_key(netifaces.AF_INET): 501 return ip[netifaces.AF_INET][0]['addr'] 502 return None 503 """ 504 old code 505 print_debug("get_ip_address() ifname=%s" %(ifname) ) 489 506 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 490 507 return socket.inet_ntoa(fcntl.ioctl( … … 493 510 struct.pack('256s', ifname[:15]) 494 511 )[20:24]) 512 """ 495 513 496 514 497 515 def getNetInterfaces(self): 516 interfaces=[] 517 for dev in netifaces.interfaces(): 518 if dev != "lo" and dev != "sit0" and not dev.startswith("vbox") and not dev.startswith("vmnet") and not dev.startswith("wmaster"): 519 ip=self.get_ip_address(dev) 520 print_debug("getNetInterfaces() iface=%s data=%s"%(dev,ip)) 521 interfaces.append( [dev, ip] ) 522 return interfaces 523 """ 524 old code 498 525 interfaces=[] 499 526 for edir in glob.glob("/sys/class/net/*"): … … 508 535 interfaces.append( [edir, IP]) 509 536 return interfaces 537 """ 510 538 511 539 def read_etc_network_interfaces(self): -
trunk/tcos-configurator/tcos-configurator.glade
r890 r956 353 353 354 354 <child> 355 <widget class="GtkLabel" id="label 19">355 <widget class="GtkLabel" id="label_boot_mode"> 356 356 <property name="visible">True</property> 357 357 <property name="label" translatable="yes">Boot mode</property>
