xtn-tools-pro 1.0.0.8.8__py3-none-any.whl → 1.0.0.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of xtn-tools-pro might be problematic. Click here for more details.
- xtn_tools_pro/flask_demo/cli.py +7 -1
- xtn_tools_pro/flask_demo/templates/server_run.py +33 -0
- {xtn_tools_pro-1.0.0.8.8.dist-info → xtn_tools_pro-1.0.0.9.0.dist-info}/METADATA +1 -1
- {xtn_tools_pro-1.0.0.8.8.dist-info → xtn_tools_pro-1.0.0.9.0.dist-info}/RECORD +8 -7
- {xtn_tools_pro-1.0.0.8.8.dist-info → xtn_tools_pro-1.0.0.9.0.dist-info}/LICENSE +0 -0
- {xtn_tools_pro-1.0.0.8.8.dist-info → xtn_tools_pro-1.0.0.9.0.dist-info}/WHEEL +0 -0
- {xtn_tools_pro-1.0.0.8.8.dist-info → xtn_tools_pro-1.0.0.9.0.dist-info}/entry_points.txt +0 -0
- {xtn_tools_pro-1.0.0.8.8.dist-info → xtn_tools_pro-1.0.0.9.0.dist-info}/top_level.txt +0 -0
xtn_tools_pro/flask_demo/cli.py
CHANGED
@@ -41,9 +41,15 @@ def create_project(args):
|
|
41
41
|
|
42
42
|
# 复制模板文件到项目目录
|
43
43
|
template_dir = os.path.join(os.path.dirname(__file__), 'templates')
|
44
|
+
print("template_dir", template_dir)
|
45
|
+
print("project_dir", project_dir)
|
44
46
|
for item in os.listdir(template_dir):
|
45
47
|
src = os.path.join(template_dir, item)
|
46
48
|
dst = os.path.join(project_dir, item)
|
49
|
+
print("item", item)
|
50
|
+
print("src", src)
|
51
|
+
print("dst", dst)
|
52
|
+
print("==========================")
|
47
53
|
|
48
54
|
if os.path.isdir(src):
|
49
55
|
shutil.copytree(src, dst) # 判断是否为目录,递归地复制整个目录树
|
@@ -60,7 +66,7 @@ class CustomArgumentParser(argparse.ArgumentParser):
|
|
60
66
|
# 自定义错误消息
|
61
67
|
# self.print_help()
|
62
68
|
print("错误:缺少必需的参数!")
|
63
|
-
print("请使用以下格式运行:
|
69
|
+
print("请使用以下格式运行:xtn_tools_pro startobj <项目名称>")
|
64
70
|
self.exit(2) # 退出程序,返回状态码 2
|
65
71
|
|
66
72
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
from app import create_app
|
5
|
+
from app.libs.error import APIException
|
6
|
+
from werkzeug.exceptions import HTTPException
|
7
|
+
from app.libs.error_code import ServerError500, MethodException
|
8
|
+
|
9
|
+
app = create_app()
|
10
|
+
|
11
|
+
|
12
|
+
@app.errorhandler(Exception)
|
13
|
+
def framework_error(e):
|
14
|
+
print("发生错误啦 => ", e)
|
15
|
+
if isinstance(e, APIException):
|
16
|
+
return e
|
17
|
+
elif isinstance(e, HTTPException):
|
18
|
+
if e.code == 405:
|
19
|
+
# 请求的URL不允许使用该方法
|
20
|
+
return MethodException()
|
21
|
+
else:
|
22
|
+
code = e.code
|
23
|
+
msg = e.description
|
24
|
+
error_code = 4999
|
25
|
+
return APIException(msg + "HTTP Exception 4999", code, error_code)
|
26
|
+
else:
|
27
|
+
print(e)
|
28
|
+
return ServerError500()
|
29
|
+
|
30
|
+
|
31
|
+
if __name__ == '__main__':
|
32
|
+
app.run(host="0.0.0.0", port=10089, debug=True)
|
33
|
+
|
@@ -7,13 +7,14 @@ xtn_tools_pro/db/MysqlDB.py,sha256=SBJrcjbZdxmtTKPGwl57NthPhs4uX8J3P6o_rK01O4k,1
|
|
7
7
|
xtn_tools_pro/db/RedisDB.py,sha256=YSWxYEPE2jp6r1ZKam2LyPgL0S2S9lGDmt36PLSwThg,6470
|
8
8
|
xtn_tools_pro/db/__init__.py,sha256=Zg91UWS02TO0Ba_0AY56s0oabRy93xLNFkpIIL_6mMM,416
|
9
9
|
xtn_tools_pro/flask_demo/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
10
|
-
xtn_tools_pro/flask_demo/cli.py,sha256=
|
10
|
+
xtn_tools_pro/flask_demo/cli.py,sha256=NAvCYsmsUEn6OrrMO9dluuoMZRtXUybWBwLCGMn4ymE,3104
|
11
11
|
xtn_tools_pro/flask_demo/ai_server_api/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
12
12
|
xtn_tools_pro/flask_demo/ai_server_api/recognize_ai_server_pro.py,sha256=l3VGFGGSVh2PjWodwOGCWfdCQ6ERXf3ZIccURIxUYqk,896
|
13
13
|
xtn_tools_pro/flask_demo/ai_server_api/app/__init__.py,sha256=GtoReIEP40zQZUH8yzouon-YWLctoexY_DlW-eIbojw,912
|
14
14
|
xtn_tools_pro/flask_demo/ai_server_api/app/app.py,sha256=1X6pp3yD5iygTv6SRJGwEZEFTQZw-oSaO2i45T2oyKM,476
|
15
15
|
xtn_tools_pro/flask_demo/templates/__init__.py,sha256=2hSMIjKC8-T_9aTJU35DjkwWKa1-ZzMgwfFajs69TWI,418
|
16
16
|
xtn_tools_pro/flask_demo/templates/recognize_ai_server_pro.py,sha256=l3VGFGGSVh2PjWodwOGCWfdCQ6ERXf3ZIccURIxUYqk,896
|
17
|
+
xtn_tools_pro/flask_demo/templates/server_run.py,sha256=l3VGFGGSVh2PjWodwOGCWfdCQ6ERXf3ZIccURIxUYqk,896
|
17
18
|
xtn_tools_pro/flask_demo/templates/app/__init__.py,sha256=GtoReIEP40zQZUH8yzouon-YWLctoexY_DlW-eIbojw,912
|
18
19
|
xtn_tools_pro/flask_demo/templates/app/app.py,sha256=1X6pp3yD5iygTv6SRJGwEZEFTQZw-oSaO2i45T2oyKM,476
|
19
20
|
xtn_tools_pro/proxy/XiaoXiangProxy.py,sha256=45SsMZDc-3Ta4THX38vScjaeRBJSp420AJwBeogC_-I,11049
|
@@ -32,9 +33,9 @@ xtn_tools_pro/utils/retry.py,sha256=0wjHsR5DBBKpv4naMfxiky8kprrZes4WURIfFQ4H708,
|
|
32
33
|
xtn_tools_pro/utils/set_data.py,sha256=IthfAclck7AbaxOIKOgJZ2wdcfEmlvC-C63Tywcr4bA,11180
|
33
34
|
xtn_tools_pro/utils/sql.py,sha256=EAKzbkZP7Q09j15Gm6o0_uq0qgQmcCQT6EAawbpp4v0,6263
|
34
35
|
xtn_tools_pro/utils/time_utils.py,sha256=TUtzG61PeVYXhaQd6pBrXAdlz7tBispNIRQRcGhE2No,4859
|
35
|
-
xtn_tools_pro-1.0.0.
|
36
|
-
xtn_tools_pro-1.0.0.
|
37
|
-
xtn_tools_pro-1.0.0.
|
38
|
-
xtn_tools_pro-1.0.0.
|
39
|
-
xtn_tools_pro-1.0.0.
|
40
|
-
xtn_tools_pro-1.0.0.
|
36
|
+
xtn_tools_pro-1.0.0.9.0.dist-info/LICENSE,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
|
+
xtn_tools_pro-1.0.0.9.0.dist-info/METADATA,sha256=4jVE3_-8qYhn09Wr_GibSMqObUcgH26nmWU_59A7XoE,498
|
38
|
+
xtn_tools_pro-1.0.0.9.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
39
|
+
xtn_tools_pro-1.0.0.9.0.dist-info/entry_points.txt,sha256=t8CtXWOgw7nRDW3XNlZh8MT_P4l8EzsFnyWi5b3ovrc,68
|
40
|
+
xtn_tools_pro-1.0.0.9.0.dist-info/top_level.txt,sha256=jyB3FLDEr8zE1U7wHczTgIbvUpALhR-ULF7RVEO7O2U,14
|
41
|
+
xtn_tools_pro-1.0.0.9.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|