From b2629286b4667ce7e81af889a0683cd72afa5ebf Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 8 Oct 2020 15:49:32 +0100 Subject: [PATCH] config.py: top-level docstring, import order, minor edits --- config.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/config.py b/config.py index 1e9340c9..d60fe841 100644 --- a/config.py +++ b/config.py @@ -1,9 +1,17 @@ +""" +Code dealing with the configuration of the program. + +On Windows this uses the Registry to store values in a flat manner. +Linux uses a file, but for commonality it's still a flat data structure. +""" + import numbers import sys import warnings from os import getenv, makedirs, mkdir, pardir -from os.path import expanduser, dirname, exists, isdir, join, normpath +from os.path import dirname, expanduser, isdir, join, normpath from sys import platform + import semantic_version from constants import applongname, appname @@ -13,7 +21,7 @@ appcmdname = 'EDMC' # appversion **MUST** follow Semantic Versioning rules: # # Major.Minor.Patch(-prerelease)(+buildmetadata) -appversion = '4.2.0-beta1' #-rc1+a872b5f' +appversion = '4.2.0-beta1' # -rc1+a872b5f' # For some things we want appversion without (possible) +build metadata appversion_nobuild = str(semantic_version.Version(appversion).truncate('prerelease')) copyright = u'© 2015-2019 Jonathan Harris, 2020-2021 EDCD' @@ -22,10 +30,10 @@ update_feed = 'https://raw.githubusercontent.com/EDCD/EDMarketConnector/releases update_interval = 8*60*60 -if platform=='darwin': +if platform == 'darwin': from Foundation import NSBundle, NSUserDefaults, NSSearchPathForDirectoriesInDomains, NSApplicationSupportDirectory, NSDocumentDirectory, NSLibraryDirectory, NSUserDomainMask -elif platform=='win32': +elif platform == 'win32': import ctypes from ctypes.wintypes import * import uuid