kcws 1.9__tar.gz → 1.92__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.9
3
+ Version: 1.92
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.9
12
+ Keywords: kcws1.92
13
13
  Platform: UNKNOWN
@@ -266,7 +266,7 @@ def kcws_save_folder_pid(folder,pid):
266
266
  f=open(folder+'/'+str(pid),'w')
267
267
  f.write(str(pid))
268
268
  f.close()
269
- def get_kcwebs_cli_pid(route):
269
+ def get_kcws_cli_pid(route):
270
270
  """通过路由地址获取进程号
271
271
 
272
272
  route 路由地址
@@ -277,14 +277,13 @@ def get_kcwebs_cli_pid(route):
277
277
  with open(get_folder()+"/pid/"+md5(route)+"_cli_pid") as file:
278
278
  pid = file.read()
279
279
  return pid
280
- def get_kcwebs_cli_info(route,types='pid'):
281
- """通过路由地址获取进程信息
280
+ def get_pid_info(pid,types='pid'):
281
+ """通过进程号获取进程信息
282
282
 
283
- route 路由地址
283
+ pid 进程号
284
284
 
285
285
  types info表示获取进程信息 否则判断进程号是否存在
286
286
  """
287
- pid=get_kcwebs_cli_pid(route)
288
287
  if pid:
289
288
  pid=int(pid)
290
289
  try:
@@ -306,10 +305,23 @@ def get_kcwebs_cli_info(route,types='pid'):
306
305
  os.remove(get_folder()+"/pid/"+md5(route)+"_cli_pid")
307
306
  except:pass
308
307
  return False
309
- except:
310
- return False
308
+ except psutil.NoSuchProcess as e:
309
+ if 'psutil.NoSuchProcess no process found with pid '+str(pid) in str(e):
310
+ return False
311
+ else:
312
+ raise e
311
313
  else:
312
314
  return False
315
+ def get_kcws_cli_info(route,types='pid'):
316
+ """通过路由地址获取进程信息
317
+
318
+ route 路由地址
319
+
320
+ types info表示获取进程信息 否则判断进程号是否存在
321
+ """
322
+ pid=get_kcws_cli_pid(route)
323
+ return get_pid_info(pid=pid,types=types)
324
+
313
325
  def kill_pid(pid):
314
326
  """通过进程结束进程
315
327
 
@@ -322,17 +334,26 @@ def kill_pid(pid):
322
334
  try:
323
335
  os.kill(int(pid), signal.SIGTERM)
324
336
  except:pass
337
+ for i in range(600):
338
+ if get_pid_info(pid=pid,types='pid'):
339
+ return True
340
+ return False
341
+ return True
325
342
  def kill_route_cli(route):
326
343
  """通过路由结束进程
327
344
 
328
345
  route 路由地址
329
346
  """
330
- pid=get_kcwebs_cli_pid(route)
347
+ pid=get_kcws_cli_pid(route)
331
348
  if pid:
332
- kill_pid(pid)
333
- try:
334
- os.remove(get_folder()+"/pid/"+md5(route)+"_cli_pid")
335
- except:pass
349
+ if kill_pid(pid):
350
+ try:
351
+ os.remove(get_folder()+"/pid/"+md5(route)+"_cli_pid")
352
+ except:pass
353
+ return True
354
+ else:
355
+ return False
356
+ return True
336
357
  def save_route_cli_pid(route):
337
358
  """通过路由保存进程号(pid)
338
359
 
@@ -27,7 +27,7 @@ route['children']=[]
27
27
 
28
28
  kcws={}
29
29
  kcws['name']='kcws' #项目的名称
30
- kcws['version']='1.9' #项目版本
30
+ kcws['version']='1.92' #项目版本
31
31
  kcws['description']='超轻量级http框架' #项目的简单描述
32
32
  kcws['long_description']='kcws是一个由kcwebs抽象出来的超轻量级http框架' #项目详细描述
33
33
  kcws['license']='MIT License' #开源协议 mit开源
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.2
2
2
  Name: kcws
3
- Version: 1.9
3
+ Version: 1.92
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.9
12
+ Keywords: kcws1.92
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.9' #项目版本
13
+ kcws['version']='1.92' #项目版本
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
File without changes