ELementum Come Client di Default

This commit is contained in:
Alhaziel01
2020-04-19 21:24:27 +02:00
parent 2502ac48b2
commit 27ae5c8058
178 changed files with 1394 additions and 6501 deletions
-39
View File
@@ -1,39 +0,0 @@
# -*- coding: utf-8 -*-
from monitor import Monitor
import traceback
try:
import xbmc, xbmcgui
except:
pass
from platformcode import config
LIBTORRENT_PATH = config.get_setting("libtorrent_path", server="torrent", default='')
from servers import torrent as torr
lt, e, e1, e2 = torr.import_libtorrent(LIBTORRENT_PATH)
class Dispatcher(Monitor):
def __init__(self, client):
super(Dispatcher, self).__init__(client)
def do_start(self, th, ses):
self._th = th
self._ses = ses
self.start()
def run(self):
if not self._ses:
raise Exception('Invalid state, session is not initialized')
while self.running:
a = self._ses.wait_for_alert(1000)
if a:
alerts = self._ses.pop_alerts()
for alert in alerts:
with self.lock:
for cb in self.listeners:
cb(lt.alert.what(alert), alert)