I'm following some examples from the standalone CT that I found
http://comictagger.forumotion.com/t80-p-t-m-combination
https://github.com/davide-romanini/comi ... op/scripts
Here's my code based on some of the above.
Code: Select all
#!/usr/bin/python
from comictaggerlib.settings import *
from comictaggerlib.comicarchive import *
def main():
utils.fix_output_encoding()
settings = ComicTaggerSettings()
if len(sys.argv) < 3:
print >> sys.stderr, "Usage: {0} [comicfile]".format(
sys.argv[0])
return
filename = sys.argv[1]
if not os.path.exists(filename):
print >> sys.stderr, filename + ": not found!"
return
ca = ComicArchive(filename, settings)
if not ca.seemsToBeAComicArchive():
print >> sys.stderr, "Sorry, but " + \
filename + " is not a comic archive!"
return
if ca.hasMetadata( style ):
md = ca.readMetadata( style )
print "{0} #{1} ({2})".format(md.series, md.issue, md.year)
if __name__ == '__main__':
main()
Code: Select all
Script raised an unhandled exception: coercing to Unicode: need string or buffer, NoneType found
Traceback (most recent call last):
File "/app/mylar/lib/comictaggerlib/options.py", line 233, in launch_script
script.main()
File "/comics/ComicTagger-AlternateSeries/alternate-series.py", line 22, in main
ca = ComicArchive(filename, settings)
File "/app/mylar/lib/comictaggerlib/comicapi/comicarchive.py", line 648, in __init__
with open(fname, 'rb') as fd:
TypeError: coercing to Unicode: need string or buffer, NoneType found