#NEWLINE# def IsOnWwan( ) : #NEWLINE# #INDENT# '"Checks WWAN device connection status.\n\n  Note: this may produce false-positives, and may not catch all WWAN\n    devices.  Several Sprint and Verizon devices were tested, all of which\n    create ppp0 upon connection.  However, L2TP VPN also creates ppp0\n    (Google no longer uses this as of Q2-2010 in favor of SSLVPN).  A\n    stronger check is probably needed at some point.\n\n    As of 2011-12-6 OpenVPN interface is tun0 on Linux and Darwin.\n\n  Returns:\n    Boolean. True if WWAN device is active, False otherwise.\n  ' #NEWLINE# wwan_ifaces = GetInterfaceNames ( INTERFACE_WWAN ) #NEWLINE# for wwan_iface in wwan_ifaces : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( return_code , unused_out , unused_err ) = flight_common . Exec ( [ IFCONFIG , wwan_iface ] ) #NEWLINE# #UNINDENT# except OSError : #NEWLINE# #INDENT# return_code = None #NEWLINE# #UNINDENT# if ( return_code == 0 ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# return False