Do not instantiate the roster at module level

.
This commit is contained in:
mathieui 2014-04-06 17:30:52 +02:00
parent e000466ab8
commit 218c71dfbf
2 changed files with 9 additions and 1 deletions

View file

@ -36,6 +36,9 @@ def main():
import logger
logger.create_logger()
import roster
roster.create_roster()
import core
log = logging.getLogger('')

View file

@ -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