From 42feae53ddb7b018c69c05bb199267e4de1b601d Mon Sep 17 00:00:00 2001 From: "beville@gmail.com" Date: Tue, 12 Feb 2013 18:29:29 +0000 Subject: [PATCH] caught some small errors exposed by calling via script git-svn-id: http://comictagger.googlecode.com/svn/trunk@485 6c5673fe-1810-88d6-992b-cd32ca31540c --- comictaggerlib/comicvinecacher.py | 2 +- comictaggerlib/issueidentifier.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/comictaggerlib/comicvinecacher.py b/comictaggerlib/comicvinecacher.py index 4fe0a9f..b94d236 100644 --- a/comictaggerlib/comicvinecacher.py +++ b/comictaggerlib/comicvinecacher.py @@ -361,7 +361,7 @@ class ComicVineCacher: row = cur.fetchone() details = dict() - if row[0] is None : + if row is None or row[0] is None : details['image_url'] = None details['thumb_image_url'] = None details['publish_month'] = None diff --git a/comictaggerlib/issueidentifier.py b/comictaggerlib/issueidentifier.py index 04f0087..11f54df 100644 --- a/comictaggerlib/issueidentifier.py +++ b/comictaggerlib/issueidentifier.py @@ -82,6 +82,7 @@ class IssueIdentifier: self.coverUrlCallback = None self.search_result = self.ResultNoMatches self.cover_page_index = 0 + self.cancel = False def setScoreMinThreshold( self, thresh ): self.min_score_thresh = thresh @@ -223,7 +224,7 @@ class IssueIdentifier: if newline: self.output_function("\n") - def getIssueCoverMatchScore( self, comicVine, issue_id, localCoverHashList, useRemoteAlternates = False , use_log=True): + def getIssueCoverMatchScore( self, comicVine, issue_id, localCoverHashList, useRemoteAlternates = False , useLog=True): # localHashes is a list of pre-calculated hashs. # useRemoteAlternates - indicates to use alternate covers from CV @@ -279,9 +280,9 @@ class IssueIdentifier: if self.cancel == True: raise IssueIdentifierCancelled - if use_log and useRemoteAlternates: + if useLog and useRemoteAlternates: self.log_msg( "[{0} alt. covers]".format(len(remote_cover_list)-1), False ) - if use_log: + if useLog: self.log_msg( "[ ", False ) score_list = [] @@ -294,7 +295,7 @@ class IssueIdentifier: score_item['url'] = remote_cover_item['url'] score_item['hash'] = remote_cover_item['hash'] score_list.append( score_item ) - if use_log: + if useLog: self.log_msg( "{0} ".format(score), False ) if score <= self.strong_score_thresh: @@ -304,7 +305,7 @@ class IssueIdentifier: if done: break - if use_log: + if useLog: self.log_msg( " ]", False ) best_score_item = min(score_list, key=lambda x:x['score'])