Load Peer class after it got pluginned

This commit is contained in:
shortcutme 2017-10-03 14:58:47 +02:00
parent 797abdea80
commit d6d9e911fe
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -2,7 +2,6 @@ import hashlib
import time import time
from Plugin import PluginManager from Plugin import PluginManager
from Peer import Peer
from util import helper from util import helper
from Crypt import CryptRsa from Crypt import CryptRsa
@ -11,6 +10,13 @@ time_full_announced = {} # Tracker address: Last announced all site to tracker
connection_pool = {} # Tracker address: Peer object connection_pool = {} # Tracker address: Peer object
# We can only import plugin host clases after the plugins are loaded
@PluginManager.afterLoad
def importErrors():
global Peer
from Peer import Peer
# Process result got back from tracker # Process result got back from tracker
def processPeerRes(site, peers): def processPeerRes(site, peers):
added = 0 added = 0