def tablets(self): out = open(s_config.web_sites("tablets.txt")).read() out = self.alltablets.inserttablets(out) out = out.replace( '{Match=""}', '{Match="' + self.eventDal.get_current_match() + '"}') return out
def matchplan(self, match): nextMatch = self.teamsList(match) setMatch = match running = True out = open(s_config.web_sites('graphing.html')).read() out = out.replace('{Match}', match) out = out.replace( '{Schedule}', setMatch + ' : ' + str(self.teamsList(setMatch)) + " {After}") while running: nextMatchNumber = int(match.split('-')[0]) - 1 if nextMatchNumber > 0: match = "{0:0>3}-q".format(nextMatchNumber) for team in nextMatch: if team in self.teamsList(match): running = False out = out.replace('{After}', 'After ' + match) else: running = False graphing.graph_match(self.teamsList(setMatch), setMatch) return out.replace('{Data}', open(s_config.web_data('matchData.html')).read())
def matchplan(self, match): nextMatch = self.teamsList(match) setMatch = match running = True out = open(s_config.web_sites('graphing.html')).read() out = out.replace('{Match}', match) out = out.replace('{Schedule}', setMatch + ' : ' + str(self.teamsList(setMatch))) while running: nextMatchNumber = int(match.split('-')[0]) - 1 if nextMatchNumber > 0: match = "{0:0>3}-q".format(nextMatchNumber) for team in nextMatch: if team in self.teamsList(match): running = False out = out.replace( '{After}', 'Final After: ' + match + ' Updated: ' + event.EventDal.get_current_match()) else: running = False out = out.replace( '{After}', 'Updated: ' + event.EventDal.get_current_match()) return out.replace('{Data}', graphing.examine_match(self.teamsList(setMatch)))
def customplan(self, red1, red2, red3, blue1, blue2, blue3): out = open(s_config.web_sites('graphing.html')).read() teams = [red1, red2, red3, blue1, blue2, blue3] out = out.replace('{Match}', 'Custom') out = out.replace('{Schedule}', str(teams)) out = out.replace('{After}', 'Updated: ' + event.EventDal.get_current_match()) return out.replace('{Data}', graphing.graph_match(teams))
def index(self): out = open(s_config.web_sites("view.html")).read() if self.alone: out = out.replace('{Back}', '') else: out = out.replace('{Back}', '<h3><a href="/">Scouting Director</a></h3>') return out
def index(self): out = open(s_config.web_sites("view.html")).read() if self.alone: out = out.replace('{Back}', '') else: out = out.replace('{Back}', '<h3><a href="/">Scouting Director</a></h3>') out = out.replace('{Match}', event.EventDal.get_current_match()) return out
def setup(self): """Returns Scouting System setup page. Allows user to set event and contains links for server directions, entering the schedule manually, setting up a new database, and backing up data. Returns: (str) HTML text """ out = open(s_config.web_sites("setup.html")).read() out = out.replace('{Event}', self.eventDal.get_current_event()[1]) out = out.replace('{Year}', self.eventDal.get_current_event()[2]) return out
def index(self): """Returns Scouting System start page. Start page displays current match and event, allows user to set current match, displays a table showing tablet pages, and includes links to other scouting system pages. Returns: (str) HTML text """ out = open(s_config.web_sites("admin.html")).read() out = out.replace('{Match}', self.eventDal.get_current_match()) out = out.replace('{Event}', self.eventDal.get_current_event()[1]) out = out.replace('{Year}', self.eventDal.get_current_event()[2]) return out
def selection(self, team='', index=-1, shift=-1, out=False): self.alliances.start() if team != '': self.alliances.alliances.set(team) if index != -1: self.alliances.alliances.choose(index) if shift != -1: self.alliances.shift(shift) if out: self.alliances.alliances.output() out = open(s_config.web_sites("selection.html")).read() out = out.replace("{Unset}", self.alliances.unset()) out = self.alliances.selections(out) return out
def restore(self, path): self.export.run_restore(path) return open(s_config.web_sites("reset.html")).read()
def index(self): return open(s_config.web_sites("resetView.html"))
def databaseset(self): server.model.setup.setup() return open(s_config.web_sites("reset.html")).read()
def eventfind(self, event, year): self.eventDal.set_current_event(event, year) self.eventDal.set_current_match('001-q') server.model.schedule.insert_sched(event, year, 'qual') return open(s_config.web_sites("reset.html")).read()
def eventcurrent(self, event, year): print("/n=====", event, year, "=====") self.eventDal.set_current_event(event, year) return open(s_config.web_sites("reset.html")).read()
def matchcurrent(self, match): self.tablet('TestSystem:Reset') self.eventDal.set_current_match(match) return open(s_config.web_sites("reset.html")).read()