kcws 1.7__tar.gz → 1.9__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.2
2
2
  Name: kcws
3
- Version: 1.7
3
+ Version: 1.9
4
4
  Summary: 超轻量级http框架
5
5
  Home-page: https://docs.kwebapp.cn/index/index/1
6
6
  Author: 百里-坤坤
@@ -9,5 +9,5 @@ Maintainer: 坤坤
9
9
  Maintainer-email: fk1402936534@qq.com
10
10
  License: MIT License
11
11
  Description: kcws是一个由kcwebs抽象出来的超轻量级http框架
12
- Keywords: kcws1.7
12
+ Keywords: kcws1.9
13
13
  Platform: UNKNOWN
@@ -2,6 +2,22 @@
2
2
  import time,hashlib,json,re,os,sys,platform,shutil,requests,importlib,traceback,pip,tarfile,zipfile,signal,psutil,filetype
3
3
  from kcws import config
4
4
  from . import globals
5
+ import subprocess
6
+ def get_pid_by_port(port):
7
+ """获取使用指定端口使用的进程号pid"""
8
+ pid=[]
9
+ strs=subprocess.check_output(f'ss -tulnp | grep '+str(port), shell=True, text=True)
10
+ if strs:
11
+ if '-bash: ss' in strs:
12
+ raise Exception(strs)
13
+ arr=strs.split('pid=')
14
+ if len(arr)>1:
15
+ del arr[0]
16
+ for k in arr:
17
+ pid.append(int(k.split(',')[0]))
18
+ else:
19
+ raise Exception(strs)
20
+ return pid
5
21
  class kcwszip:
6
22
  def __clean_filename(filename):
7
23
  # 移除或替换非法字符
@@ -27,7 +27,7 @@ route['children']=[]
27
27
 
28
28
  kcws={}
29
29
  kcws['name']='kcws' #项目的名称
30
- kcws['version']='1.7' #项目版本
30
+ kcws['version']='1.9' #项目版本
31
31
  kcws['description']='超轻量级http框架' #项目的简单描述
32
32
  kcws['long_description']='kcws是一个由kcwebs抽象出来的超轻量级http框架' #项目详细描述
33
33
  kcws['license']='MIT License' #开源协议 mit开源
@@ -284,6 +284,12 @@ def cllfunction():
284
284
  # except:pass
285
285
  if __name__ == 'kcws.kcws':
286
286
  kill_route_cli('pid/'+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+'_server_pid')
287
+ try:
288
+ allpid=get_pid_by_port(cmd_par['port'])
289
+ except:pass
290
+ else:
291
+ for kpid in allpid:
292
+ kill_pid(kpid)
287
293
  if types=='-stop':
288
294
  pass
289
295
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.2
2
2
  Name: kcws
3
- Version: 1.7
3
+ Version: 1.9
4
4
  Summary: 超轻量级http框架
5
5
  Home-page: https://docs.kwebapp.cn/index/index/1
6
6
  Author: 百里-坤坤
@@ -9,5 +9,5 @@ Maintainer: 坤坤
9
9
  Maintainer-email: fk1402936534@qq.com
10
10
  License: MIT License
11
11
  Description: kcws是一个由kcwebs抽象出来的超轻量级http框架
12
- Keywords: kcws1.7
12
+ Keywords: kcws1.9
13
13
  Platform: UNKNOWN
@@ -10,7 +10,7 @@ from setuptools import setup, find_packages,Extension
10
10
  class setupconfig:
11
11
  kcws={}
12
12
  kcws['name']='kcws' #项目的名称
13
- kcws['version']='1.7' #项目版本
13
+ kcws['version']='1.9' #项目版本
14
14
  kcws['description']='超轻量级http框架' #项目的简单描述
15
15
  kcws['long_description']='kcws是一个由kcwebs抽象出来的超轻量级http框架' #项目详细描述
16
16
  kcws['license']='MIT License' #开源协议 mit开源
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