Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar
This commit is contained in:
commit
9b9d939e45
@ -5,6 +5,7 @@ import gobject
|
|||||||
|
|
||||||
from model.BuddyModel import BuddyModel
|
from model.BuddyModel import BuddyModel
|
||||||
from sugar import env
|
from sugar import env
|
||||||
|
import logging
|
||||||
|
|
||||||
class Friends(gobject.GObject):
|
class Friends(gobject.GObject):
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
@ -45,12 +46,16 @@ class Friends(gobject.GObject):
|
|||||||
def load(self):
|
def load(self):
|
||||||
cp = ConfigParser()
|
cp = ConfigParser()
|
||||||
|
|
||||||
if cp.read([self._path]):
|
try:
|
||||||
for name in cp.sections():
|
success = cp.read([self._path])
|
||||||
buddy = BuddyModel()
|
if success:
|
||||||
buddy.set_name(name)
|
for name in cp.sections():
|
||||||
buddy.set_color(cp.get(name, 'color'))
|
buddy = BuddyModel()
|
||||||
self.add_friend(buddy)
|
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):
|
def save(self):
|
||||||
cp = ConfigParser()
|
cp = ConfigParser()
|
||||||
|
@ -99,7 +99,10 @@ class Bot:
|
|||||||
|
|
||||||
self._pservice = PresenceService.get_instance()
|
self._pservice = PresenceService.get_instance()
|
||||||
|
|
||||||
gtk.main()
|
try:
|
||||||
|
gtk.main()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
pass
|
||||||
|
|
||||||
def add_action(self, action, minutes):
|
def add_action(self, action, minutes):
|
||||||
self._timeline.add(action, minutes)
|
self._timeline.add(action, minutes)
|
||||||
|
Loading…
Reference in New Issue
Block a user