diff --git a/comicinfoxml.py b/comicinfoxml.py index 1a5b777..d658d98 100644 --- a/comicinfoxml.py +++ b/comicinfoxml.py @@ -182,8 +182,12 @@ class ComicInfoXml: node = ET.SubElement(root, 'Editor') node.text = utils.listToString( credit_editor_list ) - # !!!ATB todo: loop and add the page entries under pages node - #pages = ET.SubElement(root, 'Pages') + # loop and add the page entries under pages node + if len( md.pages ) > 0: + pages_node = ET.SubElement(root, 'Pages') + for page_dict in md.pages: + page_node = ET.SubElement(pages_node, 'Page') + page_node.attrib = page_dict # self pretty-print self.indent(root) @@ -261,9 +265,13 @@ class ComicInfoXml: for name in n.text.split(','): metadata.addCredit( name.strip(), "Cover" ) - #!!! ATB parse page data now - + # parse page data now + pages_node = root.find( "Pages" ) + if pages_node is not None: + for page in pages_node: + metadata.pages.append( page.attrib ) + print metadata.pages metadata.isEmpty = False diff --git a/genericmetadata.py b/genericmetadata.py index 2283ee1..4ea0bb7 100644 --- a/genericmetadata.py +++ b/genericmetadata.py @@ -40,15 +40,16 @@ class PageType: Other = "Other" Deleted = "Deleted" +""" class PageInfo: - SeqNum = 0 - Type = PageType.FrontCover + Image = 0 + Type = PageType.Story DoublePage = False ImageSize = 0 Key = "" ImageWidth = 0 ImageHeight = 0 - +""" class GenericMetadata: diff --git a/options.py b/options.py index 49ff03d..2e5b768 100644 --- a/options.py +++ b/options.py @@ -47,6 +47,8 @@ If no options are given, {0} will run in windowed mode -p, --print Print out tag info from file. Specify type (via -t) to get only info of that tag type + --raw With -p, will print out the raw tag block(s) + from the file -d, --delete Deletes the tag block of specified type (via -t) -s, --save Save out tags as specified type (via -t) Must specify also at least -o, -p, or -m diff --git a/todo.txt b/todo.txt index d096a4a..3a3f99e 100644 --- a/todo.txt +++ b/todo.txt @@ -1,7 +1,9 @@ ----------------- Features ---------------- - + +Raw Tag Block Window + Settings/Preferences Dialog Remove API Key Add clear cache @@ -16,14 +18,6 @@ save Last "Open" folder (include dragged) Add class for warning/info messages with "Don't show again" checkbox. Add list of these flags to settings -TaggerWindow entry fields - Special tabbed Dialog needed for: - Pages Info - maybe a custom painted widget - At minimum, preserve the page data - -File rename - -Dialog?? - Style sheets for windows/mac/linux Better stripping of html from CV text @@ -60,6 +54,14 @@ Lots of error checking Future ------------ +File rename + -Dialog?? + + +TaggerWindow entry fields + Special tabbed Dialog needed for: + Pages Info - maybe a custom painted widget + CLI write a log for multiple file processing override abort on low confidence flag