Ticket #1592 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

[Patch] Wiki delete page or version XML-RPC method

Reported by: osimons Assigned to: athomas
Priority: normal Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

Needed this for myself, but really I think it belongs in the base XML-RPC funtionality as it is also directly supported in the Trac wiki model.

Here is the essential extract of the code I am using:

...
class WikiRPC(Component):
...
    def xmlrpc_methods(self):
...
        yield ('WIKI_DELETE', ((bool, str),(bool, str, int)), self.deletePage)
...
    # Internal methods / handlers
...
    def deletePage(self, req, name, version=None):
        """ Delete a Wiki page (all versions) or a specific version by
        including an optional version number. Attachments will also be
        deleted if page no longer exists. Returns True for success. """
        try:
            wp = WikiPage(self.env, name, version)
            wp.delete(version)
            return True
        except:
            return False
...

Attachments

Change History

06/30/07 14:06:16 changed by anonymous

Oh, that would be surely useful. I have already written two scripts that interact with Trac by scraping the HTML pages (one of them is over 300 lines of PHP). I just found out about XmlRpcPlugin.

Anyway, one of those scripts was to delete spam (spambot had added links to every single page on the wiki), and I couldn't have used XmlRpcPlugin anyway, since it lacks "delete version" functionality.

09/03/07 04:43:27 changed by athomas

  • status changed from new to closed.
  • resolution set to fixed.

(In [2611]) Added wiki.deletePage(), thanks to osimons. Closes #1592.


Add/Change #1592 ([Patch] Wiki delete page or version XML-RPC method)




Change Properties
Action