@@ -38,7 +38,7 @@ class ShopifyResourceMeta(ResourceMeta):
3838 def connection (cls ):
3939 """HTTP connection for the current thread"""
4040 local = cls ._threadlocal
41- if not getattr (local , ' connection' , None ):
41+ if not getattr (local , " connection" , None ):
4242 # Make sure these variables are no longer affected by other threads.
4343 local .user = cls .user
4444 local .password = cls .password
@@ -54,7 +54,7 @@ def connection(cls):
5454 return local .connection
5555
5656 def get_user (cls ):
57- return getattr (cls ._threadlocal , ' user' , ShopifyResource ._user )
57+ return getattr (cls ._threadlocal , " user" , ShopifyResource ._user )
5858
5959 def set_user (cls , value ):
6060 cls ._threadlocal .connection = None
@@ -63,7 +63,7 @@ def set_user(cls, value):
6363 user = property (get_user , set_user , None , "The username for HTTP Basic Auth." )
6464
6565 def get_password (cls ):
66- return getattr (cls ._threadlocal , ' password' , ShopifyResource ._password )
66+ return getattr (cls ._threadlocal , " password" , ShopifyResource ._password )
6767
6868 def set_password (cls , value ):
6969 cls ._threadlocal .connection = None
@@ -72,7 +72,7 @@ def set_password(cls, value):
7272 password = property (get_password , set_password , None , "The password for HTTP Basic Auth." )
7373
7474 def get_site (cls ):
75- return getattr (cls ._threadlocal , ' site' , ShopifyResource ._site )
75+ return getattr (cls ._threadlocal , " site" , ShopifyResource ._site )
7676
7777 def set_site (cls , value ):
7878 cls ._threadlocal .connection = None
@@ -82,49 +82,49 @@ def set_site(cls, value):
8282 host = parts .hostname
8383 if parts .port :
8484 host += ":" + str (parts .port )
85- new_site = urllib .parse .urlunparse ((parts .scheme , host , parts .path , '' , '' , '' ))
85+ new_site = urllib .parse .urlunparse ((parts .scheme , host , parts .path , "" , "" , "" ))
8686 ShopifyResource ._site = cls ._threadlocal .site = new_site
8787 if parts .username :
8888 cls .user = urllib .parse .unquote (parts .username )
8989 if parts .password :
9090 cls .password = urllib .parse .unquote (parts .password )
9191
92- site = property (get_site , set_site , None , ' The base REST site to connect to.' )
92+ site = property (get_site , set_site , None , " The base REST site to connect to." )
9393
9494 def get_timeout (cls ):
95- return getattr (cls ._threadlocal , ' timeout' , ShopifyResource ._timeout )
95+ return getattr (cls ._threadlocal , " timeout" , ShopifyResource ._timeout )
9696
9797 def set_timeout (cls , value ):
9898 cls ._threadlocal .connection = None
9999 ShopifyResource ._timeout = cls ._threadlocal .timeout = value
100100
101- timeout = property (get_timeout , set_timeout , None , ' Socket timeout for HTTP requests' )
101+ timeout = property (get_timeout , set_timeout , None , " Socket timeout for HTTP requests" )
102102
103103 def get_headers (cls ):
104- if not hasattr (cls ._threadlocal , ' headers' ):
104+ if not hasattr (cls ._threadlocal , " headers" ):
105105 cls ._threadlocal .headers = ShopifyResource ._headers .copy ()
106106 return cls ._threadlocal .headers
107107
108108 def set_headers (cls , value ):
109109 cls ._threadlocal .headers = value
110110
111- headers = property (get_headers , set_headers , None , ' The headers sent with HTTP requests' )
111+ headers = property (get_headers , set_headers , None , " The headers sent with HTTP requests" )
112112
113113 def get_format (cls ):
114- return getattr (cls ._threadlocal , ' format' , ShopifyResource ._format )
114+ return getattr (cls ._threadlocal , " format" , ShopifyResource ._format )
115115
116116 def set_format (cls , value ):
117117 cls ._threadlocal .connection = None
118118 ShopifyResource ._format = cls ._threadlocal .format = value
119119
120- format = property (get_format , set_format , None , ' Encoding used for request and responses' )
120+ format = property (get_format , set_format , None , " Encoding used for request and responses" )
121121
122122 def get_prefix_source (cls ):
123123 """Return the prefix source, by default derived from site."""
124124 try :
125125 return cls .override_prefix ()
126126 except AttributeError :
127- if hasattr (cls , ' _prefix_source' ):
127+ if hasattr (cls , " _prefix_source" ):
128128 return cls .site + cls ._prefix_source
129129 else :
130130 return cls .site
@@ -133,33 +133,33 @@ def set_prefix_source(cls, value):
133133 """Set the prefix source, which will be rendered into the prefix."""
134134 cls ._prefix_source = value
135135
136- prefix_source = property (get_prefix_source , set_prefix_source , None , ' prefix for lookups for this type of object.' )
136+ prefix_source = property (get_prefix_source , set_prefix_source , None , " prefix for lookups for this type of object." )
137137
138138 def get_version (cls ):
139- if hasattr (cls ._threadlocal , ' version' ) or ShopifyResource ._version :
140- return getattr (cls ._threadlocal , ' version' , ShopifyResource ._version )
139+ if hasattr (cls ._threadlocal , " version" ) or ShopifyResource ._version :
140+ return getattr (cls ._threadlocal , " version" , ShopifyResource ._version )
141141 elif ShopifyResource ._site is not None :
142- return ShopifyResource ._site .split ('/' )[- 1 ]
142+ return ShopifyResource ._site .split ("/" )[- 1 ]
143143
144144 def set_version (cls , value ):
145145 ShopifyResource ._version = cls ._threadlocal .version = value
146146
147- version = property (get_version , set_version , None , ' Shopify Api Version' )
147+ version = property (get_version , set_version , None , " Shopify Api Version" )
148148
149149 def get_url (cls ):
150- return getattr (cls ._threadlocal , ' url' , ShopifyResource ._url )
150+ return getattr (cls ._threadlocal , " url" , ShopifyResource ._url )
151151
152152 def set_url (cls , value ):
153153 ShopifyResource ._url = cls ._threadlocal .url = value
154154
155- url = property (get_url , set_url , None , ' Base URL including protocol and shopify domain' )
155+ url = property (get_url , set_url , None , " Base URL including protocol and shopify domain" )
156156
157157
158158@six .add_metaclass (ShopifyResourceMeta )
159159class ShopifyResource (ActiveResource , mixins .Countable ):
160160 _format = formats .JSONFormat
161161 _threadlocal = threading .local ()
162- _headers = {' User-Agent' : ' ShopifyPythonAPI/%s Python/%s' % (shopify .VERSION , sys .version .split (' ' , 1 )[0 ])}
162+ _headers = {" User-Agent" : " ShopifyPythonAPI/%s Python/%s" % (shopify .VERSION , sys .version .split (" " , 1 )[0 ])}
163163 _version = None
164164 _url = None
165165
@@ -182,7 +182,7 @@ def activate_session(cls, session):
182182 cls .user = None
183183 cls .password = None
184184 cls .version = session .api_version .name
185- cls .headers [' X-Shopify-Access-Token' ] = session .token
185+ cls .headers [" X-Shopify-Access-Token" ] = session .token
186186
187187 @classmethod
188188 def clear_session (cls ):
@@ -191,7 +191,7 @@ def clear_session(cls):
191191 cls .user = None
192192 cls .password = None
193193 cls .version = None
194- cls .headers .pop (' X-Shopify-Access-Token' , None )
194+ cls .headers .pop (" X-Shopify-Access-Token" , None )
195195
196196 @classmethod
197197 def find (cls , id_ = None , from_ = None , ** kwargs ):
0 commit comments