Skip to content

Commit

Permalink
Fixed more flake8 problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
esitarski committed Jul 25, 2024
1 parent f557283 commit 776c062
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 71 deletions.
2 changes: 1 addition & 1 deletion CrossMgrVideo/AddPhotoHeader.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def AddPhotoHeader( bitmap, bib=None, ts=None, raceSeconds=None, first_name='',
bitmapHeight = drawResources.bitmapHeight
bibSpaceWidth = drawResources.bibSpaceWidth
spaceWidth = drawResources.spaceWidth
xText, yText = bitmapWidth, 0
xText = bitmapWidth

x = borderWidth
y = borderWidth
Expand Down
6 changes: 0 additions & 6 deletions CrossMgrVideo/CalendarHeatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"""

import wx
import wx.lib.agw.artmanager as AM
from math import sqrt
import datetime

Expand Down Expand Up @@ -319,16 +318,11 @@ def OnPaint(self, event):
self._getGridDate()
self._setDimensions( dc )

am = AM.ArtManager()

gc = wx.GraphicsContext.Create(dc)

dc.SetBackground(wx.Brush(self.GetParent().GetBackgroundColour()))
dc.Clear()

colour = self.GetForegroundColour()
textColour = am.DarkColour(wx.WHITE, 3.0) if am.IsDark(colour) else am.LightColour(wx.BLACK, 3.0)

valueMax = max( self.dates.values(), default=1 )

gc = wx.GraphicsContext.Create(dc)
Expand Down
2 changes: 1 addition & 1 deletion CrossMgrVideo/Database.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import sys
from datetime import datetime, timedelta, date
from datetime import datetime, timedelta, date, time
import sqlite3
from collections import namedtuple, defaultdict
from threading import RLock, Timer
Expand Down
49 changes: 0 additions & 49 deletions CrossMgrVideo/LRUCache.py

This file was deleted.

21 changes: 9 additions & 12 deletions CrossMgrVideo/MainWin.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,6 @@ def __init__( self, parent, id = wx.ID_ANY, title='', size=(1000,800) ):
# Add keyboard accellerators.

idStartAutoCapture = wx.NewIdRef()
idToggleCapture = wx.NewIdRef()

entries = [wx.AcceleratorEntry()]
entries[0].Set(wx.ACCEL_CTRL, ord('A'), idStartAutoCapture)
Expand Down Expand Up @@ -1231,7 +1230,7 @@ def refreshTriggers( self, replace=False, iTriggerRow=None ):
tsUpper = tsLower + timedelta(days=1)

# Read the triggers from the database before we repaint the screen to avoid flashing.
counts = GlobalDatabase().updateTriggerPhotoCountInterval( tsLower, tsUpper )
GlobalDatabase().updateTriggerPhotoCountInterval( tsLower, tsUpper )
triggers = GlobalDatabase().getTriggers( tsLower, tsUpper, self.bibQuery )
if triggers:
self.tsMax = triggers[-1].ts
Expand Down Expand Up @@ -1442,8 +1441,6 @@ def onStopCapture( self, event ):
tStartCapture = self.tStartCapture
captureCount = self.captureCount

captureLatency = timedelta( seconds=0.0 )

self.waitForDB()

# Update the capture trigger info.
Expand Down Expand Up @@ -1868,14 +1865,14 @@ def manageDatabase( self, event ):
trigFirst, trigLast = GlobalDatabase().getTimestampRange()
dlg = ManageDatabase( self, GlobalDatabase().getsize(), GlobalDatabase().fname, trigFirst, trigLast, title='Manage Database' )
if dlg.ShowModal() == wx.ID_OK:
work = wx.BusyCursor()
tsLower, tsUpper, vacuum, dbName = dlg.GetValues()
self.setDBName( dbName )
if tsUpper:
tsUpper = datetime.combine( tsUpper, time(23,59,59,999999) )
GlobalDatabase().cleanBetween( tsLower, tsUpper )
if vacuum:
GlobalDatabase().vacuum()
with wx.BusyCursor():
tsLower, tsUpper, vacuum, dbName = dlg.GetValues()
self.setDBName( dbName )
if tsUpper:
tsUpper = datetime.combine( tsUpper, time(23,59,59,999999) )
GlobalDatabase().cleanBetween( tsLower, tsUpper )
if vacuum:
GlobalDatabase().vacuum()
wx.CallAfter( self.finishStrip.Clear )
wx.CallAfter( self.refreshTriggers, True )
dlg.Destroy()
Expand Down
3 changes: 1 addition & 2 deletions CrossMgrVideo/PhotoDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ def onClose( self, event ):
def onGetSpeed( self, event ):
self.playStop()

t1, bitmap1, t2, bitmap2 = None, None, None, None
speedFrames = 2

if self.iJpg == 0:
Expand All @@ -548,7 +547,7 @@ def onGetSpeed( self, event ):
computeSpeed = ComputeSpeed( self, size=self.GetSize() )
self.mps, self.kmh, self.mph, self.pps = computeSpeed.Show( self.tsJpg, i1, i2, self.triggerInfo['ts_start'] )
if self.kmh is not None:
self.triggerInfo.update( {'kmh':'{:.2f}'.format(self.kmh), 'mph':'{:.2f}'.format(self.mph)} )
self.triggerInfo.update( {'kmh':f'{self.kmh:.2f}', 'mph':f'{self.mph:.2f}'} )
GlobalDatabase().updateTriggerRecord( self.triggerInfo['id'], {'kmh': self.kmh} )
wx.CallAfter( self.updateCB, self.triggerInfo )

Expand Down

0 comments on commit 776c062

Please sign in to comment.