Пример #1
0
def index():
    import config 
    
    storage = MongoStorage()
    
    entries = list(storage.iter_all_todos())
    entries = sorted(entries, key=operator.itemgetter('repo'))
    href_format = config.git_repo_url + '/projects/{proj}/repos/{slug}/browse/{filename}#{lineno}'
    for entry in entries:
        for todo in entry['todos']:
            proj, slug = StashServer.split_repo_name(entry['repo'])
            format_params = entry.copy()
            format_params.update(proj=proj, slug=slug, lineno=todo['lineno'])
            todo['href'] = href_format.format(**format_params)
            if todo['days']: 
                todo['days_as_timedelta'] = datetime.timedelta(days=todo['days'])

    date, elapsed = storage.get_last_fetch_all_status()
              
    return render_template('dashboard.html', entries=entries, date=date, elapsed=elapsed)
Пример #2
0
def index():
    import config

    storage = MongoStorage()

    entries = list(storage.iter_all_todos())
    entries = sorted(entries, key=operator.itemgetter('repo'))
    href_format = config.git_repo_url + '/projects/{proj}/repos/{slug}/browse/{filename}#{lineno}'
    for entry in entries:
        for todo in entry['todos']:
            proj, slug = StashServer.split_repo_name(entry['repo'])
            format_params = entry.copy()
            format_params.update(proj=proj, slug=slug, lineno=todo['lineno'])
            todo['href'] = href_format.format(**format_params)
            if todo['days']:
                todo['days_as_timedelta'] = datetime.timedelta(
                    days=todo['days'])

    date, elapsed = storage.get_last_fetch_all_status()

    return render_template('dashboard.html',
                           entries=entries,
                           date=date,
                           elapsed=elapsed)
Пример #3
0
def stash_server(request, repo_name):
    server = StashServer(request.config.option.stash_url, auth=None)
    proj_name = repo_name.split("/")[0]
    assert "todo-dashboard-test" in set(server.iter_repos(proj_name))
    return server
Пример #4
0
def stash_server(request, repo_name):
    server = StashServer(request.config.option.stash_url, auth=None)
    proj_name = repo_name.split('/')[0]
    assert 'todo-dashboard-test' in set(server.iter_repos(proj_name))
    return server