<div>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?</div>
<div> </div>
<div>public static void Main() {<br> ScriptRuntime runtime = ScriptRuntime.Create();<br> ScriptEngine engine = runtime.GetEngine("py");<br> foreach (string s in engine.GetRegisteredExtensions()) {<br> System.Console.WriteLine(s);</div>
<div> }<br>}<br><br></div>
<div class="gmail_quote">On Wed, Jun 11, 2008 at 12:23 PM, Ben Hall <<a href="mailto:ben2004uk@googlemail.com">ben2004uk@googlemail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi,<br><br>I have been using the latest release of the DLR (the one from<br>yesterday) but the behaviour of GetRegisteredExtensions() seems to<br>
have changed (or is broke).<br><br>I've got this test:<br><br> [Test]<br> public void GetSaveFilter_RegisteredTypes_String()<br> {<br> string expected = "IronPython 2.0 Beta|*.py";<br>
LanguageSettings python = Helper.CreateIronPythonSettings();<br> DLREngineFactory factory = new DLREngineFactory();<br> ScriptEngine engine = factory.CreateEngine(python);<br><br> EngineInformation info = new EngineInformation(engine);<br>
string actual = info.GetSaveFilter();<br> Assert.AreEqual(expected, actual);<br> }<br><br>With IP Beta 2, this worked fine, but since upgrading it now fails.<br>The code is this:<br><br> public string GetSaveFilter()<br>
{<br> string filter = string.Empty;<br> foreach (string ext in Engine.GetRegisteredExtensions())<br> {<br> filter += string.Format("{0}|*{1}",<br>Engine.LanguageDisplayName, ext);<br>
}<br><br> return filter;<br> }<br><br>>From what I can tell, the code is dropping into<br>GetRegisteredFileExtensions(LanguageContext context) which does a<br>check to see if the LanguageContext is null, but it always seems to be<br>
null.<br>if (kvp.Value.LanguageContext == context) {<br> res.Add(kvp.Key);<br>}<br><br>Can anyone else confirm this?<br><br>Its the same for GetRegisteredIdentifiers().<br><br>Thanks<br><br>Ben<br><a href="http://blog.benhall.me.uk/" target="_blank">Blog.BenHall.me.uk</a><br>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</blockquote></div><br>