Naming Scheme
Last updated
Was this helpful?
Was this helpful?
{module.member}substitutions = {
"teams": Teams,
"result": Result,
"handicaps": Handicaps,
"overunder": OverUnder,
}class Result:
""" Defines a few variables to be used in conjuctions with {result.X}
"""
def __init__(self, **kwargs):
result = kwargs.get("result", [0, 0]) or [0, 0]
self.hometeam = result[0]
self.awayteam = result[1]
self.total = sum([float(x) for x in result])
# aliases
self.home = self.hometeam
self.away = self.awayteam
class Teams:
""" Defines a few variables to be used in conjuctions with {teams.X}
"""
def __init__(self, **kwargs):
teams = kwargs.get("teams", ["", ""]) or ["", ""]
self.home = " ".join([
x.capitalize() for x in teams[0].split(" ")])
self.away = " ".join([
x.capitalize() for x in teams[1].split(" ")])