Skip to content

Commit 380644a

Browse files
Upgrade to 3.6 syntax using pyupgrade.
1 parent 0980bc3 commit 380644a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+166
-199
lines changed

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# prompt_toolkit documentation build configuration file, created by
43
# sphinx-quickstart on Thu Jul 31 14:17:08 2014.

examples/dialogs/button_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def main():
1212
buttons=[("Yes", True), ("No", False), ("Maybe...", None)],
1313
).run()
1414

15-
print("Result = {}".format(result))
15+
print(f"Result = {result}")
1616

1717

1818
if __name__ == "__main__":

examples/dialogs/input_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def main():
1010
title="Input dialog example", text="Please type your name:"
1111
).run()
1212

13-
print("Result = {}".format(result))
13+
print(f"Result = {result}")
1414

1515

1616
if __name__ == "__main__":

examples/dialogs/password_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def main():
1212
password=True,
1313
).run()
1414

15-
print("Result = {}".format(result))
15+
print(f"Result = {result}")
1616

1717

1818
if __name__ == "__main__":

examples/dialogs/progress_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def worker(set_percentage, log_text):
1919
percentage = 0
2020
for dirpath, dirnames, filenames in os.walk("../.."):
2121
for f in filenames:
22-
log_text("{} / {}\n".format(dirpath, f))
22+
log_text(f"{dirpath} / {f}\n")
2323
set_percentage(percentage + 1)
2424
percentage += 2
2525
time.sleep(0.1)

examples/dialogs/radio_dialog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def main():
1818
text="Please select a color:",
1919
).run()
2020

21-
print("Result = {}".format(result))
21+
print(f"Result = {result}")
2222

2323
# With HTML.
2424
result = radiolist_dialog(
@@ -32,7 +32,7 @@ def main():
3232
text="Please select a color:",
3333
).run()
3434

35-
print("Result = {}".format(result))
35+
print(f"Result = {result}")
3636

3737

3838
if __name__ == "__main__":

examples/dialogs/yes_no_dialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def main():
1010
title="Yes/No dialog example", text="Do you want to confirm?"
1111
).run()
1212

13-
print("Result = {}".format(result))
13+
print(f"Result = {result}")
1414

1515

1616
if __name__ == "__main__":

examples/full-screen/ansi-art-and-textarea.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python
2-
from __future__ import unicode_literals
32

43
from prompt_toolkit.application import Application
54
from prompt_toolkit.formatted_text import ANSI, HTML

examples/full-screen/calculator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def accept(buff):
5454
input_field.text, eval(input_field.text)
5555
) # Don't do 'eval' in real code!
5656
except BaseException as e:
57-
output = "\n\n{}".format(e)
57+
output = f"\n\n{e}"
5858
new_text = output_field.text + output
5959

6060
# Add text to output buffer.

examples/full-screen/text-editor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ async def coroutine():
185185
try:
186186
with open(path, "rb") as f:
187187
text_field.text = f.read().decode("utf-8", errors="ignore")
188-
except IOError as e:
189-
show_message("Error", "{}".format(e))
188+
except OSError as e:
189+
show_message("Error", f"{e}")
190190

191191
ensure_future(coroutine())
192192

0 commit comments

Comments
 (0)