Permalink
Browse files

refactor into modules and pep8ify

  • Loading branch information...
1 parent 42fe0ae commit 0d155f677c55016600d941608732266004ed40f5 @andrew-stripe andrew-stripe committed Dec 1, 2013
View
@@ -5,14 +5,14 @@
print "Attempting charge..."
resp = stripe.Charge.create(
- amount=200,
- currency='usd',
- card={
- 'number': '4242424242424242',
- 'exp_month': 10,
- 'exp_year': 2014
- },
- description='customer@gmail.com'
- )
+ amount=200,
+ currency='usd',
+ card={
+ 'number': '4242424242424242',
+ 'exp_month': 10,
+ 'exp_year': 2014
+ },
+ description='customer@gmail.com'
+)
print 'Success: %r' % (resp, )
View
@@ -13,41 +13,39 @@
# Don't import stripe module here, since deps may not be installed
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'stripe'))
-import importer
-import version
+from stripe.version import VERSION
path, script = os.path.split(sys.argv[0])
os.chdir(os.path.abspath(path))
requests = 'requests >= 0.8.8'
if sys.version_info < (2, 6):
- requests += ', < 0.10.1'
+ requests += ', < 0.10.1'
install_requires = [requests]
test_requires = install_requires + ['pycurl >= 7.19']
# Get simplejson if we don't already have json
try:
- importer.import_json()
+ from stripe.util import json
except ImportError:
- install_requires.append('simplejson')
+ install_requires.append('simplejson')
try:
- import json
- _json_loaded = hasattr(json, 'loads')
+ import json
+ _json_loaded = hasattr(json, 'loads')
except ImportError:
- pass
+ pass
setup(name='stripe',
- cmdclass = {'build_py': build_py},
- version=version.VERSION,
+ cmdclass={'build_py': build_py},
+ version=VERSION,
description='Stripe python bindings',
author='Stripe',
author_email='support@stripe.com',
url='https://stripe.com/',
- packages=['stripe','stripe.test'],
- package_data={'stripe' : ['data/ca-certificates.crt', '../VERSION']},
+ packages=['stripe', 'stripe.test'],
+ package_data={'stripe': ['data/ca-certificates.crt', '../VERSION']},
install_requires=install_requires,
- tests_require = test_requirements,
- test_suite='stripe.test',
-)
+ tests_require=test_requirements,
+ )
Oops, something went wrong.

0 comments on commit 0d155f6

Please sign in to comment.