Convert format strings strings to f-strings (#23241)

* Convert all text strings to f-strings

Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+.

Flynt 0.69 was used to reformat the strings. 120 f-strings were created in 51 files.

F-strings are in general more readable, concise and performant. See also: https://www.python.org/dev/peps/pep-0498/#rationale

* revert pyextra changes

* revert ublox.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 55390d273f36f49da3896e687ac5530f40c1d150
This commit is contained in:
Ewout ter Hoeven
2021-12-16 14:58:17 +01:00
committed by GitHub
parent 7b3e330def
commit a962365292
47 changed files with 95 additions and 96 deletions
+2 -2
View File
@@ -54,13 +54,13 @@ if __name__ == "__main__":
elif args.dump_json:
print(json.dumps(evt.to_dict()))
elif values:
print("logMonotime = {}".format(evt.logMonoTime))
print(f"logMonotime = {evt.logMonoTime}")
for value in values:
if hasattr(evt, value[0]):
item = evt
for key in value:
item = getattr(item, key)
print("{} = {}".format(".".join(value), item))
print(f"{'.'.join(value)} = {item}")
print("")
else:
try: