-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
49 lines (41 loc) · 1.11 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import time
import os
from flask import Flask
app = Flask(__name__)
@app.route("/")
def get_dog() -> str:
dog: str = ""
dog += "\n"
dog += "\n"
dog += "\n"
dog += " hello\n"
dog += " __\n"
dog += " , ,\" e`--o\n"
dog += " (( ( | __,'\n"
dog += " \\~----------------' \_;/\n"
dog += " ( /\n"
dog += " /) ._______________. )\n"
dog += " (( ( (( (\n"
dog += " ``-' ``-'\n"
dog += " bello\n"
dog += "\n"
dog += "\n"
dog += "\n"
return dog
def main():
dog: str = get_dog()
end: int = int(os.getenv('DOG_REPITITIONS', -1))
index: int = 0
while True:
print(dog)
if end > 0 and index >= end -1:
return
index += 1
time.sleep(1)
if __name__ == "__main__":
mode: str = os.getenv('DOG_MODE', 'SERVER')
print('Start hello_bello as', mode)
if mode == 'SERVER':
app.run(host='0.0.0.0')
else:
main()