View Single Post
Old 01-01-2009, 10:31 AM   #29
junkml
Addict
junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.junkml ought to be getting tired of karma fortunes by now.
 
junkml's Avatar
 
Posts: 277
Karma: 1004969
Join Date: Mar 2007
Device: Sony Reader
I'm trying to figure out how to build a plugin to make a call to the windows(dos) command line, so that when I add a book to calibre I can launch another application (Like Microsoft Word). however, I'm not getting any result when loading a lit file. Anyone have any thoughts? I'm not all that familiar with Python, so it's entirely possible I'm missing something.

The relevant lines I changed from Kovid's example:

file_types = set(['lit']) # The file types that this plugin will be applied to
on_import = True # Run this plugin after import is complete


AND

subprocess.call(r'C:\WINDOWS\system32\cmd.exe /C "C:\Program Files\Microsoft Office\OFFICE11\winword.exe"')

OR

os.system('"C:\Program Files\Microsoft Office\OFFICE11\winword.exe"')


neither the subprocess.call or os.system work.

Last edited by junkml; 01-01-2009 at 10:33 AM.
junkml is offline   Reply With Quote