-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear time is now displayed for bugged and aborted runs
• For the aborted/bugged runs, the time may not be reliable, but it's better than manually determining the time for runs where only the logs were bugged. • Constants have been separated into PTConstants and MiscConstants • Version bump to 2.6.0
- Loading branch information
Showing
4 changed files
with
124 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from sty import fg | ||
|
||
from src.utils import time_str | ||
|
||
if TYPE_CHECKING: | ||
from src.analyzer import AbsRun | ||
|
||
|
||
class BuggedRun(RuntimeError): | ||
"""An exception indicating that a run has bugged out - it does not have | ||
enough information to convert to a relative run. | ||
If require_heist_start is set to True, the analyzer should look for a 'job start' line. | ||
Otherwise, the analyzer can assume that a new run started that aborted the old run.""" | ||
def __init__(self, reasons: list[str]): | ||
def __init__(self, run: AbsRun, reasons: list[str]): | ||
self.run = run | ||
self.reasons = reasons | ||
|
||
def __str__(self): | ||
reason_str = '\n'.join(self.reasons) | ||
return f'Bugged run detected, no stats will be displayed. Bugs found:\n{reason_str}\n' | ||
return f'{fg.li_red}Profit-Taker Run #{self.run.run_nr} was bugged, no stats will be displayed. ' \ | ||
f'Bugs found:\n{reason_str}\n' \ | ||
f'{self.run.failed_run_duration_str}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,24 @@ | ||
from __future__ import annotations | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from sty import fg | ||
|
||
from src.utils import time_str | ||
|
||
if TYPE_CHECKING: | ||
from src.analyzer import AbsRun | ||
|
||
|
||
class RunAbort(Exception): | ||
"""An exception indicating that a run has aborted. | ||
If require_heist_start is set to True, the analyzer should look for a 'job start' line. | ||
Otherwise, the analyzer can assume that a new run started that aborted the old run.""" | ||
def __init__(self, *, require_heist_start: bool): | ||
def __init__(self, run: AbsRun, *, require_heist_start: bool): | ||
self.run = run | ||
self.require_heist_start = require_heist_start | ||
|
||
def __str__(self): | ||
return f'{fg.cyan}Profit-Taker Run #{self.run.run_nr} was aborted or had bugged logs.\n' \ | ||
f'{self.run.failed_run_duration_str}' |