Search the web
Sign In
New User? Sign Up
wikidPad
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
External Graphical applications on linux   Message List  
Reply | Forward Message #4065 of 5651 |
Re: External Graphical applications on linux

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
>



Sun Mar 9, 2008 9:07 pm

jonjacksonuk
Offline Offline
Send Email Send Email

Forward
Message #4065 of 5651 |
Expand Messages Author Sort by Date

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...
jonjacksonuk
Offline Send Email
Mar 1, 2008
6:06 pm

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...
jonjacksonuk
Offline Send Email
Mar 9, 2008
9:07 pm

Same issues, and same workaround works on 1.9beta16... but it is the right way. Especially forcing path to "/tmp". Thx for the new beta version Franck...
franxxk
Offline Send Email
Jul 27, 2008
2:48 pm

... Could you try the following fix instead (deleting or commenting out the 'path="/tmp"' temporarily)? In "StringOps.py" beginning about at line 112, there...
Michael Butscher
michael_buts...
Offline Send Email
Jul 28, 2008
12:05 pm

thx Michael. That's the rigth fix ! Franck ... is my ... the box...
franxxk
Offline Send Email
Jul 29, 2008
9:25 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help