Hi all,
I'm putting together a seminar at our local Code Camp for hosting the DLR
and integration with applications. The hosting spec pdf is great however I
do have (at least) one question that isn't explained very well in the doc.
How can I restrict what assemblies can be loaded by a ScriptScope? To
explain further: If I use the following code to load a py script file
ScriptRuntime env = ScriptRuntime.Create();
ScriptEngine eng = env.GetEngineByFileExtension( "py" );
ScriptSource source = eng.CreateScriptSourceFromString(
form.Source, SourceCodeKind.File );
source.Execute();
Where form.Source is a string containing this :
import sys
import clr
clr.AddReference("System.Windows.Forms")
clr.AddReference("System")
clr.AddReference("Microsoft.Xna.Framework")
clr.AddReference("Microsoft.Xna.Framework.Graphics")
clr.AddReference("Microsoft.Xna.Framework.Input")
clr.AddReference("Bnoerj.AI.Steering.Demo.Plugins.Ctf")
from Bnoerj.AI.Steering.Demo.Plugins.Ctf import CtfBase, Globals
class CtfPythonSeeker(CtfBase):
def __init__(self):
Reset()
def Reset(self):
Globals.Instance.Seeker = self
How can I prevent some references from being referenced, like "
Microsoft.Xna.Framework" but allow "Bnoerj.AI.Steering.Demo.Plugins.Ctf"?
Thanks in advance
Michael
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com