2018-03-12 10:02:45 -06:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import unicode_literals # at top of module
|
2018-07-15 09:15:05 -05:00
|
|
|
import paths
|
2018-03-12 10:02:45 -06:00
|
|
|
import os
|
|
|
|
import glob
|
|
|
|
|
|
|
|
data_directory = None
|
2018-10-11 10:59:47 -05:00
|
|
|
app_type = ""
|
2018-03-12 10:02:45 -06:00
|
|
|
|
|
|
|
def setup():
|
2018-10-11 10:59:47 -05:00
|
|
|
global data_directory, app_type
|
2018-03-12 10:02:45 -06:00
|
|
|
if len(glob.glob("Uninstall.exe")) > 0: # installed copy
|
2020-07-07 21:14:22 -05:00
|
|
|
if os.path.exists(paths.data_path("musicDL")) == False:
|
|
|
|
os.mkdir(paths.data_path("musicDL"))
|
|
|
|
data_directory = paths.data_path("musicDL")
|
2018-10-11 10:59:47 -05:00
|
|
|
app_type = "installed"
|
2018-03-12 10:02:45 -06:00
|
|
|
else:
|
2018-10-11 10:59:47 -05:00
|
|
|
app_type = "portable"
|
2018-04-01 04:47:47 -05:00
|
|
|
data_directory = os.path.join(paths.app_path(), "data")
|
|
|
|
if os.path.exists(data_directory) == False:
|
|
|
|
os.mkdir(data_directory)
|