[IronPython] ScriptEngine.GetRegisteredExtensions()
Curt Hagenlocher
curt at hagenlocher.org
Wed Jun 11 22:22:00 CEST 2008
I can't see into any of the helpers you've defined. What do you get if you
cut this down to the smallest possible program?
public static void Main() {
ScriptRuntime runtime = ScriptRuntime.Create();
ScriptEngine engine = runtime.GetEngine("py");
foreach (string s in engine.GetRegisteredExtensions()) {
System.Console.WriteLine(s);
}
}
On Wed, Jun 11, 2008 at 12:23 PM, Ben Hall <ben2004uk at googlemail.com> wrote:
> Hi,
>
> I have been using the latest release of the DLR (the one from
> yesterday) but the behaviour of GetRegisteredExtensions() seems to
> have changed (or is broke).
>
> I've got this test:
>
> [Test]
> public void GetSaveFilter_RegisteredTypes_String()
> {
> string expected = "IronPython 2.0 Beta|*.py";
> LanguageSettings python = Helper.CreateIronPythonSettings();
> DLREngineFactory factory = new DLREngineFactory();
> ScriptEngine engine = factory.CreateEngine(python);
>
> EngineInformation info = new EngineInformation(engine);
> string actual = info.GetSaveFilter();
> Assert.AreEqual(expected, actual);
> }
>
> With IP Beta 2, this worked fine, but since upgrading it now fails.
> The code is this:
>
> public string GetSaveFilter()
> {
> string filter = string.Empty;
> foreach (string ext in Engine.GetRegisteredExtensions())
> {
> filter += string.Format("{0}|*{1}",
> Engine.LanguageDisplayName, ext);
> }
>
> return filter;
> }
>
> >From what I can tell, the code is dropping into
> GetRegisteredFileExtensions(LanguageContext context) which does a
> check to see if the LanguageContext is null, but it always seems to be
> null.
> if (kvp.Value.LanguageContext == context) {
> res.Add(kvp.Key);
> }
>
> Can anyone else confirm this?
>
> Its the same for GetRegisteredIdentifiers().
>
> Thanks
>
> Ben
> Blog.BenHall.me.uk <http://blog.benhall.me.uk/>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080611/97442d93/attachment.html>
More information about the Ironpython-users
mailing list