mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-07 17:35:41 +08:00
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:
@@ -2,7 +2,7 @@
|
||||
import sys
|
||||
|
||||
if len(sys.argv) < 4:
|
||||
print("%s <route> <segment> <frame number>" % sys.argv[0])
|
||||
print(f"{sys.argv[0]} <route> <segment> <frame number>")
|
||||
print('example: ./fetch_image_from_route.py "02c45f73a2e5c6e9|2020-06-01--18-03-08" 3 500')
|
||||
exit(0)
|
||||
|
||||
@@ -33,5 +33,5 @@ if frame >= fr.frame_count:
|
||||
im = Image.fromarray(fr.get(frame, count=1, pix_fmt="rgb24")[0])
|
||||
fn = "uxxx_"+route.replace("|", "_")+"_%d_%d.png" % (segment, frame)
|
||||
im.save(fn)
|
||||
print("saved %s" % fn)
|
||||
print(f"saved {fn}")
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ def main(argv):
|
||||
i += 1
|
||||
except StopIteration:
|
||||
print('All done')
|
||||
print('Writed {} msgs'.format(i))
|
||||
print(f'Writed {i} msgs')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -7,7 +7,7 @@ import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2:
|
||||
print("%s <github username>" % sys.argv[0])
|
||||
print(f"{sys.argv[0]} <github username>")
|
||||
exit(1)
|
||||
|
||||
username = sys.argv[1]
|
||||
|
||||
Reference in New Issue
Block a user