2012-08-06, 16:31
For what it's worth, I did some trial and error debugging of the python script by adding logs here and there...
Take a look at this, from dbupdate.py, starting at line 528:
This function is always called, except the FIRST scraper is 'local artwork' (see lines 225,238). The function iterates through all the scrapers you give it. So it starts out with local nfo, which works fine. But it's the local artwork one that screws up. At line 544 (for scraper in scraperSite.scrapers:), it gives the 'NoneType' object is not iterable exception. I'm guessing this has to do with the fact that 'local artwork' is kind of a fake scraper, and it doesn't scrape anything anyway. I'm not sure why the whole thing is bypassed if the first scraper is 'local artwork', but I'm guessing it's somewhere in here that we need to skip something for the 'local artwork' scraper.
<Edit: Removed shitty code that didn't work to avoid confusion :P >
Edit: It actually doesn't work at all... but at least it doesn't throw out exceptions :P The local artwork is just ignored completely, though
Edit2: Stumbled upon this in the code:
if(isLocalArtwork):
Logutil.log('scraper == "local artwork": ' +str(isLocalArtwork), util.LOG_LEVEL_INFO)
Logutil.log('Can\'t use "local artwork" scraper if game is not already imported. Use another scraper first.', util.LOG_LEVEL_INFO)
So I'm guessing local artwork is not meant to be used on an initial import... I'll try importing with 2 runs.
Take a look at this, from dbupdate.py, starting at line 528:
Code:
def useSingleScrapers(self, result, romCollection, startIndex, gamenameFromFile, foldername, firstRomfile, fuzzyFactor, updateOption, gui, progDialogRCHeader, fileCount):
filecrc = ''
artScrapers = {}
for i in range(startIndex, len(romCollection.scraperSites)):
scraperSite = romCollection.scraperSites[i]
gui.writeMsg(progDialogRCHeader, "Import game: " +gamenameFromFile, scraperSite.name + " - downloading info", fileCount)
Logutil.log('using scraper: ' +scraperSite.name, util.LOG_LEVEL_INFO)
if(scraperSite.searchGameByCRC and filecrc == ''):
filecrc = self.getFileCRC(firstRomfile)
urlsFromPreviousScrapers = []
doContinue = False
for scraper in scraperSite.scrapers:
pyScraper = PyScraper()
result, urlsFromPreviousScrapers, doContinue = pyScraper.scrapeResults(result, scraper, urlsFromPreviousScrapers, gamenameFromFile, foldername, filecrc, firstRomfile, fuzzyFactor, updateOption, romCollection, self.Settings)
if(doContinue):
continue
#Find Filetypes and Scrapers for Art Download
if(len(result) > 0):
for path in romCollection.mediaPaths:
thumbKey = 'Filetype' + path.fileType.name
if(len(self.resolveParseResult(result, thumbKey)) > 0):
if((thumbKey in artScrapers) == 0):
artScrapers[thumbKey] = scraperSite.name
return result, artScrapers
<Edit: Removed shitty code that didn't work to avoid confusion :P >
Edit: It actually doesn't work at all... but at least it doesn't throw out exceptions :P The local artwork is just ignored completely, though
Edit2: Stumbled upon this in the code:
if(isLocalArtwork):
Logutil.log('scraper == "local artwork": ' +str(isLocalArtwork), util.LOG_LEVEL_INFO)
Logutil.log('Can\'t use "local artwork" scraper if game is not already imported. Use another scraper first.', util.LOG_LEVEL_INFO)
So I'm guessing local artwork is not meant to be used on an initial import... I'll try importing with 2 runs.