def __init__(self, fileName): self.outfile = open(fileName, "w") self.svg = SvgWriter(self.outfile) self.svg.beginFormat('210mm', '297mm')
import sys import re from lib.SvgWriter import SvgWriter from lib.Token import TokenDB, Token from lib.TokenWriter import writeTokenFront, writeTokenBack if len(sys.argv) < 3: sys.exit("Usage: genLibrary TokenDB.txt SingelView.svg") print("Create svg library...") #start svg file svgfile = open(sys.argv[2], "w") svg = SvgWriter(svgfile) svg.begin() svg.beginDefs() #the function to write the definitions def doit(token): #frontside writeTokenFront(svg, token) #backside writeTokenBack(svg, token) print("{0}-{1}-{2}-{3}".format(token.idno, token.directions, token.attack, token.defense))