исправил normalize_msg

sandbox1
inpos 2016-03-13 17:28:01 +03:00
parent 6857747c3f
commit 2a3ff4a264
3 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.module.pyrrent2http" name="pyrrent2http" version="0.8.0" provider-name="inpos"> <addon id="script.module.pyrrent2http" name="pyrrent2http" version="0.8.1" provider-name="inpos">
<requires> <requires>
<import addon="xbmc.python" version="2.14.0"/> <import addon="xbmc.python" version="2.14.0"/>
<import addon="script.module.libtorrent" /> <import addon="script.module.libtorrent" />

View File

@ -162,7 +162,7 @@ class TorrentFile(object):
return None return None
if self.filePtr is None: if self.filePtr is None:
while not os.path.exists(self.save_path): while not os.path.exists(self.save_path):
logging.info('Waiting: %s' % (self.save_path,)) logging.info('Waiting for file: %s' % (self.save_path,))
time.sleep(0.5) time.sleep(0.5)
self.filePtr = io.open(self.save_path, 'rb') self.filePtr = io.open(self.save_path, 'rb')
return self.filePtr return self.filePtr
@ -595,7 +595,7 @@ class Pyrrent2http(object):
def buildTorrentParams(self, uri): def buildTorrentParams(self, uri):
try: try:
absPath = uri2path(uri) absPath = uri2path(uri)
logging.info(normalize_msg('Opening local torrent file: %s', absPath)) logging.info(normalize_msg('Opening local torrent file: %s', (absPath,)))
torrent_info = lt.torrent_info(absPath) torrent_info = lt.torrent_info(absPath)
except Exception as e: except Exception as e:
strerror = e.args strerror = e.args

View File

@ -41,7 +41,7 @@ def detect_media_type(name):
return MediaType.VIDEO return MediaType.VIDEO
else: else:
return MediaType.UNKNOWN return MediaType.UNKNOWN
def normalize_msg(tmpl, *args): def normalize_msg(tmpl, args):
msg = isinstance(tmpl, unicode) and tmpl or tmpl.decode(chardet.detect(tmpl)['encoding']) msg = isinstance(tmpl, unicode) and tmpl or tmpl.decode(chardet.detect(tmpl)['encoding'])
arg_ = [] arg_ = []
for a in args: for a in args: