# Path: modules/utils.py
# def get_executable_path():
#     if getattr(sys, 'frozen', False):
#         executable_path = os.path.abspath(os.path.dirname(sys.executable))
#     else:
#         executable_path = os.path.abspath(os.path.dirname(sys.argv[0]))
# 
#     return executable_path
# 
# def make_dir(filename):
#     d = os.path.dirname(filename)
#     if not os.path.exists(d):
#         os.makedirs(d)
# 
# def copy_file(src, dest):
#     make_dir(dest)
#     shutil.copyfile(src, dest)


from importlib import import_module
from lxml import etree
from lxml.builder import E
from modules.utils import get_executable_path, make_dir, copy_file
import os, codecs

        self.current_profile = {}
        self.mhl = False
        self.recursive = False

        self.send_to_kindle = {}
        self.send_to_kindle['send'] = False
        self.send_to_kindle['deleteSendedBook'] = True
        self.send_to_kindle['smtpServer'] = 'smtp.gmail.com'
        self.send_to_kindle['smtpPort'] = 465
        self.send_to_kindle['smtpLogin'] = '[Your Google Email]'
        self.send_to_kindle['smtpPassword'] = '[Your Google Password]'
        self.send_to_kindle['fromUserEmail'] = '[Your Google Email]'
        self.send_to_kindle['toKindleEmail'] = '[Your Kindle Email]'

        # if no configuration - provide minimum defaults
        if not os.path.exists(self.config_file):

            # configuration
            self.write()

            # default css
            default_css = import_module('modules.default_css')
            default_css_path = os.path.abspath(os.path.join(os.path.dirname(self.config_file), 'default.css'))
            make_dir(default_css_path)
            with codecs.open(default_css_path, "w", 'utf-8') as f:
                f.write(default_css.default_css)
                f.close()

            # default cover

# Path: modules/utils.py
# def get_executable_path():
#     if getattr(sys, 'frozen', False):
#         executable_path = os.path.abspath(os.path.dirname(sys.executable))
#     else:
#         executable_path = os.path.abspath(os.path.dirname(sys.argv[0]))
# 
#     return executable_path
# 
# def make_dir(filename):
#     d = os.path.dirname(filename)
#     if not os.path.exists(d):
#         os.makedirs(d)
# 
# def copy_file(src, dest):
#     make_dir(dest)
#     shutil.copyfile(src, dest)


# Path: modules/config.py
from importlib import import_module
from lxml import etree
from lxml.builder import E
from modules.utils import get_executable_path, make_dir, copy_file
import os, codecs


        self.current_profile = {}
        self.mhl = False
        self.recursive = False

        self.send_to_kindle = {}
        self.send_to_kindle['send'] = False
        self.send_to_kindle['deleteSendedBook'] = True
        self.send_to_kindle['smtpServer'] = 'smtp.gmail.com'
        self.send_to_kindle['smtpPort'] = 465
        self.send_to_kindle['smtpLogin'] = '[Your Google Email]'
        self.send_to_kindle['smtpPassword'] = '[Your Google Password]'
        self.send_to_kindle['fromUserEmail'] = '[Your Google Email]'
        self.send_to_kindle['toKindleEmail'] = '[Your Kindle Email]'

        # if no configuration - provide minimum defaults
        if not os.path.exists(self.config_file):

            # configuration
            self.write()

            # default css
            default_css = import_module('modules.default_css')
            default_css_path = os.path.abspath(os.path.join(os.path.dirname(self.config_file), 'default.css'))
            make_dir(default_css_path)
            with codecs.open(default_css_path, "w", 'utf-8') as f:
                f.write(default_css.default_css)
                f.close()

            # default cover

            default_cover_path = os.path.join(get_executable_path(), 'default_cover.jpg')