Mercurial > hg
comparison mercurial/templater.py @ 2199:f1986a61ccff
move stringio class from bugzilla extension into templater module.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Thu, 04 May 2006 12:02:32 -0700 |
parents | c2e43535d4d1 |
children | f15056b29472 |
comparison
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() |