# HG changeset patch # User Ludovic Chabant # Date 1507133441 25200 # Node ID 0eca082133541c54edf8b77d988b4605bfd03e31 # Parent 0e88640a994db28a739deb22c6b1cd18c72d54de sources: Give better exception messages when a class is missing a method. diff -r 0e88640a994d -r 0eca08213354 piecrust/sources/base.py --- a/piecrust/sources/base.py Wed Oct 04 09:09:56 2017 -0700 +++ b/piecrust/sources/base.py Wed Oct 04 09:10:41 2017 -0700 @@ -131,23 +131,29 @@ return cache def getContents(self, group): - raise NotImplementedError("'%s' doesn't implement 'getContents'." % - self.__class__) + raise NotImplementedError( + "'%s' doesn't implement 'getContents'." % self.__class__) def getParentGroup(self, item): - raise NotImplementedError() + raise NotImplementedError( + "'%s' doesn't implement 'getParentGroup'." % self.__class__) def getRelatedContents(self, item, relationship): - raise NotImplementedError() + raise NotImplementedError( + "'%s' doesn't implement 'getRelatedContents'." % self.__class__) def findGroup(self, rel_spec): - raise NotImplementedError() + raise NotImplementedError( + "'%s' doesn't implement 'findGroup'." % self.__class__) def findContent(self, route_params): - raise NotImplementedError() + raise NotImplementedError( + "'%s' doesn't implement 'findContent'." % self.__class__) def getSupportedRouteParameters(self): - raise NotImplementedError() + raise NotImplementedError( + "'%s' doesn't implement 'getSupportedRouteParameters'." % + self.__class__) def prepareRenderContext(self, ctx): pass