Do not instantiate the roster at module level
.
This commit is contained in:
parent
e000466ab8
commit
218c71dfbf
2 changed files with 9 additions and 1 deletions
|
@ -36,6 +36,9 @@ def main():
|
|||
import logger
|
||||
logger.create_logger()
|
||||
|
||||
import roster
|
||||
roster.create_roster()
|
||||
|
||||
import core
|
||||
|
||||
log = logging.getLogger('')
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue