Dolda2000 GitWeb
/
wrw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4eca111
)
Added a SP formatter function to output mere fragments of documents.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 5 Jul 2012 04:23:45 +0000
(06:23 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 5 Jul 2012 04:23:45 +0000
(06:23 +0200)
wrw/sp/util.py
patch
|
blob
|
blame
|
history
diff --git
a/wrw/sp/util.py
b/wrw/sp/util.py
index
a913e74
..
0b31c65
100644
(file)
--- a/
wrw/sp/util.py
+++ b/
wrw/sp/util.py
@@
-140,6
+140,10
@@
class formatter(object):
def output(cls, out, el, *args, **kw):
cls(out=out, root=el, *args, **kw).start()
+ @classmethod
+ def fragment(cls, out, el, *args, **kw):
+ cls(out=out, root=el, *args, **kw).element(el)
+
def update(self, **ch):
ret = type(self).__new__(type(self))
ret.__dict__.update(self.__dict__)