コード例 #1
0
ファイル: gs_score.py プロジェクト: thebend/fantasy
	def __repr__(self):
		# no more than 6 people on ice with two digit numbers plus comma separators
		# 6*2 + 5 = 17 = max length
		return '{:1} {:>5} {:3} {:2} {:2} {:2} {:17} {:17}'.format(
			self.period,
			self.time,
			self.team,
			self.scorer,
			util.nz(self.assist1),
			util.nz(self.assist2),
			util.get_number_list_string(self.away),
			util.get_number_list_string(self.home)
		)
コード例 #2
0
ファイル: __init__.py プロジェクト: thebend/fantasy
	def __repr__(self):
		format = \
'''{date:%Y-%m-%d}
{start:%H:%M}-{end:%H:%M} ({duration})
{attendance} people at {venue}

Goals:
{goals}

Home Penalties:
{home_penalties}
Away Penalties:
{away_penalties}

Home Periods:
{home_periods}
Away Periods:
{away_periods}

Referees:
{referees}
Linesmen:
{linesmen}

Stars:
{stars}'''
		return format.format(
			date=self.start,
			start=self.start,
			end=self.end,
			duration=self.duration,
			attendance=self.attendance if self.attendance else 0,
			venue=self.venue,
			goals=self.get_goal_table_string(),
			home_penalties=self.get_penalty_table_string(self.home_penalties),
			away_penalties=self.get_penalty_table_string(self.away_penalties),
			home_periods=self.get_period_table_string(self.home_periods),
			away_periods=self.get_period_table_string(self.away_periods),
			referees=util.get_number_list_string(self.referees),
			linesmen=util.get_number_list_string(self.linesmen),
			stars=self.get_star_table_string()
		)