https://bugs.gpodder.org/show_bug.cgi?id=1730
Olivier Brisson <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #7 from Olivier Brisson <[email protected]> 2013-01-01 11:55:54 GMT --- I've also been hit with this bug on FreeBSD where iproute2 is not available. FreeBSD 8.2-STABLE i386 I wrote a little patch to make gpodder work on FreeBSD. Here it is: *** util.py.bck 2013-01-01 12:46:08.000000000 +0100 --- util.py 2013-01-01 12:47:41.000000000 +0100 *************** *** 1670,1675 **** --- 1670,1688 ---- if b: yield b.group(1) + def unix_get_active_interfaces(): + """Get active network interfaces using 'ifconfig' + + Returns a list of active network interfaces or an + empty list if the device is offline. The loopback + interface is not included. + """ + stdout = subprocess.check_output(['ifconfig']) + for i in re.split('\n(?!\t)', stdout, re.MULTILINE): + b = re.match('(\\w+):.*status: active$', i, re.MULTILINE | re.DOTALL) + if b: + yield b.group(1) + def connection_available(): """Check if an Internet connection is available *************** *** 1686,1692 **** return len(list(osx_get_active_interfaces())) > 0 return True else: ! return len(list(linux_get_active_interfaces())) > 0 except Exception, e: logger.warn('Cannot get connection status: %s', e, exc_info=True) return False --- 1699,1705 ---- return len(list(osx_get_active_interfaces())) > 0 return True else: ! return len(list(unix_get_active_interfaces())) > 0 except Exception, e: logger.warn('Cannot get connection status: %s', e, exc_info=True) return False -- Configure bugmail: https://bugs.gpodder.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes. _______________________________________________ gPodder-Bugs mailing list [email protected] https://lists.berlios.de/mailman/listinfo/gpodder-bugs
