Exemplo n.º 1
0
def count_time_spent_on_user_story(issues, fromdate = None, tilldate = None):
    statuses_for_issues = get_statuses_for_issues(issues)

    statuses = get_statuses()

    issue_subjects = get_filtered_table_as_dict('id','subject','issues','id in ({0})'.format(as_in(issues)))

    grand_total = 0
    today = date.today().isoformat() #"2015-12-31 23:59:59" 

    for issue in issues:
        bugs_free = 'BUGS FREE' in issue_subjects[issue]
        if tilldate is None: tilldate = today
        if fromdate is None: fromdate = settings.start_date
        (total, spent_line) = get_spent_time_with_subtasks(issue, fromdate, tilldate, bugs_free)
        status = statuses[statuses_for_issues[issue]]
        print u"{0};{1};{2};{3}".format(issue, str(total), status, spent_line) # .replace(".",",")
        grand_total += total

    print "\nTotal: {0}".format(grand_total)
Exemplo n.º 2
0
from redmine_git import list_non_deployed_issues_from_branch, list_remote_branches
from redmine_mysql import get_statuses, get_issues_with_statuses
from utils import get_folders_in_path
import settings

repos = get_folders_in_path(settings.repo_storage)

for repo in repos:
    print repo
    branches = list(set(list_remote_branches(repo)) - {'master'})
    branches.sort()

    for branch in branches:
        issues = list_non_deployed_issues_from_branch(repo, 'origin/'+branch)
        issues_in_status = get_issues_with_statuses(issues)
        status_dict = get_statuses()
        print "\t{}".format(branch)
        for status in issues_in_status.keys():
            print "\t\t{}: {}".format(status_dict[status], issues_in_status[status])
#!/usr/bin/python
from redmine_mysql import get_not_closed_issues_with_children, get_cursor_by_query, get_items_by_query, get_projects_with_children, get_issues_with_statuses, test_issue_statuses, get_statuses
from utils import get_issues_from_command_line
import settings

issues = get_issues_from_command_line()

issues = get_not_closed_issues_with_children(issues)

# checking status for issues
issues_in_status = get_issues_with_statuses(issues)

statuses = get_statuses()

errors = test_issue_statuses(issues_in_status, statuses, settings.allowed_statuses_for_testing, "issues")