rely on requests

This commit is contained in:
Kenneth Reitz
2011-03-31 04:48:54 -04:00
parent c1635f9b64
commit d2823bf6b7
2 changed files with 21 additions and 18 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ u'Great Stuff.'
import cStringIO
import os.path
import urllib2
import requests
from datetime import datetime
try:
@@ -97,7 +97,7 @@ class Gist(object):
else:
# Fetch Gist metadata
_meta_url = GIST_JSON % self.id
_meta = json.load(urllib2.urlopen(_meta_url))['gists'][0]
_meta = json.loads(requests.get(_meta_url).content)['gists'][0]
for key, value in _meta.iteritems():
+19 -16
View File
@@ -9,36 +9,39 @@ from distutils.core import setup
def publish():
"""Publish to PyPi"""
os.system("python setup.py sdist upload")
if sys.argv[-1] == "publish":
publish()
sys.exit()
required = []
required = ['requests']
if sys.version_info[:2] < (2,6):
required.append('simplejson')
setup(name='gistapi',
version=gistapi.__version__,
description='Python wrapper for Gist API',
long_description=open('README.rst').read() + '\n\n' +
open('HISTORY.rst').read(),
author='Kenneth Reitz',
author_email='me@kennethreitz.com',
url='http://github.com/kennethreitz/gistapi.py',
packages=['gistapi'],
install_requires=required,
license='MIT',
classifiers=(
setup(
name='gistapi',
version=gistapi.__version__,
description='Python wrapper for Gist API',
long_description=open('README.rst').read() + '\n\n' + open('HISTORY.rst').read(),
author='Kenneth Reitz',
author_email='me@kennethreitz.com',
url='http://github.com/kennethreitz/gistapi.py',
packages=['gistapi'],
install_requires=required,
license='MIT',
classifiers=(
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
)
)
)
)