Skip to content

Commit

Permalink
Fixed all bugs showing in the CrossMgr log.
Browse files Browse the repository at this point in the history
  • Loading branch information
esitarski committed Jul 16, 2024
1 parent a38e0ea commit 1d6fd05
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gantt.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def refresh( self ):
earlyBellTimes.extend( c.earlyBellTime if r.status == Finisher else None for r in catResults )
else:
results = GetResults( category )
earlyBellTimes = [category.earlyBellTime if r.status == Finisher else None for r in results]
earlyBellTimes = [(category.earlyBellTime if category else None) if r.status == Finisher else None for r in results]

if race.showFullNamesInChart:
def getLabel( r ):
Expand Down
7 changes: 5 additions & 2 deletions GanttChartPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,11 @@ def getStarPath( ctx, numPoints, radius, radiusInner ):

dc.SetPen( wx.Pen(ctColour, 3) )
dc.DrawLine( x, barHeight - 4, x, yLast + 4 )
if self.data[self.moveIRider]:
dc.DrawLine( xLeft-4, self.yMove, xRight+4, self.yMove )
try:
if self.data[self.moveIRider]:
dc.DrawLine( xLeft-4, self.yMove, xRight+4, self.yMove )
except IndexError:
pass

# Draw the time text.
dc.SetBrush( wx.Brush(ctColour) )
Expand Down
5 changes: 3 additions & 2 deletions GeoAnimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,9 @@ def setPoints( self, gpsPoints, isPointToPoint = False ):
self.gpsPoints = gpsPoints
self.isPointToPoint = isPointToPoint

self.xMax = max( p.x for p in self.gpsPoints )
self.yMax = max( p.y for p in self.gpsPoints )
self.xMax = max( (p.x for p in self.gpsPoints), default=0 )
self.yMax = max( (p.y for p in self.gpsPoints), default=0 )

dCum = 0.0
self.cumDistance = []
for p in self.gpsPoints:
Expand Down
2 changes: 1 addition & 1 deletion MainWin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ def menuCopyLogFileToClipboard( self, event ):
if wx.TheClipboard.Open():
wx.TheClipboard.SetData( dataObj )
wx.TheClipboard.Close()
Utils.MessageOK(self, '\n\n'.join( [_("Log file copied to clipboard."), _("You can now paste it into an email.")] ), f"{len(logData.decode())} bytes", _("Success") )
Utils.MessageOK(self, '\n\n'.join( [_("Log file copied to clipboard."), _("You can now paste it into an email.")] ), f"{len(logData.encode())} bytes", _("Success") )
else:
Utils.MessageOK(self, _("Unable to open the clipboard."), _("Error"), wx.ICON_ERROR )

Expand Down
2 changes: 1 addition & 1 deletion Results.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def OnPopupSwapAfter( self, event ):
def OnPopupHistory( self, event ):
mainWin = Utils.getMainWin()
if mainWin:
mainWin.showPageName( mainWin.iPassingsPage )
mainWin.showPage( mainWin.iPassingsPage )

def OnPopupRiderDetail( self, event ):
ShowRiderDetailDialog( self, self.numSelect )
Expand Down
2 changes: 1 addition & 1 deletion Version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
AppVerName="CrossMgr 3.1.58-private"
AppVerName="CrossMgr 3.1.59-private"
6 changes: 4 additions & 2 deletions crossmgr-install.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ def make_archive():
shutil.copytree( env_dir, env_dir_archive )

# Clean up excessive archive versions.
dirs = sorted( (d for d in os.listdir(archive_dir) if re.fullmatch(re_timestamp, d) and os.path.isdir(os.path.join(archive_dir,d))), reverse=True )
with os.scandir( archive_dir ) as contents:
dirs = sorted( (d.name for d in contents if d.is_dir() and re.fullmatch(re_timestamp, d.name)), reverse=True )
for d in dirs[10:]:
rmdir_ignore( os.path.join(archive_dir, d) )

Expand All @@ -401,7 +402,8 @@ def restore_archive():
return

# Find the most recent archived version and restore it.
dirs = sorted( (d for d in os.listdir(archive_dir) if re.fullmatch(re_timestamp, d) and os.path.isdir(os.path.join(archive_dir,d))), reverse=True )
with os.scandir( archive_dir ) as contents:
dirs = sorted( (d.name for d in contents if d.is_dir() and re.fullmatch(re_timestamp, d.name)), reverse=True )
if not dirs:
print( "No previously archived version to restore." )
return
Expand Down

0 comments on commit 1d6fd05

Please sign in to comment.