From 9c328eea9a788db9a21d443da3aad80b6455497b Mon Sep 17 00:00:00 2001 From: Hyungjun Kim Date: Mon, 12 Aug 2013 16:41:57 -0700 Subject: [PATCH 1/3] Used duck typing to determine whether or not 'r.json' is called --- zinc/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zinc/client.py b/zinc/client.py index e7db6f0..b3d5594 100644 --- a/zinc/client.py +++ b/zinc/client.py @@ -47,7 +47,7 @@ def _req(self,method,url,data=None): if data: logger.debug('Request data: %s',self._pjs(data)) r = getattr(requests,method)(fullurl,**kwargs).json - if isinstance(r,type(lambda:0)): r = r() # new requests uses r.json() + if hasattr(r, '__call__'): r = r() # new requests uses r.json() try: logger.debug('Response data: %s',self._pjs(r)) From 35bf2c57b7f1855c7d71737d03cc4bae9062e222 Mon Sep 17 00:00:00 2001 From: Hyungjun Kim Date: Mon, 12 Aug 2013 17:01:32 -0700 Subject: [PATCH 2/3] temp change propagation --- setup.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/setup.py b/setup.py index 83160f9..752032c 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,15 @@ -from distutils.core import setup - -setup( - name='zinc', - version='0.1.1', - author='Eric Swanson', - author_email='eswanson@alloscomp.com', - packages=['zinc'], - url='http://pypi.python.org/pypi/Zinc/', - license='LICENSE.txt', - description='Wrapper for Zinc ecommerce API (zinc.io).', - long_description=open('README.md').read(), - install_requires=[ - ], -) +# from distutils.core import setup +# +# setup( +# name='zinc', +# version='0.1.1', +# author='Eric Swanson', +# author_email='eswanson@alloscomp.com', +# packages=['zinc'], +# url='http://pypi.python.org/pypi/Zinc/', +# license='LICENSE.txt', +# description='Wrapper for Zinc ecommerce API (zinc.io).', +# long_description=open('README.md').read(), +# install_requires=[ +# ], +# ) From 566d4e9b3ae6e27890922845c1ddd18b9ba9c348 Mon Sep 17 00:00:00 2001 From: Hyungjun Kim Date: Mon, 12 Aug 2013 17:06:02 -0700 Subject: [PATCH 3/3] undo --- setup.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/setup.py b/setup.py index 752032c..83160f9 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,15 @@ -# from distutils.core import setup -# -# setup( -# name='zinc', -# version='0.1.1', -# author='Eric Swanson', -# author_email='eswanson@alloscomp.com', -# packages=['zinc'], -# url='http://pypi.python.org/pypi/Zinc/', -# license='LICENSE.txt', -# description='Wrapper for Zinc ecommerce API (zinc.io).', -# long_description=open('README.md').read(), -# install_requires=[ -# ], -# ) +from distutils.core import setup + +setup( + name='zinc', + version='0.1.1', + author='Eric Swanson', + author_email='eswanson@alloscomp.com', + packages=['zinc'], + url='http://pypi.python.org/pypi/Zinc/', + license='LICENSE.txt', + description='Wrapper for Zinc ecommerce API (zinc.io).', + long_description=open('README.md').read(), + install_requires=[ + ], +)