Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import re
|
| 2 |
import random
|
| 3 |
from http import HTTPStatus
|
|
@@ -21,28 +22,16 @@ import string
|
|
| 21 |
import random
|
| 22 |
import requests # Additional import statement
|
| 23 |
|
| 24 |
-
import os
|
| 25 |
-
import sys
|
| 26 |
-
import ast # 추가 삽입
|
| 27 |
|
| 28 |
-
|
|
|
|
| 29 |
script_repr = os.getenv("APP")
|
| 30 |
if script_repr is None:
|
| 31 |
print("Error: Environment variable 'APP' not set.")
|
| 32 |
sys.exit(1)
|
| 33 |
|
| 34 |
try:
|
| 35 |
-
|
| 36 |
-
compiled_code = compile(script_repr, '<string>', 'exec')
|
| 37 |
-
# 전역 및 지역 네임스페이스 정의
|
| 38 |
-
globals_dict = globals()
|
| 39 |
-
locals_dict = {}
|
| 40 |
-
|
| 41 |
-
# 컴파일된 코드 실행
|
| 42 |
-
exec(compiled_code, globals_dict, locals_dict)
|
| 43 |
except Exception as e:
|
| 44 |
print(f"Error executing script: {e}")
|
| 45 |
-
# 오류 정보 더 자세히 출력
|
| 46 |
-
import traceback
|
| 47 |
-
traceback.print_exc()
|
| 48 |
sys.exit(1)
|
|
|
|
| 1 |
+
import os
|
| 2 |
import re
|
| 3 |
import random
|
| 4 |
from http import HTTPStatus
|
|
|
|
| 22 |
import random
|
| 23 |
import requests # Additional import statement
|
| 24 |
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
+
import sys
|
| 27 |
+
import ast #추가 삽입, requirements: albumentations 추가
|
| 28 |
script_repr = os.getenv("APP")
|
| 29 |
if script_repr is None:
|
| 30 |
print("Error: Environment variable 'APP' not set.")
|
| 31 |
sys.exit(1)
|
| 32 |
|
| 33 |
try:
|
| 34 |
+
exec(script_repr)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
except Exception as e:
|
| 36 |
print(f"Error executing script: {e}")
|
|
|
|
|
|
|
|
|
|
| 37 |
sys.exit(1)
|