[IronPython] expose some namespaces of own application

Stanislas Pinte stan at ertmssolutions.com
Tue Aug 15 09:33:49 CEST 2006


Hello,

We are using IP as a scripting engine, embedded in one of our products.

I would like to be able to expose a subset of the namespaces present in
my application assembly (MyApp.exe) to the scripting engine...but hide
the rest:

i.e. when a user does an "from a.b.c import Bar", if a.b.c is "hidden",
then it fails:

>>> from a.b.c import Bar
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named a.b.c
>>>

whereas if a.b.pub has been "exposed" to the scripting engine, then the
user can import it.

Is this currently possible? I have the impression that it is an
all-or-nothing situation...and I would like to avoid having to split my
classes in several assemblies.

Thanks for all input,

Kind regards,

Stan.

-- 
-----------------------------------------------------------------
   Stanislas Pinte             e-mail: stan at ertmssolutions.com
   ERTMS Solutions               http://www.ertmssolutions.com
   Rue de l'Autonomie, 1             Tel:    + 322 - 522.06.63
   1070        Bruxelles              Fax:   + 322 - 522.09.30
-----------------------------------------------------------------
   Skype (http://www.skype.com) id:                  stanpinte
-----------------------------------------------------------------



More information about the Ironpython-users mailing list