Skip to content

Commit

Permalink
f-string modernization
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinbjornt committed Aug 12, 2023
1 parent ac9efb6 commit 4a89db7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ venv
*.zip
*.csv
.vscode
*.pyc
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ in the database:
```python
>>> from iceaddr import nearest_addr
>>> addr = nearest_addr(64.148446, -21.944933)[0]
>>> print("{0} {1}".format(addr["heiti_nf"], addr["husnr"]))
>>> print(f"{addr['heiti_nf']} {addr['husnr']}")
Öldugata 2
```

Expand Down
2 changes: 1 addition & 1 deletion add_placename_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def add_placenames_from_is50v(dbc) -> None:
# Special handling of flakes - use center point
elif type(c) is list:
if not c:
# print("Faulty flake: {0}".format(n))
# print(f"Faulty flake: {n}")
# pprint(i)
# raise
continue
Expand Down
2 changes: 1 addition & 1 deletion iceaddr/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def connection(self) -> sqlite3.Connection:
if not self.db_conn:
db_path = resource_filename(__name__, _DB_REL_PATH)
# Open database file in read-only mode via URI
db_uri = "file:{0}?mode=ro".format(db_path)
db_uri = f"file:{db_path}?mode=ro"
self.db_conn = sqlite3.connect(db_uri, uri=True, check_same_thread=False)
# Return rows as key-value dicts
self.db_conn.row_factory = lambda c, r: dict(
Expand Down

0 comments on commit 4a89db7

Please sign in to comment.