Allow the method autodocumenter (.. autofunction) to work without a Service parent (ie without a WSRoot). Added the path & method parameters that NOT considered for now.
This commit is contained in:
		@@ -65,6 +65,7 @@ def wsexpose(*args, **kwargs):
 | 
			
		||||
        pecan_xml_decorate(callfunction)
 | 
			
		||||
        pecan_json_decorate(callfunction)
 | 
			
		||||
        pecan.util._cfg(callfunction)['argspec'] = inspect.getargspec(f)
 | 
			
		||||
        callfunction._wsme_definition = funcdef
 | 
			
		||||
        return callfunction
 | 
			
		||||
 | 
			
		||||
    return decorate
 | 
			
		||||
 
 | 
			
		||||
@@ -334,10 +334,14 @@ class FunctionDocumenter(autodoc.MethodDocumenter):
 | 
			
		||||
    objtype = 'function'
 | 
			
		||||
    priority = 1
 | 
			
		||||
 | 
			
		||||
    option_spec = {
 | 
			
		||||
        'path': directives.unchanged,
 | 
			
		||||
        'method': directives.unchanged
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @classmethod
 | 
			
		||||
    def can_document_member(cls, member, membername, isattr, parent):
 | 
			
		||||
        return isinstance(parent, ServiceDocumenter) \
 | 
			
		||||
            and wsme.api.iswsmefunction(member)
 | 
			
		||||
        return wsme.api.iswsmefunction(member)
 | 
			
		||||
 | 
			
		||||
    def import_object(self):
 | 
			
		||||
        ret = super(FunctionDocumenter, self).import_object()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user