def _resourceof( self, request, viewd ): """For resolved view ``viewd``, fetch the resource-callable.""" res = viewd['resource'] self.pa.logdebug( "%r resource callable: %r " % (request.uri, res) ) if isinstance( res, str ) and isplugin( res ) : return self.qp( IHTTPResource, res ) elif isinstance( res, str ) : return h.string_import( res ) else : return res
def _viewof( self, request, name, viewd ): """For resolved view ``viewd``, fetch the view-callable.""" v = viewd['view'] self.pa.logdebug( "%r view callable: %r " % (request.uri, v) ) if isinstance(v, str) and isplugin(v) : view = self.qp( IHTTPView, v, name, viewd ) elif isinstance( v, str ): view = h.string_import( v ) else : view = v return getattr( view, viewd['attr'] ) if viewd['attr'] else view