示例#1
0
def makeFeed(input_params, params):
	"""
	Make an activity feed for a portal.
	"""
	tools = profiles.Toolkit()
	member_list = getMembers(input_params, params, tools)
	i = 1
	for member in member_list:
		member['item'] = i	
		member = getMemberData(member, input_params, params, tools)
		i += 1
	prepOutput(member_list, input_params, params, tools)	
示例#2
0
        rep_secs = report.getPageSectionData()
        for sec in rep_secs:
            if sec['title'] == 'Lessons learned':
                page['lessons'] = report.getPageText(sec['index'])
                page['title'] = page['page path'][7:-7]
                page['formatted'] = report.formatProfile(page)
                # 				print page['lessons']
                continue
            else:
                pass
    grant_pages = [p for p in grant_pages if p.has_key("lessons")]
    return grant_pages


def publishLearnings(learning_pages):
    report = params['header template'] + '\n'.join(page['formatted']
                                                   for page in learning_pages)
    # 	print report
    edit_sum = params['edit summary']
    pub = profiles.Profiles(params['output path'], params['type'])
    pub.publishProfile(report, params['output path'], edit_sum)


###MAIN###
tools = profiles.Toolkit()
param = output_settings.Params()
params = param.getParams(sys.argv[1])
params['type'] = sys.argv[1]
grant_pages = getGrantReports()
learning_pages = getLearnings(grant_pages)
publishLearnings(learning_pages)