reportlab/platypus/paraparser.py
changeset 2368 791a362e9cae
parent 2341 78400fba14ad
child 2369 f3cc620c14ed
equal deleted inserted replaced
2367:ff834913c5e2 2368:791a362e9cae
   612         try:
   612         try:
   613             id = attr['id']
   613             id = attr['id']
   614         except KeyError:
   614         except KeyError:
   615             id = None
   615             id = None
   616         try:
   616         try:
   617             base = math.atoi(attr['base'])
   617             base = int(attr['base'])
   618         except:
   618         except:
   619             base=0
   619             base=0
   620         self._seq.reset(id, base)
   620         self._seq.reset(id, base)
   621 
   621 
   622     def end_seqreset(self):
   622     def end_seqreset(self):
   623         pass
   623         pass
   624 
   624 
       
   625     def start_seqchain(self, attr):
       
   626         try:
       
   627             order = attr['order']
       
   628         except KeyError:
       
   629             order = ''
       
   630         order = order.split()
       
   631         seq = self._seq
       
   632         for p,c in zip(order[:-1],order[1:]):
       
   633             seq.chain(p, c)
       
   634     end_seqchain = end_seqreset
       
   635 
       
   636     def start_seqformat(self, attr):
       
   637         try:
       
   638             id = attr['id']
       
   639         except KeyError:
       
   640             id = None
       
   641         try:
       
   642             value = attr['value']
       
   643         except KeyError:
       
   644             value = '1'
       
   645         self._seq.setFormat(id,value)
       
   646     end_seqformat = end_seqreset
       
   647 
   625     # AR hacking in aliases to allow the proper casing for RML.
   648     # AR hacking in aliases to allow the proper casing for RML.
   626     # the above ones should be deprecated over time. 2001-03-22
   649     # the above ones should be deprecated over time. 2001-03-22
   627     def start_seqDefault(self, attr):
   650     start_seqDefault = start_seqdefault
   628         self.start_seqdefault(attr)
   651     end_seqDefault = end_seqdefault
   629 
   652     start_seqReset = start_seqreset
   630     def end_seqDefault(self):
   653     end_seqReset = end_seqreset
   631         self.end_seqdefault()
   654     start_seqChain = start_seqchain
   632 
   655     end_seqChain = end_seqchain
   633     def start_seqReset(self, attr):
   656     start_seqFormat = start_seqformat
   634         self.start_seqreset(attr)
   657     end_seqFormat = end_seqformat
   635 
       
   636     def end_seqReset(self):
       
   637         self.end_seqreset()
       
   638 
       
   639 
   658 
   640     def start_seq(self, attr):
   659     def start_seq(self, attr):
   641         #if it has a template, use that; otherwise try for id;
   660         #if it has a template, use that; otherwise try for id;
   642         #otherwise take default sequence
   661         #otherwise take default sequence
   643         if attr.has_key('template'):
   662         if attr.has_key('template'):