Mercurial > public > mercurial-scm > hg-stable
diff 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 |
line wrap: on
line diff
--- a/mercurial/templater.py Thu May 04 12:00:45 2006 -0700 +++ b/mercurial/templater.py Thu May 04 12:02:32 2006 -0700 @@ -499,3 +499,17 @@ inst.args[0])) except SyntaxError, inst: raise util.Abort(_('%s: %s') % (self.t.mapfile, inst.args[0])) + +class stringio(object): + '''wrap cStringIO for use by changeset_templater.''' + def __init__(self): + self.fp = cStringIO.StringIO() + + def write(self, *args): + for a in args: + self.fp.write(a) + + write_header = write + + def getvalue(self): + return self.fp.getvalue()