Decouple comicarchive from settings

git-svn-id: http://comictagger.googlecode.com/svn/trunk@703 6c5673fe-1810-88d6-992b-cd32ca31540c
This commit is contained in:
beville@gmail.com 2014-04-08 07:07:39 +00:00
parent 0adfc9beb3
commit c0f2e2f771
7 changed files with 11 additions and 11 deletions

View File

@ -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:

View File

@ -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 )))

View File

@ -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 )))

View File

@ -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 ):

View File

@ -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 )

View File

@ -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 )

View File

@ -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