/usr/lib/python2.7/dist-packages/mate_invest/networkmanager.py is in mate-applets 1.12.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import mate_invest
from gi.repository import Gio
class NetworkManager:
def __init__(self):
self.network_available = True
self.statechange_callback = None
self.monitor = Gio.NetworkMonitor.get_default()
self.monitor.connect('network-changed', self.on_network_changed)
def online(self):
return self.network_available
def offline(self):
return not self.online()
# the signal handler for signals from the network manager
def on_network_changed(self, monitor, available):
self.network_available = available
# notify about state change
if self.statechange_callback != None:
self.statechange_callback()
def set_statechange_callback(self,handler):
self.statechange_callback = handler
|