Ejemplo n.º 1
0
def setup_processing(render, datadir):
    context = Holder()
    context.render = render
    context.items = list(load(datadir))
    context.pubs = [i for i in context.items if i.section == "pub"]
    context.pubgroups = partition_pubs(context.pubs)
    context.props = [i for i in context.items if i.section == "prop"]
    context.time_allocs = compute_time_allocations(context.props)
    context.repos = process_repositories(context.items)
    context.cite_stats = compute_cite_stats(context.pubgroups.all_formal)
    context.repo_stats = compute_repo_stats(context.repos)
    context.talk_stats = summarize_talks([i for i in context.items if i.section == "talk"])
    context.engagement_stats = summarize_engagement([i for i in context.items if i.section == "engagement"])
    context.cur_formatter = None
    context.my_abbrev_name = None

    commands = {}
    commands["BEGIN_SUBST"] = cmd_begin_subst
    commands["FORMAT"] = cmd_format
    commands["MYABBREVNAME"] = cmd_my_abbrev_name
    commands["PUBLIST"] = cmd_pub_list
    commands["TALLOCLIST"] = cmd_talloc_list
    commands["RMISCLIST"] = cmd_rev_misc_list
    commands["RMISCLIST_IF"] = cmd_rev_misc_list_if
    commands["RMISCLIST_IF_NOT"] = cmd_rev_misc_list_if_not
    commands["RREPOLIST"] = cmd_rev_repo_list
    commands["TODAY."] = cmd_today

    return context, commands
Ejemplo n.º 2
0
def setup_processing (render, datadir):
    context = Holder ()
    context.render = render
    context.items = list (load (datadir))
    context.pubs = [i for i in context.items if i.section == 'pub']
    context.pubgroups = partition_pubs (context.pubs)
    context.cur_formatter = None
    context.my_abbrev_name = None

    commands = {}
    commands['CITESTATS'] = cmd_cite_stats
    commands['FORMAT'] = cmd_format
    commands['MYABBREVNAME'] = cmd_my_abbrev_name
    commands['PUBLIST'] = cmd_pub_list
    commands['RMISCLIST'] = cmd_rev_misc_list
    commands['RMISCLIST_IF'] = cmd_rev_misc_list_if
    commands['RMISCLIST_IF_NOT'] = cmd_rev_misc_list_if_not
    commands['TODAY.'] = cmd_today

    return context, commands