Skip to content

Commit f97c8fc

Browse files
author
Sara Safavi
committed
Flake8 fixes
1 parent 7337447 commit f97c8fc

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

planet/api/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def quick_search(self, request, **kw):
146146
'''Execute a quick search with the specified request.
147147
148148
:param request: see :ref:`api-search-request`
149-
:param \**kw: See Options below
149+
:param **kw: See Options below
150150
:returns: :py:class:`planet.api.models.Items`
151151
:raises planet.api.exceptions.APIException: On API error.
152152

planet/api/dispatch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def rebuild_auth(self, prepared_request, response):
8484
redir = prepared_request.url
8585
if not _is_subdomain_of_tld(orig, redir):
8686
prepared_request.headers.pop('Authorization')
87-
key = re.match('api-key (\S+)', existing_auth)
87+
key = re.match(r'api-key (\S+)', existing_auth)
8888
if key:
8989
prepared_request.prepare_url(
9090
prepared_request.url, {

planet/api/downloader.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class Downloader(object):
297297

298298
def shutdown(self):
299299
'''Halt execution.'''
300-
raise NotImplemented()
300+
raise NotImplementedError()
301301

302302
def stats(self):
303303
'''Retrieve internal state of the Downloader.
@@ -311,7 +311,7 @@ def stats(self):
311311
- complete: `int` number of completed downloads
312312
- pending: `int` number of items awaiting download
313313
'''
314-
raise NotImplemented()
314+
raise NotImplementedError()
315315

316316
def activate(self, items, asset_types):
317317
'''Request activation of specified asset_types for the sequence of
@@ -320,7 +320,7 @@ def activate(self, items, asset_types):
320320
:param items: a sequence of Item representations.
321321
:param asset_types list: list of asset-type (str)
322322
'''
323-
raise NotImplemented()
323+
raise NotImplementedError()
324324

325325
def download(self, items, asset_types, dest):
326326
'''Request activation and download of specified asset_types for the
@@ -330,7 +330,7 @@ def download(self, items, asset_types, dest):
330330
:param asset_types list: list of asset-type (str)
331331
:param dest str: Download destination directory, must exist.
332332
'''
333-
raise NotImplemented()
333+
raise NotImplementedError()
334334

335335
def on_complete(self, item, asset, path=None):
336336
'''Notification of processing an item's asset, invoked on completion of

planet/api/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def noop(*a, **kw):
140140
total += size
141141
callback(wrote=size, total=total)
142142
# seems some responses don't have a content-length header
143-
if self.size is 0:
143+
if self.size == 0:
144144
self.size = total
145145
callback(finish=self)
146146

planet/api/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def probably_wkt(text):
291291
'POINT', 'LINESTRING', 'POLYGON', 'MULTIPOINT',
292292
'MULTILINESTRING', 'MULTIPOLYGON', 'GEOMETRYCOLLECTION',
293293
])
294-
matched = re.match('(\w+)\s*\([^)]+\)', text.strip())
294+
matched = re.match(r'(\w+)\s*\([^)]+\)', text.strip())
295295
if matched:
296296
valid = matched.group(1).upper() in valid_types
297297
return valid

planet/scripts/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
def _split(value):
3737
'''return input split on any whitespace or comma'''
38-
return re.split('\s+|,', value)
38+
return re.split(r'\s+|,', value)
3939

4040

4141
# monkey patch warnings module to hide InsecurePlatformWarning - the warning

tests/test_atomic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def assert_content_is(expected):
4646

4747
# manual discarding
4848
with atomic_open(outfile, 'w') as fp:
49-
fp.write('bazzy')
50-
fp.discard()
49+
fp.write('bazzy')
50+
fp.discard()
5151
assert_content_is('bar')
5252
# no tmp files remain
5353
assert ['foo'] == lsdir()

0 commit comments

Comments
 (0)