Beispiel #1
0
 def menu_data_results_cb(self, menuitem, data=None):
     """Export live results to disk."""
     rfilename = os.path.join(self.configpath, "results.csv")
     with open(rfilename, "wb") as f:
         f.write("," + "\n,".join((self.line1, self.line2, self.line3)) + "\n\n")
         for e in self.edb:
             r = irtt.irtt(self, e, False)
             r.loadconfig()
             r.result_export(f)
             f.write("\n")
     self.log.info("Exported meet results to " + repr(rfilename))
Beispiel #2
0
 def menu_data_results_cb(self, menuitem, data=None):
     """Export live results to disk."""
     rfilename = os.path.join(self.configpath, 'results.csv')
     with open(rfilename, 'wb') as f:
         f.write(',' + '\n,'.join((self.line1, self.line2, self.line3)) +
                 '\n\n')
         for e in self.edb:
             r = irtt.irtt(self, e, False)
             r.loadconfig()
             r.result_export(f)
             f.write('\n')
     self.log.info('Exported meet results to ' + repr(rfilename))
Beispiel #3
0
 def open_event(self, eventhdl=None):
     """Open provided event handle."""
     if eventhdl is not None:
         self.close_event()
         self.curevent = irtt.irtt(self, eventhdl, True)
         self.curevent.loadconfig()
         self.race_box.add(self.curevent.frame)
         self.menu_race_close.set_sensitive(True)
         self.menu_race_abort.set_sensitive(True)
         starters = self.edb.getvalue(eventhdl, eventdb.COL_STARTERS)
         if starters is not None and starters != "":
             self.addstarters(self.curevent, eventhdl, strops.reformat_bibserlist(starters))  # xfer starters
             self.edb.editevent(eventhdl, starters="")  # and clear
         self.curevent.show()
         self.curevent.set_titlestr(" ".join([self.line1, self.line2, self.line3]).strip())
Beispiel #4
0
 def open_event(self, eventhdl=None):
     """Open provided event handle."""
     if eventhdl is not None:
         self.close_event()
         self.curevent = irtt.irtt(self, eventhdl, True)
         self.curevent.loadconfig()
         self.race_box.add(self.curevent.frame)
         self.menu_race_close.set_sensitive(True)
         self.menu_race_abort.set_sensitive(True)
         starters = self.edb.getvalue(eventhdl, eventdb.COL_STARTERS)
         if starters is not None and starters != '':
             self.addstarters(
                 self.curevent,
                 eventhdl,  # xfer starters
                 strops.reformat_bibserlist(starters))
             self.edb.editevent(eventhdl, starters='')  # and clear
         self.curevent.show()
         self.curevent.set_titlestr(' '.join(
             [self.line1, self.line2, self.line3]).strip())
Beispiel #5
0
    def open_event(self, eventhdl=None):
        """Open provided event handle."""
        if eventhdl is not None:
            self.close_event()
            if self.etype == 'irtt':
                from scbdo import irtt
                self.curevent = irtt.irtt(self, eventhdl, True)
            elif self.etype == 'sportif':
                from scbdo import sportif
                self.curevent = sportif.sportif(self, eventhdl, True)
            else:  # default is fall back to road mass start 'rms'
                from scbdo import rms
                self.curevent = rms.rms(self, eventhdl, True)

            assert (self.curevent is not None)
            self.curevent.loadconfig()
            self.race_box.add(self.curevent.frame)

            # re-populate the rider command model.
            cmds = self.curevent.get_ridercmds()
            if cmds is not None:
                self.action_model.clear()
                for cmd in cmds:
                    self.action_model.append([cmd, cmds[cmd]])
                self.action_combo.set_active(0)

            self.menu_race_close.set_sensitive(True)
            self.menu_race_abort.set_sensitive(True)
            starters = self.edb.getvalue(eventhdl, eventdb.COL_STARTERS)
            if starters is not None and starters != '':
                self.addstarters(
                    self.curevent,
                    eventhdl,  # xfer starters
                    strops.reformat_bibserlist(starters))
                self.edb.editevent(eventhdl, starters='')  # and clear
            self.curevent.show()
            self.curevent.set_titlestr(' '.join(
                [self.line1, self.line2, self.line3]).strip())
Beispiel #6
0
    def open_event(self, eventhdl=None):
        """Open provided event handle."""
        if eventhdl is not None:
            self.close_event()
            if self.etype == 'irtt':
                from scbdo import irtt
                self.curevent = irtt.irtt(self, eventhdl, True)
            elif self.etype == 'sportif':
                from scbdo import sportif
                self.curevent = sportif.sportif(self, eventhdl, True)
            else:	# default is fall back to road mass start 'rms'
                from scbdo import rms
                self.curevent = rms.rms(self, eventhdl, True)
            
            assert(self.curevent is not None)
            self.curevent.loadconfig()
            self.race_box.add(self.curevent.frame)

            # re-populate the rider command model.
            cmds = self.curevent.get_ridercmds()
            if cmds is not None:
                self.action_model.clear()
                for cmd in cmds:
                    self.action_model.append([cmd, cmds[cmd]])
                self.action_combo.set_active(0)

            self.menu_race_close.set_sensitive(True)
            self.menu_race_abort.set_sensitive(True)
            starters = self.edb.getvalue(eventhdl, eventdb.COL_STARTERS)
            if starters is not None and starters != '':
                self.addstarters(self.curevent, eventhdl, # xfer starters
                                 strops.reformat_bibserlist(starters))
                self.edb.editevent(eventhdl, starters='') # and clear
            self.curevent.show()
            self.curevent.set_titlestr(' '.join([self.line1, self.line2,
                                           self.line3]).strip())