Ruleset import hooks?
  • Hello all-

    What are the ruleset import hooks? Based on a naive investigation, it looks like they may be used to dynamically find + load ruleset modules. Is that about right?

    How are the import hooks first loaded?

    Thanks!

    -Thomas
  • Got the answer! It looks like you need the empty __init__.py files around so the various scripts can be found.

    I'm still curious how this works, but it is no longer blocking me.
  • The import hooks stuff is obsolete code that modified the way Python imports classes so rulesets could depend on each other, and the ruleset directory trees were effectively overlayed. This was confusing because it meant python behaved in an unexpected way, and it broke re-loading modules from file into a running server. I came up with a better way of breaking rulesets down into multiple xml files for greater accessibility, and removed this feature.

    If you want a directory of python files to behave like a module containing sub modules, you need to add an empty __init__.py file to the directory. This is a standard part of the pay python reflection works.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID