From 6db7529f4afbdecb9f86d53983e66bd4083f35a4 Mon Sep 17 00:00:00 2001 From: Kyle Mahan Date: Mon, 19 Jan 2015 09:44:56 -0800 Subject: [PATCH] added micropub_endpoint to authorized_handler response --- example.py | 4 +++- flask_micropub.py | 9 ++++++--- setup.py | 5 +++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/example.py b/example.py index 7cd2577..da56505 100644 --- a/example.py +++ b/example.py @@ -16,13 +16,15 @@ def micropub_callback(resp): - """.format(resp.me, resp.access_token, resp.next_url, resp.error) + """.format(resp.me, resp.micropub_endpoint, resp.access_token, + resp.next_url, resp.error) @app.route('/') diff --git a/flask_micropub.py b/flask_micropub.py index 66a55fd..baf9299 100644 --- a/flask_micropub.py +++ b/flask_micropub.py @@ -178,8 +178,8 @@ class Micropub: # success! access_token = tdata.get('access_token')[0] - return AuthResponse(me=confirmed_me, access_token=access_token, - next_url=next_url) + return AuthResponse(me=confirmed_me, micropub_endpoint=micropub_url, + access_token=access_token, next_url=next_url) def _discover_endpoints(self, me): me_response = requests.get(me) @@ -202,6 +202,7 @@ class AuthResponse: Attributes: me (string): The authenticated user's URL. This will be non-None if and only if the user was successfully authenticated. + micropub_endpoint (string): The endpoint to POST micropub requests to. access_token (string): The authorized user's micropub access token. next_url (string): The optional URL that was passed to authorize. error (string): describes the error encountered if any. It is possible @@ -209,8 +210,10 @@ class AuthResponse: will fail, in which case me will be non-None, and error will describe this condition. """ - def __init__(self, me=None, access_token=None, next_url=None, error=None): + def __init__(self, me=None, micropub_endpoint=None, + access_token=None, next_url=None, error=None): self.me = me + self.micropub_endpoint = micropub_endpoint self.access_token = access_token self.next_url = next_url self.error = error diff --git a/setup.py b/setup.py index 6111913..5e9d848 100644 --- a/setup.py +++ b/setup.py @@ -11,8 +11,8 @@ from setuptools import setup setup( name='Flask-Micropub', - version='0.1', - url='https://indiewebcamp.com/Flask-Micropub/', + version='0.1.1', + url='https://github.com/kylewm/flask-micropub/', license='BSD', author='Kyle Mahan', author_email='kyle@kylewm.com', @@ -32,6 +32,7 @@ setup( 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', + 'Development Status :: 3 - Alpha', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',