From 99bfd7c08bcaad6124fe3d3cacd62ad6c265f3c3 Mon Sep 17 00:00:00 2001 From: FoxMaSk Date: Wed, 5 Apr 2017 23:01:55 +0200 Subject: [PATCH] upd requests / python 3.6 --- README.rst | 22 +++++++++++++++++++--- setup.py | 6 +++--- wallabag_api/__init__.py | 2 +- wallabag_api/wallabag_test.py | 16 +++++++++------- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/README.rst b/README.rst index 302eb75..ebd2ec1 100644 --- a/README.rst +++ b/README.rst @@ -1,3 +1,18 @@ +.. image:: http://img.shields.io/badge/python-3.6-orange.svg + :target: https://pypi.python.org/pypi/django-th/ + :alt: Python version supported + + +.. image:: http://img.shields.io/badge/python-3.5-orange.svg + :target: https://pypi.python.org/pypi/django-th/ + :alt: Python version supported + + +.. image:: http://img.shields.io/badge/license-BSD-blue.svg + :target: https://pypi.python.org/pypi/django-th/ + :alt: License + + ============ Wallabag API ============ @@ -7,7 +22,7 @@ Python API for Wallabag v2 Requirements : ============== -* requests 2.5.0 +* requests 2.13.0 Installation: @@ -37,7 +52,7 @@ Creating a post : .. code:: python from wallabag_api.wallabag import Wallabag - # settings + # settings params = {'username': 'foxmask', 'password': 'mypass', 'client_id': 'myid', @@ -67,6 +82,8 @@ Testing : Install Wallabag V2 on your own host like explain here http://doc.wallabag.org/en/v2/user/installation.html +Then run the development version (with make run) + Then create a client API like explain here http://doc.wallabag.org/en/v2/developer/api.html this will give you somthing like this @@ -79,4 +96,3 @@ Then replace the client_id / client_secret / login / pass to wallabag_test.py an python wallabag_test.py - diff --git a/setup.py b/setup.py index 746cadd..e8b7d6e 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages from wallabag_api import __version__ as version install_requires = [ - 'requests==2.5.0', + 'requests-2.13.0', ] setup( @@ -16,13 +16,13 @@ setup( "wallabag_api-" + version + ".zip", packages=find_packages(), classifiers=[ - 'Development Status :: 4 - Beta', + 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Topic :: Internet', 'Topic :: Communications', ], diff --git a/wallabag_api/__init__.py b/wallabag_api/__init__.py index ecb4c94..1dcc671 100644 --- a/wallabag_api/__init__.py +++ b/wallabag_api/__init__.py @@ -1,2 +1,2 @@ -VERSION = (1, 1, 0) # PEP 386 +VERSION = (1, 2, 0) # PEP 386 __version__ = ".".join([str(x) for x in VERSION]) diff --git a/wallabag_api/wallabag_test.py b/wallabag_api/wallabag_test.py index e07d201..9c0d0cc 100644 --- a/wallabag_api/wallabag_test.py +++ b/wallabag_api/wallabag_test.py @@ -5,7 +5,7 @@ from wallabag import Wallabag class TestWallabag(unittest.TestCase): - host = 'http://localhost:8080' + host = 'http://localhost:8000' client_id = '' client_secret = '' token = '' @@ -20,12 +20,14 @@ class TestWallabag(unittest.TestCase): def test_get_token(self): params = {"grant_type": "password", - "client_id": '1_37e16ub8a62oc4gwcg0o0wssks800kw0ok408kkwo4kosgc88g', - "client_secret": '49etxpn66da8okg4cs40sswsog0sskwg4woc400c4w4w8s4wo4', - "username": 'foxmask', - "password": 'ratatab00m'} - - data = Wallabag.get_token(host='http://localhost:8080', **params) + "client_id": + '1_4wqe1riwt0qoks844kwc4go08koogkgk88go4cckkwg0408kcg', + "client_secret": '4mzw3qwi1xyc0cks4k80s4c8kco40wwkkkw0g40kwk4o4c44co', + "username": 'wallabag', + "password": 'wallabag'} + print(self.host) + data = Wallabag.get_token(host=self.host, **params) + print(data) self.assertTrue(isinstance(data, str), True) return data