Skip to content

Commit 4875ddc

Browse files
committed
Run autopep8 on all files
1 parent 6469a9a commit 4875ddc

File tree

81 files changed

+416
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+416
-254
lines changed

scripts/shopify_api.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,27 @@
1212
import six
1313
from six.moves import input, map
1414

15+
1516
def start_interpreter(**variables):
1617
# add the current working directory to the sys paths
1718
sys.path.append(os.getcwd())
1819
console = type('shopify ' + shopify.version.VERSION, (code.InteractiveConsole, object), {})
1920
import readline
2021
console(variables).interact()
2122

23+
2224
class ConfigFileError(Exception):
2325
pass
2426

27+
2528
def usage(usage_string):
2629
"""Decorator to add a usage string to a function"""
2730
def decorate(func):
2831
func.usage = usage_string
2932
return func
3033
return decorate
3134

35+
3236
class TasksMeta(type):
3337
_prog = os.path.basename(sys.argv[0])
3438

@@ -37,6 +41,7 @@ def __new__(mcs, name, bases, new_attrs):
3741

3842
tasks = list(new_attrs.keys())
3943
tasks.append("help")
44+
4045
def filter_func(item):
4146
return not item.startswith("_") and hasattr(getattr(cls, item), "__call__")
4247
tasks = filter(filter_func, tasks)
@@ -222,7 +227,6 @@ def _default_connection_target(cls):
222227
target = os.readlink(cls._default_symlink)
223228
return os.path.join(cls._shop_config_dir, target)
224229

225-
226230
@classmethod
227231
def _default_connection(cls):
228232
target = cls._default_connection_target()
@@ -253,6 +257,7 @@ def _is_default(cls, connection):
253257
def _no_config_file_error(cls, filename):
254258
raise ConfigFileError("There is no config file at " + filename)
255259

260+
256261
try:
257262
Tasks.run_task(*sys.argv[1:])
258263
except ConfigFileError as e:

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from setuptools import setup
22

3-
NAME='ShopifyAPI'
3+
NAME = 'ShopifyAPI'
44
exec(open('shopify/version.py').read())
5-
DESCRIPTION='Shopify API for Python'
6-
LONG_DESCRIPTION="""\
5+
DESCRIPTION = 'Shopify API for Python'
6+
LONG_DESCRIPTION = """\
77
The ShopifyAPI library allows python developers to programmatically
88
access the admin section of stores using an ActiveResource like
99
interface similar the ruby Shopify API gem. The library makes HTTP
@@ -27,7 +27,7 @@
2727
],
2828
test_suite='test',
2929
tests_require=[
30-
'mock>=1.0.1',
30+
'mock>=1.0.1',
3131
],
3232
platforms='Any',
3333
classifiers=['Development Status :: 5 - Production/Stable',

shopify/api_version.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
import json
33
from six.moves.urllib import request
44

5+
56
class InvalidVersionError(Exception):
67
pass
78

9+
810
class VersionNotFoundError(Exception):
911
pass
1012

13+
1114
class ApiVersion(object):
1215
versions = {}
1316

@@ -76,7 +79,7 @@ class Unstable(ApiVersion):
7679
def __init__(self):
7780
self._name = 'unstable'
7881
self._numeric_version = 9000000
79-
self._path = '/admin/api/unstable'
82+
self._path = '/admin/api/unstable'
8083

8184
@property
8285
def stable(self):

shopify/collection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from six.moves.urllib.parse import urlparse, parse_qs
33
import cgi
44

5+
56
class PaginatedCollection(Collection):
67
"""
78
A subclass of Collection which allows cycling through pages of
@@ -141,6 +142,7 @@ class PaginatedIterator(object):
141142
...
142143
# every page and the page items are iterated
143144
"""
145+
144146
def __init__(self, collection):
145147
if not isinstance(collection, PaginatedCollection):
146148
raise TypeError("PaginatedIterator expects a PaginatedCollection instance")

shopify/mixins.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import shopify.resources
22

3+
34
class Countable(object):
45

56
@classmethod

shopify/resources/api_permission.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from ..base import ShopifyResource
22

3+
34
class ApiPermission(ShopifyResource):
45

56
@classmethod
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from ..base import ShopifyResource
22

3+
34
class ApplicationCredit(ShopifyResource):
45
pass

shopify/resources/asset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def _prefix(cls, options={}):
1818
def _element_path(cls, id, prefix_options={}, query_options=None):
1919
if query_options is None:
2020
prefix_options, query_options = cls._split_options(prefix_options)
21-
return "%s%s.%s%s" % (cls._prefix(prefix_options)+'/', cls.plural,
21+
return "%s%s.%s%s" % (cls._prefix(prefix_options) + '/', cls.plural,
2222
cls.format.extension, cls._query_string(query_options))
2323

2424
@classmethod

shopify/resources/collection_listing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from ..base import ShopifyResource
22

3+
34
class CollectionListing(ShopifyResource):
45
_primary_key = "collection_id"
56

shopify/resources/customer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ def search(cls, **kwargs):
2121
"""
2222
return cls._build_collection(cls.get("search", **kwargs))
2323

24-
def send_invite(self, customer_invite = CustomerInvite()):
24+
def send_invite(self, customer_invite=CustomerInvite()):
2525
resource = self.post("send_invite", customer_invite.encode())
2626
return CustomerInvite(Customer.format.decode(resource.body))

0 commit comments

Comments
 (0)