[Python-modules-commits] [python-diaspy] 01/01: Import python-diaspy_0.5.1.orig.tar.gz
Wolfgang Borgert
debacle at moszumanska.debian.org
Sun Jan 22 13:06:44 UTC 2017
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to branch upstream
in repository python-diaspy.
commit 1e2ef9202b2341eb2c0dd78026aca65bff089869
Author: W. Martin Borgert <debacle at debian.org>
Date: Sun Jan 22 12:49:35 2017 +0000
Import python-diaspy_0.5.1.orig.tar.gz
---
diaspy/__init__.py | 2 +-
diaspy/streams.py | 13 +++++++++++--
setup.py | 33 ++++++++++++++++++++++++---------
3 files changed, 36 insertions(+), 12 deletions(-)
diff --git a/diaspy/__init__.py b/diaspy/__init__.py
index 36317c3..8d06f84 100644
--- a/diaspy/__init__.py
+++ b/diaspy/__init__.py
@@ -10,4 +10,4 @@ import diaspy.notifications as notifications
import diaspy.settings as settings
-__version__ = '0.4.2'
+__version__ = '0.5.1'
diff --git a/diaspy/streams.py b/diaspy/streams.py
index 6878c5e..dc59c6b 100644
--- a/diaspy/streams.py
+++ b/diaspy/streams.py
@@ -53,8 +53,10 @@ class Generic():
"""
return len(self._stream)
- def _obtain(self, max_time=0):
+ def _obtain(self, max_time=0, suppress=True):
"""Obtains stream from pod.
+
+ suppress:bool - suppress post-fetching errors (e.g. 404)
"""
params = {}
if max_time:
@@ -63,7 +65,14 @@ class Generic():
request = self._connection.get(self._location, params=params)
if request.status_code != 200:
raise errors.StreamError('wrong status code: {0}'.format(request.status_code))
- return [Post(self._connection, guid=post['guid']) for post in request.json()]
+ posts = []
+ for post in request.json():
+ try:
+ posts.append(Post(self._connection, guid=post['guid']))
+ except errors.PostError:
+ if not suppress:
+ raise
+ return posts
def _expand(self, new_stream):
"""Appends older posts to stream.
diff --git a/setup.py b/setup.py
index 32a21fd..dfae73e 100644
--- a/setup.py
+++ b/setup.py
@@ -1,10 +1,25 @@
from setuptools import setup, find_packages
-setup(name='diaspy',
- version='0.4.3',
- author='Marek Marecki',
- author_email='hi at ozro.pw',
- url='https://github.com/marekjm/diaspy',
- description='Unofficial Python API to the social network Diaspora*',
- packages=find_packages(),
- install_requires=['requests']
- )
+
+setup(
+ name='diaspy-api',
+ version='0.5.1',
+ author='Marek Marecki',
+ author_email='marekjm at ozro.pw',
+ url='https://github.com/marekjm/diaspy',
+ license='GNU GPL v3',
+ description='Unofficial Python API for Diaspora*',
+ keywords='diaspy diaspora social network api',
+ classifiers = [
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Developers',
+ 'Intended Audience :: Information Technology',
+ 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
+ 'Programming Language :: Python :: 3 :: Only',
+ 'Programming Language :: Python :: Implementation :: CPython',
+ 'Topic :: Software Development :: Libraries',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
+ 'Topic :: Utilities',
+ ],
+ packages=find_packages(),
+ install_requires=['requests']
+)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-diaspy.git
More information about the Python-modules-commits
mailing list