mercurial/templater.py
changeset 2199 f1986a61ccff
parent 2191 c2e43535d4d1
child 2201 f15056b29472
equal deleted inserted replaced
2198:564034552f7f 2199:f1986a61ccff
   497         except KeyError, inst:
   497         except KeyError, inst:
   498             raise util.Abort(_("%s: no key named '%s'") % (self.t.mapfile,
   498             raise util.Abort(_("%s: no key named '%s'") % (self.t.mapfile,
   499                                                            inst.args[0]))
   499                                                            inst.args[0]))
   500         except SyntaxError, inst:
   500         except SyntaxError, inst:
   501             raise util.Abort(_('%s: %s') % (self.t.mapfile, inst.args[0]))
   501             raise util.Abort(_('%s: %s') % (self.t.mapfile, inst.args[0]))
       
   502 
       
   503 class stringio(object):
       
   504     '''wrap cStringIO for use by changeset_templater.'''
       
   505     def __init__(self):
       
   506         self.fp = cStringIO.StringIO()
       
   507 
       
   508     def write(self, *args):
       
   509         for a in args:
       
   510             self.fp.write(a)
       
   511 
       
   512     write_header = write
       
   513 
       
   514     def getvalue(self):
       
   515         return self.fp.getvalue()