Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make package python3 compatible

* Remove relative imports
* Remove reference to urllib.urlencode
* Add python 3.3 to travis
  • Loading branch information...
commit 78efa022e34a900f949b88e354e1ad3ed8ae3e88 1 parent 15eef68
Tim Sergeant tgsergeant authored tgsergeant committed
1  .travis.yml
View
@@ -1,4 +1,5 @@
language: python
python:
- "2.7"
+ - "3.3"
script: nosetests -a '!broken'
4 bigcommerce/__init__.py
View
@@ -1,4 +1,4 @@
# from bigcommerce.connection import Connection, OAuthConnection, HttpException, ClientRequestException, \
# EmptyResponseWarning, RedirectionException, ServerException
-import resources
-import api
+import bigcommerce.resources
+import bigcommerce.api
7 bigcommerce/connection.py
View
@@ -7,7 +7,10 @@
import hashlib
import hmac
-import urllib
+try:
+ from urllib import urlencode
+except ImportError:
+ from urllib.parse import urlencode
import json # only used for urlencode querystr
import logging
import streql
@@ -79,7 +82,7 @@ def _run_method(self, method, url, data=None, query={}, headers={}):
elif not url: # blank path
url = self.full_path(url)
- qs = urllib.urlencode(query)
+ qs = urlencode(query)
if qs: qs = "?" + qs
url += qs
34 bigcommerce/resources/__init__.py
View
@@ -1,17 +1,17 @@
-from brands import *
-from categories import *
-from countries import *
-from coupons import *
-from customer_groups import *
-from customers import *
-from option_sets import *
-from options import *
-from order_statuses import *
-from orders import *
-from payments import *
-from products import *
-from redirects import *
-from shipping import *
-from store import *
-from tax_classes import *
-from time import *
+from .brands import *
+from .categories import *
+from .countries import *
+from .coupons import *
+from .customer_groups import *
+from .customers import *
+from .option_sets import *
+from .options import *
+from .order_statuses import *
+from .orders import *
+from .payments import *
+from .products import *
+from .redirects import *
+from .shipping import *
+from .store import *
+from .tax_classes import *
+from .time import *
2  bigcommerce/resources/brands.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class Brands(ListableApiResource, CreateableApiResource, UpdateableApiResource, DeleteableApiResource):
2  bigcommerce/resources/categories.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class Categories(ListableApiResource, CreateableApiResource, UpdateableApiResource, DeleteableApiResource):
2  bigcommerce/resources/countries.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class Countries(ListableApiResource):
2  bigcommerce/resources/coupons.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class Coupons(ListableApiResource, CreateableApiResource, UpdateableApiResource, DeleteableApiResource):
2  bigcommerce/resources/customer_groups.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class CustomerGroups(ListableApiResource, CreateableApiResource, UpdateableApiResource, DeleteableApiResource):
2  bigcommerce/resources/customers.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class Customers(ListableApiResource, CreateableApiResource, UpdateableApiResource, DeleteableApiResource):
2  bigcommerce/resources/option_sets.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class OptionSets(ListableApiResource, CreateableApiResource, UpdateableApiResource, DeleteableApiResource):
2  bigcommerce/resources/options.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class Options(ListableApiResource, CreateableApiResource, UpdateableApiResource, DeleteableApiResource):
2  bigcommerce/resources/order_statuses.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class OrderStatuses(ListableApiResource):
2  bigcommerce/resources/orders.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class Orders(ListableApiResource, CreateableApiResource, UpdateableApiResource, DeleteableApiResource):
2  bigcommerce/resources/payments.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class PaymentMethods(ListableApiResource):
2  bigcommerce/resources/products.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class Products(ListableApiResource, CreateableApiResource, UpdateableApiResource, DeleteableApiResource):
2  bigcommerce/resources/redirects.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class Redirects(ListableApiResource, CreateableApiResource, UpdateableApiResource, DeleteableApiResource):
2  bigcommerce/resources/shipping.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class ShippingMethods(ListableApiResource):
2  bigcommerce/resources/store.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class Store(ListableApiResource):
2  bigcommerce/resources/tax_classes.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class TaxClasses(ListableApiResource):
2  bigcommerce/resources/time.py
View
@@ -1,4 +1,4 @@
-from base import *
+from .base import *
class Time(ListableApiResource):
7 examples/ex_basic.py
View
@@ -1,3 +1,4 @@
+from __future__ import print_function
import bigcommerce.api
api = bigcommerce.api.BigcommerceApi(client_id='id', store_hash='hash', access_token='token')
@@ -8,8 +9,8 @@
custom.update(text="USA", name="Manufactured in")
-print api.ProductCustomFields.get(products[0].id, custom.id)
+print(api.ProductCustomFields.get(products[0].id, custom.id))
-print products[0].custom_fields(custom.id).delete()
+print(products[0].custom_fields(custom.id).delete())
-print api.Countries.all(country="Australia")[0].states()[0].parent_id()
+print(api.Countries.all(country="Australia")[0].states()[0].parent_id())
3  examples/ex_time.py
View
@@ -1,7 +1,8 @@
+from __future__ import print_function
import bigcommerce.api
__author__ = 'tim'
api = bigcommerce.api.BigcommerceApi(client_id='id', store_hash='hash', access_token='token')
-print repr(api.Time.all())
+print(repr(api.Time.all()))
5 requirements.txt
View
@@ -1,5 +1,8 @@
PyYAML==3.10
+cov-core==1.7
+coverage==3.7.1
+mock==1.0.1
nose==1.3.0
+nose-cov==1.6
requests==2.1.0
streql==3.0.2
-vcrpy==0.5.0
Please sign in to comment.
Something went wrong with that request. Please try again.