Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Using correct default number as config version. #1305

Merged
merged 2 commits into from
Sep 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ class Config(configfile.ConfigFileWithProfiles):
APP_NAME = 'Back In Time'
VERSION = '1.3.2'
COPYRIGHT = 'Copyright (C) 2008-2022 Oprea Dan, Bart de Koning, Richard Bailey, Germar Reitze'

CONFIG_VERSION = 6
"""Latest or highest possible version of Backin Time's config file."""

NONE = 0
AT_EVERY_BOOT = 1
Expand Down Expand Up @@ -195,11 +197,16 @@ def __init__(self, config_path = None, data_path = None):
else:
os.rename(old_path, self._LOCAL_CONFIG_PATH)

# Load global config file
self.load(self._GLOBAL_CONFIG_PATH)

# Append local config file
self.append(self._LOCAL_CONFIG_PATH)

#?Internal version of current config;;self.CONFIG_VERSION
currentConfigVersion = self.intValue('config.version', 5)
# Get the version of the config file
# or assume the highest config version if it isn't set.
currentConfigVersion \
= self.intValue('config.version', self.CONFIG_VERSION)

if currentConfigVersion < self.CONFIG_VERSION:
# config.version value wasn't stored since BiT version 0.9.99.22
Expand Down