kunapi 1.2__tar.gz → 1.4__tar.gz
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.
- {kunapi-1.2 → kunapi-1.4}/PKG-INFO +2 -2
- {kunapi-1.2 → kunapi-1.4}/kunapi/Events.py +0 -1
- {kunapi-1.2 → kunapi-1.4}/kunapi/__init__.py +1 -1
- {kunapi-1.2 → kunapi-1.4}/kunapi/app.py +67 -79
- {kunapi-1.2 → kunapi-1.4}/kunapi/kunapi.py +82 -52
- {kunapi-1.2 → kunapi-1.4}/kunapi.egg-info/PKG-INFO +2 -2
- {kunapi-1.2 → kunapi-1.4}/kunapi.egg-info/SOURCES.txt +22 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi.egg-info/requires.txt +1 -0
- {kunapi-1.2 → kunapi-1.4}/setup.py +1 -1
- {kunapi-1.2 → kunapi-1.4}/kunapi/common/__init__.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/common/autoload.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/common/globals.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/common/request.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/config/__init__.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/__init__.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/__init__.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/common/__init__.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/common/autoload.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/common/model.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/config/__init__.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/config/app.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/index/__init__.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/index/common/__init__.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/index/common/autoload.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/index/controller/__init__.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/index/controller/index/__init__.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/index/controller/index/common/model.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/index/controller/index/index.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/server.py +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi.egg-info/dependency_links.txt +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi.egg-info/entry_points.txt +0 -0
- {kunapi-1.2 → kunapi-1.4}/kunapi.egg-info/top_level.txt +0 -0
- {kunapi-1.2 → kunapi-1.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.2
|
|
2
2
|
Name: kunapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4
|
|
4
4
|
Summary: kunapi
|
|
5
5
|
Home-page: https://docs.kwebapp.cn/index/index/2
|
|
6
6
|
Author: 百里-坤坤
|
|
@@ -9,5 +9,5 @@ Maintainer: 坤坤
|
|
|
9
9
|
Maintainer-email: fengkun01@qq.com
|
|
10
10
|
License: MIT License
|
|
11
11
|
Description: kunapi
|
|
12
|
-
Keywords: kunapi1.
|
|
12
|
+
Keywords: kunapi1.4
|
|
13
13
|
Platform: UNKNOWN
|
|
@@ -12,7 +12,6 @@ class web:
|
|
|
12
12
|
self.__name=name
|
|
13
13
|
self.__appname=appname
|
|
14
14
|
if self.__name == '__main__' or self.__name=='kunapi.kunapi' or self.__name=='kwebs.kwebs' or self.__name=='kwebsp.kwebsp':
|
|
15
|
-
# print("web__new__",self.__name)
|
|
16
15
|
return super().__new__(self)
|
|
17
16
|
else:
|
|
18
17
|
def apps(env, start_response):
|
|
@@ -79,7 +78,6 @@ class web:
|
|
|
79
78
|
pass
|
|
80
79
|
else:
|
|
81
80
|
body=bytes(body, encoding='utf-8')
|
|
82
|
-
# print(env)
|
|
83
81
|
start_response(status,resheader)
|
|
84
82
|
return [body]
|
|
85
83
|
return apps
|
|
@@ -104,19 +102,18 @@ class web:
|
|
|
104
102
|
# config.app['cli']=False
|
|
105
103
|
if 'kwebsp' in cmd[0]: #基于新版本4.13.32之后 kwebsp server运行
|
|
106
104
|
cmd[0]='kwebsp'
|
|
107
|
-
filename=cmd[0]
|
|
105
|
+
# filename=cmd[0]
|
|
108
106
|
elif 'kwebs' in cmd[0]: #基于新版本4.13.32之后 kwebs server运行
|
|
109
107
|
cmd[0]='kwebs'
|
|
110
|
-
filename=cmd[0]
|
|
108
|
+
# filename=cmd[0]
|
|
111
109
|
elif 'kunapi' in cmd[0]:
|
|
112
110
|
cmd[0]='kunapi'
|
|
113
|
-
|
|
114
|
-
else:
|
|
115
|
-
|
|
116
|
-
# self.__filename=filename
|
|
111
|
+
# filename=cmd[0]
|
|
112
|
+
# else:
|
|
113
|
+
# filename=cmd[0][:-3]
|
|
117
114
|
if self.__config.app['app_debug']:
|
|
118
115
|
if 'eventlog' in cmd:
|
|
119
|
-
self.__impl(host=host,port=port
|
|
116
|
+
self.__impl(host=host,port=port)
|
|
120
117
|
else:
|
|
121
118
|
if name:
|
|
122
119
|
cmd.insert(0,name)
|
|
@@ -124,10 +121,10 @@ class web:
|
|
|
124
121
|
from . Events import Events
|
|
125
122
|
Events(cmd)
|
|
126
123
|
else:
|
|
127
|
-
self.__impl(host=host,port=port
|
|
128
|
-
elif len(
|
|
124
|
+
self.__impl(host=host,port=port)
|
|
125
|
+
elif len(cmd)==3 and cmd[2]=='--cli':
|
|
129
126
|
try:
|
|
130
|
-
RAW_URI=
|
|
127
|
+
RAW_URI=cmd[1]
|
|
131
128
|
except:pass
|
|
132
129
|
else:
|
|
133
130
|
self.cli(RAW_URI)
|
|
@@ -161,41 +158,22 @@ class web:
|
|
|
161
158
|
status,resheader,body=self.__routes(reqheader)
|
|
162
159
|
print(body)
|
|
163
160
|
if(config.app['save_cli_pid']) and pid:
|
|
164
|
-
|
|
165
161
|
try:
|
|
166
162
|
os.remove(clipidpath)
|
|
167
163
|
except:pass
|
|
168
|
-
def __impl(self,host,port
|
|
164
|
+
def __impl(self,host,port):
|
|
169
165
|
"运行测试服务器"
|
|
170
166
|
try:
|
|
171
|
-
|
|
172
|
-
#
|
|
173
|
-
#
|
|
174
|
-
#
|
|
175
|
-
#
|
|
176
|
-
#
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
# host=host,
|
|
180
|
-
# port=port,
|
|
181
|
-
# filename=filename
|
|
182
|
-
# )
|
|
183
|
-
# elif config.app['http_server']=='kwebs_server':
|
|
184
|
-
# self.__http_server(
|
|
185
|
-
# host=host,
|
|
186
|
-
# port=port,
|
|
187
|
-
# filename=filename
|
|
188
|
-
# )
|
|
189
|
-
# else:
|
|
190
|
-
# self.__http_wsgi(
|
|
191
|
-
# host=host,
|
|
192
|
-
# port=port,
|
|
193
|
-
# filename=filename
|
|
194
|
-
# )
|
|
195
|
-
self.__http_wsgi(
|
|
167
|
+
|
|
168
|
+
# self.__http_wsgi(
|
|
169
|
+
# host=host,
|
|
170
|
+
# port=port,
|
|
171
|
+
# filename=filename
|
|
172
|
+
# )
|
|
173
|
+
|
|
174
|
+
self.__waitress(
|
|
196
175
|
host=host,
|
|
197
|
-
port=port
|
|
198
|
-
filename=filename
|
|
176
|
+
port=port
|
|
199
177
|
)
|
|
200
178
|
except KeyboardInterrupt:
|
|
201
179
|
pass
|
|
@@ -333,7 +311,6 @@ class web:
|
|
|
333
311
|
# elif route['plug']: #配置模块但没有匹配插件
|
|
334
312
|
# plug=route['plug']
|
|
335
313
|
elif getplug:
|
|
336
|
-
# print('getplug',getplug)
|
|
337
314
|
plug=getplug
|
|
338
315
|
routedefault,PATH_INFO=web.__getconfigroute(
|
|
339
316
|
self,
|
|
@@ -356,7 +333,6 @@ class web:
|
|
|
356
333
|
param.append(urllib.parse.unquote(path))
|
|
357
334
|
i+=1
|
|
358
335
|
else: #完全默认
|
|
359
|
-
# print('完全默认')
|
|
360
336
|
routedefault,PATH_INFO=web.__getconfigroute(self,PATH_INFO,header)
|
|
361
337
|
if routedefault: #使用默认路由
|
|
362
338
|
for path in PATH_INFO:
|
|
@@ -550,7 +526,6 @@ class web:
|
|
|
550
526
|
status="500 Internal Server Error"
|
|
551
527
|
errms=status
|
|
552
528
|
if self.__config.app['app_debug']:
|
|
553
|
-
# print(traceback.format_exc())
|
|
554
529
|
errms=traceback.format_exc().split("\n")
|
|
555
530
|
body=web.__tpl(
|
|
556
531
|
title = status,
|
|
@@ -696,11 +671,14 @@ class web:
|
|
|
696
671
|
# headers={"Content-Type":"application/json; charset=utf-8","Access-Control-Allow-Origin":"*"}
|
|
697
672
|
# return arr,'500 error',headers
|
|
698
673
|
def __application(self,env, start_response):
|
|
699
|
-
# print(env)
|
|
700
674
|
try:
|
|
701
675
|
request_body_size = int(env.get('CONTENT_LENGTH', '0'))
|
|
702
676
|
except (ValueError):
|
|
703
677
|
request_body_size = 0
|
|
678
|
+
try:
|
|
679
|
+
env['CONTENT_TYPE']
|
|
680
|
+
except (KeyError):
|
|
681
|
+
env['CONTENT_TYPE'] = ''
|
|
704
682
|
if 'multipart/form-data; boundary' in env['CONTENT_TYPE']:#上传文件
|
|
705
683
|
files = cgi.FieldStorage(fp=env['wsgi.input'], environ=env, keep_blank_values=True)
|
|
706
684
|
# open(form["file"].filename, 'wb').write(form["file"].value)
|
|
@@ -715,39 +693,39 @@ class web:
|
|
|
715
693
|
env['RAW_URI']=env['PATH_INFO']
|
|
716
694
|
if env.get('QUERY_STRING'):
|
|
717
695
|
env['RAW_URI']=str(env['PATH_INFO'])+"?"+str(env.get('QUERY_STRING'))
|
|
718
|
-
try:
|
|
719
|
-
|
|
720
|
-
except:
|
|
721
|
-
|
|
722
|
-
try:
|
|
723
|
-
|
|
724
|
-
except:
|
|
725
|
-
|
|
726
|
-
try:
|
|
727
|
-
|
|
728
|
-
except:
|
|
729
|
-
|
|
730
|
-
try:
|
|
731
|
-
|
|
732
|
-
except:
|
|
733
|
-
|
|
734
|
-
try:
|
|
735
|
-
|
|
736
|
-
except:
|
|
737
|
-
|
|
696
|
+
# try:
|
|
697
|
+
# env['REMOTE_ADDR']
|
|
698
|
+
# except:
|
|
699
|
+
# env['REMOTE_ADDR']=''
|
|
700
|
+
# try:
|
|
701
|
+
# env['wsgi.url_scheme']
|
|
702
|
+
# except:
|
|
703
|
+
# env['wsgi.url_scheme']=''
|
|
704
|
+
# try:
|
|
705
|
+
# env['HTTP_X_REAL_IP']
|
|
706
|
+
# except:
|
|
707
|
+
# env['HTTP_X_REAL_IP']=''
|
|
708
|
+
# try:
|
|
709
|
+
# env['HTTP_COOKIE']
|
|
710
|
+
# except:
|
|
711
|
+
# env['HTTP_COOKIE']=''
|
|
712
|
+
# try:
|
|
713
|
+
# env['HTTP_USER_AGENT']
|
|
714
|
+
# except:
|
|
715
|
+
# env['HTTP_USER_AGENT']=''
|
|
738
716
|
reqheader={
|
|
739
|
-
'REQUEST_METHOD':env
|
|
740
|
-
'url_scheme':env
|
|
741
|
-
'RAW_URI':env
|
|
742
|
-
'PATH_INFO':env
|
|
743
|
-
'QUERY_STRING':env
|
|
744
|
-
'SERVER_PROTOCOL':env
|
|
745
|
-
'HTTP_HOST':env
|
|
746
|
-
'HTTP_COOKIE':env
|
|
747
|
-
'REMOTE_ADDR':env
|
|
748
|
-
'HTTP_USER_AGENT':env
|
|
749
|
-
'BODY_DATA':env
|
|
750
|
-
'HTTP_X_REAL_IP':env
|
|
717
|
+
'REQUEST_METHOD':env.get('REQUEST_METHOD'),
|
|
718
|
+
'url_scheme':env.get('wsgi.url_scheme'),
|
|
719
|
+
'RAW_URI':env.get('RAW_URI'),
|
|
720
|
+
'PATH_INFO':env.get('PATH_INFO'),
|
|
721
|
+
'QUERY_STRING':env.get('QUERY_STRING'),
|
|
722
|
+
'SERVER_PROTOCOL':env.get('SERVER_PROTOCOL'),
|
|
723
|
+
'HTTP_HOST':env.get('HTTP_HOST'),
|
|
724
|
+
'HTTP_COOKIE':env.get('HTTP_COOKIE'),
|
|
725
|
+
'REMOTE_ADDR':env.get('REMOTE_ADDR'),
|
|
726
|
+
'HTTP_USER_AGENT':env.get('HTTP_USER_AGENT'),
|
|
727
|
+
'BODY_DATA':env.get('BODY_DATA'),
|
|
728
|
+
'HTTP_X_REAL_IP':env.get('HTTP_X_REAL_IP'),
|
|
751
729
|
'files':files
|
|
752
730
|
}
|
|
753
731
|
p=(config.app['staticpath']+reqheader['RAW_URI'].replace(' ',''))
|
|
@@ -791,9 +769,19 @@ class web:
|
|
|
791
769
|
body=bytes(body, encoding='utf-8')
|
|
792
770
|
start_response(status,resheader)
|
|
793
771
|
return [body]
|
|
794
|
-
|
|
772
|
+
def __waitress(self,host,port):
|
|
773
|
+
if host=='0.0.0.0':
|
|
774
|
+
print("\033[32m* (CTRL+单击打开)http://127.0.0.1:"+str(port)+"(按CTRL+C退出)")
|
|
775
|
+
else:
|
|
776
|
+
print("\033[32m* 运行在http://"+host+":"+str(port)+"(按CTRL+C退出)")
|
|
777
|
+
if self.__config.app['app_debug']:
|
|
778
|
+
print('\033[37m* 调试器:开启')
|
|
779
|
+
else:
|
|
780
|
+
print('\033[37m* 调试器:已关闭')
|
|
781
|
+
from waitress import serve
|
|
782
|
+
serve(self.__application, host=host, port=port)
|
|
795
783
|
def __http_wsgi(self,host,port,filename):
|
|
796
|
-
"http——wsgi测试服务"
|
|
784
|
+
"http——wsgi测试服务 windows建议使用Waitress"
|
|
797
785
|
from wsgiref.simple_server import make_server
|
|
798
786
|
print("* \033[1;31;40m! 警告:\033[0m这是一个wsgiref开发服务器。不要在生产环境中部署使用它")
|
|
799
787
|
# print('* 生产环境中建议使用gunicorn,gunicorn运行命令如:gunicorn -b '+host+':'+str(port)+' '+str(filename)+':app')
|
|
@@ -164,35 +164,9 @@ def cllfunction():
|
|
|
164
164
|
print("\033[32m"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" --modular api --uninstall 卸载app/api模块")
|
|
165
165
|
print("\033[32m"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" --modular api --plug plug1 --uninstall 卸载app/api/plug1插件\n")
|
|
166
166
|
else:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
if obj.config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr!=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1:
|
|
171
|
-
print("该项目只能使用"+obj.config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr+"开头的命令!")
|
|
172
|
-
exit()
|
|
173
|
-
except Exception as e:
|
|
174
|
-
print('项目不合法',traceback.format_exc())
|
|
175
|
-
exit()
|
|
176
|
-
config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1
|
|
177
|
-
from kunapi import web
|
|
178
|
-
try:
|
|
179
|
-
import app as application
|
|
180
|
-
except Exception as e:
|
|
181
|
-
if "No module named 'app'" in str(e):
|
|
182
|
-
print("请在"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"项目下运行")
|
|
183
|
-
else:
|
|
184
|
-
print(traceback.format_exc())
|
|
185
|
-
exit()
|
|
186
|
-
else:
|
|
187
|
-
app=web(__name__,application)
|
|
188
|
-
try:
|
|
189
|
-
RAW_URI=sys.argv[1]
|
|
190
|
-
except:pass
|
|
191
|
-
else:
|
|
192
|
-
if RAW_URI=='--cli':
|
|
193
|
-
RAW_URI=''
|
|
194
|
-
app.cli(RAW_URI)
|
|
195
|
-
elif cmd_par['update']:#更新kunapi包:
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
if cmd_par['update']:#更新kunapi包:
|
|
196
170
|
# print(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1)
|
|
197
171
|
# exit()
|
|
198
172
|
serall=['kunapi','kwebs','kwebsp']
|
|
@@ -252,7 +226,6 @@ def cllfunction():
|
|
|
252
226
|
if bs==fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1:
|
|
253
227
|
break
|
|
254
228
|
elif cmd_par['server']:#启动web服务
|
|
255
|
-
|
|
256
229
|
try:
|
|
257
230
|
obj=importlib.import_module(cmd_par['appname']+'.common')
|
|
258
231
|
if obj.config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr!=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1:
|
|
@@ -263,7 +236,27 @@ def cllfunction():
|
|
|
263
236
|
exit()
|
|
264
237
|
config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1
|
|
265
238
|
types=sys.argv[len(sys.argv)-1]
|
|
266
|
-
if
|
|
239
|
+
if True:# os.name == 'nt':
|
|
240
|
+
from kunapi import web
|
|
241
|
+
try:
|
|
242
|
+
import app as application
|
|
243
|
+
except Exception as e:
|
|
244
|
+
if "No module named 'app'" in str(e):
|
|
245
|
+
print("请在"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"项目下运行")
|
|
246
|
+
else:
|
|
247
|
+
print(traceback.format_exc())
|
|
248
|
+
exit()
|
|
249
|
+
else:
|
|
250
|
+
app=web(__name__,application)
|
|
251
|
+
if __name__ == 'kunapi.kunapi':
|
|
252
|
+
tar=len(sys.argv)
|
|
253
|
+
kill_route_cli('pid/'+str(sys.argv[tar-1])+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+'_server_pid')
|
|
254
|
+
if types=='-stop':
|
|
255
|
+
pass
|
|
256
|
+
else:
|
|
257
|
+
save_route_cli_pid('pid/'+str(sys.argv[tar-1])+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+'_server_pid')
|
|
258
|
+
app.run(host=cmd_par['host'],port=int(cmd_par['port']))
|
|
259
|
+
else:
|
|
267
260
|
pythonpath=site.getsitepackages()[0].replace('\\','/')
|
|
268
261
|
t=pythonpath.split('/')
|
|
269
262
|
tt='/'+t[-3]+'/'+t[-2]+'/'+t[-1]
|
|
@@ -299,27 +292,8 @@ def cllfunction():
|
|
|
299
292
|
sys.argv=[sys.argv[0], '-w', str(cmd_par['processcount']), '-b', cmd_par['host']+':'+str(cmd_par['port']),'-t',cmd_par['timeout'], 'server:'+cmd_par['appname']]
|
|
300
293
|
sys.exit(run())
|
|
301
294
|
exit()
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
try:
|
|
305
|
-
import app as application
|
|
306
|
-
except Exception as e:
|
|
307
|
-
if "No module named 'app'" in str(e):
|
|
308
|
-
print("请在"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"项目下运行")
|
|
309
|
-
else:
|
|
310
|
-
print(traceback.format_exc())
|
|
311
|
-
exit()
|
|
312
|
-
else:
|
|
313
|
-
app=web(__name__,application)
|
|
314
|
-
if __name__ == 'kunapi.kunapi':
|
|
315
|
-
tar=len(sys.argv)
|
|
316
|
-
kill_route_cli('pid/'+str(sys.argv[tar-1])+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+'_server_pid')
|
|
317
|
-
if types=='-stop':
|
|
318
|
-
pass
|
|
319
|
-
else:
|
|
320
|
-
save_route_cli_pid('pid/'+str(sys.argv[tar-1])+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+'_server_pid')
|
|
321
|
-
app.run(host=cmd_par['host'],port=int(cmd_par['port']))
|
|
322
|
-
else:
|
|
295
|
+
|
|
296
|
+
elif cmd_par['install'] or cmd_par['pack'] or cmd_par['upload'] or cmd_par['uninstall']:
|
|
323
297
|
if cmd_par['install']:#插入 应用、模块、插件
|
|
324
298
|
if cmd_par['appname'] and cmd_par['modular']:
|
|
325
299
|
if os.path.exists(cmd_par['appname']):
|
|
@@ -420,6 +394,62 @@ def cllfunction():
|
|
|
420
394
|
else:
|
|
421
395
|
print("\033[1;31;40m卸载时 必须指定应该app和modular,参考命令: "+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" --app app --modular api")
|
|
422
396
|
exit()
|
|
397
|
+
elif cmd_par['cli']:#通过命令行执行控制器的方法
|
|
398
|
+
try:
|
|
399
|
+
obj=importlib.import_module(cmd_par['appname']+'.common')
|
|
400
|
+
if obj.config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr!=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1:
|
|
401
|
+
print("该项目只能使用"+obj.config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr+"开头的命令!")
|
|
402
|
+
exit()
|
|
403
|
+
except Exception as e:
|
|
404
|
+
print('项目不合法',traceback.format_exc())
|
|
405
|
+
exit()
|
|
406
|
+
config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1
|
|
407
|
+
from kunapi import web
|
|
408
|
+
try:
|
|
409
|
+
import app as application
|
|
410
|
+
except Exception as e:
|
|
411
|
+
if "No module named 'app'" in str(e):
|
|
412
|
+
print("请在"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"项目下运行")
|
|
413
|
+
else:
|
|
414
|
+
print(traceback.format_exc())
|
|
415
|
+
exit()
|
|
416
|
+
else:
|
|
417
|
+
app=web(__name__,application)
|
|
418
|
+
try:
|
|
419
|
+
RAW_URI=sys.argv[1]
|
|
420
|
+
except:pass
|
|
421
|
+
else:
|
|
422
|
+
if RAW_URI=='--cli':
|
|
423
|
+
RAW_URI=''
|
|
424
|
+
app.cli(RAW_URI)
|
|
425
|
+
else:#通过命令行执行控制器的方法
|
|
426
|
+
try:
|
|
427
|
+
obj=importlib.import_module(cmd_par['appname']+'.common')
|
|
428
|
+
if obj.config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr!=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1:
|
|
429
|
+
print("该项目只能使用"+obj.config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr+"开头的命令!")
|
|
430
|
+
exit()
|
|
431
|
+
except Exception as e:
|
|
432
|
+
print('项目不合法',traceback.format_exc())
|
|
433
|
+
exit()
|
|
434
|
+
config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1
|
|
435
|
+
from kunapi import web
|
|
436
|
+
try:
|
|
437
|
+
import app as application
|
|
438
|
+
except Exception as e:
|
|
439
|
+
if "No module named 'app'" in str(e):
|
|
440
|
+
print("请在"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"项目下运行")
|
|
441
|
+
else:
|
|
442
|
+
print(traceback.format_exc())
|
|
443
|
+
exit()
|
|
444
|
+
else:
|
|
445
|
+
app=web(__name__,application)
|
|
446
|
+
try:
|
|
447
|
+
RAW_URI=sys.argv[1]
|
|
448
|
+
except:pass
|
|
449
|
+
else:
|
|
450
|
+
if RAW_URI=='--cli':
|
|
451
|
+
RAW_URI=''
|
|
452
|
+
app.cli(RAW_URI)
|
|
423
453
|
def cill_start(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr='kunapi'):
|
|
424
454
|
"脚本入口"
|
|
425
455
|
global fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.2
|
|
2
2
|
Name: kunapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4
|
|
4
4
|
Summary: kunapi
|
|
5
5
|
Home-page: https://docs.kwebapp.cn/index/index/2
|
|
6
6
|
Author: 百里-坤坤
|
|
@@ -9,5 +9,5 @@ Maintainer: 坤坤
|
|
|
9
9
|
Maintainer-email: fengkun01@qq.com
|
|
10
10
|
License: MIT License
|
|
11
11
|
Description: kunapi
|
|
12
|
-
Keywords: kunapi1.
|
|
12
|
+
Keywords: kunapi1.4
|
|
13
13
|
Platform: UNKNOWN
|
|
@@ -30,4 +30,26 @@ kunapi/tempfile/kunapi/app/index/controller/index/__init__.py
|
|
|
30
30
|
kunapi/tempfile/kunapi/app/index/controller/index/index.py
|
|
31
31
|
kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py
|
|
32
32
|
kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.py
|
|
33
|
+
kunapi/tempfile/kunapi/app/index/controller/index/common/model.py
|
|
34
|
+
kunapi/common/__init__.py
|
|
35
|
+
kunapi/common/autoload.py
|
|
36
|
+
kunapi/common/globals.py
|
|
37
|
+
kunapi/common/request.py
|
|
38
|
+
kunapi/config/__init__.py
|
|
39
|
+
kunapi/tempfile/__init__.py
|
|
40
|
+
kunapi/tempfile/kunapi/server.py
|
|
41
|
+
kunapi/tempfile/kunapi/app/__init__.py
|
|
42
|
+
kunapi/tempfile/kunapi/app/common/__init__.py
|
|
43
|
+
kunapi/tempfile/kunapi/app/common/autoload.py
|
|
44
|
+
kunapi/tempfile/kunapi/app/common/model.py
|
|
45
|
+
kunapi/tempfile/kunapi/app/config/__init__.py
|
|
46
|
+
kunapi/tempfile/kunapi/app/config/app.py
|
|
47
|
+
kunapi/tempfile/kunapi/app/index/__init__.py
|
|
48
|
+
kunapi/tempfile/kunapi/app/index/common/__init__.py
|
|
49
|
+
kunapi/tempfile/kunapi/app/index/common/autoload.py
|
|
50
|
+
kunapi/tempfile/kunapi/app/index/controller/__init__.py
|
|
51
|
+
kunapi/tempfile/kunapi/app/index/controller/index/__init__.py
|
|
52
|
+
kunapi/tempfile/kunapi/app/index/controller/index/index.py
|
|
53
|
+
kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py
|
|
54
|
+
kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.py
|
|
33
55
|
kunapi/tempfile/kunapi/app/index/controller/index/common/model.py
|
|
@@ -31,7 +31,7 @@ def start():
|
|
|
31
31
|
maintainer_email = kcwsinfo["maintainer_email"],
|
|
32
32
|
url=kcwsinfo['url'],
|
|
33
33
|
packages = b,
|
|
34
|
-
install_requires = ['gunicorn==20.0.4','watchdog==4.0.0','filetype==1.2.0','psutil==5.8.0','requests==2.32.4'], #第三方包
|
|
34
|
+
install_requires = ['gunicorn==20.0.4','waitress==3.0.0','watchdog==4.0.0','filetype==1.2.0','psutil==5.8.0','requests==2.32.4'], #第三方包
|
|
35
35
|
package_data = {
|
|
36
36
|
'': ['*.html', '*.js','*.css','*.jpg','*.png','*.gif'],
|
|
37
37
|
},
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py
RENAMED
|
File without changes
|
{kunapi-1.2 → kunapi-1.4}/kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|