Commit b2c9c824 authored by Mattia Bondanza's avatar Mattia Bondanza

Corrected a bug with unicode char.

parent bc2ca3ab
......@@ -31,7 +31,7 @@ class dbAnalysis:
for book in books:
info = self.get_info( book[0] )
if info is not None:
print '{}\t\x1b[33mAuthor: {}\t\x1b[32mTitle: {}\x1b[0m'.format(os.path.basename( book[1].encode('UTF-8') ), info['auth'], info['title'] )
print '{}\t\x1b[33mAuthor: {}\t\x1b[32mTitle: {}\x1b[0m'.format(os.path.basename( book[1].encode('UTF-8') ), info['auth'].encode('UTF-8') , info['title'].encode('UTF-8') )
else:
print '{}\t\x1b[31mNo data found.\x1b[0m'.format( os.path.basename( book[1].encode('UTF-8') ) )
......@@ -55,6 +55,6 @@ class dbAnalysis:
print "Found metadata for {} books (analyzed {}, {} %).ISBN+ found {} % of the total metadatas, OpenLibrary {} %.".format( total, len( books ), 100.0 * total/len( books ), 100.0*isbnPlus/(isbnPlus+OL), 100.0*isbnPlus/(isbnPlus+OL) )
db = dbAnalysis('/mnt/liberalibri/.bao_sqlite.db')
db = dbAnalysis('/home/mattia/Nextcloud/Universita/Libreria/.bao_sqlite.db')
db.pretty_print()
db.statistics()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment