Ejemplo n.º 1
0
 def _on_network_connector_switched(self, oldstate, newstate, evt, *args, **kwargs):
     from p2p import p2p_connector
     from system import tray_icon
     if oldstate != newstate:
         if newstate == 'CONNECTED' or newstate == 'DISCONNECTED':
             p2p_connector.A('network_connector.state', newstate)
             tray_icon.state_changed(newstate, p2p_connector.A().state)
Ejemplo n.º 2
0
 def _on_network_connector_switched(self, oldstate, newstate, evt, args):
     from p2p import p2p_connector
     from system import tray_icon
     if oldstate != newstate:
         if newstate == 'CONNECTED' or newstate == 'DISCONNECTED':
             p2p_connector.A('network_connector.state', newstate)
             tray_icon.state_changed(newstate, p2p_connector.A().state)
Ejemplo n.º 3
0
 def state_changed(self, oldstate, newstate, event, arg):
     global_state.set_global_state('NETWORK ' + newstate)
     if driver.is_on('service_p2p_hookups'):
         from p2p import p2p_connector
         from system import tray_icon
         p2p_connector.A('network_connector.state', newstate)
         tray_icon.state_changed(self.state, p2p_connector.A().state)
Ejemplo n.º 4
0
 def _on_p2p_connector_switched(self, oldstate, newstate, evt, *args, **kwargs):
     if newstate == 'INCOMMING?':
         if self._starting_defer is not None:
             self._starting_defer.callback(newstate)
             self._starting_defer = None
     from p2p import network_connector
     from system import tray_icon
     if network_connector.A():
         tray_icon.state_changed(network_connector.A().state, newstate)
Ejemplo n.º 5
0
 def _on_p2p_connector_switched(self, oldstate, newstate, evt, args):
     if newstate == 'INCOMMING?':
         if self._starting_defer is not None:
             self._starting_defer.callback(newstate)
             self._starting_defer = None
     from p2p import network_connector
     from system import tray_icon
     if network_connector.A():
         tray_icon.state_changed(network_connector.A().state, newstate)
Ejemplo n.º 6
0
 def state_changed(self, oldstate, newstate, event, *args, **kwargs):
     global_state.set_global_state('NETWORK ' + newstate)
     if driver.is_on('service_p2p_hookups'):
         from p2p import p2p_connector
         from system import tray_icon
         p2p_connector.A('network_connector.state', newstate)
         tray_icon.state_changed(self.state, p2p_connector.A().state)
     if oldstate != 'CONNECTED' and newstate == 'CONNECTED':
         # TODO: redesign the state machine to cover that
         if self.last_bytes_in_counter < p2p_stats.get_total_bytes_in():
             lg.info('HELLO BITDUST WORLD !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
         else:
             lg.warn('SEEMS I AM OFFLINE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
         self.last_bytes_in_counter = p2p_stats.get_total_bytes_in()