'Open the e-book at ``path`` for editing. Will show an error if the e-book is not in a supported format or the current book has unsaved changes.
:param edit_file: The name of a file inside the newly opened book to start editing. Can also be a list of names.'

def open_book(self, path=None, edit_file=None, clear_notify_data=True, open_folder=False):

    if (isinstance(path, (list, tuple)) and path):
        path = path[(-1)]
    if (not self._check_before_open()):
        return
    if (not hasattr(path, u'rpartition')):
        if open_folder:
            path = choose_dir(self.gui, u'open-book-folder-for-tweaking', _(u'Choose    book    folder'))
            if path:
                path = [path]
        else:
            path = choose_files(self.gui, u'open-book-for-tweaking', _(u'Choose    book'), [(_(u'Books'), [x.lower() for x in SUPPORTED])], all_files=False, select_only_single_file=True)
        if (not path):
            return
        path = path[0]
    if (not os.path.exists(path)):
        return error_dialog(self.gui, _(u'File    not    found'), (_(u'The    file    %s    does    not    exist.') % path), show=True)
    isdir = os.path.isdir(path)
    ext = path.rpartition(u'.')[(-1)].upper()
    if ((ext not in SUPPORTED) and (not isdir)):
        from calibre.ebooks.oeb.polish.import_book import IMPORTABLE
        if (ext.lower() in IMPORTABLE):
            return self.import_book(path)
        return error_dialog(self.gui, _(u'Unsupported    format'), (_(u'Tweaking    is    only    supported    for    books    in    the    %s    formats.    Convert    your    book    to    one    of    these    formats    first.') % _(u'    and    ').join(sorted(SUPPORTED))), show=True)
    for name in tuple(editors):
        self.close_editor(name)
    self.gui.preview.clear()
    self.gui.live_css.clear()
    self.container_count = (-1)
    if self.tdir:
        shutil.rmtree(self.tdir, ignore_errors=True)
    self.tdir = PersistentTemporaryDirectory()
    self._edit_file_on_open = edit_file
    self._clear_notify_data = clear_notify_data
    self.gui.blocking_job(u'open_book', _(u'Opening    book,    please    wait...'), self.book_opened, get_container, path, tdir=self.mkdtemp())
