From d81db41f16a8e9edda60e3a136db0fc2711e9d18 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Mon, 12 Mar 2018 10:02:45 -0600 Subject: [PATCH] Define paths according to presence of uninstall.exe --- src/storage.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/storage.py diff --git a/src/storage.py b/src/storage.py new file mode 100644 index 0000000..f68971c --- /dev/null +++ b/src/storage.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals # at top of module +from platform_utils import paths +import os +import glob + +data_directory = None + +def setup(): + global data_directory + if len(glob.glob("Uninstall.exe")) > 0: # installed copy + if os.path.exists(paths.app_data_path("musicDL")) == False: + paths.prepare_app_data_path("musicDL") + data_directory = paths.app_data_path("musicDL") + else: + data_directory = paths.app_path() \ No newline at end of file