dokuwikixmlrpc icon indicating copy to clipboard operation
dokuwikixmlrpc copied to clipboard

Please add parameters to getPagelist

Open chang-zhao opened this issue 2 years ago • 0 comments

Requesting dw.pagelist(':') gives all the pages, maybe many thousands. Users may be interested in limiting the depth of search:

dw.pagelist(':', {'depth': 1})

but that gives

TypeError: DokuWikiClient.pagelist() takes 2 positional arguments but 3 were given

It's reasonable to add the second parameter here:

    def pagelist(self, namespace):
        """Lists all pages within a given namespace."""
        return self._xmlrpc.dokuwiki.getPagelist(namespace, {})

Kind of

    def pagelist(self, namespace, opts = {'depth': 0, 'hash': False, 'skipacl': False}):
        """Lists all pages within a given namespace."""
        return self._xmlrpc.dokuwiki.getPagelist(namespace, opts)

chang-zhao avatar May 22 '22 15:05 chang-zhao