Skip to content

Commit 5aba623

Browse files
committed
Refactoring. flask__webservers/. Adding the None annotation to the return value
1 parent 40a200b commit 5aba623

27 files changed

Lines changed: 33 additions & 33 deletions

File tree

‎flask__webservers/cors__hello_world.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
@app.route("/")
19-
def index():
19+
def index() -> str:
2020
return "Hello World!"
2121

2222

‎flask__webservers/custom_error_page/main.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def index():
3939

4040

4141
@app.route("/500")
42-
def do_500():
42+
def do_500() -> None:
4343
1/0
4444

4545

‎flask__webservers/flask_debugtoolbar__examples/app.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ExampleModel(db.Model):
2828

2929

3030
@app.before_first_request
31-
def setup():
31+
def setup() -> None:
3232
db.create_all()
3333

3434

‎flask__webservers/flask_debugtoolbar__examples/hello_world.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
@app.route("/")
20-
def index():
20+
def index() -> str:
2121
# NOTE: Need tab body: "Could not insert debug toolbar. </body> tag not found in response."
2222
return "<body>Hello World!</body>"
2323

‎flask__webservers/get_URL__parameter_argument_query.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
@app.route("/")
16-
def index():
16+
def index() -> str:
1717
return """
1818
<div id="result"></div>
1919

‎flask__webservers/get_upload_and_image_process/main.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636

3737
# SOURCE: https://github.com/gil9red/SimplePyScripts/blob/master/img_to_base64_html/main.py
38-
def img_to_base64_html(file_name__or__bytes__or__file_object):
38+
def img_to_base64_html(file_name__or__bytes__or__file_object) -> str:
3939
arg = file_name__or__bytes__or__file_object
4040

4141
if type(arg) == str:
@@ -72,12 +72,12 @@ def img_to_base64_html(file_name__or__bytes__or__file_object):
7272
LAST_IMAGE = "last_image.jpg"
7373

7474

75-
def save_last_image(file_data):
75+
def save_last_image(file_data) -> None:
7676
with open(LAST_IMAGE, "wb") as f:
7777
f.write(file_data)
7878

7979

80-
def load_last_image():
80+
def load_last_image() -> bytes:
8181
with open(LAST_IMAGE, "rb") as f:
8282
return f.read()
8383

‎flask__webservers/get_upload_image_info/main.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def get_exif_tags(file_object_or_file_name, as_category=True):
8585

8686

8787
# SOURCE: https://github.com/gil9red/SimplePyScripts/blob/master/img_to_base64_html/main.py
88-
def img_to_base64_html(file_name__or__bytes__or__file_object):
88+
def img_to_base64_html(file_name__or__bytes__or__file_object) -> str:
8989
arg = file_name__or__bytes__or__file_object
9090

9191
if type(arg) == str:

‎flask__webservers/hello_world.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
@app.route("/")
17-
def index():
17+
def index() -> str:
1818
return "Hello World!"
1919

2020

‎flask__webservers/logging__examples/main_new.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242

4343
@app.route("/")
44-
def index():
44+
def index() -> str:
4545
log.debug("call index")
4646
return "Hello World!"
4747

‎flask__webservers/logging__examples/main_old.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444

4545
@app.route("/")
46-
def index():
46+
def index() -> str:
4747
log.debug("call index")
4848
return "Hello World!"
4949

0 commit comments

Comments
 (0)