mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
views.py: Changed the behavior of percentage done
This changes the percetage done from recipes up to date in the period to percentage of not updated recipes that were updated in the period. Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
This commit is contained in:
parent
50d821aab4
commit
823ee8c3d8
24
rrs/views.py
24
rrs/views.py
|
@ -40,10 +40,29 @@ def _get_milestone_statistics(milestone, maintainer_name=None):
|
|||
milestone.start_date,
|
||||
milestone.end_date
|
||||
)
|
||||
recipe_upstream_history_first = \
|
||||
RecipeUpstreamHistory.get_first_by_date_range(
|
||||
milestone.start_date,
|
||||
milestone.end_date,
|
||||
)
|
||||
|
||||
if maintainer_name is None:
|
||||
if recipe_upstream_history_first:
|
||||
recipes_not_upgraded = \
|
||||
Raw.get_reup_by_date(recipe_upstream_history_first.id)
|
||||
if recipes_not_upgraded:
|
||||
recipes_upgraded = \
|
||||
Raw.get_reupg_by_dates_and_recipes(
|
||||
milestone.start_date, milestone.end_date, recipes_not_upgraded)
|
||||
milestone_statistics['all'] = \
|
||||
RecipeUpstream.get_all_recipes(recipe_upstream_history).count()
|
||||
float(len(recipes_upgraded))/float(len(recipes_not_upgraded))
|
||||
else:
|
||||
milestone_statistics['all'] = 0
|
||||
else:
|
||||
milestone_statistics['all'] = 0
|
||||
|
||||
milestone_statistics['percentage'] = "%.0f" % \
|
||||
(float(milestone_statistics['all']) * 100.0)
|
||||
milestone_statistics['up_to_date'] = \
|
||||
RecipeUpstream.get_recipes_up_to_date(recipe_upstream_history).count()
|
||||
milestone_statistics['not_updated'] = \
|
||||
|
@ -79,9 +98,8 @@ def _get_milestone_statistics(milestone, maintainer_name=None):
|
|||
milestone_statistics['cant_be_updated'] += 1
|
||||
else:
|
||||
milestone_statistics['unknown'] += 1
|
||||
|
||||
if milestone_statistics['all'] == 0:
|
||||
milestone_statistics['percentage'] = 0
|
||||
milestone_statistics['percentage'] = '0'
|
||||
else:
|
||||
milestone_statistics['percentage'] = "%.0f" % \
|
||||
((float(milestone_statistics['up_to_date']) /
|
||||
|
|
Loading…
Reference in New Issue
Block a user