17
17
from supervisor .process import ProcessStates
18
18
from supervisor .http import NOT_DONE_YET
19
19
20
+ from supervisor .options import VERSION
20
21
from supervisor .options import make_namespec
21
22
from supervisor .options import split_namespec
22
23
@@ -45,7 +46,7 @@ def more(self):
45
46
response = self .callback ()
46
47
if response is NOT_DONE_YET :
47
48
return NOT_DONE_YET
48
-
49
+
49
50
self .finished = True
50
51
return self .sendresponse (response )
51
52
@@ -74,7 +75,7 @@ def sendresponse(self, response):
74
75
75
76
body = response .get ('body' , '' )
76
77
self .request ['Content-Length' ] = len (body )
77
-
78
+
78
79
self .request .push (body )
79
80
80
81
connection = get_header (self .CONNECTION , self .request .header )
@@ -358,7 +359,7 @@ def startprocess():
358
359
return 'Process %s started' % namespec
359
360
startprocess .delay = 0.05
360
361
return startprocess
361
-
362
+
362
363
elif action == 'clearlog' :
363
364
callback = rpcinterface .supervisor .clearProcessLog (
364
365
namespec )
@@ -368,7 +369,7 @@ def clearlog():
368
369
return clearlog
369
370
370
371
raise ValueError (action )
371
-
372
+
372
373
def render (self ):
373
374
form = self .context .form
374
375
response = self .context .response
@@ -420,7 +421,7 @@ def render(self):
420
421
'state' :info ['state' ],
421
422
'description' :info ['description' ],
422
423
})
423
-
424
+
424
425
root = self .clone ()
425
426
426
427
if message is not None :
@@ -449,24 +450,25 @@ def render(self):
449
450
450
451
actions = item ['actions' ]
451
452
actionitem_td = tr_element .findmeld ('actionitem_td' )
452
-
453
+
453
454
for li_element , actionitem in actionitem_td .repeat (actions ):
454
455
anchor = li_element .findmeld ('actionitem_anchor' )
455
456
if actionitem is None :
456
457
anchor .attrib ['class' ] = 'hidden'
457
458
else :
458
- anchor .attributes (href = actionitem ['href' ],
459
+ anchor .attributes (href = actionitem ['href' ],
459
460
name = actionitem ['name' ])
460
461
anchor .content (actionitem ['name' ])
461
462
if actionitem ['target' ]:
462
463
anchor .attributes (target = actionitem ['target' ])
463
- if shaded_tr :
464
+ if shaded_tr :
464
465
tr_element .attrib ['class' ] = 'shade'
465
466
shaded_tr = not shaded_tr
466
467
else :
467
468
table = root .findmeld ('statustable' )
468
469
table .replace ('No programs to manage' )
469
470
471
+ root .findmeld ('supervisor_version' ).content (VERSION )
470
472
copyright_year = str (datetime .date .today ().year )
471
473
root .findmeld ('copyright_date' ).content (copyright_year )
472
474
@@ -476,7 +478,7 @@ class OKView:
476
478
delay = 0
477
479
def __init__ (self , context ):
478
480
self .context = context
479
-
481
+
480
482
def __call__ (self ):
481
483
return {'body' :'OK' }
482
484
@@ -513,7 +515,7 @@ def match(self, request):
513
515
514
516
if not path :
515
517
path = 'index.html'
516
-
518
+
517
519
for viewname in VIEWS .keys ():
518
520
if viewname == path :
519
521
return True
0 commit comments