comparison piecrust/sources/base.py @ 932:0eca08213354

sources: Give better exception messages when a class is missing a method.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 04 Oct 2017 09:10:41 -0700
parents 1d0364614665
children 84fc72a17f7a
comparison
equal deleted inserted replaced
931:0e88640a994d 932:0eca08213354
129 cache.append(c) 129 cache.append(c)
130 self._cache = cache 130 self._cache = cache
131 return cache 131 return cache
132 132
133 def getContents(self, group): 133 def getContents(self, group):
134 raise NotImplementedError("'%s' doesn't implement 'getContents'." % 134 raise NotImplementedError(
135 self.__class__) 135 "'%s' doesn't implement 'getContents'." % self.__class__)
136 136
137 def getParentGroup(self, item): 137 def getParentGroup(self, item):
138 raise NotImplementedError() 138 raise NotImplementedError(
139 "'%s' doesn't implement 'getParentGroup'." % self.__class__)
139 140
140 def getRelatedContents(self, item, relationship): 141 def getRelatedContents(self, item, relationship):
141 raise NotImplementedError() 142 raise NotImplementedError(
143 "'%s' doesn't implement 'getRelatedContents'." % self.__class__)
142 144
143 def findGroup(self, rel_spec): 145 def findGroup(self, rel_spec):
144 raise NotImplementedError() 146 raise NotImplementedError(
147 "'%s' doesn't implement 'findGroup'." % self.__class__)
145 148
146 def findContent(self, route_params): 149 def findContent(self, route_params):
147 raise NotImplementedError() 150 raise NotImplementedError(
151 "'%s' doesn't implement 'findContent'." % self.__class__)
148 152
149 def getSupportedRouteParameters(self): 153 def getSupportedRouteParameters(self):
150 raise NotImplementedError() 154 raise NotImplementedError(
155 "'%s' doesn't implement 'getSupportedRouteParameters'." %
156 self.__class__)
151 157
152 def prepareRenderContext(self, ctx): 158 def prepareRenderContext(self, ctx):
153 pass 159 pass
154 160
155 def onRouteFunctionUsed(self, route_params): 161 def onRouteFunctionUsed(self, route_params):