pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/chat/py-mastodon



Module Name:    pkgsrc
Committed By:   nia
Date:           Tue Jul 31 16:14:29 UTC 2018

Modified Files:
        pkgsrc/chat/py-mastodon: Makefile distinfo
Added Files:
        pkgsrc/chat/py-mastodon/patches: patch-mastodon_Mastodon.py

Log Message:
chat/py-mastodon: Add a patch to avoid the use of the 'async' keyword,
allowing it to be used with Python 3.7.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 pkgsrc/chat/py-mastodon/Makefile
cvs rdiff -u -r1.1 -r1.2 pkgsrc/chat/py-mastodon/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/chat/py-mastodon/patches/patch-mastodon_Mastodon.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/chat/py-mastodon/Makefile
diff -u pkgsrc/chat/py-mastodon/Makefile:1.4 pkgsrc/chat/py-mastodon/Makefile:1.5
--- pkgsrc/chat/py-mastodon/Makefile:1.4        Tue Jul 31 15:54:26 2018
+++ pkgsrc/chat/py-mastodon/Makefile    Tue Jul 31 16:14:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2018/07/31 15:54:26 nia Exp $
+# $NetBSD: Makefile,v 1.5 2018/07/31 16:14:29 nia Exp $
 
 VERSION=       1.2.2
 DISTNAME=      Mastodon.py-${VERSION}
@@ -14,9 +14,6 @@ LICENSE=      mit
 EXTRACT_USING= bsdtar
 USE_LANGUAGES= # none
 
-# collision with the async keyword, issues/120
-PYTHON_VERSIONS_INCOMPATIBLE+= 37
-
 DEPENDS+=      ${PYPKGPREFIX}-dateutil-[0-9]*:../../time/py-dateutil
 DEPENDS+=      ${PYPKGPREFIX}-decorator-[0-9]*:../../devel/py-decorator
 DEPENDS+=      ${PYPKGPREFIX}-pytz-[0-9]*:../../time/py-pytz

Index: pkgsrc/chat/py-mastodon/distinfo
diff -u pkgsrc/chat/py-mastodon/distinfo:1.1 pkgsrc/chat/py-mastodon/distinfo:1.2
--- pkgsrc/chat/py-mastodon/distinfo:1.1        Wed Jul 25 17:00:57 2018
+++ pkgsrc/chat/py-mastodon/distinfo    Tue Jul 31 16:14:29 2018
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.1 2018/07/25 17:00:57 nia Exp $
+$NetBSD: distinfo,v 1.2 2018/07/31 16:14:29 nia Exp $
 
 SHA1 (Mastodon.py-1.2.2.tar.gz) = 1589bf3c18e1ae765cd8312a4cb53164d4447d08
 RMD160 (Mastodon.py-1.2.2.tar.gz) = 282216a8179a1f019432943d5039105fc6fa3fd7
 SHA512 (Mastodon.py-1.2.2.tar.gz) = 4e82fec7a53c36a14f27a238ac97a2f71cdfbb10671013d60f3083456209c2916f7a1e22015d33238c017a9f81c46e4703477076d5974cb86816af048b5c5ecf
 Size (Mastodon.py-1.2.2.tar.gz) = 19793 bytes
+SHA1 (patch-mastodon_Mastodon.py) = a1baf579da05905dcb1cf679c728877dd3fcee54

Added files:

Index: pkgsrc/chat/py-mastodon/patches/patch-mastodon_Mastodon.py
diff -u /dev/null pkgsrc/chat/py-mastodon/patches/patch-mastodon_Mastodon.py:1.1
--- /dev/null   Tue Jul 31 16:14:29 2018
+++ pkgsrc/chat/py-mastodon/patches/patch-mastodon_Mastodon.py  Tue Jul 31 16:14:29 2018
@@ -0,0 +1,80 @@
+$NetBSD: patch-mastodon_Mastodon.py,v 1.1 2018/07/31 16:14:29 nia Exp $
+
+'async' is a reserved keyword in Python 3.7.
+
+--- mastodon/Mastodon.py.orig  2018-01-29 14:20:16.000000000 +0000
++++ mastodon/Mastodon.py
+@@ -1381,45 +1381,45 @@ class Mastodon:
+     # Streaming
+     ###
+     @api_version("1.1.0", "1.4.2")    
+-    def stream_user(self, listener, async=False):
++    def stream_user(self, listener, run_async=False):
+         """
+         Streams events that are relevant to the authorized user, i.e. home
+         timeline and notifications.
+         """
+-        return self.__stream('/api/v1/streaming/user', listener, async=async)
++        return self.__stream('/api/v1/streaming/user', listener, run_async=run_async)
+ 
+     @api_version("1.1.0", "1.4.2")
+-    def stream_public(self, listener, async=False):
++    def stream_public(self, listener, run_async=False):
+         """
+         Streams public events.
+         """
+-        return self.__stream('/api/v1/streaming/public', listener, async=async)
++        return self.__stream('/api/v1/streaming/public', listener, run_async=run_async)
+ 
+     @api_version("1.1.0", "1.4.2")
+-    def stream_local(self, listener, async=False):
++    def stream_local(self, listener, run_async=False):
+         """
+         Streams local public events.
+         """
+-        return self.__stream('/api/v1/streaming/public/local', listener, async=async)
++        return self.__stream('/api/v1/streaming/public/local', listener, run_async=run_async)
+ 
+     @api_version("1.1.0", "1.4.2")
+-    def stream_hashtag(self, tag, listener, async=False):
++    def stream_hashtag(self, tag, listener, run_async=False):
+         """
+         Stream for all public statuses for the hashtag 'tag' seen by the connected
+         instance.
+         """
+         if tag.startswith("#"):
+             raise MastodonIllegalArgumentError("Tag parameter should omit leading #")
+-        return self.__stream("/api/v1/streaming/hashtag?tag={}".format(tag), listener, async=async)
++        return self.__stream("/api/v1/streaming/hashtag?tag={}".format(tag), listener, run_async=run_async)
+ 
+     @api_version("2.1.0", "2.1.0")
+-    def stream_list(self, id, listener, async=False):
++    def stream_list(self, id, listener, run_async=False):
+         """
+         Stream events for the current user, restricted to accounts on the given
+         list. 
+         """
+         id =  self.__unpack_id(id)
+-        return self.__stream("/api/v1/streaming/list?list={}".format(id), listener, async=async)
++        return self.__stream("/api/v1/streaming/list?list={}".format(id), listener, run_async=run_async)
+     
+     ###
+     # Internal helpers, dragons probably
+@@ -1661,7 +1661,7 @@ class Mastodon:
+ 
+         return response
+ 
+-    def __stream(self, endpoint, listener, params={}, async=False):
++    def __stream(self, endpoint, listener, params={}, usync=False):
+         """
+         Internal streaming API helper.
+ 
+@@ -1720,7 +1720,7 @@ class Mastodon:
+ 
+         handle = __stream_handle(connection)
+ 
+-        if async:
++        if run_async:
+             t = threading.Thread(args=(), daemon = True, target=handle._threadproc)
+             t.start()
+             return handle



Home | Main Index | Thread Index | Old Index