Skip to content

Commit 1722624

Browse files
Samuel ScullySamuel Scully
authored andcommitted
Fix line length lint
1 parent fc071a0 commit 1722624

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
max-line-length = 110
2+
max-line-length = 120
33
exclude = .git,__pycache__,build,dist
44
ignore = W503
55
per-file-ignores =

opencage/batch.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
from tqdm import tqdm
1212
import certifi
1313
import backoff
14-
from opencage.geocoder import OpenCageGeocode, OpenCageGeocodeError, _query_for_reverse_geocoding, floatify_latlng
14+
from opencage.geocoder import (
15+
OpenCageGeocode,
16+
OpenCageGeocodeError,
17+
_query_for_reverse_geocoding,
18+
floatify_latlng
19+
)
1520

1621

1722
class OpenCageBatchGeocoder():
@@ -77,7 +82,12 @@ async def geocode(self, csv_input, csv_output):
7782

7883
async def test_request(self):
7984
try:
80-
async with OpenCageGeocode(self.options.api_key, domain=self.options.api_domain, sslcontext=self.sslcontext, user_agent_comment=self.user_agent_comment) as geocoder:
85+
async with OpenCageGeocode(
86+
self.options.api_key,
87+
domain=self.options.api_domain,
88+
sslcontext=self.sslcontext,
89+
user_agent_comment=self.user_agent_comment
90+
) as geocoder:
8191
result = await geocoder.geocode_async('Kendall Sq, Cambridge, MA', raw_response=True)
8292

8393
free = False
@@ -175,7 +185,12 @@ def on_backoff(details):
175185
max_tries=self.options.retries,
176186
on_backoff=on_backoff)
177187
async def _geocode_one_address():
178-
async with OpenCageGeocode(self.options.api_key, domain=self.options.api_domain, sslcontext=self.sslcontext, user_agent_comment=self.user_agent_comment) as geocoder:
188+
async with OpenCageGeocode(
189+
self.options.api_key,
190+
domain=self.options.api_domain,
191+
sslcontext=self.sslcontext,
192+
user_agent_comment=self.user_agent_comment
193+
) as geocoder:
179194
geocoding_results = None
180195
response = None
181196
params = {'no_annotations': 1, 'raw_response': True, **self.options.optional_api_params}
@@ -208,7 +223,13 @@ async def _geocode_one_address():
208223
'response': response
209224
})
210225

211-
await self.write_one_geocoding_result(csv_output, row_id, geocoding_result, response, original_columns)
226+
await self.write_one_geocoding_result(
227+
csv_output,
228+
row_id,
229+
geocoding_result,
230+
response,
231+
original_columns
232+
)
212233
except Exception as exc:
213234
traceback.print_exception(exc, file=sys.stderr)
214235

opencage/command_line.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ def add_optional_arguments(parser):
9090
default=default_input_cols,
9191
help=f"Comma-separated list of integers (default '{default_input_cols}')",
9292
metavar='')
93-
default_add_cols = 'lat,lng,_type,_category,country_code,country,state,county,_normalized_city,postcode,road,house_number,confidence,formatted'
93+
default_add_cols = (
94+
'lat,lng,_type,_category,country_code,country,state,county,_normalized_city,'
95+
'postcode,road,house_number,confidence,formatted'
96+
)
9497
parser.add_argument(
9598
"--add-columns",
9699
type=comma_separated_type(str),

0 commit comments

Comments
 (0)