Example #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)
 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)
Example #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)
Example #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)
 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)
 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()