r70988 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70987‎ | r70988 | r70989 >
Date:20:38, 12 August 2010
Author:daniel
Status:deferred
Tags:
Comment:
support more flags, support callable handlers
Modified paths:
  • /trunk/extensions/XMLRC/client/rcclient.py (modified) (history)

Diff [purge]

Index: trunk/extensions/XMLRC/client/rcclient.py
@@ -37,7 +37,7 @@
3838 using item syntax (e.g. rc['revid']) or attribute syntax (e.g. rc.revid).
3939 Well known attributes are converted to the appropriate type automatically. """
4040
41 - flags = set( ( 'anon', 'bot', 'minor', ) )
 41+ flags = set( ( 'anon', 'bot', 'minor', 'redirect', 'patrolled' ) )
4242 numerics = set( ( 'rcid', 'pageid', 'revid', 'old_revid', 'newlen', 'oldlen', 'ns', ) )
4343 times = set( ( 'timestamp', ) )
4444
@@ -98,7 +98,7 @@
9999
100100 props = ( 'rcid', 'timestamp', 'type', 'ns', 'title', 'pageid', 'revid', 'old_revid',
101101 'user', 'oldlen', 'newlen', 'comment', 'logid', 'logtype', 'logaction',
102 - 'anon', 'bot', 'minor' )
 102+ 'anon', 'bot', 'minor', 'redirect', 'patrolled' )
103103
104104 def process(self, rc):
105105 print "-----------------------------------------------"
@@ -195,7 +195,10 @@
196196
197197 def dispatch_rc(self, rc):
198198 for h in self.handlers:
199 - h.process( rc )
 199+ if callable( h ):
 200+ h( rc )
 201+ else:
 202+ h.process( rc )
200203
201204 def add_handler(self, handler):
202205 self.handlers.append( handler )

Status & tagging log