Define paths according to presence of uninstall.exe

This commit is contained in:
Manuel Cortez 2018-03-12 10:02:45 -06:00
parent c6c0774ec5
commit d81db41f16

16
src/storage.py Normal file
View File

@ -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()