Skip to content

Commit

Permalink
Setup, fix syntax error, being verbose, .gitignore
Browse files Browse the repository at this point in the history
Now comes with a setup.py, fixed some minor syntax errors, added
.gitignore and being a little more verbose.
  • Loading branch information
michaelhelmick committed Jan 8, 2012
1 parent 03fb783 commit 7caa1d3
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .gitignore
@@ -0,0 +1,21 @@
*.mo
*.egg-info
*.egg
*.EGG
*.EGG-INFO
bin
build
develop-eggs
downloads
eggs
fake-eggs
parts
dist
.installed.cfg
.mr.developer.cfg
.hg
.bzr
.svn
*.pyc
*.pyo
*.tmp*
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -17,7 +17,7 @@ auth_url = auth_props['auth_url']
#Store this token in a session or something for later use in the next step. #Store this token in a session or something for later use in the next step.
oauth_token_secret = auth_props['oauth_token_secret'] oauth_token_secret = auth_props['oauth_token_secret']


Connect with Netflix via: % auth_url print 'Connect with Netflix via %s' % auth_url
``` ```


Once you click "Allow" be sure that there is a URL set up to handle getting finalized tokens and possibly adding them to your database to use their information at a later date. \n\n' Once you click "Allow" be sure that there is a URL set up to handle getting finalized tokens and possibly adding them to your database to use their information at a later date. \n\n'
Expand Down
4 changes: 2 additions & 2 deletions netflix.py
Expand Up @@ -82,7 +82,7 @@ def get_auth_url(self):
resp, content = self.client.request('%s?oauth_callback=%s' % (self.request_token_url, self.callback_url), 'GET', **request_args) resp, content = self.client.request('%s?oauth_callback=%s' % (self.request_token_url, self.callback_url), 'GET', **request_args)


if resp['status'] != '200': if resp['status'] != '200':
raise NetflixAuthErrorError('There was a problem retrieving an authentication url.') raise NetflixAuthError('There was a problem retrieving an authentication url.')


request_tokens = dict(parse_qsl(content)) request_tokens = dict(parse_qsl(content))


Expand Down Expand Up @@ -150,7 +150,7 @@ def api_request(self, endpoint=None, method='GET', params={}, format='json'):
try: try:
content = json.loads(content) content = json.loads(content)
except json.JSONDecodeError: except json.JSONDecodeError:
raise NetflixAPIError('Content unable to be decoded.') raise NetflixAPIError('Content is not valid JSON, unable to be decoded.')


if status < 200 or status >= 300: if status < 200 or status >= 300:
raise NetflixAPIError('Code %d: %s' % (status, content['status']['message'])) raise NetflixAPIError('Code %d: %s' % (status, content['status']['message']))
Expand Down
31 changes: 31 additions & 0 deletions setup.py
@@ -0,0 +1,31 @@
#!/usr/bin/env python

import sys, os
from setuptools import setup
from setuptools import find_packages

__author__ = 'Mike Helmick <mikehelmick@me.com>'
__version__ = '1.0'

setup(
name='python-netflix',
version=__version__,
packages=find_packages(),
include_package_data=True,
install_requires=['httplib2', 'oauth2', 'simplejson'],
author='Mike Helmick',
author_email='mikehelmick@me.com',
license='MIT License',
url='http://github.com/michaelhelmick/python-netflix/',
keywords='python netflix oauth api',
description='A Python Library to interface with Netflix REST API & OAuth',
long_description=open('README.md').read(),
classifiers = [
'Development Status :: 1 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Communications :: Chat',
'Topic :: Internet'
]
)

0 comments on commit 7caa1d3

Please sign in to comment.