kunapi 1.19__tar.gz → 1.20__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.
Files changed (35) hide show
  1. kunapi-1.20/PKG-INFO +13 -0
  2. {kunapi-1.19 → kunapi-1.20}/kunapi/__init__.py +1 -1
  3. {kunapi-1.19 → kunapi-1.20}/kunapi/app.py +7 -2
  4. {kunapi-1.19 → kunapi-1.20}/kunapi/config/__init__.py +3 -0
  5. {kunapi-1.19 → kunapi-1.20}/kunapi/kunapi.py +11 -84
  6. kunapi-1.20/kunapi.egg-info/PKG-INFO +13 -0
  7. kunapi-1.19/PKG-INFO +0 -30
  8. kunapi-1.19/kunapi.egg-info/PKG-INFO +0 -30
  9. {kunapi-1.19 → kunapi-1.20}/kunapi/Events.py +0 -0
  10. {kunapi-1.19 → kunapi-1.20}/kunapi/common/__init__.py +0 -0
  11. {kunapi-1.19 → kunapi-1.20}/kunapi/common/autoload.py +0 -0
  12. {kunapi-1.19 → kunapi-1.20}/kunapi/common/globals.py +0 -0
  13. {kunapi-1.19 → kunapi-1.20}/kunapi/common/request.py +0 -0
  14. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/__init__.py +0 -0
  15. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/common/__init__.py +0 -0
  16. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/common/autoload.py +0 -0
  17. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/common/model.py +0 -0
  18. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/config/__init__.py +0 -0
  19. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/config/app.py +0 -0
  20. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/index/__init__.py +0 -0
  21. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/index/common/__init__.py +0 -0
  22. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/index/common/autoload.py +0 -0
  23. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/index/controller/__init__.py +0 -0
  24. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/index/controller/index/__init__.py +0 -0
  25. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py +0 -0
  26. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.py +0 -0
  27. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/index/controller/index/common/model.py +0 -0
  28. {kunapi-1.19 → kunapi-1.20}/kunapi/tempfile/kunapi/app/index/controller/index/index.py +0 -0
  29. {kunapi-1.19 → kunapi-1.20}/kunapi.egg-info/SOURCES.txt +0 -0
  30. {kunapi-1.19 → kunapi-1.20}/kunapi.egg-info/dependency_links.txt +0 -0
  31. {kunapi-1.19 → kunapi-1.20}/kunapi.egg-info/entry_points.txt +0 -0
  32. {kunapi-1.19 → kunapi-1.20}/kunapi.egg-info/requires.txt +0 -0
  33. {kunapi-1.19 → kunapi-1.20}/kunapi.egg-info/top_level.txt +0 -0
  34. {kunapi-1.19 → kunapi-1.20}/setup.cfg +0 -0
  35. {kunapi-1.19 → kunapi-1.20}/setup.py +0 -0
kunapi-1.20/PKG-INFO ADDED
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.1
2
+ Name: kunapi
3
+ Version: 1.20
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.20
12
+
13
+ kunapi
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- __version__ = '1.19'
2
+ __version__ = '1.20'
3
3
  try:
4
4
  from .app import web
5
5
  except:pass
@@ -793,8 +793,13 @@ class web:
793
793
  print('\033[37m* 调试器:开启')
794
794
  else:
795
795
  print('\033[37m* 调试器:已关闭')
796
- from waitress import serve
797
- serve(self.__application, host=host, port=port,threads=1,channel_timeout=3600) #框架不支持多线程 所以 threads设为1
796
+ try:
797
+ from waitress import serve
798
+ serve(self.__application, host=host, port=port,threads=1,_quiet=False,channel_timeout=3600) #框架不支持多线程 所以 threads设为1
799
+ except:
800
+ from wsgiref.simple_server import make_server
801
+ self.__httpd = make_server(host, int(port), self.__application)
802
+ self.__httpd.serve_forever()
798
803
  def __http_wsgi(self,host,port,filename):
799
804
  "http——wsgi测试服务 windows建议使用Waitress‌"
800
805
  from wsgiref.simple_server import make_server
@@ -12,6 +12,9 @@ app['cli']=False
12
12
  app['save_cli_pid']=False #是否开启cli运行时保存pid
13
13
  app['temp_folder']='app/runtime/temp' #是否开启cli运行时保存pid
14
14
 
15
+ app['run_cmd']={ #运行命令 b不可修改该出手
16
+ 'server':False
17
+ }
15
18
 
16
19
  #路由配置
17
20
  route={}
@@ -9,10 +9,6 @@ def get_cmd_par(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=''):
9
9
  global fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1
10
10
  if fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr:
11
11
  fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1=fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr
12
- # python_version=platform.python_version()
13
- # if python_version[0:3]!='3.8':
14
- # print("\033[1;31;40m "+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"依赖python3.8,与你现在的python"+python_version+"不兼容")
15
- # exit()
16
12
  if os.name == 'posix' or os.name == 'nt':pass
17
13
  else:
18
14
  print("\033[1;31;40m "+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"不支持当前操作系统 在linux或windows系统下运行")
@@ -151,24 +147,13 @@ def get_cmd_par(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=''):
151
147
  else:
152
148
  os.system(cmds.strip())
153
149
  else:
154
- if os.name == 'posix' and cmd_par['daemonyun']:
155
- with daemon.DaemonContext():
156
- os.chdir(cmd_par['path'])
157
- for cmds in cmd_par['cmd'].split('&&'):
158
- print('执行命令',cmds.strip())
159
- if cmds[0:3] == 'cd ':
160
- print('已切换工作目录',cmds[3:])
161
- os.chdir(cmds[3:].strip())
162
- else:
163
- os.system(cmds.strip())
164
- else:
165
- for cmds in cmd_par['cmd'].split('&&'):
166
- print('执行命令',cmds.strip())
167
- if cmds[0:3] == 'cd ':
168
- print('已切换工作目录',cmds[3:])
169
- os.chdir(cmds[3:].strip())
170
- else:
171
- os.system(cmds.strip())
150
+ for cmds in cmd_par['cmd'].split('&&'):
151
+ print('执行命令',cmds.strip())
152
+ if cmds[0:3] == 'cd ':
153
+ print('已切换工作目录',cmds[3:])
154
+ os.chdir(cmds[3:].strip())
155
+ else:
156
+ os.system(cmds.strip())
172
157
  else:
173
158
  if os.name == 'posix' and cmd_par['daemonyun']:
174
159
  with daemon.DaemonContext():
@@ -239,68 +224,10 @@ def cllfunction():
239
224
  print("\033[32m"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" --modular api --uninstall 卸载app/api模块")
240
225
  print("\033[32m"+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+" --modular api --plug plug1 --uninstall 卸载app/api/plug1插件\n")
241
226
  else:
242
- import requests,shutil,importlib,traceback
243
- from .common import create,kcwszip,config,kill_route_cli,save_route_cli_pid,get_pid_by_port,kill_pid
244
- if cmd_par['update']:#更新kunapi包:
245
- # print(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1)
246
- # exit()
247
- serall=['kunapi','kwebs','kwebsp']
248
- if fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1 not in serall:
249
- print('不支持该命令')
250
- exit()
251
- for bs in serall:
252
- if 'kunapi'==bs:
253
- response=requests.get("https://gitee.com/open_source_official_website/pypi/raw/master/kunapi.zip")
254
- elif 'kwebs'==bs:
255
- response=requests.get("https://gitee.com/open_source_official_website/pypi/raw/master/kwebs.zip")
256
- elif 'kwebsp'==bs:
257
- response=requests.get("https://gitee.com/open_source_official_website/pypi/raw/master/kwebsp.zip")
258
- f=open(bs+'.zip',"wb")
259
- f.write(response.content)
260
- f.close()
261
- kcwszip.unzip_file(bs+'.zip','')
262
- os.remove(bs+'.zip')
263
- if os.name == 'nt': #windows
264
- os.system("pip uninstall "+bs+" -y")
265
- os.system("python setup.py sdist install")
266
- try:
267
- shutil.rmtree('__pycache__')
268
- except:pass
269
- shutil.rmtree('build')
270
- shutil.rmtree('dist')
271
- shutil.rmtree(bs)
272
- shutil.rmtree(bs+'.egg-info')
273
- os.remove('setup.py')
274
- elif os.name == 'posix': #linux
275
- os.system("pip3.8 uninstall "+bs+" -y")
276
- os.system("python3.8 setup.py sdist install")
277
- try:
278
- shutil.rmtree('__pycache__')
279
- except:pass
280
- shutil.rmtree('build')
281
- shutil.rmtree('dist')
282
- shutil.rmtree(bs)
283
- shutil.rmtree(bs+'.egg-info')
284
- os.remove('setup.py')
285
- # os.system("pip3 uninstall "+bs+" -y")
286
- # sys.argv=['setup.py', 'sdist', 'install']
287
- # import setup
288
- # importlib.reload(setup)
289
- # setup.start()
290
-
291
- # try:
292
- # shutil.rmtree('__pycache__')
293
- # except:pass
294
- # shutil.rmtree('build')
295
- # shutil.rmtree('dist')
296
- # shutil.rmtree(bs)
297
- # shutil.rmtree(bs+'.egg-info')
298
- # os.remove('setup.py')
299
- else:
300
- print("该操作系统不支持更新"+bs)
301
- if bs==fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1:
302
- break
303
- elif cmd_par['server']:#启动web服务
227
+ import shutil,importlib,traceback #requests
228
+ from .common import create,config,kill_route_cli,save_route_cli_pid,get_pid_by_port,kill_pid #kcwszip
229
+ config.app['run_cmd']=cmd_par
230
+ if cmd_par['server']:#启动web服务
304
231
 
305
232
  try:
306
233
 
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.1
2
+ Name: kunapi
3
+ Version: 1.20
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.20
12
+
13
+ kunapi
kunapi-1.19/PKG-INFO DELETED
@@ -1,30 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: kunapi
3
- Version: 1.19
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.19
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,30 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: kunapi
3
- Version: 1.19
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.19
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes