comparison mercurial/hgweb/webutil.py @ 38243:06d11cd90516

templater: promote getmember() to an interface of wrapped types
author Yuya Nishihara <yuya@tcha.org>
date Wed, 21 Mar 2018 11:30:21 +0900
parents f715faeaceee
children 688fbb758ba9
comparison
equal deleted inserted replaced
38242:12b6ee9e88f3 38243:06d11cd90516
711 self._vars[key] = value 711 self._vars[key] = value
712 712
713 def __copy__(self): 713 def __copy__(self):
714 return sessionvars(copy.copy(self._vars), self._start) 714 return sessionvars(copy.copy(self._vars), self._start)
715 715
716 def getmember(self, context, mapping, key):
717 return self._vars.get(key)
718
716 def itermaps(self, context): 719 def itermaps(self, context):
717 separator = self._start 720 separator = self._start
718 for key, value in sorted(self._vars.iteritems()): 721 for key, value in sorted(self._vars.iteritems()):
719 yield {'name': key, 722 yield {'name': key,
720 'value': pycompat.bytestr(value), 723 'value': pycompat.bytestr(value),