hgweb: prefix private variables of sessionvars with '_'
authorYuya Nishihara <yuya@tcha.org>
Sun, 01 Apr 2018 23:03:02 +0900
changeset 37694 d14dbf46e5c7
parent 37693 31a0d47d69b3
child 37695 570a4426c5b8
hgweb: prefix private variables of sessionvars with '_'
mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py	Fri Apr 13 16:32:33 2018 -0400
+++ b/mercurial/hgweb/webutil.py	Sun Apr 01 23:03:02 2018 +0900
@@ -653,17 +653,17 @@
 
 class sessionvars(object):
     def __init__(self, vars, start='?'):
-        self.start = start
-        self.vars = vars
+        self._start = start
+        self._vars = vars
     def __getitem__(self, key):
-        return self.vars[key]
+        return self._vars[key]
     def __setitem__(self, key, value):
-        self.vars[key] = value
+        self._vars[key] = value
     def __copy__(self):
-        return sessionvars(copy.copy(self.vars), self.start)
+        return sessionvars(copy.copy(self._vars), self._start)
     def __iter__(self):
-        separator = self.start
-        for key, value in sorted(self.vars.iteritems()):
+        separator = self._start
+        for key, value in sorted(self._vars.iteritems()):
             yield {'name': key,
                    'value': pycompat.bytestr(value),
                    'separator': separator,