##// END OF EJS Templates
templater: remove redundant member variables from templater class...
Yuya Nishihara -
r38459:3813c6b7 @51 default
parent child Browse files
Show More
@@ -863,17 +863,11 b' class templater(object):'
863 self.cache may be updated later to register additional template
863 self.cache may be updated later to register additional template
864 fragments.
864 fragments.
865 """
865 """
866 if filters is None:
866 allfilters = templatefilters.filters.copy()
867 filters = {}
867 if filters:
868 if defaults is None:
868 allfilters.update(filters)
869 defaults = {}
870 self._filters = templatefilters.filters.copy()
871 self._filters.update(filters)
872 self.defaults = defaults
873 self._resources = resources
874 self._loader = loader(cache, aliases)
869 self._loader = loader(cache, aliases)
875 self._proc = engine(self._loader.load, self._filters, self.defaults,
870 self._proc = engine(self._loader.load, allfilters, defaults, resources)
876 self._resources)
877 self._minchunk, self._maxchunk = minchunk, maxchunk
871 self._minchunk, self._maxchunk = minchunk, maxchunk
878
872
879 @classmethod
873 @classmethod
@@ -894,6 +888,15 b' class templater(object):'
894 def cache(self):
888 def cache(self):
895 return self._loader.cache
889 return self._loader.cache
896
890
891 # for highlight extension to insert one-time 'colorize' filter
892 @property
893 def _filters(self):
894 return self._proc._filters
895
896 @property
897 def defaults(self):
898 return self._proc._defaults
899
897 def load(self, t):
900 def load(self, t):
898 """Get parsed tree for the given template name. Use a local cache."""
901 """Get parsed tree for the given template name. Use a local cache."""
899 return self._loader.load(t)
902 return self._loader.load(t)
General Comments 0
You need to be logged in to leave comments. Login now