Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import zipfile
import xml.etree.ElementTree as etree
class ComicInfoXmlHandler():
def __init__(self):
self.series = ''
self.number = ''
self.title = '' = ''
self.member = ''
self.genre = ''
self.year = ''
self.month = '' = ''
self.fromxml = ['Series', 'Number', 'Title', 'Writer', 'Penciller', 'Genre', 'Year', 'Month', 'Day']
self.todisplay = [self.series, self.number, self.title,, self.member, self.genre, self.year, self.month,]
def get_info(self, filepath):
with zipfile.ZipFile(filepath, mode='r',) as z:
comicinfoxml ='ComicInfo.xml', mode='r')
infoTree = etree.parse(comicinfoxml)
root = infoTree.getroot()
for i in range(len(self.fromxml)):
self.todisplay[i] = root.findtext(self.fromxml[i])
for i in range(len(self.todisplay)):
if __name__ == '__main__':
cix = ComicInfoXmlHandler()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment