From 218c71dfbfb9f564eb1ec2a966df24eef2efbdec Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 6 Apr 2014 17:30:52 +0200 Subject: Do not instantiate the roster at module level . --- src/poezio.py | 3 +++ src/roster.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/poezio.py b/src/poezio.py index 219a2279..f9d27a51 100644 --- a/src/poezio.py +++ b/src/poezio.py @@ -36,6 +36,9 @@ def main(): import logger logger.create_logger() + import roster + roster.create_roster() + import core log = logging.getLogger('') diff --git a/src/roster.py b/src/roster.py index 51468aad..b306bd07 100644 --- a/src/roster.py +++ b/src/roster.py @@ -327,5 +327,10 @@ class RosterGroup(object): """Return the number of connected contacts""" return len([1 for contact in self.contacts if len(contact)]) +def create_roster(): + "Create the global roster object" + global roster + roster = Roster() + # Shared roster object -roster = Roster() +roster = None -- cgit v1.2.3