Decouple comicarchive from settings
git-svn-id: http://comictagger.googlecode.com/svn/trunk@703 6c5673fe-1810-88d6-992b-cd32ca31540c
This commit is contained in:
parent
0adfc9beb3
commit
c0f2e2f771
@ -28,7 +28,7 @@ def main():
|
||||
comic_list = []
|
||||
max_name_len = 2
|
||||
for filename in filelist:
|
||||
ca = ComicArchive(filename, settings )
|
||||
ca = ComicArchive(filename, settings.rar_exe_path )
|
||||
if ca.seemsToBeAComicArchive() and ca.hasMetadata( style ):
|
||||
max_name_len = max ( max_name_len, len(filename))
|
||||
fmt_str = u"{{0:{0}}}".format(max_name_len)
|
||||
@ -74,7 +74,7 @@ def main():
|
||||
print "Found {0} duplicate sets".format( len(dupe_set_list))
|
||||
|
||||
for dupe_set in dupe_set_list:
|
||||
ca = ComicArchive(dupe_set[0], settings )
|
||||
ca = ComicArchive(dupe_set[0], settings.rar_exe_path )
|
||||
md = ca.readMetadata( style )
|
||||
print "{0} #{1} ({2})".format( md.series, md.issue, md.year )
|
||||
for filename in dupe_set:
|
||||
|
@ -43,7 +43,7 @@ def main():
|
||||
metadata_list = []
|
||||
max_name_len = 2
|
||||
for filename in filelist:
|
||||
ca = ComicArchive(filename, settings )
|
||||
ca = ComicArchive(filename, settings.rar_exe_path )
|
||||
if ca.hasMetadata( style ):
|
||||
#make a list of paired filenames and metadata objects
|
||||
metadata_list.append((filename, ca.readMetadata( style )))
|
||||
|
@ -66,7 +66,7 @@ def main():
|
||||
comic_list = []
|
||||
max_name_len = 2
|
||||
for filename in filelist:
|
||||
ca = ComicArchive(filename, settings )
|
||||
ca = ComicArchive(filename, settings.rar_exe_path )
|
||||
if ca.seemsToBeAComicArchive() and ca.hasMetadata( style ):
|
||||
|
||||
comic_list.append((filename, ca.readMetadata( style )))
|
||||
|
@ -99,7 +99,7 @@ def main():
|
||||
max_name_len = 2
|
||||
fmt_str = ""
|
||||
for filename in filelist:
|
||||
ca = ComicArchive(filename, settings )
|
||||
ca = ComicArchive(filename, settings.rar_exe_path )
|
||||
# do we care if it already has metadata?
|
||||
if ca.seemsToBeAComicArchive() and not ca.hasMetadata( style ):
|
||||
|
||||
|
@ -51,7 +51,7 @@ def main():
|
||||
modify_list = []
|
||||
for filename in filelist:
|
||||
|
||||
ca = ComicArchive(filename, settings )
|
||||
ca = ComicArchive(filename, settings.rar_exe_path )
|
||||
if (ca.isZip or ca.isRar()) and ca.hasMetadata( style ):
|
||||
md = ca.readMetadata( style )
|
||||
if len(md.pages) != 0:
|
||||
@ -63,7 +63,7 @@ def main():
|
||||
|
||||
#now actually process those files
|
||||
for filename,md in modify_list:
|
||||
ca = ComicArchive(filename, settings )
|
||||
ca = ComicArchive(filename, settings.rar_exe_path )
|
||||
curr_folder = os.path.dirname( filename )
|
||||
curr_subfolder = os.path.join( curr_folder, subfolder_name )
|
||||
|
||||
@ -140,7 +140,7 @@ def main():
|
||||
print "Done!".format(filename)
|
||||
|
||||
# Create a new archive object for the new file, and write the old CIX data, with new page info
|
||||
ca = ComicArchive( filename, settings )
|
||||
ca = ComicArchive( filename, settings.rar_exe_path )
|
||||
md.pages = new_pages
|
||||
ca.writeMetadata( style, md )
|
||||
|
||||
|
@ -52,7 +52,7 @@ def main():
|
||||
fmt_str = u"{{0:{0}}}".format(max_name_len)
|
||||
for filename in filelist:
|
||||
|
||||
ca = ComicArchive(filename, settings )
|
||||
ca = ComicArchive(filename, settings.rar_exe_path )
|
||||
if (ca.seemsToBeAComicArchive()):
|
||||
# Check the images in the file, see if we need to reduce any
|
||||
|
||||
@ -180,7 +180,7 @@ def main():
|
||||
|
||||
# Create a new archive object for the new file, and write the old CIX data, w/o page info
|
||||
if cix_md is not None:
|
||||
ca = ComicArchive( filename, settings )
|
||||
ca = ComicArchive( filename, settings.rar_exe_path )
|
||||
cix_md.pages = []
|
||||
ca.writeCIX( cix_md )
|
||||
|
||||
|
@ -44,7 +44,7 @@ def main():
|
||||
print >> sys.stderr, filename + ": not found!"
|
||||
return
|
||||
|
||||
ca = ComicArchive(filename, settings )
|
||||
ca = ComicArchive(filename, settings.rar_exe_path )
|
||||
if not ca.seemsToBeAComicArchive():
|
||||
print >> sys.stderr, "Sorry, but "+ filename + " is not a comic archive!"
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user