number of fixes to the mission generation

This commit is contained in:
Vasyl Horbachenko
2018-06-29 05:33:35 +03:00
parent 2ace05c565
commit e03342b3ff
15 changed files with 72 additions and 78 deletions

View File

@@ -92,7 +92,7 @@ class Debriefing:
def debriefing_directory_location() -> str:
return os.path.expanduser("~\Saved Games\DCS")
return os.path.expanduser("~\Saved Games\DCS\liberation_debriefings")
def _logfiles_snapshot() -> typing.Dict[str, float]:
@@ -109,14 +109,7 @@ def _poll_new_debriefing_log(snapshot: typing.Dict[str, float], callback: typing
while should_run:
for file, timestamp in _logfiles_snapshot().items():
if file not in snapshot or timestamp != snapshot[file]:
for _ in range(0, 3):
# some solid programming going on in here
try:
debriefing = Debriefing.parse(os.path.join(debriefing_directory_location(), file))
break
except:
time.sleep(3)
debriefing = Debriefing.parse(os.path.join(debriefing_directory_location(), file))
callback(debriefing)
should_run = False
break