Why not allow the user to override paths to external programs via the prefs json?
Code:
prefs = bk.get_prefs()
#Default to none
if 'jpegtrans_path' not in prefs
prefs['jpegtran_path'] = None
# Default to false
if 'use_wine' not in prefs
prefs['use_wine'] = False
Then somewhere in your platform logic:
Code:
islinux = sys.platform.startswith('linux')
if islinux and prefs['jpegtran_path'] is not None:
exe_path = prefs['jpegtran_path']
else:
exe_path = 'jpegtran'
if islinux and prefs['use_wine']:
args = ['wine', path_to_included_windows_exe]
else:
args = [exe_path]
''' Plugin processing '''
# Need a call to savePrefs so the json file gets created after first run
bk.savePrefs(prefs)
Or something similar. I've not actually looked at the plugin code.
That way the user can just modify the json prefs file to 1) point to a newer version of jpegtran (which I'm betting calibre's is); or 2) use wine to run the included Windows version.