upd requests / python 3.6

This commit is contained in:
FoxMaSk
2017-04-05 23:01:55 +02:00
parent 8ce21dcdd3
commit 99bfd7c08b
4 changed files with 32 additions and 14 deletions

View File

@@ -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

View File

@@ -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',
],

View File

@@ -1,2 +1,2 @@
VERSION = (1, 1, 0) # PEP 386
VERSION = (1, 2, 0) # PEP 386
__version__ = ".".join([str(x) for x in VERSION])

View File

@@ -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