XZise has uploaded a new change for review.
https://gerrit.wikimedia.org/r/175648
Change subject: [FIX] Logevents: Support automatic selection
......................................................................
[FIX] Logevents: Support automatic selection
With 675c29ee5771a32e99512082ccf0c734f32b017f the log event constructors
require the site parameter which wasn't used in the automatic log type
selector.
Change-Id: Ice0b389654228cf6aad72877d2fc286e79e28ad2
---
M pywikibot/logentries.py
1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/48/175648/1
diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py
index 5b35cd8..8bfb0a6 100644
--- a/pywikibot/logentries.py
+++ b/pywikibot/logentries.py
@@ -279,7 +279,8 @@
else:
# Bind a Class object to self._creator:
# When called, it will initialize a new object of that class
- self._creator = LogEntryFactory._getEntryClass(logtype)
+ logclass = LogEntryFactory._getEntryClass(logtype)
+ self._creator = lambda data: logclass(data, self._site)
def create(self, logdata):
"""
@@ -290,7 +291,7 @@
@return: LogEntry object representing logdata
"""
- return self._creator(logdata, self._site)
+ return self._creator(logdata)
@staticmethod
def _getEntryClass(logtype):
@@ -315,7 +316,7 @@
"""
try:
logtype = logdata['type']
- return LogEntryFactory._getEntryClass(logtype)(logdata)
+ return LogEntryFactory._getEntryClass(logtype)(logdata, self._site)
except KeyError:
pywikibot.debug(u"API log entry received:\n" + logdata,
_logger)
--
To view, visit https://gerrit.wikimedia.org/r/175648
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice0b389654228cf6aad72877d2fc286e79e28ad2
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits