jamessanford / assetto-corsa-deltabar

DeltaBar - iRacing-style bar with variable color
29 stars 4 forks source link

statusbox crash when flipping through modes #4

Closed jamessanford closed 9 years ago

jamessanford commented 9 years ago

I was clicking through the various modes (best sector, optimal, ...) repeatedly and it crashed.

Looks like statusbox/format_time() expects milliseconds to only ever be an integer... There are likely more bugs in statusbox.

Exception: Thu Sep 24 05:24:46 2015
Traceback (most recent call last):
  File "apps/python/deltabar\deltabar.py", line 59, in acUpdate
    deltabar_app.acUpdate(delta_t)
  File "apps/python/deltabar\deltabar_lib\deltabar_lib.py", line 356, in acUpdate
    pos, self.lap.invalid_sectors[current_sector])
  File "apps/python/deltabar\deltabar_lib\statusbox.py", line 221, in update_frame
    self.data.textbox.set('i{}_2'.format(current_sector), format_time(current_sector_time - benchmark_sector_time, invalid=invalid, delta=True))
  File "apps/python/deltabar\deltabar_lib\statusbox.py", line 71, in format_time
    return "{}{}{}.{:03d}".format(star, sign, sec, thou)
ValueError: Unknown format code 'd' for object of type 'float'
StoneSpb commented 9 years ago

Hi, James!

Thanks, will fix it :)

 James Sanford notifications@github.com:

I was clicking through the various modes (best sector, optimal, ...) repeatedly and it crashed. Looks like statusbox/format_time() expects milliseconds to only ever be an integer... There are likely more bugs in statusbox. Exception: Thu Sep 24 05:24:46 2015 Traceback (most recent call last): File "apps/python/deltabar\deltabar.py", line 59, in acUpdate deltabar_app.acUpdate(delta_t) File "apps/python/deltabar\deltabar_lib\deltabar_lib.py", line 356, in acUpdate pos, self.lap.invalid_sectors[current_sector]) File "apps/python/deltabar\deltabar_lib\statusbox.py", line 221, in update_frame self.data.textbox.set('i{}_2'.format(current_sector), format_time(current_sector_time - benchmark_sector_time, invalid=invalid, delta=True)) File "apps/python/deltabar\deltabar_lib\statusbox.py", line 71, in format_time return "{}{}{}.{:03d}".format(star, sign, sec, thou) ValueError: Unknown format code 'd' for object of type 'float' — Reply to this email directly or view it on GitHub .

jamessanford commented 9 years ago

Oh, I just fixed it :)

StoneSpb commented 9 years ago

Mmm! Thank you! :)

Alexander Denisov

James Sanford notifications@github.com:

Oh, I just fixed it :) — Reply to this email directly or view it on GitHub .

jamessanford commented 9 years ago

"fixed" in 469c7e9f352afd1b745dbd349b1dec315dbe1a56