mirror of
https://github.com/kennethreitz/gistapi.py.git
synced 2026-06-05 23:10:17 +00:00
rely on requests
This commit is contained in:
+2
-2
@@ -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():
|
||||
|
||||
|
||||
@@ -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",
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user