On 26/04/12 09:34, Vsevolod Fedorov wrote:
On 04/25/12 20:36, Phil Charlesworth wrote:
I have looked at Seva's code and it doesn't produce any errors on my system. However, it doesn't access the images at all! If I add some additional tree items to force it to use images, it works fine even if I move the images out of the public directory. I attach my version of his index.py. and it's located in the examples/seva/ sub-directory of my web root.

I am using an apache server (Xampp for Windows). Is the problem something to do with the way he is serving using server.py. He is not by any chance serving index.py, I suppose? Would that cause the observed problem?
P


I think I know why this is working for you:
You are using apache, configured in such a way, so it gives access to the whole file system, and by absolute path.

If you will try to use server.py, which I provided in the example, you will see the problem: you need to make entire file system paths under server catalog:
-------
$ ./server.py
localhost - - [25/Apr/2012 11:10:26] "GET /public/index.html HTTP/1.1" 200 -
localhost - - [25/Apr/2012 11:10:26] code 404, message File not found
localhost - - [25/Apr/2012 11:10:26] "GET /home/seva/pyjamas/library/pyjamas/ui/public/tree_white.gif HTTP/1.1" 404 -
localhost - - [25/Apr/2012 11:10:26] code 404, message File not found
localhost - - [25/Apr/2012 11:10:26] "GET /home/seva/pyjamas/library/pyjamas/ui/public/tree_closed.gif HTTP/1.1" 404 -
------
As you see, I have to make paths like home/seva/pyjamas/library/pyjamas... under server's catalog for this to work. (I have pyjamas installed in my /home catalog).

So, as I understand, we have currently two options for pyjd:
1. configure web server so it serves all file system, under absolute paths.
2. recreate full file system paths under public/ catalog.

In both cases we have different environment in pyjd and pyjs:
In first case, it is bad to make all file system available for production code.
I second case, your public/ catalog must look different for pyjd and pyjs.

I do not like either of the options :)

Seva

   *
    * English
    * Russian

    * English
    * Russian

Seva,

Yes, I see your point. I have now run my modified version of index.py with your server and it does indeed report 404 file not found errors, in my case only for /public/tree-closed.gif, because of the extra nodes I've added.

However, the actual display produced shows the images and they are being obtained from pyjamas/library/pyjamas/ui/public (it makes no difference whether they are present in /public/ or not). The application is reporting no errors - only the server. And the errors are, in a sense, spurious, because the application can obtain the images without doing an HTTP call to get them. There should be a work-around that can handle that. Pause for thought :).

Phil

Reply via email to