kunapi 1.12__tar.gz → 1.14__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.12 → kunapi-1.14}/PKG-INFO +2 -2
- {kunapi-1.12 → kunapi-1.14}/kunapi/__init__.py +1 -1
- {kunapi-1.12 → kunapi-1.14}/kunapi/app.py +1 -1
- {kunapi-1.12 → kunapi-1.14}/kunapi/common/autoload.py +28 -12
- {kunapi-1.12 → kunapi-1.14}/kunapi/config/__init__.py +1 -1
- {kunapi-1.12 → kunapi-1.14}/kunapi/kunapi.py +110 -41
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/config/app.py +1 -1
- {kunapi-1.12 → kunapi-1.14}/kunapi.egg-info/PKG-INFO +2 -2
- {kunapi-1.12 → kunapi-1.14}/kunapi.egg-info/requires.txt +1 -0
- {kunapi-1.12 → kunapi-1.14}/setup.py +1 -1
- {kunapi-1.12 → kunapi-1.14}/kunapi/Events.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/common/__init__.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/common/globals.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/common/request.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/__init__.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/common/__init__.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/common/autoload.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/common/model.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/config/__init__.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/index/__init__.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/index/common/__init__.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/index/common/autoload.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/index/controller/__init__.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/index/controller/index/__init__.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/index/controller/index/common/model.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/index/controller/index/index.py +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi.egg-info/SOURCES.txt +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi.egg-info/dependency_links.txt +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi.egg-info/entry_points.txt +0 -0
- {kunapi-1.12 → kunapi-1.14}/kunapi.egg-info/top_level.txt +0 -0
- {kunapi-1.12 → kunapi-1.14}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: kunapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.14
|
|
4
4
|
Summary: kunapi
|
|
5
5
|
Home-page: https://docs.kwebapp.cn/index/index/2
|
|
6
6
|
Author: 百里-坤坤
|
|
@@ -8,6 +8,6 @@ Author-email: fengkun01@qq.com
|
|
|
8
8
|
Maintainer: 坤坤
|
|
9
9
|
Maintainer-email: fengkun01@qq.com
|
|
10
10
|
License: MIT License
|
|
11
|
-
Keywords: kunapi1.
|
|
11
|
+
Keywords: kunapi1.14
|
|
12
12
|
|
|
13
13
|
kunapi
|
|
@@ -55,17 +55,30 @@ def timestampToDate(times,format="%Y-%m-%d %H:%M:%S"):
|
|
|
55
55
|
def get_pid_by_port(port):
|
|
56
56
|
"""获取使用指定端口使用的进程号pid"""
|
|
57
57
|
pid=[]
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
if os.name == 'posix':
|
|
59
|
+
strs=subprocess.check_output(f'ss -tulnp | grep '+str(port), shell=True, text=True)
|
|
60
|
+
if strs:
|
|
61
|
+
if '-bash: ss' in strs:
|
|
62
|
+
raise Exception(strs)
|
|
63
|
+
arr=strs.split('pid=')
|
|
64
|
+
if len(arr)>1:
|
|
65
|
+
del arr[0]
|
|
66
|
+
for k in arr:
|
|
67
|
+
pid.append(int(k.split(',')[0]))
|
|
68
|
+
else:
|
|
69
|
+
raise Exception(strs)
|
|
70
|
+
elif os.name == 'nt':
|
|
71
|
+
pi=subprocess.Popen(f'netstat -ano | findstr :'+str(port),shell=True, stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
|
|
72
|
+
strs=pi.stdout.read().decode()
|
|
73
|
+
# print('strs',strs)
|
|
74
|
+
if strs:
|
|
75
|
+
if '-bash: ss' in strs:
|
|
76
|
+
raise Exception(strs)
|
|
77
|
+
arr=strs.split('\r\n')
|
|
65
78
|
for k in arr:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
79
|
+
numbers = re.findall(r'\d+', k)
|
|
80
|
+
if numbers:
|
|
81
|
+
pid.append(int(numbers[-1]))
|
|
69
82
|
return pid
|
|
70
83
|
|
|
71
84
|
def get_file(folder='./',is_folder=True,suffix="*",lists=[],append=False):
|
|
@@ -223,7 +236,10 @@ def kill_pid(pid,retry=60):
|
|
|
223
236
|
if pid:
|
|
224
237
|
for i in range(retry):
|
|
225
238
|
if 'Linux' in get_sysinfo()['platform']:
|
|
226
|
-
os.system("kill -9 "+str(pid))
|
|
239
|
+
# os.system("kill -9 "+str(pid))
|
|
240
|
+
try:
|
|
241
|
+
os.kill(int(pid), signal.SIGTERM)
|
|
242
|
+
except:pass
|
|
227
243
|
else:
|
|
228
244
|
try:
|
|
229
245
|
os.kill(int(pid), signal.SIGTERM)
|
|
@@ -262,7 +278,7 @@ def save_route_cli_pid(route):
|
|
|
262
278
|
f.write(str(pid))
|
|
263
279
|
f.close()
|
|
264
280
|
def kill_all_pid():
|
|
265
|
-
"""结束
|
|
281
|
+
"""结束knuapi框架的所有子进程"""
|
|
266
282
|
folder=get_folder()+"/pid"
|
|
267
283
|
kcws_kill_path_pid(folder)
|
|
268
284
|
if not os.path.exists(get_folder()+"/pid/"):
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import getopt,site,sys
|
|
1
|
+
|
|
2
|
+
import getopt,site,sys,os
|
|
3
|
+
if os.name == 'posix':
|
|
4
|
+
import daemon
|
|
3
5
|
PATH=os.getcwd()
|
|
4
6
|
sys.path.append(PATH)
|
|
5
7
|
fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1=''
|
|
@@ -11,7 +13,7 @@ def get_cmd_par(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=''):
|
|
|
11
13
|
# if python_version[0:3]!='3.8':
|
|
12
14
|
# print("\033[1;31;40m "+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"依赖python3.8,与你现在的python"+python_version+"不兼容")
|
|
13
15
|
# exit()
|
|
14
|
-
if
|
|
16
|
+
if os.name == 'posix' or os.name == 'nt':pass
|
|
15
17
|
else:
|
|
16
18
|
print("\033[1;31;40m "+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"不支持当前操作系统 在linux或windows系统下运行")
|
|
17
19
|
exit()
|
|
@@ -20,6 +22,7 @@ def get_cmd_par(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=''):
|
|
|
20
22
|
"install","uninstall","pack","upload","cli"])
|
|
21
23
|
# print("opts",opts)
|
|
22
24
|
# print("args",args)
|
|
25
|
+
# exit()
|
|
23
26
|
server=False
|
|
24
27
|
if 'server' in args:
|
|
25
28
|
server=True
|
|
@@ -29,6 +32,14 @@ def get_cmd_par(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=''):
|
|
|
29
32
|
help=False
|
|
30
33
|
if 'help' in args:
|
|
31
34
|
help=True
|
|
35
|
+
|
|
36
|
+
daemonyun=False
|
|
37
|
+
if '-d' in args:
|
|
38
|
+
daemonyun=True
|
|
39
|
+
|
|
40
|
+
stop=False
|
|
41
|
+
if '-stop' in args:
|
|
42
|
+
stop=True
|
|
32
43
|
|
|
33
44
|
project=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1 #项目名称
|
|
34
45
|
appname='app' #应用名 目前是固定值 app
|
|
@@ -104,8 +115,10 @@ def get_cmd_par(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=''):
|
|
|
104
115
|
except:
|
|
105
116
|
gcs=''
|
|
106
117
|
if gcs=='-v':
|
|
118
|
+
from . import config
|
|
107
119
|
if fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1=='kunapi':
|
|
108
|
-
|
|
120
|
+
from . import kcwsinfo
|
|
121
|
+
print(kcwsinfo['name']+"-"+kcwsinfo['version'])
|
|
109
122
|
elif fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1=='kwebs':
|
|
110
123
|
from kwebs.config import kwebs
|
|
111
124
|
print(kwebs['name']+"-"+kwebs['version'])
|
|
@@ -116,15 +129,57 @@ def get_cmd_par(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=''):
|
|
|
116
129
|
print("\033[1;31;40m有关"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"命令的详细信息,请键入 "+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" help",e)
|
|
117
130
|
return False
|
|
118
131
|
else:
|
|
119
|
-
|
|
132
|
+
cmd_par={
|
|
120
133
|
'server':server,
|
|
121
134
|
'update':update,
|
|
122
135
|
'project':project,'appname':appname,'modular':modular,'username':username,'password':password,'plug':plug,'host':host,'port':port,'timeout':timeout,'processcount':processcount,
|
|
123
|
-
'help':help,'install':install,'uninstall':uninstall,'pack':pack,'upload':upload,'cli':cli,'cmd':cmd,'path':path,
|
|
136
|
+
'help':help,'install':install,'uninstall':uninstall,'pack':pack,'upload':upload,'cli':cli,'cmd':cmd,'path':path,'daemonyun':daemonyun,'stop':stop,
|
|
124
137
|
'index':i
|
|
125
138
|
}
|
|
126
|
-
|
|
127
|
-
|
|
139
|
+
if cmd_par['cmd']:
|
|
140
|
+
if '&&' in cmd_par['cmd']:
|
|
141
|
+
for cmds in cmd_par['cmd'].split('&&'):
|
|
142
|
+
print('执行命令',cmds.strip())
|
|
143
|
+
if cmds[0:3] == 'cd ':
|
|
144
|
+
# os.system(cmds)
|
|
145
|
+
print('已切换工作目录',cmds[3:])
|
|
146
|
+
os.chdir(cmds[3:].strip())
|
|
147
|
+
else:
|
|
148
|
+
if os.name == 'posix':
|
|
149
|
+
if cmd_par['daemonyun']:
|
|
150
|
+
with daemon.DaemonContext():
|
|
151
|
+
os.system(cmds.strip())
|
|
152
|
+
else:
|
|
153
|
+
os.system(cmds.strip())
|
|
154
|
+
else:
|
|
155
|
+
os.system(cmds.strip())
|
|
156
|
+
elif '||' in cmd_par['cmd']:
|
|
157
|
+
for cmds in cmd_par['cmd'].split('||'):
|
|
158
|
+
print('执行命令',cmds)
|
|
159
|
+
if cmds[0:3] == 'cd ':
|
|
160
|
+
print('已切换工作目录',cmds[3:])
|
|
161
|
+
os.chdir(cmds[3:])
|
|
162
|
+
else:
|
|
163
|
+
if os.name == 'posix':
|
|
164
|
+
if cmd_par['daemonyun']:
|
|
165
|
+
with daemon.DaemonContext():
|
|
166
|
+
os.system(cmds)
|
|
167
|
+
else:
|
|
168
|
+
os.system(cmds)
|
|
169
|
+
else:
|
|
170
|
+
os.system(cmds)
|
|
171
|
+
else:
|
|
172
|
+
print('执行命令',cmd_par['cmd'].strip())
|
|
173
|
+
if os.name == 'posix':
|
|
174
|
+
if cmd_par['daemonyun']:
|
|
175
|
+
with daemon.DaemonContext():
|
|
176
|
+
os.system(cmd_par['cmd'].strip())
|
|
177
|
+
else:
|
|
178
|
+
os.system(cmd_par['cmd'].strip())
|
|
179
|
+
else:
|
|
180
|
+
os.system(cmd_par['cmd'].strip())
|
|
181
|
+
|
|
182
|
+
return cmd_par
|
|
128
183
|
def temp_get_file(folder='./',lists=[]):
|
|
129
184
|
lis=os.listdir(folder)
|
|
130
185
|
for files in lis:
|
|
@@ -138,6 +193,7 @@ def temp_get_file(folder='./',lists=[]):
|
|
|
138
193
|
pass
|
|
139
194
|
return lists
|
|
140
195
|
def cllfunction():
|
|
196
|
+
|
|
141
197
|
global fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1
|
|
142
198
|
cmd_par=get_cmd_par()
|
|
143
199
|
if not cmd_par:
|
|
@@ -158,6 +214,7 @@ def cllfunction():
|
|
|
158
214
|
print("\033[32m"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" --host 0.0.0.0 --port 39001 server 启动web服务")
|
|
159
215
|
print("\033[32mhost、port并不是必须的,如果要使用默认值,您可以使用下面简短的命令来启动服务")
|
|
160
216
|
print("\033[32m"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" server\n")
|
|
217
|
+
print("\033[32m"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" server -d 表示后台运行\n")
|
|
161
218
|
if 'modular' == cs:
|
|
162
219
|
print("\033[32m"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" --modular api --plug plug --install 进行安装")
|
|
163
220
|
print("\033[1;31;40m初始化一个web应用示例,通常情况下modular、plug、install同时使用")
|
|
@@ -181,8 +238,8 @@ def cllfunction():
|
|
|
181
238
|
print("\033[32m"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" --modular api --uninstall 卸载app/api模块")
|
|
182
239
|
print("\033[32m"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" --modular api --plug plug1 --uninstall 卸载app/api/plug1插件\n")
|
|
183
240
|
else:
|
|
184
|
-
|
|
185
|
-
|
|
241
|
+
import requests,shutil,importlib,traceback
|
|
242
|
+
from .common import create,kcwszip,config,kill_route_cli,save_route_cli_pid,get_pid_by_port,kill_pid
|
|
186
243
|
if cmd_par['update']:#更新kunapi包:
|
|
187
244
|
# print(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1)
|
|
188
245
|
# exit()
|
|
@@ -243,7 +300,9 @@ def cllfunction():
|
|
|
243
300
|
if bs==fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1:
|
|
244
301
|
break
|
|
245
302
|
elif cmd_par['server']:#启动web服务
|
|
303
|
+
|
|
246
304
|
try:
|
|
305
|
+
|
|
247
306
|
obj=importlib.import_module(cmd_par['appname']+'.common')
|
|
248
307
|
if obj.config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr!=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1:
|
|
249
308
|
print("该项目只能使用"+obj.config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr+"开头的命令.")
|
|
@@ -252,7 +311,6 @@ def cllfunction():
|
|
|
252
311
|
print('项目不合法',traceback.format_exc())
|
|
253
312
|
exit()
|
|
254
313
|
config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1
|
|
255
|
-
types=sys.argv[len(sys.argv)-1]
|
|
256
314
|
if os.name == 'nt':
|
|
257
315
|
from kunapi import web
|
|
258
316
|
try:
|
|
@@ -268,19 +326,25 @@ def cllfunction():
|
|
|
268
326
|
if __name__ == 'kunapi.kunapi':
|
|
269
327
|
tar=len(sys.argv)
|
|
270
328
|
kill_route_cli('pid/'+str(sys.argv[tar-1])+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+'_server_pid')
|
|
271
|
-
|
|
329
|
+
try:
|
|
330
|
+
allpid=get_pid_by_port(cmd_par['port'])
|
|
331
|
+
except:pass
|
|
332
|
+
else:
|
|
333
|
+
for kpid in allpid:
|
|
334
|
+
kill_pid(kpid)
|
|
335
|
+
if cmd_par['stop']:
|
|
272
336
|
pass
|
|
273
337
|
else:
|
|
274
338
|
save_route_cli_pid('pid/'+str(sys.argv[tar-1])+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+'_server_pid')
|
|
275
339
|
app.run(host=cmd_par['host'],port=int(cmd_par['port']))
|
|
276
|
-
elif
|
|
340
|
+
elif os.name == 'posix':
|
|
277
341
|
pythonpath=site.getsitepackages()[0].replace('\\','/')
|
|
278
342
|
t=pythonpath.split('/')
|
|
279
343
|
tt='/'+t[-3]+'/'+t[-2]+'/'+t[-1]
|
|
280
344
|
pythonpath=pythonpath.replace(tt,'')
|
|
281
345
|
if not os.path.exists('/usr/bin/'+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1) and os.path.isfile(pythonpath+'/bin/'+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1):
|
|
282
346
|
os.system("ln -s "+pythonpath+"/bin/"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" /usr/bin/"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1)
|
|
283
|
-
|
|
347
|
+
|
|
284
348
|
if __name__ == 'kunapi.kunapi':
|
|
285
349
|
kill_route_cli('pid/'+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+'_server_pid')
|
|
286
350
|
try:
|
|
@@ -289,15 +353,21 @@ def cllfunction():
|
|
|
289
353
|
else:
|
|
290
354
|
for kpid in allpid:
|
|
291
355
|
kill_pid(kpid)
|
|
292
|
-
if
|
|
356
|
+
if cmd_par['stop']:
|
|
293
357
|
pass
|
|
294
358
|
else:
|
|
295
359
|
save_route_cli_pid('pid/'+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+'_server_pid')
|
|
296
360
|
from gunicorn.app.wsgiapp import run
|
|
361
|
+
import re
|
|
297
362
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$','',sys.argv[0])
|
|
298
363
|
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']]
|
|
299
|
-
|
|
300
|
-
|
|
364
|
+
if cmd_par['daemonyun']:
|
|
365
|
+
with daemon.DaemonContext():
|
|
366
|
+
sys.exit(run())
|
|
367
|
+
exit()
|
|
368
|
+
else:
|
|
369
|
+
sys.exit(run())
|
|
370
|
+
exit()
|
|
301
371
|
else:
|
|
302
372
|
raise Exception('不支持该操作系统')
|
|
303
373
|
elif cmd_par['install'] or cmd_par['pack'] or cmd_par['upload'] or cmd_par['uninstall']:
|
|
@@ -402,28 +472,7 @@ def cllfunction():
|
|
|
402
472
|
print("\033[1;31;40m卸载时 必须指定应该app和modular,参考命令: "+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" --app app --modular api")
|
|
403
473
|
exit()
|
|
404
474
|
elif cmd_par['cmd']:
|
|
405
|
-
|
|
406
|
-
if '&&' in cmd_par['cmd']:
|
|
407
|
-
for cmds in cmd_par['cmd'].split('&&'):
|
|
408
|
-
print('执行命令',cmds.strip())
|
|
409
|
-
if cmds[0:3] == 'cd ':
|
|
410
|
-
# os.system(cmds)
|
|
411
|
-
print('已切换工作目录',cmds[3:])
|
|
412
|
-
os.chdir(cmds[3:].strip())
|
|
413
|
-
else:
|
|
414
|
-
os.system(cmds.strip())
|
|
415
|
-
# elif '||' in cmd_par['cmd']:
|
|
416
|
-
# for cmds in cmd_par['cmd'].split('||'):
|
|
417
|
-
# print('执行命令',cmds)
|
|
418
|
-
# if cmds[0:3] == 'cd ':
|
|
419
|
-
# # os.system(cmds)
|
|
420
|
-
# print('已切换工作目录',cmds[3:])
|
|
421
|
-
# os.chdir(cmds[3:])
|
|
422
|
-
# else:
|
|
423
|
-
# os.system(cmds)
|
|
424
|
-
else:
|
|
425
|
-
print('执行命令',cmd_par['cmd'].strip())
|
|
426
|
-
os.system(cmd_par['cmd'].strip())
|
|
475
|
+
pass
|
|
427
476
|
elif cmd_par['cli']:#通过命令行执行控制器的方法
|
|
428
477
|
try:
|
|
429
478
|
obj=importlib.import_module(cmd_par['appname']+'.common')
|
|
@@ -451,7 +500,17 @@ def cllfunction():
|
|
|
451
500
|
else:
|
|
452
501
|
if RAW_URI=='--cli':
|
|
453
502
|
RAW_URI=''
|
|
454
|
-
|
|
503
|
+
if cmd_par['stop']:
|
|
504
|
+
kill_route_cli(RAW_URI)
|
|
505
|
+
exit()
|
|
506
|
+
if os.name == 'posix':
|
|
507
|
+
if cmd_par['daemonyun']:
|
|
508
|
+
with daemon.DaemonContext():
|
|
509
|
+
app.cli(RAW_URI)
|
|
510
|
+
else:
|
|
511
|
+
app.cli(RAW_URI)
|
|
512
|
+
else:
|
|
513
|
+
app.cli(RAW_URI)
|
|
455
514
|
else:#通过命令行执行控制器的方法
|
|
456
515
|
try:
|
|
457
516
|
obj=importlib.import_module(cmd_par['appname']+'.common')
|
|
@@ -479,7 +538,17 @@ def cllfunction():
|
|
|
479
538
|
else:
|
|
480
539
|
if RAW_URI=='--cli':
|
|
481
540
|
RAW_URI=''
|
|
482
|
-
|
|
541
|
+
if cmd_par['stop']:
|
|
542
|
+
kill_route_cli(RAW_URI)
|
|
543
|
+
exit()
|
|
544
|
+
if os.name == 'posix':
|
|
545
|
+
if cmd_par['daemonyun']:
|
|
546
|
+
with daemon.DaemonContext():
|
|
547
|
+
app.cli(RAW_URI)
|
|
548
|
+
else:
|
|
549
|
+
app.cli(RAW_URI)
|
|
550
|
+
else:
|
|
551
|
+
app.cli(RAW_URI)
|
|
483
552
|
def cill_start(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr='kunapi'):
|
|
484
553
|
"脚本入口"
|
|
485
554
|
global fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
from kunapi.config import *
|
|
4
|
-
app['app_debug']=
|
|
4
|
+
app['app_debug']=False #是否开启调试模式
|
|
5
5
|
app['tpl_folder']='./app' #设置模板文件目录名 注意:所有的配置目录都是以您的运行文件所在目录开始
|
|
6
6
|
app['before_request']='before_request' #设置请求前要执行的函数名
|
|
7
7
|
app['after_request']='after_request' #设置请求后要执行的函数名
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: kunapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.14
|
|
4
4
|
Summary: kunapi
|
|
5
5
|
Home-page: https://docs.kwebapp.cn/index/index/2
|
|
6
6
|
Author: 百里-坤坤
|
|
@@ -8,6 +8,6 @@ Author-email: fengkun01@qq.com
|
|
|
8
8
|
Maintainer: 坤坤
|
|
9
9
|
Maintainer-email: fengkun01@qq.com
|
|
10
10
|
License: MIT License
|
|
11
|
-
Keywords: kunapi1.
|
|
11
|
+
Keywords: kunapi1.14
|
|
12
12
|
|
|
13
13
|
kunapi
|
|
@@ -34,7 +34,7 @@ def start():
|
|
|
34
34
|
maintainer_email = kcwsinfo["maintainer_email"],
|
|
35
35
|
url=kcwsinfo['url'],
|
|
36
36
|
packages = b,
|
|
37
|
-
install_requires = ['gunicorn==20.0.4','waitress==3.0.0','watchdog==4.0.0','filetype==1.2.0','psutil==5.9.4','requests==2.32.4'], #第三方包
|
|
37
|
+
install_requires = ['gunicorn==20.0.4','waitress==3.0.0','watchdog==4.0.0','filetype==1.2.0','psutil==5.9.4','requests==2.32.4','python-daemon==3.1.2'], #第三方包
|
|
38
38
|
package_data = {
|
|
39
39
|
'': ['*.html', '*.js','*.css','*.jpg','*.png','*.gif'],
|
|
40
40
|
},
|
|
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.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py
RENAMED
|
File without changes
|
{kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.py
RENAMED
|
File without changes
|
{kunapi-1.12 → kunapi-1.14}/kunapi/tempfile/kunapi/app/index/controller/index/common/model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|