# Path: libs/utils.py
# def ensure_dir(f):
#     d = os.path.dirname(f)
#     if not os.path.exists(d):
#         os.makedirs(d)
# 
# def ensure_file(f):
#     if not os.path.isfile(f):
#         open(f, 'a').close()


import os
import sys
import copy
import inspect
import framework
from enum import Enum
from libs.utils import ensure_dir, ensure_file
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  fuddly is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with fuddly. If not, see <http://www.gnu.org/licenses/>
#
################################################################################




fuddly_version = '0.27.2'

framework_folder = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
# framework_folder = os.path.dirname(framework.__file__)
framework_folder  = '.' if framework_folder == '' else framework_folder

app_folder = os.path.dirname(framework_folder)
app_folder = '.' if app_folder == '' else app_folder
projects_folder = app_folder + os.sep + 'projects' + os.sep
data_models_folder = app_folder + os.sep + 'data_models' + os.sep

fuddly_data_folder = os.path.expanduser('~' + os.sep + 'fuddly_data' + os.sep)
if not os.path.exists(fuddly_data_folder):
    new_fuddly_data_folder = True

# Path: libs/utils.py
# def ensure_dir(f):
#     d = os.path.dirname(f)
#     if not os.path.exists(d):
#         os.makedirs(d)
# 
# def ensure_file(f):
#     if not os.path.isfile(f):
#         open(f, 'a').close()


# Path: framework/global_resources.py
import os
import sys
import copy
import inspect
import framework
from enum import Enum
from libs.utils import ensure_dir, ensure_file

#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  fuddly is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with fuddly. If not, see <http://www.gnu.org/licenses/>
#
################################################################################




fuddly_version = '0.27.2'

framework_folder = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
# framework_folder = os.path.dirname(framework.__file__)
framework_folder  = '.' if framework_folder == '' else framework_folder

app_folder = os.path.dirname(framework_folder)
app_folder = '.' if app_folder == '' else app_folder
projects_folder = app_folder + os.sep + 'projects' + os.sep
data_models_folder = app_folder + os.sep + 'data_models' + os.sep

fuddly_data_folder = os.path.expanduser('~' + os.sep + 'fuddly_data' + os.sep)
if not os.path.exists(fuddly_data_folder):
    new_fuddly_data_folder = True

ensure_dir(fuddly_data_folder)