Skip to content

Commit

Permalink
wait 0.1 sec before opening gisrc file
Browse files Browse the repository at this point in the history
  • Loading branch information
lindakladivova authored and petrasovaa committed Jun 3, 2023
1 parent dc88d85 commit 20b2923
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gui/wxpython/core/watchdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""

import os
import time

watchdog_used = True
try:
Expand Down Expand Up @@ -63,6 +64,8 @@ def on_modified(self, event):
if timestamp - self.modified_time < 0.5:
return
self.modified_time = timestamp
# wait to make sure file writing is done
time.sleep(0.1)
with open(event.src_path, "r") as f:
gisrc = {}
for line in f.readlines():
Expand Down

0 comments on commit 20b2923

Please sign in to comment.