# 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

        if 'generateAPNX' in self.current_profile:
            self.apnx = self.current_profile['generateAPNX']

        if 'charactersPerPage' in self.current_profile:
            self.characters_per_page = self.current_profile['charactersPerPage']

    def write(self):
        # yapf: disable
        config = E('settings',
            # pylint: disable=C0330
            E('debug', str(self.debug)),
            E('logFile', self.original_log_file) if self.original_log_file else E('logFile'),
            E('logLevel', self.log_level),
            E('consoleLevel', self.console_level),
            E('outputFormat', self.output_format),
            E('kindleCompressionLevel', str(self.kindle_compression_level)),
            E('noDropcapsSymbols', self.no_dropcaps_symbols),
            E('transliterate', str(self.transliterate)),
            E('screenWidth', str(self.screen_width)),
            E('screenHeight', str(self.screen_height)),
            E('defaultProfile', self.default_profile),
            E('noMOBIoptimization', str(self.noMOBIoptimization)),
            E('profiles', *self._getProfiles()),
            E('sendToKindle',
                E('send', str(self.send_to_kindle['send'])),
                E('deleteSendedBook', str(self.send_to_kindle['deleteSendedBook'])),
                E('smtpServer', self.send_to_kindle['smtpServer']),
                E('smtpPort', str(self.send_to_kindle['smtpPort'])),
                E('smtpLogin', self.send_to_kindle['smtpLogin']),

# 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


        if 'generateAPNX' in self.current_profile:
            self.apnx = self.current_profile['generateAPNX']

        if 'charactersPerPage' in self.current_profile:
            self.characters_per_page = self.current_profile['charactersPerPage']

    def write(self):
        # yapf: disable
        config = E('settings',
            # pylint: disable=C0330
            E('debug', str(self.debug)),
            E('logFile', self.original_log_file) if self.original_log_file else E('logFile'),
            E('logLevel', self.log_level),
            E('consoleLevel', self.console_level),
            E('outputFormat', self.output_format),
            E('kindleCompressionLevel', str(self.kindle_compression_level)),
            E('noDropcapsSymbols', self.no_dropcaps_symbols),
            E('transliterate', str(self.transliterate)),
            E('screenWidth', str(self.screen_width)),
            E('screenHeight', str(self.screen_height)),
            E('defaultProfile', self.default_profile),
            E('noMOBIoptimization', str(self.noMOBIoptimization)),
            E('profiles', *self._getProfiles()),
            E('sendToKindle',
                E('send', str(self.send_to_kindle['send'])),
                E('deleteSendedBook', str(self.send_to_kindle['deleteSendedBook'])),
                E('smtpServer', self.send_to_kindle['smtpServer']),
                E('smtpPort', str(self.send_to_kindle['smtpPort'])),
                E('smtpLogin', self.send_to_kindle['smtpLogin']),

                E('smtpPassword', self.send_to_kindle['smtpPassword']) if self.send_to_kindle['smtpPassword'] else E('smtpPassword'),