Quote:
Originally Posted by DiapDealer
Does writer2xhtml ever output anything other than the file the Sigil plugin needs to process (or nothing)? Just wondering if the process of opening writer2xhtml's output could be done in a more generic way that's not looking for a specific epub name.
|
The plugin basically just runs writer2xhtml and adds it to Sigil as a new epub via the default input plugin code. (Plugin users can also add additional files via plugin preference settings.)
The original plugin code was:
Code:
epub_path = os.path.splitext(odt_file)[0] + '.epub'
(odt_file is the full .odt file path)
The current working version is:
Code:
# handle file names with additional periods correctly
base = os.path.basename(odt_file)
# workaround for writer2latex file name bug
stem = base[:-4] # remove ".odt"
name_without_ext = stem
# check for file name with periods
if '.' in stem:
name_without_ext = stem.rsplit('.', 1)[0]
epub_filename = name_without_ext + '.epub'
# assemble epub path
epub_path = os.path.join(os.path.dirname(odt_file), epub_filename)
The new code appears to be working, but I still don't understand why writer2latex apparently has problems with additional periods in file names.