mirror of
https://github.com/spencershepard/RotorOps.git
synced 2025-11-10 15:45:30 +00:00
create user-data.yaml if it doesn't exist (#67)
This commit is contained in:
@@ -519,6 +519,12 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
self.user_ratings = prefs["ratings"]
|
||||
except:
|
||||
logger.error("Could not load prefs.yaml")
|
||||
|
||||
else:
|
||||
logger.info("No user data file found. Creating a new one.")
|
||||
prefs = {"player_slots": ["AH-64D_BLK_II", "UH-1H", "Mi-24P", "Ka-50_3", "Mi-8MT"]}
|
||||
with open(directories.user_datafile_path, 'w') as pfile:
|
||||
yaml.dump(prefs, pfile)
|
||||
if not prefs:
|
||||
prefs = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user