kunapi 1.5__tar.gz → 1.6__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.5 → kunapi-1.6}/PKG-INFO +2 -2
- {kunapi-1.5 → kunapi-1.6}/kunapi/__init__.py +1 -1
- {kunapi-1.5 → kunapi-1.6}/kunapi/app.py +65 -62
- kunapi-1.6/kunapi/common/globals.py +9 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/common/request.py +4 -1
- {kunapi-1.5 → kunapi-1.6}/kunapi/kunapi.py +7 -2
- {kunapi-1.5 → kunapi-1.6}/kunapi.egg-info/PKG-INFO +2 -2
- {kunapi-1.5 → kunapi-1.6}/kunapi.egg-info/SOURCES.txt +20 -0
- kunapi-1.5/kunapi/common/globals.py +0 -9
- {kunapi-1.5 → kunapi-1.6}/kunapi/Events.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/common/__init__.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/common/autoload.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/config/__init__.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/__init__.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/common/__init__.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/common/autoload.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/common/model.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/config/__init__.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/config/app.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/index/__init__.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/index/common/__init__.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/index/common/autoload.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/index/controller/__init__.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/index/controller/index/__init__.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/index/controller/index/common/model.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/index/controller/index/index.py +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi.egg-info/dependency_links.txt +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi.egg-info/entry_points.txt +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi.egg-info/requires.txt +0 -0
- {kunapi-1.5 → kunapi-1.6}/kunapi.egg-info/top_level.txt +0 -0
- {kunapi-1.5 → kunapi-1.6}/setup.cfg +0 -0
- {kunapi-1.5 → kunapi-1.6}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.2
|
|
2
2
|
Name: kunapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6
|
|
4
4
|
Summary: kunapi
|
|
5
5
|
Home-page: https://docs.kwebapp.cn/index/index/2
|
|
6
6
|
Author: 百里-坤坤
|
|
@@ -9,5 +9,5 @@ Maintainer: 坤坤
|
|
|
9
9
|
Maintainer-email: fengkun01@qq.com
|
|
10
10
|
License: MIT License
|
|
11
11
|
Description: kunapi
|
|
12
|
-
Keywords: kunapi1.
|
|
12
|
+
Keywords: kunapi1.6
|
|
13
13
|
Platform: UNKNOWN
|
|
@@ -73,7 +73,7 @@ class web:
|
|
|
73
73
|
env['url_scheme']=env['HTTP_X_REAL_IP']
|
|
74
74
|
except:
|
|
75
75
|
env['url_scheme']=env['wsgi.url_scheme'],
|
|
76
|
-
status,resheader,body=self.__routes(
|
|
76
|
+
status,resheader,body=self.__routes(env)
|
|
77
77
|
if type(body) is bytes:
|
|
78
78
|
pass
|
|
79
79
|
else:
|
|
@@ -248,9 +248,9 @@ class web:
|
|
|
248
248
|
globals.VAR.defmodular=''
|
|
249
249
|
globals.VAR.defplug=''
|
|
250
250
|
route=self.__config.route
|
|
251
|
-
modular=
|
|
251
|
+
modular=self.__get_modular(header)
|
|
252
252
|
if route['plug']:
|
|
253
|
-
getplug=
|
|
253
|
+
getplug=self.__get_plug(header)
|
|
254
254
|
else:
|
|
255
255
|
getplug=''
|
|
256
256
|
routedefault=route['default']
|
|
@@ -270,8 +270,7 @@ class web:
|
|
|
270
270
|
# plug=route['plug']
|
|
271
271
|
if getplug:
|
|
272
272
|
plug=getplug
|
|
273
|
-
routedefault,PATH_INFO=
|
|
274
|
-
self,
|
|
273
|
+
routedefault,PATH_INFO=self.__getconfigroute(
|
|
275
274
|
PATH_INFO,
|
|
276
275
|
header
|
|
277
276
|
)
|
|
@@ -288,8 +287,7 @@ class web:
|
|
|
288
287
|
param.append(urllib.parse.unquote(path))
|
|
289
288
|
i+=1
|
|
290
289
|
else: #配置模块没有配置插件
|
|
291
|
-
routedefault,PATH_INFO=
|
|
292
|
-
self,
|
|
290
|
+
routedefault,PATH_INFO=self.__getconfigroute(
|
|
293
291
|
PATH_INFO,
|
|
294
292
|
header
|
|
295
293
|
)
|
|
@@ -312,8 +310,7 @@ class web:
|
|
|
312
310
|
# plug=route['plug']
|
|
313
311
|
elif getplug:
|
|
314
312
|
plug=getplug
|
|
315
|
-
routedefault,PATH_INFO=
|
|
316
|
-
self,
|
|
313
|
+
routedefault,PATH_INFO=self.__getconfigroute(
|
|
317
314
|
PATH_INFO,
|
|
318
315
|
header
|
|
319
316
|
)
|
|
@@ -333,7 +330,7 @@ class web:
|
|
|
333
330
|
param.append(urllib.parse.unquote(path))
|
|
334
331
|
i+=1
|
|
335
332
|
else: #完全默认
|
|
336
|
-
routedefault,PATH_INFO=
|
|
333
|
+
routedefault,PATH_INFO=self.__getconfigroute(PATH_INFO,header)
|
|
337
334
|
if routedefault: #使用默认路由
|
|
338
335
|
for path in PATH_INFO:
|
|
339
336
|
if path:
|
|
@@ -382,8 +379,21 @@ class web:
|
|
|
382
379
|
body=data
|
|
383
380
|
return body,status,resheader
|
|
384
381
|
def __set_globals(self,header):
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
globals.VAR = threading.local()
|
|
385
|
+
globals.HEADER = threading.local()
|
|
386
|
+
globals.G = threading.local()
|
|
387
|
+
|
|
388
|
+
PATH_INFO=header['PATH_INFO'].split('/')
|
|
389
|
+
if PATH_INFO[0]==' ' or PATH_INFO[0]=='':
|
|
390
|
+
del PATH_INFO[0]
|
|
391
|
+
methods,modular,plug,files,funct,param=self.defaultroute(header,PATH_INFO)
|
|
392
|
+
globals.VAR.component=(methods,modular,plug,files,funct,param)
|
|
393
|
+
globals.VAR.defmodular=''
|
|
394
|
+
globals.VAR.defplug=''
|
|
395
|
+
|
|
385
396
|
globals.HEADER.GET=header
|
|
386
|
-
# globals.HEADER.url_scheme=header['url_scheme']
|
|
387
397
|
globals.HEADER.Method=header['REQUEST_METHOD']
|
|
388
398
|
globals.HEADER.URL=header['RAW_URI']
|
|
389
399
|
globals.HEADER.PATH_INFO=header['PATH_INFO']
|
|
@@ -405,26 +415,23 @@ class web:
|
|
|
405
415
|
globals.HEADER.HTTP_USER_AGENT=header['HTTP_USER_AGENT']
|
|
406
416
|
except:
|
|
407
417
|
globals.HEADER.HTTP_USER_AGENT=None
|
|
408
|
-
def __del_globals():
|
|
409
|
-
|
|
410
|
-
globals.
|
|
411
|
-
globals.
|
|
418
|
+
def __del_globals(self):
|
|
419
|
+
pass
|
|
420
|
+
globals.VAR = None
|
|
421
|
+
globals.HEADER = None
|
|
422
|
+
globals.G = None
|
|
412
423
|
def __routes(self,header):
|
|
413
424
|
body="这是一个http测试服务器"
|
|
414
425
|
status="200 ok"
|
|
415
426
|
resheader={"Content-Type":"application/json; charset=utf-8"}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if PATH_INFO[0]==' ' or PATH_INFO[0]=='':
|
|
419
|
-
del PATH_INFO[0]
|
|
420
|
-
methods,modular,plug,files,funct,param=web.defaultroute(self,header,PATH_INFO)
|
|
421
|
-
globals.VAR.component=(methods,modular,plug,files,funct,param)
|
|
427
|
+
self.__set_globals(header)
|
|
428
|
+
methods,modular,plug,files,funct,param=globals.VAR.component
|
|
422
429
|
if header['REQUEST_METHOD'] in methods:
|
|
423
430
|
try:
|
|
424
|
-
obj=getattr(
|
|
431
|
+
obj=getattr(self.__appname,modular)
|
|
425
432
|
except (AttributeError,UnboundLocalError):
|
|
426
433
|
status="500 Internal Server Error"
|
|
427
|
-
body=
|
|
434
|
+
body=self.__tpl(
|
|
428
435
|
title = status,
|
|
429
436
|
e=status,
|
|
430
437
|
data="路由不存在:"+str(modular)+"/"
|
|
@@ -434,7 +441,7 @@ class web:
|
|
|
434
441
|
obj=getattr(obj,"controller")
|
|
435
442
|
except (AttributeError,UnboundLocalError):
|
|
436
443
|
status="404 Not Found"
|
|
437
|
-
body=
|
|
444
|
+
body=self.__tpl(
|
|
438
445
|
title = status,
|
|
439
446
|
e=status,
|
|
440
447
|
data="路由不存在:"+str(modular)+"/controller/"
|
|
@@ -446,15 +453,14 @@ class web:
|
|
|
446
453
|
con="无法找到目录:"+str(modular)+"/controller/"+str(plug)+"/"
|
|
447
454
|
try:
|
|
448
455
|
data=getattr(obj,"error")(e,con)
|
|
449
|
-
body,status,resheader=
|
|
450
|
-
self,
|
|
456
|
+
body,status,resheader=self.__tran(
|
|
451
457
|
data,
|
|
452
458
|
status,
|
|
453
459
|
resheader
|
|
454
460
|
)
|
|
455
461
|
except (AttributeError,UnboundLocalError):
|
|
456
462
|
status="404 Not Found"
|
|
457
|
-
body=
|
|
463
|
+
body=self.__tpl(
|
|
458
464
|
title = status,
|
|
459
465
|
e=status,data=con
|
|
460
466
|
)
|
|
@@ -464,7 +470,7 @@ class web:
|
|
|
464
470
|
if self.__config.app['app_debug']:
|
|
465
471
|
print(traceback.format_exc())
|
|
466
472
|
errms=traceback.format_exc().split("\n")
|
|
467
|
-
body=
|
|
473
|
+
body=self.__tpl(
|
|
468
474
|
title = status,
|
|
469
475
|
data=errms,e=e
|
|
470
476
|
)
|
|
@@ -475,15 +481,14 @@ class web:
|
|
|
475
481
|
con="无法找到文件:"+str(modular)+"/controller/"+str(plug)+"/"+str(files)+".py"
|
|
476
482
|
try:
|
|
477
483
|
data=getattr(obj,"error")(e,con)
|
|
478
|
-
body,status,resheader=
|
|
479
|
-
|
|
480
|
-
,data
|
|
484
|
+
body,status,resheader=self.__tran(
|
|
485
|
+
data
|
|
481
486
|
,status
|
|
482
487
|
,resheader
|
|
483
488
|
)
|
|
484
489
|
except (AttributeError,UnboundLocalError):
|
|
485
490
|
status="404 Not Found"
|
|
486
|
-
body=
|
|
491
|
+
body=self.__tpl(
|
|
487
492
|
title = status
|
|
488
493
|
,data=con
|
|
489
494
|
,e=status)
|
|
@@ -493,7 +498,7 @@ class web:
|
|
|
493
498
|
if self.__config.app['app_debug']:
|
|
494
499
|
print(traceback.format_exc())
|
|
495
500
|
errms=traceback.format_exc().split("\n")
|
|
496
|
-
body=
|
|
501
|
+
body=self.__tpl(
|
|
497
502
|
title = status,
|
|
498
503
|
data=errms,
|
|
499
504
|
e=e
|
|
@@ -505,8 +510,8 @@ class web:
|
|
|
505
510
|
try:
|
|
506
511
|
data=getattr(obj,self.__config.app['before_request'])()
|
|
507
512
|
if data:
|
|
508
|
-
body,status,resheader=
|
|
509
|
-
|
|
513
|
+
body,status,resheader=self.__tran(
|
|
514
|
+
data,
|
|
510
515
|
status,
|
|
511
516
|
resheader
|
|
512
517
|
)
|
|
@@ -516,8 +521,8 @@ class web:
|
|
|
516
521
|
except Exception as e:
|
|
517
522
|
try:
|
|
518
523
|
data=getattr(obj,"error")(e,traceback.format_exc().split("\n"))
|
|
519
|
-
body,status,resheader=
|
|
520
|
-
|
|
524
|
+
body,status,resheader=self.__tran(
|
|
525
|
+
data,
|
|
521
526
|
status,
|
|
522
527
|
resheader
|
|
523
528
|
)
|
|
@@ -527,7 +532,7 @@ class web:
|
|
|
527
532
|
errms=status
|
|
528
533
|
if self.__config.app['app_debug']:
|
|
529
534
|
errms=traceback.format_exc().split("\n")
|
|
530
|
-
body=
|
|
535
|
+
body=self.__tpl(
|
|
531
536
|
title = status,
|
|
532
537
|
data=errms,e=e
|
|
533
538
|
)
|
|
@@ -538,7 +543,7 @@ class web:
|
|
|
538
543
|
if self.__config.app['app_debug']:
|
|
539
544
|
print(traceback.format_exc())
|
|
540
545
|
errms=traceback.format_exc().split("\n")
|
|
541
|
-
body=
|
|
546
|
+
body=self.__tpl(
|
|
542
547
|
title = status,
|
|
543
548
|
data=errms,e=e
|
|
544
549
|
)
|
|
@@ -549,16 +554,16 @@ class web:
|
|
|
549
554
|
data=getattr(obj,funct)(*param) #兼容性之前的控制器
|
|
550
555
|
else:
|
|
551
556
|
data=getattr(objclass,funct)(*param)
|
|
552
|
-
body,status,resheader=
|
|
553
|
-
|
|
557
|
+
body,status,resheader=self.__tran(
|
|
558
|
+
data,
|
|
554
559
|
status,
|
|
555
560
|
resheader
|
|
556
561
|
)
|
|
557
562
|
except Exception as e:
|
|
558
563
|
try:
|
|
559
564
|
data=getattr(obj,"error")(e,traceback.format_exc().split("\n"))
|
|
560
|
-
body,status,resheader=
|
|
561
|
-
|
|
565
|
+
body,status,resheader=self.__tran(
|
|
566
|
+
data,
|
|
562
567
|
status,
|
|
563
568
|
resheader
|
|
564
569
|
)
|
|
@@ -568,7 +573,7 @@ class web:
|
|
|
568
573
|
if self.__config.app['app_debug']:
|
|
569
574
|
print(traceback.format_exc())
|
|
570
575
|
errms=traceback.format_exc().split("\n")
|
|
571
|
-
body=
|
|
576
|
+
body=self.__tpl(
|
|
572
577
|
title = status,
|
|
573
578
|
data=errms,
|
|
574
579
|
e=e
|
|
@@ -579,14 +584,14 @@ class web:
|
|
|
579
584
|
if self.__config.app['app_debug']:
|
|
580
585
|
print(traceback.format_exc())
|
|
581
586
|
errms=traceback.format_exc().split("\n")
|
|
582
|
-
body=
|
|
587
|
+
body=self.__tpl(
|
|
583
588
|
title = status,
|
|
584
589
|
data=errms,
|
|
585
590
|
e=e
|
|
586
591
|
)
|
|
587
592
|
else:
|
|
588
593
|
status="405 Method Not Allowed"
|
|
589
|
-
body=
|
|
594
|
+
body=self.__tpl(
|
|
590
595
|
title = status,
|
|
591
596
|
data='405 Method Not Allowed',
|
|
592
597
|
e=''
|
|
@@ -600,13 +605,13 @@ class web:
|
|
|
600
605
|
try:
|
|
601
606
|
data=getattr(obj,self.__config.app['after_request'])(body,status,resheader)
|
|
602
607
|
if data:
|
|
603
|
-
body,status,resheader=
|
|
608
|
+
body,status,resheader=self.__tran(data,status,resheader)
|
|
604
609
|
except (AttributeError,UnboundLocalError):pass
|
|
605
610
|
except Exception as e:
|
|
606
611
|
try:
|
|
607
612
|
data=getattr(obj,"error")(e,traceback.format_exc().split("\n"))
|
|
608
|
-
body,status,resheader=
|
|
609
|
-
|
|
613
|
+
body,status,resheader=self.__tran(
|
|
614
|
+
data,
|
|
610
615
|
status,
|
|
611
616
|
resheader
|
|
612
617
|
)
|
|
@@ -616,7 +621,7 @@ class web:
|
|
|
616
621
|
if self.__config.app['app_debug']:
|
|
617
622
|
print(traceback.format_exc())
|
|
618
623
|
errms=traceback.format_exc().split("\n")
|
|
619
|
-
body=
|
|
624
|
+
body=self.__tpl(
|
|
620
625
|
title = status
|
|
621
626
|
,data=errms,
|
|
622
627
|
e=e
|
|
@@ -627,7 +632,7 @@ class web:
|
|
|
627
632
|
if self.__config.app['app_debug']:
|
|
628
633
|
print(traceback.format_exc())
|
|
629
634
|
errms=traceback.format_exc().split("\n")
|
|
630
|
-
body=
|
|
635
|
+
body=self.__tpl(
|
|
631
636
|
title = status,
|
|
632
637
|
data=errms,
|
|
633
638
|
e=""
|
|
@@ -635,15 +640,12 @@ class web:
|
|
|
635
640
|
resheaders=[]
|
|
636
641
|
for key in resheader:
|
|
637
642
|
resheaders.append((key,resheader[key]))
|
|
638
|
-
web.__del_globals()
|
|
639
|
-
|
|
640
|
-
|
|
641
643
|
if self.__config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=='kwebs' or self.__config.fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=='kwebsp':#请求后执行的函数
|
|
642
644
|
try:
|
|
643
645
|
getattr(obj,"rfdsgeagesegdsfdsfdrrsebskwebsafterrequest")() #关闭数据库相关连接
|
|
644
646
|
except:pass
|
|
645
647
|
|
|
646
|
-
|
|
648
|
+
self.__del_globals()
|
|
647
649
|
if isinstance(resheaders,list):
|
|
648
650
|
if not body:
|
|
649
651
|
body=''
|
|
@@ -653,15 +655,15 @@ class web:
|
|
|
653
655
|
body=str(body)
|
|
654
656
|
return str(status),resheaders,body
|
|
655
657
|
else:
|
|
656
|
-
raise
|
|
657
|
-
def __tpl(
|
|
658
|
+
raise
|
|
659
|
+
def __tpl(self,**context):
|
|
658
660
|
arr=json_encode({
|
|
659
661
|
'title':context['title'],
|
|
660
662
|
'msg':str(context['e']),
|
|
661
663
|
'error':context['data']
|
|
662
664
|
})
|
|
663
665
|
return arr
|
|
664
|
-
# def __tpl(
|
|
666
|
+
# def __tpl(__tpl,**context):
|
|
665
667
|
# title,status,error=context
|
|
666
668
|
# arr=json_encode({
|
|
667
669
|
# 'title':title,
|
|
@@ -728,6 +730,7 @@ class web:
|
|
|
728
730
|
'HTTP_X_REAL_IP':env.get('HTTP_X_REAL_IP'),
|
|
729
731
|
'files':files
|
|
730
732
|
}
|
|
733
|
+
|
|
731
734
|
p=(config.app['staticpath']+reqheader['RAW_URI'].replace(' ',''))
|
|
732
735
|
status='200 ok'
|
|
733
736
|
if os.path.isfile(p):
|
|
@@ -760,7 +763,7 @@ class web:
|
|
|
760
763
|
resheader.append(("Last-Modified",otherStyleTime))
|
|
761
764
|
resheader.append(("ETag",ETag))
|
|
762
765
|
else:
|
|
763
|
-
status,resheader,body=
|
|
766
|
+
status,resheader,body=self.__routes(reqheader)
|
|
764
767
|
from kunapi import __version__
|
|
765
768
|
resheader.append(('Server', "kunapi-"+__version__))
|
|
766
769
|
if type(body) is bytes:
|
|
@@ -769,7 +772,7 @@ class web:
|
|
|
769
772
|
body=bytes(body, encoding='utf-8')
|
|
770
773
|
start_response(status,resheader)
|
|
771
774
|
return [body]
|
|
772
|
-
def __waitress(self,host,port):
|
|
775
|
+
def __waitress(self,host,port,threads=1):
|
|
773
776
|
if host=='0.0.0.0':
|
|
774
777
|
print("\033[32m* (CTRL+单击打开)http://127.0.0.1:"+str(port)+"(按CTRL+C退出)")
|
|
775
778
|
else:
|
|
@@ -779,8 +782,8 @@ class web:
|
|
|
779
782
|
else:
|
|
780
783
|
print('\033[37m* 调试器:已关闭')
|
|
781
784
|
from waitress import serve
|
|
782
|
-
serve(self.__application, host=host, port=port)
|
|
783
|
-
def __http_wsgi(self,host,port
|
|
785
|
+
serve(self.__application, host=host, port=port,threads=threads,channel_timeout=3600) #框架不支持多线程 所以 threads设为1
|
|
786
|
+
def __http_wsgi(self,host,port):
|
|
784
787
|
"http——wsgi测试服务 windows建议使用Waitress"
|
|
785
788
|
from wsgiref.simple_server import make_server
|
|
786
789
|
print("* \033[1;31;40m! 警告:\033[0m这是一个wsgiref开发服务器。不要在生产环境中部署使用它")
|
|
@@ -113,7 +113,10 @@ class HEADER:
|
|
|
113
113
|
def SERVER_PROTOCOL():
|
|
114
114
|
return kcwsglobals.HEADER.SERVER_PROTOCOL
|
|
115
115
|
def HTTP_HOST():
|
|
116
|
-
|
|
116
|
+
if kcwsglobals.HEADER.HTTP_HOST:
|
|
117
|
+
return kcwsglobals.HEADER.HTTP_HOST
|
|
118
|
+
else:
|
|
119
|
+
return ''
|
|
117
120
|
def HTTP_COOKIE():
|
|
118
121
|
return kcwsglobals.HEADER.HTTP_COOKIE
|
|
119
122
|
def HTTP_USER_AGENT():
|
|
@@ -11,6 +11,10 @@ def get_cmd_par(fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr=''):
|
|
|
11
11
|
if python_version[0:3]!='3.8':
|
|
12
12
|
print("\033[1;31;40m "+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"依赖python3.8,与你现在的python"+python_version+"不兼容")
|
|
13
13
|
exit()
|
|
14
|
+
if 'Linux' in get_sysinfo()['platform'] or 'Windows' in get_sysinfo()['platform']:pass
|
|
15
|
+
else:
|
|
16
|
+
print("\033[1;31;40m "+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+"不支持当前操作系统 解压在linux或windows系统下运行")
|
|
17
|
+
exit()
|
|
14
18
|
try:
|
|
15
19
|
opts, args = getopt.getopt(sys.argv[1:], "h", ["project=","app=","modular=","plug=","user=","pwd=","host=","port=","timeout=","processcount=",
|
|
16
20
|
"install","uninstall","pack","upload","cli"])
|
|
@@ -256,7 +260,7 @@ def cllfunction():
|
|
|
256
260
|
else:
|
|
257
261
|
save_route_cli_pid('pid/'+str(sys.argv[tar-1])+fdgrsgrsegsrsgrsbsdbftbrsbfdrtrtbdfsrsgr1+'_server_pid')
|
|
258
262
|
app.run(host=cmd_par['host'],port=int(cmd_par['port']))
|
|
259
|
-
|
|
263
|
+
elif 'Linux' in get_sysinfo()['platform']:
|
|
260
264
|
pythonpath=site.getsitepackages()[0].replace('\\','/')
|
|
261
265
|
t=pythonpath.split('/')
|
|
262
266
|
tt='/'+t[-3]+'/'+t[-2]+'/'+t[-1]
|
|
@@ -281,7 +285,8 @@ def cllfunction():
|
|
|
281
285
|
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']]
|
|
282
286
|
sys.exit(run())
|
|
283
287
|
exit()
|
|
284
|
-
|
|
288
|
+
else:
|
|
289
|
+
raise Exception('不支持该操作系统')
|
|
285
290
|
elif cmd_par['install'] or cmd_par['pack'] or cmd_par['upload'] or cmd_par['uninstall']:
|
|
286
291
|
if cmd_par['install']:#插入 应用、模块、插件
|
|
287
292
|
if cmd_par['appname'] and cmd_par['modular']:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 1.2
|
|
2
2
|
Name: kunapi
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6
|
|
4
4
|
Summary: kunapi
|
|
5
5
|
Home-page: https://docs.kwebapp.cn/index/index/2
|
|
6
6
|
Author: 百里-坤坤
|
|
@@ -9,5 +9,5 @@ Maintainer: 坤坤
|
|
|
9
9
|
Maintainer-email: fengkun01@qq.com
|
|
10
10
|
License: MIT License
|
|
11
11
|
Description: kunapi
|
|
12
|
-
Keywords: kunapi1.
|
|
12
|
+
Keywords: kunapi1.6
|
|
13
13
|
Platform: UNKNOWN
|
|
@@ -28,4 +28,24 @@ kunapi/tempfile/kunapi/app/index/controller/index/__init__.py
|
|
|
28
28
|
kunapi/tempfile/kunapi/app/index/controller/index/index.py
|
|
29
29
|
kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py
|
|
30
30
|
kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.py
|
|
31
|
+
kunapi/tempfile/kunapi/app/index/controller/index/common/model.py
|
|
32
|
+
kunapi/common/__init__.py
|
|
33
|
+
kunapi/common/autoload.py
|
|
34
|
+
kunapi/common/globals.py
|
|
35
|
+
kunapi/common/request.py
|
|
36
|
+
kunapi/config/__init__.py
|
|
37
|
+
kunapi/tempfile/kunapi/app/__init__.py
|
|
38
|
+
kunapi/tempfile/kunapi/app/common/__init__.py
|
|
39
|
+
kunapi/tempfile/kunapi/app/common/autoload.py
|
|
40
|
+
kunapi/tempfile/kunapi/app/common/model.py
|
|
41
|
+
kunapi/tempfile/kunapi/app/config/__init__.py
|
|
42
|
+
kunapi/tempfile/kunapi/app/config/app.py
|
|
43
|
+
kunapi/tempfile/kunapi/app/index/__init__.py
|
|
44
|
+
kunapi/tempfile/kunapi/app/index/common/__init__.py
|
|
45
|
+
kunapi/tempfile/kunapi/app/index/common/autoload.py
|
|
46
|
+
kunapi/tempfile/kunapi/app/index/controller/__init__.py
|
|
47
|
+
kunapi/tempfile/kunapi/app/index/controller/index/__init__.py
|
|
48
|
+
kunapi/tempfile/kunapi/app/index/controller/index/index.py
|
|
49
|
+
kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py
|
|
50
|
+
kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.py
|
|
31
51
|
kunapi/tempfile/kunapi/app/index/controller/index/common/model.py
|
|
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.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/index/controller/index/common/__init__.py
RENAMED
|
File without changes
|
{kunapi-1.5 → kunapi-1.6}/kunapi/tempfile/kunapi/app/index/controller/index/common/autoload.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
|