Try to import system rencode before deluge.rencode to allow the use of the new rencode library at: http://code.google.com/p/rencode/
This commit is contained in:
parent
e025b6b9db
commit
961d405921
|
@ -47,7 +47,11 @@ from twisted.internet import ssl, reactor, defer
|
||||||
from OpenSSL import crypto, SSL
|
from OpenSSL import crypto, SSL
|
||||||
from types import FunctionType
|
from types import FunctionType
|
||||||
|
|
||||||
import deluge.rencode as rencode
|
try:
|
||||||
|
import rencode
|
||||||
|
except ImportError:
|
||||||
|
import deluge.rencode as rencode
|
||||||
|
|
||||||
from deluge.log import LOG as log
|
from deluge.log import LOG as log
|
||||||
|
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
|
|
|
@ -35,7 +35,11 @@
|
||||||
|
|
||||||
from twisted.internet.protocol import Protocol, ClientFactory
|
from twisted.internet.protocol import Protocol, ClientFactory
|
||||||
from twisted.internet import reactor, ssl, defer
|
from twisted.internet import reactor, ssl, defer
|
||||||
import deluge.rencode as rencode
|
try:
|
||||||
|
import rencode
|
||||||
|
except ImportError:
|
||||||
|
import deluge.rencode as rencode
|
||||||
|
|
||||||
import zlib
|
import zlib
|
||||||
|
|
||||||
import deluge.common
|
import deluge.common
|
||||||
|
|
|
@ -38,7 +38,11 @@ import sys
|
||||||
import os
|
import os
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
import deluge.rencode
|
try:
|
||||||
|
import rencode
|
||||||
|
except ImportError:
|
||||||
|
import deluge.rencode as rencode
|
||||||
|
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
from deluge.ui.client import client
|
from deluge.ui.client import client
|
||||||
import deluge.common
|
import deluge.common
|
||||||
|
@ -51,12 +55,12 @@ import twisted.internet.error
|
||||||
|
|
||||||
class IPCProtocolServer(Protocol):
|
class IPCProtocolServer(Protocol):
|
||||||
def dataReceived(self, data):
|
def dataReceived(self, data):
|
||||||
data = deluge.rencode.loads(data)
|
data = rencode.loads(data)
|
||||||
process_args(data)
|
process_args(data)
|
||||||
|
|
||||||
class IPCProtocolClient(Protocol):
|
class IPCProtocolClient(Protocol):
|
||||||
def connectionMade(self):
|
def connectionMade(self):
|
||||||
self.transport.write(deluge.rencode.dumps(self.factory.args))
|
self.transport.write(rencode.dumps(self.factory.args))
|
||||||
self.transport.loseConnection()
|
self.transport.loseConnection()
|
||||||
|
|
||||||
def connectionLost(self, reason):
|
def connectionLost(self, reason):
|
||||||
|
|
Loading…
Reference in New Issue