Modify ↓
Opened 18 years ago
Closed 17 years ago
#1592 closed enhancement (fixed)
[Patch] Wiki delete page or version XML-RPC method
Reported by: | osimons | Owned by: | Alec Thomas |
---|---|---|---|
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 (0)
Change History (2)
comment:1 Changed 18 years ago by
comment:2 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
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.