Quote:
Never mind: My confusion lies with the fact that you keep implying that the environment variables need to be set for the PLUGIN to work. When in fact, the environment variables need to be set so your PROGRAM (and its Python subprocesses) interacts with a calibre plugin correctly.
|
Nope. ZMI is a GUI Plug-in. No executable program is involved, other than calibredb.exe and calibre.exe. It does, however, use whatever versions of Python, APSW and Qt that Calibre is currently bundling. It has to. It is a GUI Plug-in.
Assume that the user uses a RAMDISK via CALIBRE_TEMP_DIR. If ZMI used the same temporary folder as CALIBRE_TEMP_DIR, the RAMDISK could potentially overflow while ZMI is processing, for example, 15,000 .pdf files containing images and text, but all at one time (as inadvisable as that is).
So, the base case is to make TMPDIR = CALIBRE_TEMP_DIR, but to handle the above scenario, they will have to make TMPDIR point to a hard drive, not to a RAMDISK. Calibre will work off of the RAMDISK, but just ZMI (a Calibre GUI plug-in) will work off of the hard drive.
TMPDIR is the "goto" first choice for Python when looking for where to create a temporary file. The user could pick and choose among several other environment variables and directories, of course. That is up to them.
It is just as trivial to set TMPDIR = CALIBRE_TEMP_DIR as it is trivial to set CALIBRE_TEMP_DIR = ...\some_path\...
The cost is trivial, and the flexibility given the user to manage their computer resources the way they wish is extremely high.
DaltonST