Ashish:
I agree;
choice to install content is better than no content...
Also, I tried your PrcConverter.py, but I got a message on startup that it failed to load. Any ideas why that would happen. I ran the script on its own to see if there were any syntax errors but only got the message that impserve wasn't defined.
I know you are away for a bit, but does anything appear wrong with this:
Code:
# v0.1 - Inital plugin idea by ashkulz; Adapted by nrapallo (Sept 2008)
import impserve
import os, subprocess
class PrcConverter(impserve.ProxyResponse):
def get_response(self, url, headers, data):
if not 'prc' in headers['Content-Type']:
return headers, data
open('input.prc', 'wb').write(data)
# using a command to convert .prc to .imp 'on the fly'... copied "C:\Program Files\Mobi2IMP\bin\Mobi2IMP.exe" to impserve directory
if not subprocess.call(['Mobi2IMP', '--cover', '--o', 'output', 'input.prc']) or not os.path.isfile('output.imp'):
return headers, data
headers['Content-Type'] = 'application/x-softbook'
data = open('output.imp', 'rb').read()
os.remove('input.prc')
os.remove('output.imp')
return headers, data
I got this message when impserve was launched:
Code:
Loaded plugin: AdjustHtml.py
Loaded plugin: AdjustQueryString.py
The following plugins failed to load: PrcConverter.py
impserve 0.4.2: starting server on 127.0.0.1:9090