Sha256: c00a055a8d4f069e274f7fa31c3d7af759b0c388dfd941f968f8a61753b99501
Contents?: true
Size: 1.11 KB
Versions: 4
Compression:
Stored size: 1.11 KB
Contents
from estimationtools.utils import get_estimation_field, execute_query from trac.wiki.macros import WikiMacroBase from trac.wiki.api import parse_args class HoursRemaining(WikiMacroBase): """Calculates remaining estimated hours for the queried tickets. The macro accepts a comma-separated list of query parameters for the ticket selection, in the form "key=value" as specified in TracQuery#QueryLanguage. Example: {{{ [[HoursRemaining(milestone=Sprint 1)]] }}} """ estimation_field = get_estimation_field() def render_macro(self, req, name, content): _, options = parse_args(content, strict=False) # we have to add custom estimation field to query so that field is added to # resulting ticket list options[self.estimation_field + "!"] = None tickets = execute_query(self.env, req, options) sum = 0.0 for t in tickets: try: sum += float(t[self.estimation_field]) except: pass return "%s" % int(sum)
Version data entries
4 entries across 4 versions & 1 rubygems