##// END OF EJS Templates
hgweb: lift {sessionvars} to a wrapped type...
Yuya Nishihara -
r37714:9ac3e97b default
parent child Browse files
Show More
@@ -651,7 +651,7 b' def diffstat(tmpl, ctx, statgen, parity)'
651 'parity': next(parity),
651 'parity': next(parity),
652 })
652 })
653
653
654 class sessionvars(object):
654 class sessionvars(templateutil.wrapped):
655 def __init__(self, vars, start='?'):
655 def __init__(self, vars, start='?'):
656 self._start = start
656 self._start = start
657 self._vars = vars
657 self._vars = vars
@@ -665,7 +665,7 b' class sessionvars(object):'
665 def __copy__(self):
665 def __copy__(self):
666 return sessionvars(copy.copy(self._vars), self._start)
666 return sessionvars(copy.copy(self._vars), self._start)
667
667
668 def __iter__(self):
668 def itermaps(self, context):
669 separator = self._start
669 separator = self._start
670 for key, value in sorted(self._vars.iteritems()):
670 for key, value in sorted(self._vars.iteritems()):
671 yield {'name': key,
671 yield {'name': key,
@@ -674,6 +674,16 b' class sessionvars(object):'
674 }
674 }
675 separator = '&'
675 separator = '&'
676
676
677 def join(self, context, mapping, sep):
678 # could be '{separator}{name}={value|urlescape}'
679 raise error.ParseError(_('not displayable without template'))
680
681 def show(self, context, mapping):
682 return self.join(context, '')
683
684 def tovalue(self, context, mapping):
685 return self._vars
686
677 class wsgiui(uimod.ui):
687 class wsgiui(uimod.ui):
678 # default termwidth breaks under mod_wsgi
688 # default termwidth breaks under mod_wsgi
679 def termwidth(self):
689 def termwidth(self):
General Comments 0
You need to be logged in to leave comments. Login now