---On Mon, 17 Feb 2003 22:32:43 -0500, Bill Nalen said
> Chris wrote:
>> tempbase = tempfile.mktemp()
>> tempdoc = os.path.join(tempfile.tempdir, tempbase + ".doc")
>> temphtml = os.path.join(tempfile.tempdir, tempbase + ".html")
>> command = worddoc_converter
>> command = command + " -d " + tempfile.tempdir + " -b " + tempbase
>> command = command + " " + tempdoc + " > " + temphtml
>>then all converted docs would have their own (correct) images. Cleaning up
>>the temp files is easily done just before Spider.py exits.
>
> I'm not too familiar with Python, but does it clean up the temp files for
> you? Or will this keep creating temp directories with a bunch of temp
> files?
Python will create temp files (tempdir is /var/tmp on linux unless you
specifically change it, /tmp on Winders I think) with a unique name for
each group. This code in (the new) Spider.py will delete any that exist:
if tempfile.tempdir is not None:
""" Clean up any temp files """
base = re.compile (tempfile.template)
for file in os.listdir (tempfile.tempdir):
if base.match (file):
os.remove(os.path.join(tempfile.tempdir, file))
Let me know if it mis-behaves under Winders.
--re: Re: Parsing MS Word documents
Chris
Christopher R. Hawks Software Engineer
Syscon Plantstar a Division of Syscon International
-------------------------------------------------------------------------
> Linux is not user-friendly.
It _is_ user-friendly. It is not ignorant-friendly and idiot-friendly.
-- Seen somewhere on the net.
_______________________________________________
plucker-dev mailing list
[EMAIL PROTECTED]
http://lists.rubberchicken.org/mailman/listinfo/plucker-dev