nnrpd Python scripts for INN 2.4.5

Julien ÉLIE julien at trigofacile.com
Sat Jun 21 22:09:22 UTC 2008


Hi,

Python scripts for *nnrpd* are currently broken in STABLE (and CURRENT).

(Note that Python scripts for *innd* work fine -- well, they seem to work
fine, I have not extensively tested all their features.  The only issue
was their reload in the case there was a syntax mistake within them, but
the problem is nom solved in STABLE.)


As for *nnrpd* Python scripts, what works now is only very basic scripts
which do not import other modules...

In documentation, it is said that
    python_auth: "auth1.py"
works but in fact it works /better/ with
    python_auth: "auth1"

When I say /better/, it is because if "py" is put, the filter works
but you cannot import modules except from the top-level (and all
the imported modules within these modules must also import at
top-level...).  And if you do not put "py", you can do whatever you want
(well, I hope so) but all methods are required to be defined in
auth1.py (like dynamic_init, dynamic_close, etc.) because of the
"exception bug" for which I have just sent a mail.

I still do not understand why the behaviour is different, be "py" put or not.
Anyway, I suggest to write in the documentation that "py" should not
be written in readers.conf.

I think it is the best thing to do.



However, as for another issue, which is the use of access, auth and dynamic
hooks inside the *same* Python script (which should normally work according
to the documentation and the nnrpd_auth.py sample file), it is broken.
Note that it is a bit complex to do that owing to the current architecture of the
Python scripts in INN (the name of the file is a module, registered by Python
when it is loaded and put into a hash struct [the one for which hash_free is called]
so it is not easy to change (hash_replace is not enough and PY_setup is not designed
to do that).
Anyway, I think it is proper to separate the three scripts.
If you agree, I can do that and update both the documentation and the samples
to specify it.
And that change can be shipped with INN 2.4.5 because it will not break scripts
(they had already to be distinct).


After that, I reckon INN 2.4.5 can be released.

-- 
Julien ÉLIE

« Quand on aime on ne compte pas...
  Ça tombe bien, je suis mauvaise en calcul ! »



More information about the inn-workers mailing list