diff --git a/ogn/collect/database.py b/ogn/collect/database.py index b62ddff..3d193cb 100644 --- a/ogn/collect/database.py +++ b/ogn/collect/database.py @@ -30,7 +30,7 @@ def import_ddb(): logger.info("Import registered devices fom the DDB...") counter = update_devices(app.session, AddressOrigin.ogn_ddb, get_ddb()) - logger.info("Imported %i devices." % counter) + logger.info("Imported {} devices.".format(counter)) @app.task @@ -39,7 +39,7 @@ def import_file(path='tests/custom_ddb.txt'): logger.info("Import registered devices from '{}'...".format(path)) counter = update_devices(app.session, AddressOrigin.user_defined, get_ddb(path)) - logger.info("Imported %i devices." % counter) + logger.info("Imported {} devices.".format(counter)) @app.task diff --git a/ogn/collect/logbook.py b/ogn/collect/logbook.py index aa0834d..a748821 100644 --- a/ogn/collect/logbook.py +++ b/ogn/collect/logbook.py @@ -86,6 +86,6 @@ def compute_takeoff_and_landing(): result = app.session.execute(ins) counter = result.rowcount app.session.commit() - logger.debug("New/recalculated takeoffs and landings: %s" % counter) + logger.debug("New/recalculated takeoffs and landings: {}".format(counter)) return counter diff --git a/ogn/commands/logbook.py b/ogn/commands/logbook.py index 3e76a39..2bda31c 100644 --- a/ogn/commands/logbook.py +++ b/ogn/commands/logbook.py @@ -21,7 +21,7 @@ def compute(): print("Compute takeoffs and landings...") result = compute_takeoff_and_landing.delay() counter = result.get() - print("New/recalculated takeoffs/landings: %s" % counter) + print("New/recalculated takeoffs/landings: {}"format(counter)) @manager.command diff --git a/ogn/utils.py b/ogn/utils.py index fa4a0e5..c66ca08 100644 --- a/ogn/utils.py +++ b/ogn/utils.py @@ -49,15 +49,15 @@ def get_trackable(ddb): l = [] for i in ddb: if i.tracked and i.address_type in address_prefixes: - l.append('{}{}'.format(address_prefixes[i.address_type], i.address)) + l.append("{}{}".format(address_prefixes[i.address_type], i.address)) return l def get_country_code(latitude, longitude): geolocator = Nominatim() try: - location = geolocator.reverse("%f, %f" % (latitude, longitude)) - country_code = location.raw["address"]["country_code"] + location = geolocator.reverse("{}, {}".format(latitude, longitude)) + country_code = location.raw['address']['country_code'] except KeyError: country_code = None except GeopyError: