Beispiel #1
0
    def get_raw_stats_for_path(self, pootle_path):
        """Return a raw stats dictionary for this goal inside the given path.

        If this is a project goal the stats returned are the ones for the
        stores in the given path that correspond to the stores inside this goal
        that are present in the matching path in the 'templates' TP.

        :param pootle_path: A string with a valid pootle path.
        """
        # Retrieve the stores for this goal in the path.
        tp_stores_for_this_goal = self.get_stores_for_path(pootle_path)

        # Get and sum the stats for the stores.
        quickstats = statssum(tp_stores_for_this_goal)
        stats = get_processed_stats(add_percentages(quickstats))

        # Get and sum the suggestion counts for the stores.
        stats['suggestions'] = suggestions_sum(tp_stores_for_this_goal)

        return stats
Beispiel #2
0
 def get_suggestion_stats(self):
     file_result = suggestions_sum(self.child_stores.iterator())
     dir_result = suggestions_sum(self.child_dirs.iterator())
     return file_result + dir_result