projectstatus.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 ######################################################################
3 #
4 # Name: projectstatus.py
5 #
6 # Purpose: Python class ProjectStatus (used by project.py script).
7 # This class contains information about project status.
8 #
9 # Created: 12-Dec-2014 Herbert Greenlee
10 #
11 ######################################################################
12 
13 from __future__ import absolute_import
14 from __future__ import print_function
15 from project_modules.stagestatus import StageStatus
16 
17 # Project status class.
18 
20 
21  # Constructor.
22 
23  def __init__(self, projects):
24 
25  # Initialize attributes.
26 
27  self.projects = projects
28  self.stats = {}
29  for project in projects:
30  for stage in project.stages:
31  self.stats[stage.name] = StageStatus(stage)
32 
33  # Update data for the specified project.
34 
35  def update(self):
36 
37  # Update all stages.
38 
39  for stagename in list(self.stats.keys()):
40  self.stats[stagename].update()
41 
42  # Get stage status for specified stage.
43 
44  def get_stage_status(self, stagename):
45  return self.stats[stagename]
def get_stage_status(self, stagename)