def loadconfig(self): """Load race config from disk.""" self.riders.clear() cr = ConfigParser.ConfigParser({ 'startlist': '', 'showinfo': 'Yes', 'events': '', 'evnicks': '' }) cr.add_section('race') cr.add_section('riders') # no need fr omnium?? if os.path.isfile(self.configpath): self.log.debug('Attempting to read config from ' + repr(self.configpath)) cr.read(self.configpath) for r in cr.get('race', 'startlist').split(): self.addrider(r) ## TODO : load/save comment for rider self.info_expand.set_expanded( strops.confopt_bool(cr.get('race', 'showinfo'))) self.events = strops.reformat_bibserlist(cr.get('race', 'events')) self.nicknames = cr.get('race', 'evnicks').split() self.recalculate()
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())
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())
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())
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())
def loadconfig(self): """Load race config from disk.""" self.riders.clear() cr = ConfigParser.ConfigParser({'startlist':'', 'showinfo':'Yes', 'events':'', 'evnicks':''}) cr.add_section('race') cr.add_section('riders') # no need fr omnium?? if os.path.isfile(self.configpath): self.log.debug('Attempting to read config from ' + repr(self.configpath)) cr.read(self.configpath) for r in cr.get('race', 'startlist').split(): self.addrider(r) ## TODO : load/save comment for rider self.info_expand.set_expanded(strops.confopt_bool( cr.get('race', 'showinfo'))) self.events = strops.reformat_bibserlist(cr.get('race', 'events')) self.nicknames = cr.get('race', 'evnicks').split() self.recalculate()