Пример #1
0
def make_html(instream, outstream, title):
	p = parser.parser()
	printer = html_printer.printer(outstream)
	html_printer.prelude(outstream, title)

	j = p.parse(instream, sys.argv[1])

	amapper = abbreviation.mapper()
	for i in j:
		for k in i.results:
			amapper.analyse_result(k)

	remapper = abbreviation.remapper(amapper.shorts)
	peo = person.analyser()
	for i in j:
		for k in i.results:
			remapper.fix_result(k)
			peo.analyse_result(k)

	for i in j:
		printer.print_comp(i)
		print >>outstream, "\n"

	print >>outstream, "<h1>Per-person summary</h1>\n<p>Note: you can click the table headings for different sortings</p>"
	pp = html_printer.personlist_printer(peo.people.values(), True, outstream)
	pp.print_people()
Пример #2
0
def make_jim(instream, printer, title):
	p = parser.parser()

	j = p.parse(instream, sys.argv[1])

	amapper = abbreviation.mapper()
	for i in j:
		for k in i.results:
			amapper.analyse_result(k)

	remapper = abbreviation.remapper(amapper.shorts)

	for i in j:
		for k in i.results:
			remapper.fix_result(k)

	for i in j:
		printer.print_comp(i)
Пример #3
0
def load(filenames):
	agg = personAggregator()
	meetings = []
	for filename in filenames:
		print >>sys.stderr, "Loading", filename
		p=parser.parser()
		f = file(filename, "r")
		res = p.parse(f, filename)
		f.close()
		amapper = abbreviation.mapper()
		for i in res:
			for k in i.results:
				amapper.analyse_result(k)
		remapper = abbreviation.remapper(amapper.shorts)
		for i in res:
			for k in i.results:
				remapper.fix_result(k)
		agg.add_results(res, filename)
		meetings.append(filename)
	return (meetings, agg.people)
Пример #4
0
def load(filenames):
	agg = competitionAggregator()
	meetings = []
	for filename in filenames:
		p=parser.parser()
		f = file(filename, "r")
		res = p.parse(f, filename)
		f.close()
		m = re.search("(\d+)-(\d+)", filename)
		date = float(m.groups(1)[0]) + float(m.groups(1)[1])/12
		
		amapper = abbreviation.mapper()
		for i in res:
			for k in i.results:
				amapper.analyse_result(k)
		remapper = abbreviation.remapper(amapper.shorts)
		for i in res:
			for k in i.results:
				remapper.fix_result(k)
		
		agg.add_results(res, date)
		meetings.append(filename)
	return agg