View Single Post
Old 08-29-2014, 06:21 PM   #35
rebl
r.eads e.njoys b.ooks lol
rebl ought to be getting tired of karma fortunes by now.rebl ought to be getting tired of karma fortunes by now.rebl ought to be getting tired of karma fortunes by now.rebl ought to be getting tired of karma fortunes by now.rebl ought to be getting tired of karma fortunes by now.rebl ought to be getting tired of karma fortunes by now.rebl ought to be getting tired of karma fortunes by now.rebl ought to be getting tired of karma fortunes by now.rebl ought to be getting tired of karma fortunes by now.rebl ought to be getting tired of karma fortunes by now.rebl ought to be getting tired of karma fortunes by now.
 
rebl's Avatar
 
Posts: 76
Karma: 580748
Join Date: Mar 2010
Location: It's time to get this Book a Rest
Device: Kindle 4 NT
@igi
I've edited the file inside the zip to:
Code:
 options = {
        OptionRecommendation(name='wordconv_exe_path', recommended_value='c:\Program Files (x86)\Microsoft Office\Office12\Wordconv.exe', 
            help=_('test tooltip ')),
        OptionRecommendation(name='docx_no_cover', recommended_value=False,
            help=_('Normally, if a large image is present at the start of the document that looks like a cover, '
                   'it will be removed from the document and used as the cover for created ebook. This option '
                   'turns off that behavior.')),

    }
I know, I've also edited to tooltip text, just to see it working (and it works).
But I still had the same error:
Code:
Python function terminated unexpectedly
  Not found c:\Program Files\Microsoft Office\Office12\Wordconv.exe (Error Code: 1)
Traceback (most recent call last):
  File "site.py", line 132, in main
  File "site.py", line 109, in run_entry_point
  File "site-packages\calibre\utils\ipc\worker.py", line 195, in main
  File "site-packages\calibre\gui2\convert\gui_conversion.py", line 31, in gui_convert_override
  File "site-packages\calibre\gui2\convert\gui_conversion.py", line 25, in gui_convert
  File "site-packages\calibre\ebooks\conversion\plumber.py", line 1041, in run
  File "site-packages\calibre\customize\conversion.py", line 241, in __call__
  File "calibre_plugins.doc_input.__init__", line 51, in convert
ValueError: Not found c:\Program Files\Microsoft Office\Office12\Wordconv.exe

What I've noticed is that __init__.py uses the slashback separator '\' in the path while the doc_input.py uses '/'. Also, one was using capital C for drive letter, while the other lowercase c. Not sure if this is relevant.

Then I've tried once more this time with Office14. I've edited
__init__.py
to contain:
Code:
 OptionRecommendation(name='wordconv_exe_path', recommended_value='C:\Program Files (x86)\Microsoft Office\Office14\Wordconv.exe',
Then doc_input.py to contain:
Code:
u'wordconv_exe_path' : u'C:/Program Files (x86)/Microsoft Office/Office14/Wordconv.exe'
Now the Preferences -> Input dialogue shows:
C:/Program Files (x86)/Microsoft Office/Office14/Wordconv.exe

Converting one single book from doc works (and the path shown in the single book convert dialogue is correct so I don't need to change it).
Trying to bulk convert two books raises the old path error.
Trying to convert only the second book presents me with a surprise. The path in the single conversion dialogue is (again !?):
c:\Program Files\Microsoft Office\Office12\Wordconv.exe
With lowercase c:
Yet, the tooltip displays my text (tooltip test).
I don't understand where this path comes from. I've edited both files and used the uppercase C:\ (if that matters), x86 and Office14.

If i manually edit doc_input.py and capitalize OFFICE14 (C:/Program Files (x86)/Microsoft Office/OFFICE14/Wordconv.exe) it appears this way in Preferences-> Input -> Doc input.
If i manually edit __init__.py and capitalize the path with different case (e.g. MiCrOsOfT), it does not appear anywhere in calibre.
Also please note that your example uses "/" in __init__.py while initially it had "\".
Then I've tried in __init__.py both with / and \ but it doesn't seem to matter. For some books the path in the single convert dialogue appears:
C:/Program Files (x86)/Microsoft Office/Office14/Wordconv.exe
For others appears:
c:\Program Files\Microsoft Office\Office12\Wordconv.exe
(Note the lowercase c
I've restarted calibre after every change with no effect.
When doing a bulk convert, the plugin will use the paths listed above, so for first book will work, second will raise the same error:

Python function terminated unexpectedly
Not found c:\Program Files\Microsoft Office\Office12\Wordconv.exe (Error Code: 1)
Traceback (most recent call last):
File "site.py", line 132, in main
File "site.py", line 109, in run_entry_point
File "site-packages\calibre\utils\ipc\worker.py", line 195, in main
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 31, in gui_convert_override
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 25, in gui_convert
File "site-packages\calibre\ebooks\conversion\plumber.py", line 1041, in run
File "site-packages\calibre\customize\conversion.py", line 241, in __call__
File "calibre_plugins.doc_input.__init__", line 51, in convert
ValueError: Not found c:\Program Files\Microsoft Office\Office12\Wordconv.exe

Last edited by rebl; 08-29-2014 at 06:26 PM.
rebl is offline   Reply With Quote