Ticket #2959: 0001-Do-not-fail-if-NetworkManager-is-absent-2959.patch

File 0001-Do-not-fail-if-NetworkManager-is-absent-2959.patch, 2.8 KB (added by alsroot, 12 years ago)
  • src/jarabe/model/adhoc.py

    From 021cb0c4befeb7b24d7a36c794c3a6d6ab067997 Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@activitycentral.org>
    Date: Mon, 11 Jul 2011 11:45:58 +0000
    Subject: [PATCH sugar] Do not fail if NetworkManager is absent #2959
    
    ---
     src/jarabe/model/adhoc.py    |    3 ---
     src/jarabe/model/network.py  |    8 +++++++-
     src/jarabe/model/olpcmesh.py |    5 +----
     3 files changed, 8 insertions(+), 8 deletions(-)
    
    diff --git a/src/jarabe/model/adhoc.py b/src/jarabe/model/adhoc.py
    index 647bd8e..b5a3557 100644
    a b class AdHocManager(gobject.GObject): 
    137137    def _update_state(self):
    138138        self.emit('state-changed', self._current_channel, self._device_state)
    139139
    140     def _have_configured_connections(self):
    141         return len(network.get_settings().connections) > 0
    142 
    143140    def autoconnect(self):
    144141        """Start a timer which basically looks for 30 seconds of inactivity
    145142        on the device, then does autoconnect to an Ad-hoc network.
  • src/jarabe/model/network.py

    diff --git a/src/jarabe/model/network.py b/src/jarabe/model/network.py
    index f265ae4..d58ad84 100644
    a b def get_settings(): 
    820820
    821821
    822822def find_connection_by_ssid(ssid):
     823    if get_settings() is None:
     824        return None
     825
    823826    connections = get_settings().connections
    824827
    825828    for conn_index in connections:
    def load_connections(): 
    961964
    962965
    963966def find_gsm_connection():
     967    if get_settings() is None:
     968        return None
     969
    964970    connections = get_settings().connections
    965971
    966972    for connection in connections.values():
    def find_gsm_connection(): 
    972978
    973979
    974980def have_wifi_connections():
    975     return bool(get_settings().connections)
     981    return get_settings() is not None and bool(get_settings().connections)
    976982
    977983
    978984def clear_wifi_connections():
  • src/jarabe/model/olpcmesh.py

    diff --git a/src/jarabe/model/olpcmesh.py b/src/jarabe/model/olpcmesh.py
    index f070100..e6562fa 100644
    a b class OlpcMeshManager(object): 
    8282        self._mesh_device_state = DEVICE_STATE_UNKNOWN
    8383        self._eth_device_state = DEVICE_STATE_UNKNOWN
    8484
    85         if self._have_configured_connections():
     85        if network.have_wifi_connections():
    8686            self._start_automesh_timer()
    8787        else:
    8888            self._start_automesh()
    class OlpcMeshManager(object): 
    9292        eth_device_o = props.Get(_NM_OLPC_MESH_IFACE, 'Companion')
    9393        return self._bus.get_object(_NM_SERVICE, eth_device_o)
    9494
    95     def _have_configured_connections(self):
    96         return len(network.get_settings().connections) > 0
    97 
    9895    def _start_automesh_timer(self):
    9996        """Start our timer system which basically looks for 10 seconds of
    10097           inactivity on both devices, then starts automesh.