jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370365 )

Change subject: Add repr string to EventStreams
......................................................................


Add repr string to EventStreams

Change-Id: I0d571f7c9f39b848d67812128d95a21c30b019b4
---
M pywikibot/comms/eventstreams.py
1 file changed, 13 insertions(+), 0 deletions(-)

Approvals:
  Dalba: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/comms/eventstreams.py b/pywikibot/comms/eventstreams.py
index 2236481..55128f4 100644
--- a/pywikibot/comms/eventstreams.py
+++ b/pywikibot/comms/eventstreams.py
@@ -69,6 +69,19 @@
         kwargs.setdefault('timeout', config.socket_timeout)
         self.sse_kwargs = kwargs
 
+    def __repr__(self):
+        """Return representation string."""
+        kwargs = self.sse_kwargs.copy()
+        if self._site != Site():
+            kwargs['site'] = self._site
+        if self._stream:
+            kwargs['stream'] = self._stream
+            kwargs.pop('url')
+        if kwargs['timeout'] == config.socket_timeout:
+            kwargs.pop('timeout')
+        return '{0}({1})'.format(self.__class__.__name__, ', '.join(
+            '%s=%r' % x for x in kwargs.items()))
+
     @property
     def url(self):
         """Get the EventStream's url.

-- 
To view, visit https://gerrit.wikimedia.org/r/370365
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0d571f7c9f39b848d67812128d95a21c30b019b4
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <i...@gno.de>
Gerrit-Reviewer: Dalba <dalba.w...@gmail.com>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: Magul <tomasz.magul...@gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhall...@arctus.nl>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to