Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/model/Friends.py17
-rw-r--r--sugar/simulator.py5
2 files changed, 15 insertions, 7 deletions
diff --git a/shell/model/Friends.py b/shell/model/Friends.py
index b90f9d9..4a2298c 100644
--- a/shell/model/Friends.py
+++ b/shell/model/Friends.py
@@ -5,6 +5,7 @@ import gobject
from model.BuddyModel import BuddyModel
from sugar import env
+import logging
class Friends(gobject.GObject):
__gsignals__ = {
@@ -45,12 +46,16 @@ class Friends(gobject.GObject):
def load(self):
cp = ConfigParser()
- if cp.read([self._path]):
- for name in cp.sections():
- buddy = BuddyModel()
- buddy.set_name(name)
- buddy.set_color(cp.get(name, 'color'))
- self.add_friend(buddy)
+ try:
+ success = cp.read([self._path])
+ if success:
+ for name in cp.sections():
+ buddy = BuddyModel()
+ buddy.set_name(name)
+ buddy.set_color(cp.get(name, 'color'))
+ self.add_friend(buddy)
+ except Exception, exc:
+ logging.error("Error parsing friends file: %s" % exc)
def save(self):
cp = ConfigParser()
diff --git a/sugar/simulator.py b/sugar/simulator.py
index b46b9c3..271d5ed 100644
--- a/sugar/simulator.py
+++ b/sugar/simulator.py
@@ -99,7 +99,10 @@ class Bot:
self._pservice = PresenceService.get_instance()
- gtk.main()
+ try:
+ gtk.main()
+ except KeyboardInterrupt:
+ pass
def add_action(self, action, minutes):
self._timeline.add(action, minutes)