kunapi 1.15__tar.gz → 1.16__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.16/PKG-INFO +30 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/__init__.py +1 -1
- {kunapi-1.15 → kunapi-1.16}/kunapi/common/autoload.py +13 -3
- {kunapi-1.15 → kunapi-1.16}/kunapi/kunapi.py +34 -36
- kunapi-1.16/kunapi.egg-info/PKG-INFO +30 -0
- kunapi-1.15/PKG-INFO +0 -13
- kunapi-1.15/kunapi.egg-info/PKG-INFO +0 -13
- {kunapi-1.15 → kunapi-1.16}/kunapi/Events.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/app.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/common/__init__.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/common/globals.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/common/request.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/config/__init__.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/__init__.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/common/__init__.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/common/autoload.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/common/model.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/config/__init__.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/config/app.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/index/__init__.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/index/common/__init__.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/index/common/autoload.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/index/controller/__init__.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/index/controller/index/__init__.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/index/controller/index/common/model.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/index/controller/index/index.py +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi.egg-info/SOURCES.txt +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi.egg-info/dependency_links.txt +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi.egg-info/entry_points.txt +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi.egg-info/requires.txt +0 -0
- {kunapi-1.15 → kunapi-1.16}/kunapi.egg-info/top_level.txt +0 -0
- {kunapi-1.15 → kunapi-1.16}/setup.cfg +0 -0
- {kunapi-1.15 → kunapi-1.16}/setup.py +0 -0
kunapi-1.16/PKG-INFO
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kunapi
|
|
3
|
+
Version: 1.16
|
|
4
|
+
Summary: kunapi
|
|
5
|
+
Home-page: https://docs.kwebapp.cn/index/index/2
|
|
6
|
+
Author: 百里-坤坤
|
|
7
|
+
Author-email: fengkun01@qq.com
|
|
8
|
+
Maintainer: 坤坤
|
|
9
|
+
Maintainer-email: fengkun01@qq.com
|
|
10
|
+
License: MIT License
|
|
11
|
+
Keywords: kunapi1.16
|
|
12
|
+
Requires-Dist: gunicorn==20.0.4
|
|
13
|
+
Requires-Dist: waitress==3.0.0
|
|
14
|
+
Requires-Dist: watchdog==4.0.0
|
|
15
|
+
Requires-Dist: filetype==1.2.0
|
|
16
|
+
Requires-Dist: psutil==5.9.4
|
|
17
|
+
Requires-Dist: requests==2.32.4
|
|
18
|
+
Requires-Dist: python-daemon==3.1.2
|
|
19
|
+
Dynamic: author
|
|
20
|
+
Dynamic: author-email
|
|
21
|
+
Dynamic: description
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: keywords
|
|
24
|
+
Dynamic: license
|
|
25
|
+
Dynamic: maintainer
|
|
26
|
+
Dynamic: maintainer-email
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: summary
|
|
29
|
+
|
|
30
|
+
kunapi
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
|
-
import time,
|
|
2
|
+
import time,json,re,os,platform,shutil,requests,importlib,traceback,tarfile,psutil,random
|
|
3
3
|
from kunapi import config
|
|
4
4
|
from . import globals
|
|
5
5
|
import subprocess
|
|
@@ -139,6 +139,7 @@ def md5(strs):
|
|
|
139
139
|
|
|
140
140
|
return String类型
|
|
141
141
|
"""
|
|
142
|
+
import hashlib
|
|
142
143
|
m = hashlib.md5()
|
|
143
144
|
b = strs.encode(encoding='utf-8')
|
|
144
145
|
m.update(b)
|
|
@@ -191,7 +192,8 @@ def get_pid_info(pid,types='pid'):
|
|
|
191
192
|
types info表示获取进程信息 否则判断进程号是否存在
|
|
192
193
|
"""
|
|
193
194
|
if pid:
|
|
194
|
-
pid=int(pid)
|
|
195
|
+
try:pid=int(pid)
|
|
196
|
+
except:return False
|
|
195
197
|
try:
|
|
196
198
|
if types=='info':
|
|
197
199
|
p = psutil.Process(pid)
|
|
@@ -234,6 +236,7 @@ def kill_pid(pid,retry=60):
|
|
|
234
236
|
pid 进程号
|
|
235
237
|
"""
|
|
236
238
|
if pid:
|
|
239
|
+
import signal
|
|
237
240
|
for i in range(retry):
|
|
238
241
|
if 'Linux' in get_sysinfo()['platform']:
|
|
239
242
|
# os.system("kill -9 "+str(pid))
|
|
@@ -323,6 +326,7 @@ class kcwszip:
|
|
|
323
326
|
return filename
|
|
324
327
|
def packzip(src,dst):
|
|
325
328
|
"压缩"
|
|
329
|
+
import zipfile
|
|
326
330
|
filelist = []
|
|
327
331
|
if os.path.isfile(src):
|
|
328
332
|
filelist.append(src)
|
|
@@ -336,6 +340,7 @@ class kcwszip:
|
|
|
336
340
|
zf.close()
|
|
337
341
|
def unzip_file(dst, src,all=True):
|
|
338
342
|
"解压"
|
|
343
|
+
import zipfile
|
|
339
344
|
if all:
|
|
340
345
|
zf = zipfile.ZipFile(dst)
|
|
341
346
|
zf.extractall(src)
|
|
@@ -347,6 +352,7 @@ class kcwszip:
|
|
|
347
352
|
zip_ref.close()
|
|
348
353
|
def unzip(filename):
|
|
349
354
|
"解压到文件所在目录"
|
|
355
|
+
import zipfile
|
|
350
356
|
diswjj=''
|
|
351
357
|
tarr=filename.split('.')
|
|
352
358
|
i=0
|
|
@@ -649,7 +655,7 @@ class create:
|
|
|
649
655
|
|
|
650
656
|
plug 插件名
|
|
651
657
|
"""
|
|
652
|
-
import pip
|
|
658
|
+
import pip,zipfile
|
|
653
659
|
plug=str(plug)
|
|
654
660
|
if os.path.exists(self.project+self.appname+"/"+self.modular+"/controller/"+plug) and not mandatory:
|
|
655
661
|
return False,"该插件已存在"
|
|
@@ -718,6 +724,8 @@ class create:
|
|
|
718
724
|
if len(install_requires):
|
|
719
725
|
try:
|
|
720
726
|
install_requires.insert(0,"install")
|
|
727
|
+
install_requires.append('-i')
|
|
728
|
+
install_requires.append('https://mirrors.aliyun.com/pypi/simple/')
|
|
721
729
|
if 0 != pip.main(install_requires):
|
|
722
730
|
shutil.rmtree(self.project+self.appname+"/"+self.modular+"/controller/"+plug)
|
|
723
731
|
return False,"依赖包安装错误"
|
|
@@ -914,6 +922,8 @@ class create:
|
|
|
914
922
|
if len(install_requires):
|
|
915
923
|
try:
|
|
916
924
|
install_requires.insert(0,"install")
|
|
925
|
+
install_requires.append('-i')
|
|
926
|
+
install_requires.append('https://mirrors.aliyun.com/pypi/simple/')
|
|
917
927
|
if 0 != pip.main(install_requires):
|
|
918
928
|
shutil.rmtree(self.project+self.appname+"/"+self.modular)
|
|
919
929
|
return False,"模块依赖包安装错误"
|
|
@@ -129,8 +129,6 @@ def get_cmd_par(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=''):
|
|
|
129
129
|
print("\033[1;31;40m有关"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"命令的详细信息,请键入 "+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" help",e)
|
|
130
130
|
return False
|
|
131
131
|
else:
|
|
132
|
-
if not path:
|
|
133
|
-
path=os.getcwd()
|
|
134
132
|
cmd_par={
|
|
135
133
|
'server':server,
|
|
136
134
|
'update':update,
|
|
@@ -140,43 +138,45 @@ def get_cmd_par(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=''):
|
|
|
140
138
|
}
|
|
141
139
|
if cmd_par['cmd']:
|
|
142
140
|
if '&&' in cmd_par['cmd']:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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())
|
|
151
152
|
else:
|
|
152
153
|
os.system(cmds.strip())
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
os.chdir(cmds[3:].strip())
|
|
162
|
-
else:
|
|
163
|
-
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:])
|
|
164
162
|
else:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
os.chdir(cmds[3:].strip())
|
|
163
|
+
if os.name == 'posix':
|
|
164
|
+
if cmd_par['daemonyun']:
|
|
165
|
+
with daemon.DaemonContext():
|
|
166
|
+
os.system(cmds)
|
|
170
167
|
else:
|
|
171
|
-
os.system(cmds
|
|
168
|
+
os.system(cmds)
|
|
169
|
+
else:
|
|
170
|
+
os.system(cmds)
|
|
172
171
|
else:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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:
|
|
177
178
|
os.system(cmd_par['cmd'].strip())
|
|
178
179
|
else:
|
|
179
|
-
print('执行命令',cmd_par['cmd'].strip())
|
|
180
180
|
os.system(cmd_par['cmd'].strip())
|
|
181
181
|
|
|
182
182
|
return cmd_par
|
|
@@ -358,12 +358,10 @@ def cllfunction():
|
|
|
358
358
|
else:
|
|
359
359
|
save_route_cli_pid('pid/'+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+'_server_pid')
|
|
360
360
|
from gunicorn.app.wsgiapp import run
|
|
361
|
-
import re
|
|
362
361
|
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$','',sys.argv[0])
|
|
363
362
|
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']]
|
|
364
363
|
if cmd_par['daemonyun']:
|
|
365
364
|
with daemon.DaemonContext():
|
|
366
|
-
os.chdir(cmd_par['path'])
|
|
367
365
|
sys.exit(run())
|
|
368
366
|
exit()
|
|
369
367
|
else:
|
|
@@ -475,6 +473,7 @@ def cllfunction():
|
|
|
475
473
|
elif cmd_par['cmd']:
|
|
476
474
|
pass
|
|
477
475
|
elif cmd_par['cli']:#通过命令行执行控制器的方法
|
|
476
|
+
config.app['cli']=True
|
|
478
477
|
try:
|
|
479
478
|
obj=importlib.import_module(cmd_par['appname']+'.common')
|
|
480
479
|
if obj.config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr!=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1:
|
|
@@ -507,13 +506,13 @@ def cllfunction():
|
|
|
507
506
|
if os.name == 'posix':
|
|
508
507
|
if cmd_par['daemonyun']:
|
|
509
508
|
with daemon.DaemonContext():
|
|
510
|
-
os.chdir(cmd_par['path'])
|
|
511
509
|
app.cli(RAW_URI)
|
|
512
510
|
else:
|
|
513
511
|
app.cli(RAW_URI)
|
|
514
512
|
else:
|
|
515
513
|
app.cli(RAW_URI)
|
|
516
514
|
else:#通过命令行执行控制器的方法
|
|
515
|
+
config.app['cli']=True
|
|
517
516
|
try:
|
|
518
517
|
obj=importlib.import_module(cmd_par['appname']+'.common')
|
|
519
518
|
if obj.config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr!=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1:
|
|
@@ -546,7 +545,6 @@ def cllfunction():
|
|
|
546
545
|
if os.name == 'posix':
|
|
547
546
|
if cmd_par['daemonyun']:
|
|
548
547
|
with daemon.DaemonContext():
|
|
549
|
-
os.chdir(cmd_par['path'])
|
|
550
548
|
app.cli(RAW_URI)
|
|
551
549
|
else:
|
|
552
550
|
app.cli(RAW_URI)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kunapi
|
|
3
|
+
Version: 1.16
|
|
4
|
+
Summary: kunapi
|
|
5
|
+
Home-page: https://docs.kwebapp.cn/index/index/2
|
|
6
|
+
Author: 百里-坤坤
|
|
7
|
+
Author-email: fengkun01@qq.com
|
|
8
|
+
Maintainer: 坤坤
|
|
9
|
+
Maintainer-email: fengkun01@qq.com
|
|
10
|
+
License: MIT License
|
|
11
|
+
Keywords: kunapi1.16
|
|
12
|
+
Requires-Dist: gunicorn==20.0.4
|
|
13
|
+
Requires-Dist: waitress==3.0.0
|
|
14
|
+
Requires-Dist: watchdog==4.0.0
|
|
15
|
+
Requires-Dist: filetype==1.2.0
|
|
16
|
+
Requires-Dist: psutil==5.9.4
|
|
17
|
+
Requires-Dist: requests==2.32.4
|
|
18
|
+
Requires-Dist: python-daemon==3.1.2
|
|
19
|
+
Dynamic: author
|
|
20
|
+
Dynamic: author-email
|
|
21
|
+
Dynamic: description
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: keywords
|
|
24
|
+
Dynamic: license
|
|
25
|
+
Dynamic: maintainer
|
|
26
|
+
Dynamic: maintainer-email
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: summary
|
|
29
|
+
|
|
30
|
+
kunapi
|
kunapi-1.15/PKG-INFO
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: kunapi
|
|
3
|
-
Version: 1.15
|
|
4
|
-
Summary: kunapi
|
|
5
|
-
Home-page: https://docs.kwebapp.cn/index/index/2
|
|
6
|
-
Author: 百里-坤坤
|
|
7
|
-
Author-email: fengkun01@qq.com
|
|
8
|
-
Maintainer: 坤坤
|
|
9
|
-
Maintainer-email: fengkun01@qq.com
|
|
10
|
-
License: MIT License
|
|
11
|
-
Keywords: kunapi1.15
|
|
12
|
-
|
|
13
|
-
kunapi
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: kunapi
|
|
3
|
-
Version: 1.15
|
|
4
|
-
Summary: kunapi
|
|
5
|
-
Home-page: https://docs.kwebapp.cn/index/index/2
|
|
6
|
-
Author: 百里-坤坤
|
|
7
|
-
Author-email: fengkun01@qq.com
|
|
8
|
-
Maintainer: 坤坤
|
|
9
|
-
Maintainer-email: fengkun01@qq.com
|
|
10
|
-
License: MIT License
|
|
11
|
-
Keywords: kunapi1.15
|
|
12
|
-
|
|
13
|
-
kunapi
|
|
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.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py
RENAMED
|
File without changes
|
{kunapi-1.15 → kunapi-1.16}/kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.py
RENAMED
|
File without changes
|
{kunapi-1.15 → kunapi-1.16}/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
|
|
File without changes
|
|
File without changes
|