self.posx = posx
def tag_start(self):
return "frame start"
- return '<table border="0" width="%d"><tr><td width="%d"> </td><td>' % (self.width+self.posx,self.posx)
def tag_end(self):
return True
def tag_stop(self):
return "frame stop"
- return '</td></tr></table><br/>'
def tag_mergeable(self):
return False
def tag_start(self):
return "draw string \"%s\" @(%d,%d)..\n" %("txt",self.posx,self.posy)
- self.pos.sort()
- res = '\\table ...'
- posx = 0
- i = 0
- for (x,y,align,txt, style, fs) in self.pos:
- if align=="left":
- pos2 = len(txt)*fs
- res+='<td width="%d"></td><td style="%s" width="%d">%s</td>' % (x - posx, style, pos2, txt)
- posx = x+pos2
- if align=="right":
- res+='<td width="%d" align="right" style="%s">%s</td>' % (x - posx, style, txt)
- posx = x
- if align=="center":
- res+='<td width="%d" align="center" style="%s">%s</td>' % ((x - posx)*2, style, txt)
- posx = 2*x-posx
- i+=1
- res+='\\table end'
- return res
+
def merge(self, ds):
self.pos+=ds.pos
def tag_start(self):
return "draw lines..\n"
- if self.ok:
- return '<table border="0" cellpadding="0" cellspacing="0" width="%d"><tr><td width="%d"></td><td><hr width="100%%" style="margin:0px; %s"></td></tr></table>' % (self.posx+self.width,self.posx,self.style)
- else:
- return ''
class _rml_stylesheet(object):
def __init__(self, stylesheet, doc):
def end(self):
return "template end\n"
- result = ''
- while not self.loop:
- result += self.frame_start()
- result += self.frame_stop()
- return result
class _rml_doc(object):
def __init__(self, node, localcontext=None, images=None, path='.', title=None):