~aaronp/software-center/enhance-usefulness

« back to all changes in this revision

Viewing changes to softwarecenter/netstatus.py

  • Committer: Matthew McGowan
  • Date: 2011-04-12 00:03:15 UTC
  • mto: (1736.2.3 oneiric)
  • mto: This revision was merged to the branch mainline in revision 1746.
  • Revision ID: matthew.joseph.mcgowan@gmail.com-20110412000315-svfjdjrthkrbopbc
desensitive action buttons when the netconnection drops

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# this program; if not, write to the Free Software Foundation, Inc.,
18
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
19
 
 
20
 
20
21
import dbus
21
22
import gobject
22
23
import logging
60
61
# init network state
61
62
def __init_network_state():
62
63
    global NETWORK_STATE
 
64
 
 
65
    # check is SOFTWARE_CENTER_NET_DISCONNECTED is in the environment variables
 
66
    # if so force the network status to be disconnected
 
67
    import os
 
68
    if "SOFTWARE_CENTER_NET_DISCONNECTED" in os.environ and \
 
69
        os.environ["SOFTWARE_CENTER_NET_DISCONNECTED"] == 1:
 
70
        NETWORK_STATE = NetState.NM_STATE_DISCONNECTED
 
71
        print 'forced netstate into disconnected mode...'
 
72
        return
 
73
 
63
74
    dbus_loop = DBusGMainLoop()
64
75
    try:
65
76
        bus = dbus.SystemBus(mainloop=dbus_loop)