Skip to content

Commit 43dae7a

Browse files
committed
autopep8 --in-place --select=F401,W291,E201,E202 ./tests/*.py ./shotgun_api3/shotgun.py ./shotgun_api3/lib/*.py
1 parent fdda095 commit 43dae7a

File tree

10 files changed

+253
-253
lines changed

10 files changed

+253
-253
lines changed

shotgun_api3/lib/sgtimezone.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /opt/local/bin/python
22
# ----------------------------------------------------------------------------
33
# SG_TIMEZONE module
4-
# this is rolled into the this shotgun api file to avoid having to require
4+
# this is rolled into the this shotgun api file to avoid having to require
55
# current users of api2 to install new modules and modify PYTHONPATH info.
66
# ----------------------------------------------------------------------------
77

@@ -23,7 +23,7 @@ class SgTimezone(object):
2323
DSTOFFSET = STDOFFSET
2424
DSTDIFF = DSTOFFSET - STDOFFSET
2525

26-
def __init__(self):
26+
def __init__(self):
2727
self.utc = UTC()
2828
self.local = LocalTimezone()
2929

shotgun_api3/shotgun.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -939,8 +939,8 @@ def _construct_read_parameters(self,
939939
params["return_fields"] = fields or ["id"]
940940
params["filters"] = filters
941941
params["return_only"] = (retired_only and 'retired') or "active"
942-
params["paging"] = { "entities_per_page": self.config.records_per_page,
943-
"current_page": 1 }
942+
params["paging"] = {"entities_per_page": self.config.records_per_page,
943+
"current_page": 1}
944944

945945
if additional_filter_presets:
946946
params["additional_filter_presets"] = additional_filter_presets;
@@ -2691,7 +2691,7 @@ def update_project_last_accessed(self, project, user=None):
26912691
if self.config.user_login:
26922692
user = self.find_one('HumanUser', [['login', 'is', self.config.user_login]])
26932693

2694-
params = { "project_id": project['id'], }
2694+
params = {"project_id": project['id'], }
26952695
if user:
26962696
params['user_id'] = user['id']
26972697

@@ -2767,7 +2767,7 @@ def note_thread_read(self, note_id, entity_fields=None):
27672767
if not isinstance(entity_fields, dict):
27682768
raise ValueError("entity_fields parameter must be a dictionary")
27692769

2770-
params = { "note_id": note_id, "entity_fields": entity_fields }
2770+
params = {"note_id": note_id, "entity_fields": entity_fields}
27712771

27722772
record = self._call_rpc("note_thread_contents", params)
27732773
result = self._parse_records(record)
@@ -2851,10 +2851,10 @@ def text_search(self, text, entity_types, project_ids=None, limit=None):
28512851

28522852
project_ids = project_ids or []
28532853

2854-
params = { "text": text,
2854+
params = {"text": text,
28552855
"entity_types": api_entity_types,
28562856
"project_ids": project_ids,
2857-
"max_results": limit }
2857+
"max_results": limit}
28582858

28592859
record = self._call_rpc("query_display_name_cache", params)
28602860
result = self._parse_records(record)[0]
@@ -2937,12 +2937,12 @@ def activity_stream_read(self, entity_type, entity_id, entity_fields=None, min_i
29372937
if not isinstance(entity_fields, dict):
29382938
raise ValueError("entity_fields parameter must be a dictionary")
29392939

2940-
params = { "type": entity_type,
2940+
params = {"type": entity_type,
29412941
"id": entity_id,
29422942
"max_id": max_id,
29432943
"min_id": min_id,
29442944
"limit": limit,
2945-
"entity_fields": entity_fields }
2945+
"entity_fields": entity_fields}
29462946

29472947
record = self._call_rpc("activity_stream", params)
29482948
result = self._parse_records(record)[0]
@@ -2983,7 +2983,7 @@ def nav_search_string(self, root_path, search_string, seed_entity_field=None):
29832983
{
29842984
"root_path":root_path,
29852985
"seed_entity_field": seed_entity_field,
2986-
"search_criteria": { "search_string": search_string }
2986+
"search_criteria": {"search_string": search_string}
29872987
}
29882988
)
29892989

@@ -3003,7 +3003,7 @@ def nav_search_entity(self, root_path, entity, seed_entity_field=None):
30033003
{
30043004
"root_path": root_path,
30053005
"seed_entity_field": seed_entity_field,
3006-
"search_criteria": {"entity": entity }
3006+
"search_criteria": {"entity": entity}
30073007
}
30083008
)
30093009

@@ -3674,7 +3674,7 @@ def _upload_file_to_storage(self, path, storage_url):
36743674
content_type = mimetypes.guess_type(filename)[0]
36753675
content_type = content_type or "application/octet-stream"
36763676
file_size = os.fstat(fd.fileno())[stat.ST_SIZE]
3677-
self._upload_data_to_storage(fd, content_type, file_size, storage_url )
3677+
self._upload_data_to_storage(fd, content_type, file_size, storage_url)
36783678
finally:
36793679
fd.close()
36803680

@@ -3703,7 +3703,7 @@ def _multipart_upload_file_to_storage(self, path, upload_info):
37033703
data = fd.read(chunk_size)
37043704
bytes_read += len(data)
37053705
part_url = self._get_upload_part_link(upload_info, filename, part_number)
3706-
etags.append(self._upload_data_to_storage(data, content_type, len(data), part_url ))
3706+
etags.append(self._upload_data_to_storage(data, content_type, len(data), part_url))
37073707
part_number += 1
37083708

37093709
self._complete_multipart_upload(upload_info, filename, etags)

tests/base.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,26 @@ def setUp(self, auth_mode='ApiUser'):
5252
self.config.script_name,
5353
self.config.api_key,
5454
http_proxy=self.config.http_proxy,
55-
connect=self.connect )
55+
connect=self.connect)
5656
elif auth_mode == 'HumanUser':
5757
self.sg = api.Shotgun(self.config.server_url,
5858
login=self.human_login,
5959
password=self.human_password,
6060
http_proxy=self.config.http_proxy,
61-
connect=self.connect )
61+
connect=self.connect)
6262
elif auth_mode == 'SessionToken':
63-
# first make an instance based on script key/name so
63+
# first make an instance based on script key/name so
6464
# we can generate a session token
6565
sg = api.Shotgun(self.config.server_url,
6666
self.config.script_name,
6767
self.config.api_key,
68-
http_proxy=self.config.http_proxy )
68+
http_proxy=self.config.http_proxy)
6969
self.session_token = sg.get_session_token()
7070
# now log in using session token
7171
self.sg = api.Shotgun(self.config.server_url,
7272
session_token=self.session_token,
7373
http_proxy=self.config.http_proxy,
74-
connect=self.connect )
74+
connect=self.connect)
7575
else:
7676
raise ValueError("Unknown value for auth_mode: %s" % auth_mode)
7777

@@ -128,13 +128,13 @@ def _mock_http(self, data, headers=None, status=None):
128128
if not isinstance(data, str):
129129
data = json.dumps(data, ensure_ascii=False)
130130

131-
resp_headers = { 'cache-control': 'no-cache',
131+
resp_headers = {'cache-control': 'no-cache',
132132
'connection': 'close',
133133
'content-length': (data and str(len(data))) or 0 ,
134134
'content-type': 'application/json; charset=utf-8',
135135
'date': 'Wed, 13 Apr 2011 04:18:58 GMT',
136136
'server': 'Apache/2.2.3 (CentOS)',
137-
'status': '200 OK' }
137+
'status': '200 OK'}
138138
if headers:
139139
resp_headers.update(headers)
140140

@@ -166,25 +166,25 @@ def _assert_http_method(self, method, params, check_auth=True):
166166

167167

168168
def _setup_mock_data(self):
169-
self.human_user = { 'id':1,
169+
self.human_user = {'id':1,
170170
'login':self.config.human_login,
171-
'type':'HumanUser' }
172-
self.project = { 'id':2,
171+
'type':'HumanUser'}
172+
self.project = {'id':2,
173173
'name':self.config.project_name,
174-
'type':'Project' }
175-
self.shot = { 'id':3,
174+
'type':'Project'}
175+
self.shot = {'id':3,
176176
'code':self.config.shot_code,
177-
'type':'Shot' }
178-
self.asset = { 'id':4,
177+
'type':'Shot'}
178+
self.asset = {'id':4,
179179
'code':self.config.asset_code,
180-
'type':'Asset' }
181-
self.version = { 'id':5,
180+
'type':'Asset'}
181+
self.version = {'id':5,
182182
'code':self.config.version_code,
183-
'type':'Version' }
184-
self.ticket = { 'id':6,
183+
'type':'Version'}
184+
self.ticket = {'id':6,
185185
'title':self.config.ticket_title,
186-
'type':'Ticket' }
187-
self.playlist = { 'id':7,
186+
'type':'Ticket'}
187+
self.playlist = {'id':7,
188188
'code':self.config.playlist_code,
189189
'type':'Playlist'}
190190

@@ -307,8 +307,8 @@ def __init__(self):
307307
def config_keys(self):
308308
return [
309309
'api_key', 'asset_code', 'http_proxy', 'human_login', 'human_name',
310-
'human_password', 'mock', 'project_name', 'script_name',
311-
'server_url', 'session_uuid', 'shot_code', 'task_content',
310+
'human_password', 'mock', 'project_name', 'script_name',
311+
'server_url', 'session_uuid', 'shot_code', 'task_content',
312312
'version_code', 'playlist_code'
313313
]
314314

tests/dummy_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Dummy data returned for schema functions when mocking the server.
22
3-
NOTE: Mostly abbreviated version of real data returned from the server.
3+
NOTE: Mostly abbreviated version of real data returned from the server.
44
"""
55

66
schema_entity_read = {'Version': {'name': {'editable': False, 'value': 'Version'}}}
@@ -873,4 +873,4 @@
873873
'valid_types': {'editable': True,
874874
'value': ['HumanUser',
875875
'ApiUser']}}}}
876-
876+

0 commit comments

Comments
 (0)