Skip to content

Commit 57652f1

Browse files
authored
state cleanup (#307)
* state cleanup Forgot to change how the output for /app/pl/state is derived. Corrected it.
1 parent 8271634 commit 57652f1

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Python/dawgie/fe/app.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,13 @@ def log_messages():
8888
return json.dumps(dawgie.pl.logger.fe.remembered()).encode()
8989

9090

91-
def pl_state():
91+
def current_state():
9292
return json.dumps(
93-
{'name': dawgie.context.fsm.state, 'status': 'active'}
93+
{
94+
'name': dawgie.context.fsm.state,
95+
'ready': dawgie.context.fsm.is_pipeline_active(),
96+
'status': dawgie.context.fsm.transition.name,
97+
}
9498
).encode()
9599

96100

@@ -280,12 +284,6 @@ def start_changeset():
280284
return dawgie.context.git_rev.encode('utf-8')
281285

282286

283-
def start_state():
284-
return json.dumps(
285-
{'name': dawgie.context.fsm.state, 'status': 'active'}
286-
).encode()
287-
288-
289287
def versions():
290288
fn = os.path.join(os.path.dirname(__file__), 'requirements.txt')
291289
vers = {'dawgie': dawgie.__version__, 'python': sys.version}
@@ -314,7 +312,7 @@ def versions():
314312

315313
DynamicContent(log_messages, '/app/pl/log')
316314

317-
DynamicContent(pl_state, '/app/pl/state')
315+
DynamicContent(current_state, '/app/pl/state')
318316

319317
DynamicContent(schedule_crew, '/app/schedule/crew')
320318
DynamicContent(schedule_doing, '/app/schedule/doing')
@@ -337,6 +335,6 @@ def versions():
337335

338336
DynamicContent(start_changeset, '/app/changeset.txt')
339337
DynamicContent(snapshot, '/app/snapshot')
340-
DynamicContent(start_state, '/app/state/status')
338+
DynamicContent(current_state, '/app/state/status')
341339
DynamicContent(start_submit, '/app/submit', [HttpMethod.POST])
342340
DynamicContent(versions, '/app/versions')

0 commit comments

Comments
 (0)