Skip to content

Commit 39770a3

Browse files
committed
PEP8
1 parent 3870734 commit 39770a3

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

cities_light/management/commands/cities_light.py

+13-10
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ class Command(BaseCommand):
8080
),
8181
optparse.make_option('--verify-city-import', action='store_true',
8282
default=False,
83-
help='Verify city import and print out missing cities. For debug purposes only.'
83+
help='Verify city import and print out missing cities.'
8484
),
85-
)
85+
)
8686

8787
@transaction.commit_on_success
8888
def handle(self, *args, **options):
@@ -101,7 +101,7 @@ def handle(self, *args, **options):
101101
' Done: ',
102102
progressbar.Percentage(),
103103
progressbar.Bar(),
104-
]
104+
]
105105

106106
for url in SOURCES:
107107
destination_file_name = url.split('/')[-1]
@@ -160,11 +160,12 @@ def handle(self, *args, **options):
160160
progress.finish()
161161

162162
if url in TRANSLATION_SOURCES and options.get(
163-
'hack_translations', False):
163+
'hack_translations', False):
164164
with open(translation_hack_path, 'w+') as f:
165165
pickle.dump(self.translation_data, f)
166166

167-
if options.get('verify_city_import', False) and url in CITY_SOURCES:
167+
if (options.get('verify_city_import', False) and
168+
url in CITY_SOURCES):
168169
self.logger.info('Verifying city import')
169170
self.verify_city_import(geonames)
170171

@@ -290,10 +291,12 @@ def verify_city_import(self, geonames):
290291
except City.DoesNotExist:
291292
self.logger.info(items)
292293
for duplicate_items in geonames.parse():
293-
if items[0] != duplicate_items[0] and items[1] == duplicate_items[1] and items[8] == duplicate_items[8] and items[10] == duplicate_items[10]:
294+
if (items[0] != duplicate_items[0] and
295+
items[1] == duplicate_items[1] and
296+
items[8] == duplicate_items[8] and
297+
items[10] == duplicate_items[10]):
294298
self.logger.info(duplicate_items)
295299

296-
297300
def city_import(self, items):
298301
try:
299302
city_items_pre_import.send(sender=self, items=items)
@@ -314,12 +317,12 @@ def city_import(self, items):
314317
raise
315318

316319
try:
317-
region_id=self._get_region_id(country_code2, region_geoname_code)
320+
region_id = self._get_region_id(country_code2, region_geoname_code)
318321
except Region.DoesNotExist:
319322
if self.noinsert:
320323
return
321324
else:
322-
region_id=None
325+
region_id = None
323326

324327
try:
325328
kwargs = dict(name=force_unicode(name),
@@ -389,7 +392,7 @@ def translation_parse(self, items):
389392
Country: {},
390393
Region: {},
391394
City: {},
392-
}
395+
}
393396

394397
if len(items) > 4:
395398
# avoid shortnames, colloquial, and historic

0 commit comments

Comments
 (0)