Jesus Loves GRASS

Technical blog about GRASS/GIS,open source geoinformatics and MAPSERVER.

Tuesday, July 31, 2007

SOAPpy small bug

Installing SOAPpy 0.12.0 on python 2.5 I got the following error:

Traceback (most recent call last):
File "setup.py", line 8, in
from SOAPpy.version import __version__
File "/usr/local/src/SOAPpy-0.12.0/SOAPpy/__init__.py", line 5, in
from Client import *
File "/usr/local/src/SOAPpy-0.12.0/SOAPpy/Client.py", line 46
from __future__ import nested_scopes
SyntaxError: from __future__ imports must occur at the beginning of the file

The solution is to open file Client.py and copy/past the "from __future__ imports" line to be the first import.

The same error will appear in several files and also during installation, but the solution is always the same

Labels: , , ,

Thursday, July 26, 2007

Easier way to check python

Like we say in Portuguese "Who knows, know it" here is an easier way to get the mod_python info (posted by Grahan Dumpleton in the comments)


It is easier to go:

<Location /mpinfo>
SetHandler mod_python
PythonHandler mod_python.testhandler
</Location>

and then use '/mpinfo' as URL.

Wednesday, July 25, 2007

mod_python info server request

This is how information of the server and options can be made with mod_python 3.3.1 (like to do phpinfo() in PHP)

1. Make a /test directory in the htdocs tree

2. Create a directory structure in the httpd.conf as follow:

<Directory "/usr/local/apache2/htdocs/test">
Options Indexes FollowSymLinks
AllowOverride All
AddHandler mod_python .py
PythonHandler mod_python.testhandler
PythonDebug On
Order allow,deny
Allow from all
</Directory>

3. Restart Apache

4. Point to some hypothetical python script: http://localhost/test/ImaginaryScript.py

And the information of mod_python and apache should appear!!!!

Labels: , ,