All four plugins are now working! I added path="/tmp" at line 184 of lib/pwiki/TempFileSet.py, so it now reads:
# The following three functions do not record the created files in a
# TempFileSet and have no internal defaults for path and relativeTo.
def createTempFile(content, suffix, path=None, relativeTo=None):
"""
Specialized function. Creates a file in directory path, fills it with
content (byte string), closes it and returns its full path.
relativeTo -- path relative to which the path should be or None
for absolute path
"""
path="/tmp"
fd, fullPath = tempfile.mkstemp(suffix=pathEnc(suffix), dir=pathEnc(path),
text=False)
try:
os.write(fd, content)
finally:
os.close(fd)
return getRelativePath(relativeTo, fullPath)
Obviously the above is platform specific to linux/unix, but this is my first attempt at any python code
Also had to modify extensions/PloticusClBridge.py, changing all instances of 'gif' to 'png', since gif is not supported out of the box in Ploticus on Ubuntu (presumably due to licence restrictions).
--- In wikidPad@yahoogroups.com, "jonjacksonuk" <jsjweb@...> wrote:
>
> Hi,
>
> I've installed the 'gnuplot', 'ploticus', 'graphviz' and 'mimetex'
> binaries on my system (Ubuntu 7.10) and set the paths in the Wikidpad
> options, but the examples on the ExternalGraphicalApplications page of
> Wikidpad help give error messages. Is there any way to change the
> default location for storing the temporary .png files - I'm guessing
> this is the problem.
>
> Jon
>
> Errors are:
>
> Example
> If you have downloaded and installed all applications you can see here
> how the graphics look like:
> MimeTeX: You should know that
> Traceback (most recent call last):
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/Exporters.py",
> line 1128, in _processInsertion
> insertionAstNode)
> File
> "/usr/local/lib/WikidPad-1.9beta15/extensions/MimeTexCGIBridge.py",
> line 117, in createContent
> url = tfs.createTempUrl(response, ".gif", pythonUrl=pythonUrl)
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/TempFileSet.py",
> line 168, in createTempUrl
> fullPath = self.createTempFile(content, suffix, path, "")
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/TempFileSet.py",
> line 139, in createTempFile
> fullPath = createTempFile(content, suffix, path)
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/TempFileSet.py",
> line 184, in createTempFile
> fd, fullPath = tempfile.mkstemp(suffix=pathEnc(suffix),
> dir=pathEnc(path),
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/StringOps.py",
> line 115, in pathEnc
> return mbcsEnc(s, "replace")[0]
> TypeError: coercing to Unicode: need string or buffer, NoneType found
> is important!
> GraphViz (Dot, with "noerror" appendix)
>
> Traceback (most recent call last):
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/Exporters.py",
> line 1128, in _processInsertion
> insertionAstNode)
> File
> "/usr/local/lib/WikidPad-1.9beta15/extensions/GraphvizClBridge.py",
> line 114, in createContent
> dstFullPath = tfs.createTempFile("", ".png", relativeTo="")
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/TempFileSet.py",
> line 139, in createTempFile
> fullPath = createTempFile(content, suffix, path)
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/TempFileSet.py",
> line 184, in createTempFile
> fd, fullPath = tempfile.mkstemp(suffix=pathEnc(suffix),
> dir=pathEnc(path),
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/StringOps.py",
> line 115, in pathEnc
> return mbcsEnc(s, "replace")[0]
> TypeError: coercing to Unicode: need string or buffer, NoneType found
>
> Ploticus
>
> Traceback (most recent call last):
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/Exporters.py",
> line 1128, in _processInsertion
> insertionAstNode)
> File
> "/usr/local/lib/WikidPad-1.9beta15/extensions/PloticusClBridge.py",
> line 98, in createContent
> dstFullPath = tfs.createTempFile("", ".gif", relativeTo="")
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/TempFileSet.py",
> line 139, in createTempFile
> fullPath = createTempFile(content, suffix, path)
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/TempFileSet.py",
> line 184, in createTempFile
> fd, fullPath = tempfile.mkstemp(suffix=pathEnc(suffix),
> dir=pathEnc(path),
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/StringOps.py",
> line 115, in pathEnc
> return mbcsEnc(s, "replace")[0]
> TypeError: coercing to Unicode: need string or buffer, NoneType found
>
> Gnuplot
>
> Traceback (most recent call last):
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/Exporters.py",
> line 1128, in _processInsertion
> insertionAstNode)
> File
> "/usr/local/lib/WikidPad-1.9beta15/extensions/GnuplotClBridge.py",
> line 96, in createContent
> dstFullPath = tfs.createTempFile("", ".png", relativeTo="")
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/TempFileSet.py",
> line 139, in createTempFile
> fullPath = createTempFile(content, suffix, path)
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/TempFileSet.py",
> line 184, in createTempFile
> fd, fullPath = tempfile.mkstemp(suffix=pathEnc(suffix),
> dir=pathEnc(path),
> File "/usr/local/lib/WikidPad-1.9beta15/lib/pwiki/StringOps.py",
> line 115, in pathEnc
> return mbcsEnc(s, "replace")[0]
> TypeError: coercing to Unicode: need string or buffer, NoneType found
>