log update

This commit is contained in:
DiMartinoXBMC committed 2015-12-23 18:26:19 +03:00
1 parent 32196e5876
commit de2323f7af
13 files changed
+589 -655

No files matched your search

+5 -16
View File
@@ -2,6 +2,7 @@
#
try:
import xbmcaddon
from functions import log, debug
__settings__ = xbmcaddon.Addon("plugin.video.torrenter")
debug = __settings__.getSetting("debug")
@@ -10,31 +11,19 @@ except:
def Log(msg, force=False):
try:
print "[torrenter log] " + msg
except UnicodeEncodeError:
print "[torrenter log] " + msg.encode("utf-8", "ignore")
log(msg)
def Debug(msg, force=False):
if debug == 'true' or force:
try:
print "[torrenter] " + msg
except UnicodeEncodeError:
print "[torrenter] " + msg.encode("utf-8", "ignore")
debug(msg, True)
def Info(msg, force=False):
if debug == 'true' or force:
try:
print "[torrenter] " + msg
except UnicodeEncodeError:
print "[torrenter] " + msg.encode("utf-8", "ignore")
debug(msg, True)
def Warn(msg, force=False):
if debug == 'true' or force:
try:
print "[torrenter] " + msg
except UnicodeEncodeError:
print "[torrenter] " + msg.encode("utf-8", "ignore")
debug(msg, True)
+5 -4
View File
@@ -4,6 +4,7 @@ import time
import urllib
from cache import Cache
from functions import log
import tmdb
@@ -154,9 +155,9 @@ class TmDb:
movie_id = None
for name in search:
movies = tmdb.Movies(title=name, year=year, limit=True).get_ordered_matches()
print '********************************************************'
log('********************************************************')
try:
print str(isAsciiString(movies[1]['title']))
log(str(isAsciiString(movies[1]['title'])))
except:
pass
@@ -320,7 +321,7 @@ def scoreMediaTitleMatch(mediaName, mediaAltTitle, mediaYear, title, original_ti
def get_best(Data, search, year):
print '****** Finding TMDB: ' + str(search) + '; year ' + str(year)
log('****** Finding TMDB: ' + str(search) + '; year ' + str(year))
shows = []
itemIndex = -1
if len(search) == 2:
@@ -349,7 +350,7 @@ def get_best(Data, search, year):
release_date=str(show.get('release_date').split('-')[0])
else:
release_date='0'
print (' ... %d: id="%s", name="%s", year="%s", score="%d".' %
log(' ... %d: id="%s", name="%s", year="%s", score="%d".' %
(i, str(show['id']), show.get('title').encode('utf-8'), release_date,
s['rate']))
if shows:
+4 -3
View File
@@ -10,6 +10,7 @@ import zipfile
import xbmc
from net import HTTP
from cache import Cache
from functions import log
class TvDb:
@@ -82,7 +83,7 @@ class TvDb:
# print url
response = self.http.fetch(url, headers=self.headers, download=os.path.join(dirname, 'movie.zip'), timeout=20)
if response.error:
print "ERRRRRROR! " + str(response.error)
log("ERRRRRROR! " + str(response.error))
self._movie_clear(dirname)
return False, None
@@ -411,7 +412,7 @@ def get_best(Data, search, year):
shows.append({'rate': rate, 'id': id})
shows = sorted(shows, key=lambda x: x['rate'], reverse=True)
print '********************** TheTVDB ******************************'
print str(shows) + str(mediaName.encode('utf-8'))
log('********************** TheTVDB ******************************')
log(str(shows) + str(mediaName.encode('utf-8')))
if shows:
return shows[0]