From xmlhacker at gmail.com Sat Sep 1 09:36:21 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sat, 1 Sep 2007 01:36:21 -0600 Subject: [IronPython] IronRuby and Ruby.NET Labor Day Weekend *HACKFEST* Extravaganza Message-ID: NOTE TO IRONPYTHON LIST: There doesn't seem to be an IronRuby list quite yet, so I figured it best to Cc the IP list to try and locate those who have interest in both (meaning both IP and IR) to participate in the event mentioned in the subject line. If you're annoyed, mad, and/or in other ways wish *VERY BAD THINGS* upon my head for littering your inbox with "junk" mail, two words: Byte me! err, wait, no, thats not what I meant. Instead, what I meant was: I'm sorry. :D (could you ever find it your heart to forgive me?) To the rest of you (which means those on the RubyDOTNET and URUG (Utah Ruby Users Group) mailing lists as well as those of you on the IP list not wishing *VERY BAD THINGS* upon my head): via http://www.oreillynet.com/windows/blog/2007/09/ironruby_and_rubynet_labor_day.html > So with the releaseof IronRuby > to RubyForge and opening things > up for community contribution (you will need to sign a contributors > agreement before they will be able to accept your contributions, but that's > completely normal and an understood necessity by anyone who has contributed > to a large open source project before) what better way to celebrate than by > throwing a *HACKFEST* Extravaganza? > > Of course, while we're at it, why not spend some time helping out with the > *other* .NET Ruby runtime and compiler project, Ruby.NET > ? > > So without further adieu, > > This Saturday? day, day < Sunday... day, day, and < Monday... day, day > *ONLY*, the IronRuby and Ruby.NET Labor Day Weekend *HACKFEST* > Extravaganza is coming to an IRC channel near you, > > irc://irc.freenode.net/#ironruby > > - and - > > irc://irc.freenode.net/#ruby.net > > [Said in the deepest, most stern Monster Truck Weekend announcer voice I > can conjure up] BE THEEEERRE? > If you know of any other people and/or groups who might have interest in the above (unless by "above" you interpret that to mean those you would wish *VERY BAD THINGS* upon my head. If yes, please disregard what follows...), if you wouldn't mind forwarding this on to them that would be *GREAT* Thanks! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Sat Sep 1 16:46:34 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sat, 1 Sep 2007 08:46:34 -0600 Subject: [IronPython] IronRuby and Ruby.NET Labor Day Weekend *HACKFEST* Extravaganza In-Reply-To: References: Message-ID: FYI > bootstrap utilities for building on Mono (currently doesn't build, though its close) http://mdavid.googlecode.com/svn/trunk/IronRuby/ (run ./build.sh to get the make; make install tarball) On 9/1/07, M. David Peterson wrote: > > NOTE TO IRONPYTHON LIST: There doesn't seem to be an IronRuby list quite > yet, so I figured it best to Cc the IP list to try and locate those who have > interest in both (meaning both IP and IR) to participate in the event > mentioned in the subject line. If you're annoyed, mad, and/or in other ways > wish *VERY BAD THINGS* upon my head for littering your inbox with "junk" > mail, two words: Byte me! err, wait, no, thats not what I meant. Instead, > what I meant was: I'm sorry. :D (could you ever find it your heart to > forgive me?) > > To the rest of you (which means those on the RubyDOTNET and URUG (Utah > Ruby Users Group) mailing lists as well as those of you on the IP list not > wishing *VERY BAD THINGS* upon my head): > > via http://www.oreillynet.com/windows/blog/2007/09/ironruby > _and_rubynet_labor_day.html > > > So with the releaseof IronRuby > > to RubyForge and opening things > > up for community contribution (you will need to sign a contributors > > agreement before they will be able to accept your contributions, but that's > > completely normal and an understood necessity by anyone who has contributed > > to a large open source project before) what better way to celebrate than by > > throwing a *HACKFEST* Extravaganza? > > > > Of course, while we're at it, why not spend some time helping out with > > the *other* .NET Ruby runtime and compiler project, Ruby.NET > > ? > > > > So without further adieu, > > > > This Saturday? day, day < Sunday... day, day, and < Monday... day, day > > *ONLY*, the IronRuby and Ruby.NET Labor Day Weekend *HACKFEST* > > Extravaganza is coming to an IRC channel near you, > > > > irc://irc.freenode.net/#ironruby > > > > - and - > > > > irc://irc.freenode.net/#ruby.net > > > > [Said in the deepest, most stern Monster Truck Weekend announcer voice I > > can conjure up] BE THEEEERRE? > > > If you know of any other people and/or groups who might have interest in > the above (unless by "above" you interpret that to mean those you would wish > *VERY BAD THINGS* upon my head. If yes, please disregard what follows...), > if you wouldn't mind forwarding this on to them that would be *GREAT* > > Thanks! > > -- > /M:D > > M. David Peterson > http://mdavid.name | http://www.oreillynet.com/pub > /au/2354 | > http://dev.aol.com/blog/3155 -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Sat Sep 1 16:49:14 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sat, 1 Sep 2007 08:49:14 -0600 Subject: [IronPython] IronRuby and Ruby.NET Labor Day Weekend *HACKFEST* Extravaganza In-Reply-To: References: Message-ID: NOTE: Proper credit where it's due: The nant build file comes from Seo@ http://sparcs.kaist.ac.kr/~tinuviel/download/IronRuby/ On 9/1/07, M. David Peterson wrote: > > FYI > bootstrap utilities for building on Mono (currently doesn't build, > though its close) http://mdavid.googlecode.com/svn/trunk/IronRuby/ (run > ./build.sh to get the make; make install tarball) > > On 9/1/07, M. David Peterson < xmlhacker at gmail.com> wrote: > > > > NOTE TO IRONPYTHON LIST: There doesn't seem to be an IronRuby list quite > > yet, so I figured it best to Cc the IP list to try and locate those who have > > interest in both (meaning both IP and IR) to participate in the event > > mentioned in the subject line. If you're annoyed, mad, and/or in other ways > > wish *VERY BAD THINGS* upon my head for littering your inbox with "junk" > > mail, two words: Byte me! err, wait, no, thats not what I meant. Instead, > > what I meant was: I'm sorry. :D (could you ever find it your heart to > > forgive me?) > > > > To the rest of you (which means those on the RubyDOTNET and URUG (Utah > > Ruby Users Group) mailing lists as well as those of you on the IP list not > > wishing *VERY BAD THINGS* upon my head): > > > > via http://www.oreillynet.com/windows/blog/2007/09/ironruby > > _and_rubynet_labor_day.html > > > > > So with the releaseof IronRuby > > > to RubyForge and opening > > > things up for community contribution (you will need to sign a contributors > > > agreement before they will be able to accept your contributions, but that's > > > completely normal and an understood necessity by anyone who has contributed > > > to a large open source project before) what better way to celebrate than by > > > throwing a *HACKFEST* Extravaganza? > > > > > > Of course, while we're at it, why not spend some time helping out with > > > the *other* .NET Ruby runtime and compiler project, Ruby.NET > > > ? > > > > > > So without further adieu, > > > > > > This Saturday? day, day < Sunday... day, day, and < Monday... day, day > > > *ONLY*, the IronRuby and Ruby.NET Labor Day Weekend *HACKFEST* > > > Extravaganza is coming to an IRC channel near you, > > > > > > irc://irc.freenode.net/#ironruby > > > > > > - and - > > > > > > irc://irc.freenode.net/#ruby.net > > > > > > [Said in the deepest, most stern Monster Truck Weekend announcer voice > > > I can conjure up] BE THEEEERRE? > > > > > If you know of any other people and/or groups who might have interest in > > the above (unless by "above" you interpret that to mean those you would wish > > *VERY BAD THINGS* upon my head. If yes, please disregard what follows...), > > if you wouldn't mind forwarding this on to them that would be *GREAT* > > > > Thanks! > > > > -- > > /M:D > > > > M. David Peterson > > http://mdavid.name | http://www.oreillynet.com/pub > > /au/2354 | > > http://dev.aol.com/blog/3155 > > > > > -- > /M:D > > M. David Peterson > http://mdavid.name | http://www.oreillynet.com/pub/au/2354 > | http://dev.aol.com/blog/3155 > -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Sun Sep 2 17:16:43 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sun, 2 Sep 2007 09:16:43 -0600 Subject: [IronPython] IronRuby and Ruby.NET Labor Day Weekend *HACKFEST* Extravaganza In-Reply-To: References: Message-ID: On 9/1/07, M. David Peterson wrote: > > FYI > bootstrap utilities for building on Mono (currently doesn't build, > though its close) http://mdavid.googlecode.com/svn/trunk/IronRuby/ (run > ./build.sh to get the make; make install tarball) Now it does. Access the pre-configured tarball @ http://mdavid.googlecode.com/svn/trunk/IronRuby/IronRuby-svnr24M.tar.gz or checkout the above SVN folder, run ./build.sh and then untar the generated tarball and run, make; sudo make install which will enable you to run, [mdavid at localhost ~]$ rbx -X:TabCompletion -X:ColorfulConsole IronRuby Pre-Alpha (1.0.0.0) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> and get the same result as above. Still *PLENTY* of bugs to work through but this will at least allow anyone who wants to help track down bugs as they relate to both IronRuby and Mono (or at least bugs related to running IronRuby on Mono) to do just that. Happy Hunting! I'm updating nuXleus (http://nuxleus.com) with all of the latest bits from IronRuby and Ruby.NET (IronPython has been integrated for quite some time now), so for those who want to play around with GNU/Linux/Mono inside of a virtualized instance (VMware, VPC/Server, QEMU/Q:, Parallels, or an Amazon AMI) running on their host environment I'll update this post when the update is complete and ready for download. -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Sep 3 23:23:32 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 03 Sep 2007 22:23:32 +0100 Subject: [IronPython] Hosting IronPython in a Silverlight App Message-ID: <46DC7B54.1060205@voidspace.org.uk> Hello all, I'm experimenting with hosting IronPython in a silverlight (1.1 alpha refresh) app. When I write C# code that uses the PythonEngine it works fine when access *from IronPython code*. If I use the same code as 'code behind', then it throws an exception "The method or operation is not implemented." (At the line "PythonEngine pe = PythonEngine.CurrentEngine;") The code is: using System; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using IronPython.Hosting; using Microsoft.Scripting; namespace EmbeddedWithCodeBehind { public partial class Page : Canvas { public void Page_Loaded(object o, EventArgs e) { // Required to initialize variables InitializeComponent(); try { PythonEngine pe = PythonEngine.CurrentEngine; string code = "lambda x: x.upper()"; Function func = pe.EvaluateAs>(code); string x = "i'm talking loudly"; string result = func(x); textBlock.Text = result; } catch (Exception ex) { textBlock.Text = ex.Message; } } } } The XAML is: Everything else is the default from an Orcas beta 2 new Silverlight project. Anyone got any clues as to what is happening? Thanks Michael Foord http://www.ironpython.info/ From billchi at microsoft.com Tue Sep 4 23:39:58 2007 From: billchi at microsoft.com (Bill Chiles) Date: Tue, 4 Sep 2007 14:39:58 -0700 Subject: [IronPython] TEST, IGNORE In-Reply-To: <20070901152805671272@lhkk> References: <20070901152805671272@lhkk> Message-ID: <2C734460517A154B8E98AC8BA98D49A15890CCA50B@NA-EXMSG-C105.redmond.corp.microsoft.com> This is a test ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Tue Sep 4 23:27:39 2007 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 4 Sep 2007 14:27:39 -0700 Subject: [IronPython] Hosting IronPython in a Silverlight App In-Reply-To: <46DC7B54.1060205@voidspace.org.uk> References: <46DC7B54.1060205@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3283ED0EE424C@NA-EXMSG-C116.redmond.corp.microsoft.com> Michael, Thanks for bringing this to our attention! When hosting IronPython in a normal C# app, the Hosting API makes some assumptions for that scenario and makes the hosting work "out of the box". Those assumptions are not all true in Silverlight, so a custom Platform Adaptation Layer (PAL) must be used. I've attached a working version of your project to this email, and here's what it does different: Before you create the Python Engine: ScriptEnvironmentSetup setup = new ScriptEnvironmentSetup(true); setup.PALType = typeof(SilverlightPAL); ScriptEnvironment.Create(setup); This will override the default PAL the Silverlight PAL, which is defined here: // Definition of Silverlight Platform Adoption Layer: public class SilverlightPAL : PlatformAdaptationLayer { public override Assembly LoadAssembly(string name) { return Assembly.Load(LookupFullName(name)); } private Dictionary _assemblyFullNames = new Dictionary(); public SilverlightPAL() { LoadSilverlightAssemblyNameMapping(); } // TODO: This will not be necessary as it will eventually move down into the host private void LoadSilverlightAssemblyNameMapping() { AssemblyName clrAssembly = new AssemblyName(typeof(object).Assembly.FullName); foreach (string asm in new string[] { "mscorlib", "System", "System.Core", "System.Xml.Core" }) { clrAssembly.Name = asm; _assemblyFullNames.Add(asm.ToLower(), clrAssembly.FullName); } _assemblyFullNames.Add("system.silverlight", "System.SilverLight, Version=1.0.0.0, PublicKeyToken=b03f5f7f11d50a3a"); _assemblyFullNames.Add("agclr", "agclr, Version=0.0.0.0, PublicKeyToken=b03f5f7f11d50a3a"); _assemblyFullNames.Add("microsoft.visualbasic", "Microsoft.VisualBasic, Version=8.1.0.0, PublicKeyToken=b03f5f7f11d50a3a"); AssemblyName dlrAssembly = new AssemblyName(typeof(PlatformAdaptationLayer).Assembly.FullName); foreach (string asm in new string[] { "Microsoft.Scripting", "Microsoft.Scripting.Silverlight", "IronPython", "IronPython.Modules", "Microsoft.JScript.Compiler", "Microsoft.JScript.Runtime", "Microsoft.VisualBasic.Compiler", "Microsoft.VisualBasic.Scripting", "Ruby"}) { dlrAssembly.Name = asm; _assemblyFullNames.Add(asm.ToLower(), dlrAssembly.FullName); } } protected string LookupFullName(string name) { AssemblyName asm = new AssemblyName(name); if (asm.Version != null || asm.GetPublicKeyToken() != null || asm.GetPublicKey() != null) { return name; } return _assemblyFullNames.ContainsKey(name.ToLower()) ? _assemblyFullNames[name.ToLower()] : name; } } This allows for IronPython.Modules to be loaded by the host, which is the exception you were getting. This is *a lot* to get IronPython hosted in Silverlight! This work was done for the DLR/Silverlight integration effort, however simple hosting in Silverlight shouldn't be this hard. I wouldn't be surprised if we decided to move this bit into the DLR host. =) Let me know if you have any other questions, ~Jimmy > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, September 03, 2007 2:24 PM > To: Discussion of IronPython > Subject: [IronPython] Hosting IronPython in a Silverlight App > > Hello all, > > I'm experimenting with hosting IronPython in a silverlight (1.1 alpha > refresh) app. > > When I write C# code that uses the PythonEngine it works fine when > access *from IronPython code*. > > If I use the same code as 'code behind', then it throws an exception > "The method or operation is not implemented." > > (At the line "PythonEngine pe = PythonEngine.CurrentEngine;") > > The code is: > > using System; > using System.Windows; > using System.Windows.Controls; > using System.Windows.Documents; > using System.Windows.Ink; > using System.Windows.Input; > using System.Windows.Media; > using System.Windows.Media.Animation; > using System.Windows.Shapes; > using IronPython.Hosting; > using Microsoft.Scripting; > > namespace EmbeddedWithCodeBehind > { > public partial class Page : Canvas > { > public void Page_Loaded(object o, EventArgs e) > { > // Required to initialize variables > InitializeComponent(); > > try > { > PythonEngine pe = PythonEngine.CurrentEngine; > string code = "lambda x: x.upper()"; > Function func = > pe.EvaluateAs>(code); > > string x = "i'm talking loudly"; > string result = func(x); > textBlock.Text = result; > } > catch (Exception ex) > { > textBlock.Text = ex.Message; > } > > } > } > } > > > > The XAML is: > > xmlns="http://schemas.microsoft.com/client/2007" > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > Loaded="Page_Loaded" > > x:Class="EmbeddedWithCodeBehind.Page;assembly=ClientBin/EmbeddedWithCod > eBehind.dll" > Width="640" > Height="480" > Background="White" > > > > > > > > > Everything else is the default from an Orcas beta 2 new Silverlight > project. > > Anyone got any clues as to what is happening? > > Thanks > > Michael Foord > http://www.ironpython.info/ > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- A non-text attachment was scrubbed... Name: EmbeddedWithCodeBehind.zip Type: application/x-zip-compressed Size: 27231 bytes Desc: EmbeddedWithCodeBehind.zip URL: From Jimmy.Schementi at microsoft.com Tue Sep 4 23:02:37 2007 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 4 Sep 2007 14:02:37 -0700 Subject: [IronPython] Hosting IronPython in a Silverlight App In-Reply-To: <46DC7B54.1060205@voidspace.org.uk> References: <46DC7B54.1060205@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A3283ED0EE4223@NA-EXMSG-C116.redmond.corp.microsoft.com> Michael, Thanks for bringing this to our attention! When hosting IronPython in a normal C# app, the Hosting API makes some assumptions for that scenario and makes the hosting work "out of the box". Those assumptions are not all true in Silverlight, so a custom Platform Adaptation Layer must be used. I've attached a working version of your project to this email, and here's what it does different: Before you create the Python Engine: ScriptEnvironmentSetup setup = new ScriptEnvironmentSetup(true); setup.PALType = typeof(SilverlightPAL); ScriptEnvironment.Create(setup); This will create the Silverlight Platform Adoption Layer, which is defined here: // Definition of Silverlight Platform Adoption Layer: public class SilverlightPAL : PlatformAdaptationLayer { public override Assembly LoadAssembly(string name) { return Assembly.Load(LookupFullName(name)); } private Dictionary _assemblyFullNames = new Dictionary(); public SilverlightPAL() { LoadSilverlightAssemblyNameMapping(); } // TODO: This will not be necessary as it will eventually move down into the host private void LoadSilverlightAssemblyNameMapping() { AssemblyName clrAssembly = new AssemblyName(typeof(object).Assembly.FullName); foreach (string asm in new string[] { "mscorlib", "System", "System.Core", "System.Xml.Core" }) { clrAssembly.Name = asm; _assemblyFullNames.Add(asm.ToLower(), clrAssembly.FullName); } _assemblyFullNames.Add("system.silverlight", "System.SilverLight, Version=1.0.0.0, PublicKeyToken=b03f5f7f11d50a3a"); _assemblyFullNames.Add("agclr", "agclr, Version=0.0.0.0, PublicKeyToken=b03f5f7f11d50a3a"); _assemblyFullNames.Add("microsoft.visualbasic", "Microsoft.VisualBasic, Version=8.1.0.0, PublicKeyToken=b03f5f7f11d50a3a"); AssemblyName dlrAssembly = new AssemblyName(typeof(PlatformAdaptationLayer).Assembly.FullName); foreach (string asm in new string[] { "Microsoft.Scripting", "Microsoft.Scripting.Silverlight", "IronPython", "IronPython.Modules", "Microsoft.JScript.Compiler", "Microsoft.JScript.Runtime", "Microsoft.VisualBasic.Compiler", "Microsoft.VisualBasic.Scripting", "Ruby"}) { dlrAssembly.Name = asm; _assemblyFullNames.Add(asm.ToLower(), dlrAssembly.FullName); } } protected string LookupFullName(string name) { AssemblyName asm = new AssemblyName(name); if (asm.Version != null || asm.GetPublicKeyToken() != null || asm.GetPublicKey() != null) { return name; } return _assemblyFullNames.ContainsKey(name.ToLower()) ? _assemblyFullNames[name.ToLower()] : name; } } This allows for IronPython.Modules to be loaded, which is the exception you were getting. This is *a lot* to get IronPython hosted in Silverlight! This work was done for the DLR/Silverlight integration effort, however simple hosting in Silverlight shouldn't be this hard. I wouldn't be surprised if we decided to move this bit into the DLR host. =) Let me know if you have any other questions, ~Jimmy > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, September 03, 2007 2:24 PM > To: Discussion of IronPython > Subject: [IronPython] Hosting IronPython in a Silverlight App > > Hello all, > > I'm experimenting with hosting IronPython in a silverlight (1.1 alpha > refresh) app. > > When I write C# code that uses the PythonEngine it works fine when > access *from IronPython code*. > > If I use the same code as 'code behind', then it throws an exception > "The method or operation is not implemented." > > (At the line "PythonEngine pe = PythonEngine.CurrentEngine;") > > The code is: > > using System; > using System.Windows; > using System.Windows.Controls; > using System.Windows.Documents; > using System.Windows.Ink; > using System.Windows.Input; > using System.Windows.Media; > using System.Windows.Media.Animation; > using System.Windows.Shapes; > using IronPython.Hosting; > using Microsoft.Scripting; > > namespace EmbeddedWithCodeBehind > { > public partial class Page : Canvas > { > public void Page_Loaded(object o, EventArgs e) > { > // Required to initialize variables > InitializeComponent(); > > try > { > PythonEngine pe = PythonEngine.CurrentEngine; > string code = "lambda x: x.upper()"; > Function func = > pe.EvaluateAs>(code); > > string x = "i'm talking loudly"; > string result = func(x); > textBlock.Text = result; > } > catch (Exception ex) > { > textBlock.Text = ex.Message; > } > > } > } > } > > > > The XAML is: > > xmlns="http://schemas.microsoft.com/client/2007" > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > Loaded="Page_Loaded" > > x:Class="EmbeddedWithCodeBehind.Page;assembly=ClientBin/EmbeddedWithCod > eBehind.dll" > Width="640" > Height="480" > Background="White" > > > > > > > > > Everything else is the default from an Orcas beta 2 new Silverlight > project. > > Anyone got any clues as to what is happening? > > Thanks > > Michael Foord > http://www.ironpython.info/ > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- A non-text attachment was scrubbed... Name: EmbeddedWithCodeBehind.zip Type: application/x-zip-compressed Size: 27231 bytes Desc: EmbeddedWithCodeBehind.zip URL: From fuzzyman at voidspace.org.uk Wed Sep 5 00:19:25 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 04 Sep 2007 23:19:25 +0100 Subject: [IronPython] [python] Re: Hosting IronPython in a Silverlight App In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A3283ED0EE424C@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <46DC7B54.1060205@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A3283ED0EE424C@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <46DDD9ED.7010209@voidspace.org.uk> Hello Jimmy, Thanks a lot for this. I'll have a play with it tonight. :-) Michael http://www.ironpython.info Jimmy Schementi wrote: > Michael, > > Thanks for bringing this to our attention! > > When hosting IronPython in a normal C# app, the Hosting API makes some assumptions for that scenario and makes the hosting work "out of the box". Those assumptions are not all true in Silverlight, so a custom Platform Adaptation Layer (PAL) must be used. > > I've attached a working version of your project to this email, and here's what it does different: > > Before you create the Python Engine: > > ScriptEnvironmentSetup setup = new ScriptEnvironmentSetup(true); > setup.PALType = typeof(SilverlightPAL); > ScriptEnvironment.Create(setup); > > This will override the default PAL the Silverlight PAL, which is defined here: > > // Definition of Silverlight Platform Adoption Layer: > public class SilverlightPAL : PlatformAdaptationLayer > { > public override Assembly LoadAssembly(string name) > { > return Assembly.Load(LookupFullName(name)); > } > > private Dictionary _assemblyFullNames = new Dictionary(); > > public SilverlightPAL() > { > LoadSilverlightAssemblyNameMapping(); > } > > // TODO: This will not be necessary as it will eventually move down into the host > private void LoadSilverlightAssemblyNameMapping() > { > AssemblyName clrAssembly = new AssemblyName(typeof(object).Assembly.FullName); > foreach (string asm in new string[] { "mscorlib", "System", "System.Core", "System.Xml.Core" }) > { > clrAssembly.Name = asm; > _assemblyFullNames.Add(asm.ToLower(), clrAssembly.FullName); > } > > _assemblyFullNames.Add("system.silverlight", "System.SilverLight, Version=1.0.0.0, PublicKeyToken=b03f5f7f11d50a3a"); > _assemblyFullNames.Add("agclr", "agclr, Version=0.0.0.0, PublicKeyToken=b03f5f7f11d50a3a"); > _assemblyFullNames.Add("microsoft.visualbasic", "Microsoft.VisualBasic, Version=8.1.0.0, PublicKeyToken=b03f5f7f11d50a3a"); > > AssemblyName dlrAssembly = new AssemblyName(typeof(PlatformAdaptationLayer).Assembly.FullName); > foreach (string asm in new string[] { > "Microsoft.Scripting", > "Microsoft.Scripting.Silverlight", > "IronPython", > "IronPython.Modules", > "Microsoft.JScript.Compiler", > "Microsoft.JScript.Runtime", > "Microsoft.VisualBasic.Compiler", > "Microsoft.VisualBasic.Scripting", > "Ruby"}) > { > dlrAssembly.Name = asm; > _assemblyFullNames.Add(asm.ToLower(), dlrAssembly.FullName); > } > } > > protected string LookupFullName(string name) > { > AssemblyName asm = new AssemblyName(name); > if (asm.Version != null || asm.GetPublicKeyToken() != null || asm.GetPublicKey() != null) > { > return name; > } > return _assemblyFullNames.ContainsKey(name.ToLower()) ? _assemblyFullNames[name.ToLower()] : name; > } > > } > > This allows for IronPython.Modules to be loaded by the host, which is the exception you were getting. > > This is *a lot* to get IronPython hosted in Silverlight! This work was done for the DLR/Silverlight integration effort, however simple hosting in Silverlight shouldn't be this hard. I wouldn't be surprised if we decided to move this bit into the DLR host. =) > > Let me know if you have any other questions, > > ~Jimmy > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Monday, September 03, 2007 2:24 PM >> To: Discussion of IronPython >> Subject: [IronPython] Hosting IronPython in a Silverlight App >> >> Hello all, >> >> I'm experimenting with hosting IronPython in a silverlight (1.1 alpha >> refresh) app. >> >> When I write C# code that uses the PythonEngine it works fine when >> access *from IronPython code*. >> >> If I use the same code as 'code behind', then it throws an exception >> "The method or operation is not implemented." >> >> (At the line "PythonEngine pe = PythonEngine.CurrentEngine;") >> >> The code is: >> >> using System; >> using System.Windows; >> using System.Windows.Controls; >> using System.Windows.Documents; >> using System.Windows.Ink; >> using System.Windows.Input; >> using System.Windows.Media; >> using System.Windows.Media.Animation; >> using System.Windows.Shapes; >> using IronPython.Hosting; >> using Microsoft.Scripting; >> >> namespace EmbeddedWithCodeBehind >> { >> public partial class Page : Canvas >> { >> public void Page_Loaded(object o, EventArgs e) >> { >> // Required to initialize variables >> InitializeComponent(); >> >> try >> { >> PythonEngine pe = PythonEngine.CurrentEngine; >> string code = "lambda x: x.upper()"; >> Function func = >> pe.EvaluateAs>(code); >> >> string x = "i'm talking loudly"; >> string result = func(x); >> textBlock.Text = result; >> } >> catch (Exception ex) >> { >> textBlock.Text = ex.Message; >> } >> >> } >> } >> } >> >> >> >> The XAML is: >> >> > xmlns="http://schemas.microsoft.com/client/2007" >> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >> Loaded="Page_Loaded" >> >> x:Class="EmbeddedWithCodeBehind.Page;assembly=ClientBin/EmbeddedWithCod >> eBehind.dll" >> Width="640" >> Height="480" >> Background="White" >> > >> >> >> >> >> >> >> Everything else is the default from an Orcas beta 2 new Silverlight >> project. >> >> Anyone got any clues as to what is happening? >> >> Thanks >> >> Michael Foord >> http://www.ironpython.info/ >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> ------------------------------------------------------------------------ From lo.maximo73 at gmail.com Wed Sep 5 13:31:52 2007 From: lo.maximo73 at gmail.com (luis cota) Date: Wed, 5 Sep 2007 07:31:52 -0400 Subject: [IronPython] ZipImport Implementation? Message-ID: <2e598d7f0709050431hde8420cpf340e1ae0b1ff9fd@mail.gmail.com> Does anyone have (or know of) a working zipimport implementation for IronPython? I'm trying to make use of the SQLObject library and need zipimport for this. Thanks! - Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Wed Sep 5 13:40:54 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 05 Sep 2007 12:40:54 +0100 Subject: [IronPython] [python] ZipImport Implementation? In-Reply-To: <2e598d7f0709050431hde8420cpf340e1ae0b1ff9fd@mail.gmail.com> References: <2e598d7f0709050431hde8420cpf340e1ae0b1ff9fd@mail.gmail.com> Message-ID: <46DE95C6.8040400@voidspace.org.uk> luis cota wrote: > Does anyone have (or know of) a working zipimport implementation for > IronPython? I'm trying to make use of the SQLObject library and need > zipimport for this. I've not heard of one, but if you are up for some hacking then Brett Cannon has done some work on rewriting the import machinery in pure Python and you can probably use parts of that. All the best, Michael Foord http://www.ironpython.info/ > > Thanks! > > - Luis > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From lo.maximo73 at gmail.com Wed Sep 5 15:25:31 2007 From: lo.maximo73 at gmail.com (luis cota) Date: Wed, 5 Sep 2007 09:25:31 -0400 Subject: [IronPython] sys.path_importer_cache (or another SQL abstraction library?) Message-ID: <2e598d7f0709050625p6adb5ce1x486fe1508eebf2c7@mail.gmail.com> So I've gotten around the zipimport requirement, though now I am running into this: sys.path_importer_cache does not exist in the default sys package. Is there a way I can get around this one? It appears when attempting to use the FormEncode module from standard python. Alternatively, perhaps you can suggest a good SQL abstraction library such as SQLObject that works with IronPython. Thanks, - Luis On 9/5/07, Michael Foord wrote: > > luis cota wrote: > > Does anyone have (or know of) a working zipimport implementation for > > IronPython? I'm trying to make use of the SQLObject library and need > > zipimport for this. > > I've not heard of one, but if you are up for some hacking then Brett > Cannon has done some work on rewriting the import machinery in pure > Python and you can probably use parts of that. > > All the best, > > Michael Foord > http://www.ironpython.info/ > > > > > Thanks! > > > > - Luis > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > 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: From nico.rauhut at web.de Wed Sep 5 19:17:40 2007 From: nico.rauhut at web.de (nico rauhut) Date: Wed, 5 Sep 2007 19:17:40 +0200 Subject: [IronPython] Compatibility of cPython Pickled Objects w/IronPython In-Reply-To: <469A6861.7040006@voidspace.org.uk> Message-ID: Hello, I have run a few tests passing values from cPython to IronPython (and back) using a pickled list (in order to integrate .NET-Components in Zope). Unfortunately the results were not as good as expected. The only protocol that seemed to be useful is version 0 of the pickle-module. Using this protocol I was able to pass a list including some floats, boolean and integer to IronPython, use these values in a .NET-class and return the result-values to cPython. Only strings made some difficulties (insecure string pickle). Protocol-version 1 doesn't work properly. Especially float-values make some trouble. When I unpickle my list in IronPython these values seemed to be adulterated (...hmm don?t know if this is the right word :) Protocol-version 2 seemed to be entire useless as I wasn?t able to unpickle my list in cPython. I tested the cPickle-module, too. But as expected the results were even worse. Are there any plans to improve the pickle-compatibility in future releases of IronPython? Has somebody else made some other experiences with Pickle/cPickle? Kindly regards, Nico Rauhut -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Michael Foord Gesendet: Sonntag, 15. Juli 2007 20:33 An: Discussion of IronPython Betreff: Re: [IronPython] Compatibility of cPython Pickled Objects w/IronPython M. David Peterson wrote: > As per the subject line, is there any reason why passing pickled > objects between cPython and IronPython wouldn't just work? Of course I > could just try and find out, but I hesitate to jump into unchartered > territory as (and I assume I am not alone in this) I have a tendency > to become infatuated with forcing things into submission when they > don't "just work", eating away an entire dev day or two in the process. > > Anyone care to help a brother save a couple dev days and a few strands > of hair? :D > > Thanks in advance! I haven't tried it, but they *should* be compatible. Pickle uses its own stack based language to write out objects - so for pure Python it should work fine. As pickle is a pure Python module which works (I'm pretty sure I tried it back in the past !?!) with IronPython, the semantics should be unchanged. Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml > > -- > /M:D > > M. David Peterson > http://mdavid.name | > http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 > ------------------------------------------------------------------------ > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From xmlhacker at gmail.com Wed Sep 5 21:12:50 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Wed, 5 Sep 2007 13:12:50 -0600 Subject: [IronPython] IronRuby and Ruby.NET Labor Day Weekend *HACKFEST* Extravaganza In-Reply-To: References: Message-ID: On 9/5/07, Mike Moore wrote: > > To save ourselves from the aforementioend *VERY BAD THINGS*, I think it > would be a good idea for all those serious about contributing to IronRuby in > any way to subscribe to the new ironruby-core mailing list: > > http://rubyforge.org/mailman/listinfo/ironruby-core Great! Thanks for the info, Mike! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Sep 5 22:32:24 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Sep 2007 13:32:24 -0700 Subject: [IronPython] Compatibility of cPython Pickled Objects w/IronPython In-Reply-To: References: <469A6861.7040006@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227C08674826B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I don't believe we are aware of these issues - there are a couple of bugs open against pickling but they seem to be around types we apparently don't support (xrange, re) and features we don't support in cPickle (persistent load support) and .NET interop (System.DateTime). Is there anything other than floats w/ protocol 1? Are the lists all the same in each version? W/ a little more detail we can open a bug and look at getting the issues fixed. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of nico rauhut Sent: Wednesday, September 05, 2007 10:18 AM To: 'Discussion of IronPython' Subject: Re: [IronPython] Compatibility of cPython Pickled Objects w/IronPython Hello, I have run a few tests passing values from cPython to IronPython (and back) using a pickled list (in order to integrate .NET-Components in Zope). Unfortunately the results were not as good as expected. The only protocol that seemed to be useful is version 0 of the pickle-module. Using this protocol I was able to pass a list including some floats, boolean and integer to IronPython, use these values in a .NET-class and return the result-values to cPython. Only strings made some difficulties (insecure string pickle). Protocol-version 1 doesn't work properly. Especially float-values make some trouble. When I unpickle my list in IronPython these values seemed to be adulterated (...hmm don't know if this is the right word :) Protocol-version 2 seemed to be entire useless as I wasn't able to unpickle my list in cPython. I tested the cPickle-module, too. But as expected the results were even worse. Are there any plans to improve the pickle-compatibility in future releases of IronPython? Has somebody else made some other experiences with Pickle/cPickle? Kindly regards, Nico Rauhut -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Michael Foord Gesendet: Sonntag, 15. Juli 2007 20:33 An: Discussion of IronPython Betreff: Re: [IronPython] Compatibility of cPython Pickled Objects w/IronPython M. David Peterson wrote: > As per the subject line, is there any reason why passing pickled > objects between cPython and IronPython wouldn't just work? Of course I > could just try and find out, but I hesitate to jump into unchartered > territory as (and I assume I am not alone in this) I have a tendency > to become infatuated with forcing things into submission when they > don't "just work", eating away an entire dev day or two in the process. > > Anyone care to help a brother save a couple dev days and a few strands > of hair? :D > > Thanks in advance! I haven't tried it, but they *should* be compatible. Pickle uses its own stack based language to write out objects - so for pure Python it should work fine. As pickle is a pure Python module which works (I'm pretty sure I tried it back in the past !?!) with IronPython, the semantics should be unchanged. Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml > > -- > /M:D > > M. David Peterson > http://mdavid.name | > http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 > ------------------------------------------------------------------------ > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Wed Sep 5 23:23:23 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 05 Sep 2007 22:23:23 +0100 Subject: [IronPython] Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) Message-ID: <46DF1E4B.4080901@voidspace.org.uk> Hello all, I'm having an issue using Silverlight controls (compiled assemblies) from C#. Something is going wrong with member name resolution and XAML interactions. I've had this with controls I've created myself, but it also happens with the sample controls project in the Silverlight 1.1 Refresh SDK. If you try adding a reference to the 'Button' class and using it from IronPython, then Silverlight bombs out with the following message: Exception Details: System.MissingMethodException: Event handler 'PulseStoryboardCompleted' is not defined PulseStoryBoardCompleted is setup in XAML (embedded as a resource in the assembly). This exception kills Silverlight - it cannot be caught at the IronPython level. To illustrate this, try the following IronPython code: import clr clr.AddReference("Silverlight.Samples.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null") from Silverlight.Samples.Controls import Button b = Button() Any suggestions as to a way round this ? All the best, Michael Foord http://www.ironpython.info/ From sanxiyn at gmail.com Thu Sep 6 11:03:34 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 6 Sep 2007 18:03:34 +0900 Subject: [IronPython] Unused files Message-ID: <5b0248170709060203m5af5539dr8232ab95a0522372@mail.gmail.com> Please consider removing following unused files from the repository so that they don't appear in the source code download. Microsoft.Scripting/Ast/TryFinallyStatement.cs Microsoft.Scripting/CheckedDictionaryEnumerator.cs Microsoft.Scripting/DictionaryUnionEnumerator.cs Microsoft.Scripting/Publisher.cs Microsoft.Scripting/Utils.cs Microsoft.Scripting/WeakHash.cs I know, they are already removed from the project file, but some people (including myself) prefer to use filesystem rather than XML file for the view of the project. -- Seo Sanghyeon From sanxiyn at gmail.com Thu Sep 6 11:26:45 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 6 Sep 2007 18:26:45 +0900 Subject: [IronPython] Compatibility of cPython Pickled Objects w/IronPython In-Reply-To: References: <469A6861.7040006@voidspace.org.uk> Message-ID: <5b0248170709060226p4fda23ccu3bdb99b7b0a7738a@mail.gmail.com> 2007/9/6, nico rauhut : > Protocol-version 1 doesn't work properly. Especially float-values make some > trouble. When I unpickle my list in IronPython these values seemed to be > adulterated (...hmm don't know if this is the right word :) I don't see this. Can you give a specific example? -- Seo Sanghyeon From davidjensen at usa.net Thu Sep 6 15:23:00 2007 From: davidjensen at usa.net (David Jensen) Date: Thu, 06 Sep 2007 09:23:00 -0400 Subject: [IronPython] ironpython as a scripting language for ms office Message-ID: <401LiFNwa9930S26.1189084980@cmsweb26.cms.usa.net> I have never used the old visual basic for ms office, so I do not know what it is like. I have a (2001?) book on Python for win 32. I have not used the code yet, but it says I can use python (2.1?) in, for example, ms word to put text into word, but I cannot change fonts, among other things. Does IronPython work to fully access ms office apps, like the old vb apparently worked in the old office (97?). If it does, does this require ms office 2007? (I have it) I am mostly interested mostly interested in modifying ms access tables.( I can do this outside access now with standard Python). A lot of people would be very pleased if they could use the language of their choice in ms office. I have vs 2005 standard, apparently I need vs 2005 office ($700) to do this. Can't I just run IronPython and forget vs 2005? I started in computers in the days when everything was command line, and I prefer that environment. Ms Office is much more powerful than trying to do things with tkinter or wx. David Jensen Apartment 412 414 West 120th Street New York, New York 10027 212-866-7094 646-245-2654 (cell) 206-984-4900 (fax to email) davidjensen at usa.net From nico.rauhut at web.de Thu Sep 6 19:18:49 2007 From: nico.rauhut at web.de (nico rauhut) Date: Thu, 6 Sep 2007 19:18:49 +0200 Subject: [IronPython] Compatibility of cPython PickledObjects w/IronPython In-Reply-To: <7AD436E4270DD54A94238001769C2227C08674826B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: I don't make any modifications to the list, so it should be the same: I pickle the list in cPython and pass the picklestring through a pipe to IronPython. In IronPython I unpickle the list, pickle it again and send it through a pipe back to the cPython-Process. In cPython the list is unpickled one more time. All states of the list are logged into logfiles. Checking the logfiles I saw that the float-value 12.45 changed in IronPython to 12.3542968750. Also the string looks a little bit strange after the list was unpickled in cPython. I use Python 2.4.4 and IronPython 1.1 on WinXP. Below the code I used: cPython: import os import pickle l = [5, 12.45, True, 'testString'] log = open("log_python.pkl", "wb") cin, cout = os.popen2("D:\Dev\IronPython-1.1\ipy.exe child_pickle.py", "b") pickledList = pickle.dumps(l, 1) log.write(pickledList) cin.write(pickledList) cin.close() pList = cout.read() log.write("\n") log.write(pList) myList = pickle.loads(pList) log.write("\n") for item in myList: log.write(str(item) + "\n") cout.close() log.close() IronPython: import pickle log = open("log_ipy.pkl", "wb") pList = sys.stdin.read() log.write(pList) myList = pickle.loads(pList) log.write("\n\n") for item in myList: log.write(str(item) + "\n") pResList = pickle.dumps(myList, 1) log.write("\n\n") log.write(pResList) sys.stdout.write(pResList) log.close() logfile log_python (without picklestrings): 5 12.45 1 testStringq logfile log_ipy (without picklestrings): 5 12.3542968750 True testString -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Dino Viehland Gesendet: Mittwoch, 5. September 2007 22:32 An: Discussion of IronPython Betreff: Re: [IronPython] Compatibility of cPython PickledObjects w/IronPython I don't believe we are aware of these issues - there are a couple of bugs open against pickling but they seem to be around types we apparently don't support (xrange, re) and features we don't support in cPickle (persistent load support) and .NET interop (System.DateTime). Is there anything other than floats w/ protocol 1? Are the lists all the same in each version? W/ a little more detail we can open a bug and look at getting the issues fixed. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of nico rauhut Sent: Wednesday, September 05, 2007 10:18 AM To: 'Discussion of IronPython' Subject: Re: [IronPython] Compatibility of cPython Pickled Objects w/IronPython Hello, I have run a few tests passing values from cPython to IronPython (and back) using a pickled list (in order to integrate .NET-Components in Zope). Unfortunately the results were not as good as expected. The only protocol that seemed to be useful is version 0 of the pickle-module. Using this protocol I was able to pass a list including some floats, boolean and integer to IronPython, use these values in a .NET-class and return the result-values to cPython. Only strings made some difficulties (insecure string pickle). Protocol-version 1 doesn't work properly. Especially float-values make some trouble. When I unpickle my list in IronPython these values seemed to be adulterated (...hmm don't know if this is the right word :) Protocol-version 2 seemed to be entire useless as I wasn't able to unpickle my list in cPython. I tested the cPickle-module, too. But as expected the results were even worse. Are there any plans to improve the pickle-compatibility in future releases of IronPython? Has somebody else made some other experiences with Pickle/cPickle? Kindly regards, Nico Rauhut -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Michael Foord Gesendet: Sonntag, 15. Juli 2007 20:33 An: Discussion of IronPython Betreff: Re: [IronPython] Compatibility of cPython Pickled Objects w/IronPython M. David Peterson wrote: > As per the subject line, is there any reason why passing pickled > objects between cPython and IronPython wouldn't just work? Of course I > could just try and find out, but I hesitate to jump into unchartered > territory as (and I assume I am not alone in this) I have a tendency > to become infatuated with forcing things into submission when they > don't "just work", eating away an entire dev day or two in the process. > > Anyone care to help a brother save a couple dev days and a few strands > of hair? :D > > Thanks in advance! I haven't tried it, but they *should* be compatible. Pickle uses its own stack based language to write out objects - so for pure Python it should work fine. As pickle is a pure Python module which works (I'm pretty sure I tried it back in the past !?!) with IronPython, the semantics should be unchanged. Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml > > -- > /M:D > > M. David Peterson > http://mdavid.name | > http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 > ------------------------------------------------------------------------ > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Thu Sep 6 19:36:18 2007 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 6 Sep 2007 10:36:18 -0700 Subject: [IronPython] Unused files In-Reply-To: <5b0248170709060203m5af5539dr8232ab95a0522372@mail.gmail.com> References: <5b0248170709060203m5af5539dr8232ab95a0522372@mail.gmail.com> Message-ID: Thanks for the report, Seo. Some of the files you reported are actually alredy gone, but the DictionaryEnumerators are still there. We moved them elsewhere in the tree and apparently didn't delete them from the old location. The change will go through soon. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Thursday, September 06, 2007 2:04 AM To: Discussion of IronPython Subject: [IronPython] Unused files Please consider removing following unused files from the repository so that they don't appear in the source code download. Microsoft.Scripting/Ast/TryFinallyStatement.cs Microsoft.Scripting/CheckedDictionaryEnumerator.cs Microsoft.Scripting/DictionaryUnionEnumerator.cs Microsoft.Scripting/Publisher.cs Microsoft.Scripting/Utils.cs Microsoft.Scripting/WeakHash.cs I know, they are already removed from the project file, but some people (including myself) prefer to use filesystem rather than XML file for the view of the project. -- Seo Sanghyeon _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ctrachte at gmail.com Thu Sep 6 22:25:44 2007 From: ctrachte at gmail.com (Carl Trachte) Date: Thu, 6 Sep 2007 13:25:44 -0700 Subject: [IronPython] ironpython as a scripting language for ms office In-Reply-To: <401LiFNwa9930S26.1189084980@cmsweb26.cms.usa.net> References: <401LiFNwa9930S26.1189084980@cmsweb26.cms.usa.net> Message-ID: <426ada670709061325j3a2414d3q14e8e7aadb9c653c@mail.gmail.com> I can't speak with any authority on the Dot Net Framework, but I was following this thread in the hopes of getting some pointers myself. I've used Mark Hammond's win32com module for years now and have had great luck automating Office apps with COM (Microsoft's Component Object Model). But, I had previously done the same thing with Visual Basic and VBA within Office apps, so the transition was easy once I learned how to generate python modules for the app in question (both Office and other COM enable apps). If you generate your own file with pymake (part of the win32 package), you should have access to the same functionality that you would inside the app (Word, for example) in VBA. I commonly open Excel or Word, bring up the VBA editor with the AltF11 combination, and browse the reference libraries for documentation on the objects I need to write my script in Python. It's not the most elegant programming environment, but it works for me. What little I know about the Dot Net framework suggests that you use a wrapper type class to COM provided within the framework (I forget the exact MS terminology). I don't know if anyone's been doing this from IronPython, but I would be surprised if someone hadn't at least tried. I'm using win32com for now, but I'd like to hear more about this too. My 2 cents. On 9/6/07, David Jensen wrote: > > I have never used the old visual basic for ms office, so I do not know > what it > is like. I have a (2001?) book on Python for win 32. I have not used the > code > yet, but it says I can use python (2.1?) in, for example, ms word to put > text > into word, but I cannot change fonts, among other things. Does IronPython > work to fully access ms office apps, like the old vb apparently worked in > the > old office (97?). If it does, does this require ms office 2007? (I have > it) > I am mostly interested mostly interested in modifying ms access tables.( I > can > do this outside access now with standard Python). A lot of people would be > very pleased if they could use the language of their choice in ms office. > I > have vs 2005 standard, apparently I need vs 2005 office ($700) to do this. > Can't I just run IronPython and forget vs 2005? I started in computers in > the > days when everything was command line, and I prefer that environment. Ms > Office is much more powerful than trying to do things with tkinter or wx. > > > David Jensen > Apartment 412 > 414 West 120th Street > New York, New York 10027 > 212-866-7094 > 646-245-2654 (cell) > 206-984-4900 (fax to email) > davidjensen at usa.net > > > > > _______________________________________________ > 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: From timr at probo.com Thu Sep 6 23:36:05 2007 From: timr at probo.com (Tim Roberts) Date: Thu, 06 Sep 2007 14:36:05 -0700 Subject: [IronPython] ironpython as a scripting language for ms office In-Reply-To: References: Message-ID: <46E072C5.1050905@probo.com> On Thu, 06 Sep 2007 09:23:00 -0400, "David Jensen" wrote: > I have never used the old visual basic for ms office, so I do not know what it > is like. I have a (2001?) book on Python for win 32. I have not used the code > yet, but it says I can use python (2.1?) in, for example, ms word to put text > into word, but I cannot change fonts, among other things. That's not true. You have the entire object model available to you. Once to have the Word application object, you can select text and apply styles to it. > Does IronPython work to fully access ms office apps, like the old vb apparently worked in the > old office (97?). Just to clarify things, the "old vb" did not work in the "old office". Office (even Office 2007) includes a thing called "Visual Basic for Applications", which is entirely separate from Visual Basic. VBA is similar to the old VB, but just different enough to be confusing. Office still does not use .NET natively, so IronPython won't integrate any more tightly than C#. It's all just COM object manipulation, and that's what you get from CPython as well. > I am mostly interested mostly interested in modifying ms access tables.( I can > do this outside access now with standard Python). And that is still the best way to manipulate Access databases. The Access application is a rather crude wrapper around the Jet database engine, which is completely functional without the Access application. > A lot of people would be > very pleased if they could use the language of their choice in ms office. Maybe some day, but it will take a new and very different version of Office, and it means all of those existing macros and scripts will have to be rewritten. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From ctrachte at gmail.com Fri Sep 7 00:09:58 2007 From: ctrachte at gmail.com (Carl Trachte) Date: Thu, 6 Sep 2007 15:09:58 -0700 Subject: [IronPython] ironpython as a scripting language for ms office In-Reply-To: <46E072C5.1050905@probo.com> References: <46E072C5.1050905@probo.com> Message-ID: <426ada670709061509o32ec1152h3a3cc9ca8f78cfb@mail.gmail.com> Tim, Thanks. One last thing that might be worth mentioning - "I prefer that environment. Ms Office is much more powerful than trying to do things with tkinter or wx." One thing I know can be done (I've witnessed it done interactively) is invoking Windows Forms through IronPython. If you want a nice GUI, this can be done natively with the language of your choice. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Fri Sep 7 02:32:47 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 7 Sep 2007 09:32:47 +0900 Subject: [IronPython] ironpython as a scripting language for ms office In-Reply-To: <426ada670709061325j3a2414d3q14e8e7aadb9c653c@mail.gmail.com> References: <401LiFNwa9930S26.1189084980@cmsweb26.cms.usa.net> <426ada670709061325j3a2414d3q14e8e7aadb9c653c@mail.gmail.com> Message-ID: <5b0248170709061732x7d5fc25ak436b11fcccc0940f@mail.gmail.com> 2007/9/7, Carl Trachte : > What little I know about the Dot Net framework suggests that you use a > wrapper type class to COM provided within the framework (I forget the exact > MS terminology). I don't know if anyone's been doing this from IronPython, > but I would be surprised if someone hadn't at least tried. > > I'm using win32com for now, but I'd like to hear more about this too. I think the exact terminology is RCW(Runtime Callable Wrapper). COM interoperation is well supported on IronPython, and IronPython Cookbook wiki has some good pages on the topic: http://www.ironpython.info/index.php/Contents#Interop -- Seo Sanghyeon From ctrachte at gmail.com Fri Sep 7 18:18:08 2007 From: ctrachte at gmail.com (Carl Trachte) Date: Fri, 7 Sep 2007 09:18:08 -0700 Subject: [IronPython] ironpython as a scripting language for ms office In-Reply-To: <5b0248170709061732x7d5fc25ak436b11fcccc0940f@mail.gmail.com> References: <401LiFNwa9930S26.1189084980@cmsweb26.cms.usa.net> <426ada670709061325j3a2414d3q14e8e7aadb9c653c@mail.gmail.com> <5b0248170709061732x7d5fc25ak436b11fcccc0940f@mail.gmail.com> Message-ID: <426ada670709070918q405e93c4vb54cd04a6d7aa431@mail.gmail.com> Thanks! This link is fantastic. I've bookmarked the cookbook. http://www.ironpython.info/index.php/Contents#Interop One recipe that deals explicitly with Excel is this one: http://www.ironpython.info/index.php/Interacting_with_Excel "Interop" was the word I had been looking for previously. This is one of the subheadings in the cookbook. I had been dragging my feet on using IronPython and dotNet instead of CPython, even when IronPython would have been more appropriate. The cookbook link lowers the barrier to entry considerably. Again, thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Fri Sep 7 22:30:00 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 7 Sep 2007 13:30:00 -0700 Subject: [IronPython] IronPython 2.0 Alpha 4 Released! Message-ID: <7AD436E4270DD54A94238001769C2227C0867485E7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Hello IronPython Community, We have just released IronPython 2.0 Alpha 4. This release is essentially another snapshot of the ongoing work with respect to IronPython 2.0 and the Dynamic Language Runtime. The most significant changes in this release include: * Completion of the -X:Interpret mode and its incorporation into the eval and exec functions * The addition of the -X:PreferComDispatch mode * Improved performance for the itertools module and the importing of CLR-based modules * A number of bug fixes Like previous Alpha releases, quite a bit of refactoring work has been completed and this process is still ongoing. In particular, effort has been put into making .NET interoperability easier for language implementers on the DLR. The -X:Interpret mode flag, previously named -X:FastEval, is the biggest change found in this release When you utilize this flag IronPython interprets the DLR AST directly rather than compiling it into IL and down to machine code. This makes the compilation process much faster while slowing down the execution speed of the resulting code. This is a particularly good tradeoff for code that will only be executed once which explains its default usage by the exec and eval functions. -X:PreferComDispatch enables direct support for IDispatch COM objects, and includes support for indexers and output parameters in IDispatch-based calls. This will improve IronPython's integration with IDispatch-based COM APIs such as in Microsoft Office. Some of the notable bug fixes included in this release are: * __iter__ is now available for all iterable .NET objects with the exception of System.String (CPython's string type does not support this) * isinstance now works on interfaces * fixed null reference exception when attempting to read a write-only (.NET) property * fixed invalid IL generated for Python code similar to 'System.IComparable.CompareTo(1,1)', Note: Again due to dependencies upon APIs that are not present in Silverlight 1.1 Alpha (released at MIX) you won't be able to re-build this release for use with Silverlight. As both products stabilize more we expect better compatibility between releases. You can download IronPython 2.0 Alpha 4 at: http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=6942 The Dynamic Language Runtime Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From jomes at microsoft.com Fri Sep 7 22:25:59 2007 From: jomes at microsoft.com (John Messerly) Date: Fri, 7 Sep 2007 13:25:59 -0700 Subject: [IronPython] Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) In-Reply-To: <46DF1E4B.4080901@voidspace.org.uk> References: <46DF1E4B.4080901@voidspace.org.uk> Message-ID: <918705E903F4714CB713D89AB5F1857D712D9F7E95@NA-EXMSG-C116.redmond.corp.microsoft.com> Sounds like a bug in XAML event binding... In the Silverlight 1.1 alpha, if the XAML contains an x:Code element, then the XAML parser will always go to DLR/IronPython for event hookup. That is to say, it will never use reflection to hook the event to a statically defined C# method. That is a known limitation. I thought this behavior was per-XAML file, but from what you're describing it sounds like it's per application. The only workaround I can think of would be to define a function in your Python code for that event ("PulseStoryboardCompleted"), and then from that function call into the "real" event handler. Hope this helps, John -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, September 05, 2007 2:23 PM To: Discussion of IronPython Subject: [IronPython] Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) Hello all, I'm having an issue using Silverlight controls (compiled assemblies) from C#. Something is going wrong with member name resolution and XAML interactions. I've had this with controls I've created myself, but it also happens with the sample controls project in the Silverlight 1.1 Refresh SDK. If you try adding a reference to the 'Button' class and using it from IronPython, then Silverlight bombs out with the following message: Exception Details: System.MissingMethodException: Event handler 'PulseStoryboardCompleted' is not defined PulseStoryBoardCompleted is setup in XAML (embedded as a resource in the assembly). This exception kills Silverlight - it cannot be caught at the IronPython level. To illustrate this, try the following IronPython code: import clr clr.AddReference("Silverlight.Samples.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null") from Silverlight.Samples.Controls import Button b = Button() Any suggestions as to a way round this ? All the best, Michael Foord http://www.ironpython.info/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Fri Sep 7 23:31:43 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 7 Sep 2007 14:31:43 -0700 Subject: [IronPython] Compatibility of cPython PickledObjects w/IronPython In-Reply-To: References: <7AD436E4270DD54A94238001769C2227C08674826B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227C08674863C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> This seems to be related to file I/O issues rather than Pickling - particularly the fact that the I/O is going through std-out / std-in. For example if I do: C:\Product\Released\IronPython-1.1 > cpy Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> import pickle >>> >>> l = [5, 12.45, True, 'testString'] >>> >>> pickledList = pickle.dumps(l, 1) >>> pickledList ']q\x00(K\x05G@(\xe6fffffI01\nU\ntestStringq\x01e.' >>> ^Z C:\Product\Released\IronPython-1.1 > .\ipy.exe IronPython 1.1 (1.1) on .NET 2.0.50727.1408 Copyright (c) Microsoft Corporation. All rights reserved. >>> import pickle >>> pickle.loads(']q\x00(K\x05G@(\xe6fffffI01\nU\ntestStringq\x01e.') [5, 12.45, True, 'testString'] I get the correct results. But I see the same odd behavior you do w/ the full repro. If I had a MessageBox.Show(repr(pList)) to child_pickle I get: ']q\x00(K\x05G@(\xb5fffffI01\nU\ntestStringq\x01e.' Vs: ']q\x00(K\x05G@(\xe6fffffI01\nU\ntestStringq\x01e.' As you can see the \xe6 byte has been replaced by the \xb5 byte - likely due to encoding issues (we open std-in w/ the default encoding of your console window). Is there any reason you need to do this through std out? I'm not actually entirely certain how we'd fix this - ultimately we need some encodings to be applied to the console input, maybe we could make a binary encoding. But that might break other scenarios where users are expecting to be able to input localized data. There does seem to be an interesting difference in the console behavior that deserves documentation though. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of nico rauhut Sent: Thursday, September 06, 2007 10:19 AM To: 'Discussion of IronPython' Subject: Re: [IronPython] Compatibility of cPython PickledObjects w/IronPython I don't make any modifications to the list, so it should be the same: I pickle the list in cPython and pass the picklestring through a pipe to IronPython. In IronPython I unpickle the list, pickle it again and send it through a pipe back to the cPython-Process. In cPython the list is unpickled one more time. All states of the list are logged into logfiles. Checking the logfiles I saw that the float-value 12.45 changed in IronPython to 12.3542968750. Also the string looks a little bit strange after the list was unpickled in cPython. I use Python 2.4.4 and IronPython 1.1 on WinXP. Below the code I used: cPython: import os import pickle l = [5, 12.45, True, 'testString'] log = open("log_python.pkl", "wb") cin, cout = os.popen2("D:\Dev\IronPython-1.1\ipy.exe child_pickle.py", "b") pickledList = pickle.dumps(l, 1) log.write(pickledList) cin.write(pickledList) cin.close() pList = cout.read() log.write("\n") log.write(pList) myList = pickle.loads(pList) log.write("\n") for item in myList: log.write(str(item) + "\n") cout.close() log.close() IronPython: import pickle log = open("log_ipy.pkl", "wb") pList = sys.stdin.read() log.write(pList) myList = pickle.loads(pList) log.write("\n\n") for item in myList: log.write(str(item) + "\n") pResList = pickle.dumps(myList, 1) log.write("\n\n") log.write(pResList) sys.stdout.write(pResList) log.close() logfile log_python (without picklestrings): 5 12.45 1 testStringq logfile log_ipy (without picklestrings): 5 12.3542968750 True testString -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Dino Viehland Gesendet: Mittwoch, 5. September 2007 22:32 An: Discussion of IronPython Betreff: Re: [IronPython] Compatibility of cPython PickledObjects w/IronPython I don't believe we are aware of these issues - there are a couple of bugs open against pickling but they seem to be around types we apparently don't support (xrange, re) and features we don't support in cPickle (persistent load support) and .NET interop (System.DateTime). Is there anything other than floats w/ protocol 1? Are the lists all the same in each version? W/ a little more detail we can open a bug and look at getting the issues fixed. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of nico rauhut Sent: Wednesday, September 05, 2007 10:18 AM To: 'Discussion of IronPython' Subject: Re: [IronPython] Compatibility of cPython Pickled Objects w/IronPython Hello, I have run a few tests passing values from cPython to IronPython (and back) using a pickled list (in order to integrate .NET-Components in Zope). Unfortunately the results were not as good as expected. The only protocol that seemed to be useful is version 0 of the pickle-module. Using this protocol I was able to pass a list including some floats, boolean and integer to IronPython, use these values in a .NET-class and return the result-values to cPython. Only strings made some difficulties (insecure string pickle). Protocol-version 1 doesn't work properly. Especially float-values make some trouble. When I unpickle my list in IronPython these values seemed to be adulterated (...hmm don't know if this is the right word :) Protocol-version 2 seemed to be entire useless as I wasn't able to unpickle my list in cPython. I tested the cPickle-module, too. But as expected the results were even worse. Are there any plans to improve the pickle-compatibility in future releases of IronPython? Has somebody else made some other experiences with Pickle/cPickle? Kindly regards, Nico Rauhut -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Michael Foord Gesendet: Sonntag, 15. Juli 2007 20:33 An: Discussion of IronPython Betreff: Re: [IronPython] Compatibility of cPython Pickled Objects w/IronPython M. David Peterson wrote: > As per the subject line, is there any reason why passing pickled > objects between cPython and IronPython wouldn't just work? Of course I > could just try and find out, but I hesitate to jump into unchartered > territory as (and I assume I am not alone in this) I have a tendency > to become infatuated with forcing things into submission when they > don't "just work", eating away an entire dev day or two in the process. > > Anyone care to help a brother save a couple dev days and a few strands > of hair? :D > > Thanks in advance! I haven't tried it, but they *should* be compatible. Pickle uses its own stack based language to write out objects - so for pure Python it should work fine. As pickle is a pure Python module which works (I'm pretty sure I tried it back in the past !?!) with IronPython, the semantics should be unchanged. Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml > > -- > /M:D > > M. David Peterson > http://mdavid.name | > http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 > ------------------------------------------------------------------------ > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From mbarnett at uniserve.com Sat Sep 8 11:42:05 2007 From: mbarnett at uniserve.com (Mitch Barnett) Date: Sat, 8 Sep 2007 02:42:05 -0700 Subject: [IronPython] ironpython as a scripting language for ms office In-Reply-To: References: Message-ID: <000001c7f1fc$842ef130$6700a8c0@valleyforge> Hi David, Have a look at the list of Primary Interop Assemblies (PIA's) for both versions of Office 2003 and 2007 at: http://msdn2.microsoft.com/en-us/library/15s06t57(VS.80).aspx You can install the PIA's from a redistributable package at: http://msdn2.microsoft.com/en-us/library/kh3965hw(VS.80).aspx You should be able to use IP to manipulate all the types in the assemblies just like you would from Visual Studio in C# using Visual Studio Tools for Office (VSTO) Hope that helps, Mitch http://softwareindustrialization.com From xmlhacker at gmail.com Sun Sep 9 07:27:57 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sat, 8 Sep 2007 23:27:57 -0600 Subject: [IronPython] IP2a4 and/or Mono Bug? > "no implementation for interface method Microsoft.Scripting.Types.ISuperDynamicObject::get_Dict() ..." Message-ID: As per the subject line, I was playing around with the MS.NET compiled IP2a4 bits on Mono 1.2.5 as well as 1.2.5./trunk/ r85523 (the latest bits as of a few hours ago) and came across the following two issues when running against the Axon/Kamaelia SimpleSwarm.py[1] test file, 1.2.5 > ** ERROR **: file metadata.c: line 950 (mono_metadata_decode_row): assertion failed: (res_size == count) 1.2.5./trunk/ r85523 > no implementation for interface method Microsoft.Scripting.Types.ISuperDynamicObject::get_Dict() in class IronPython.NewTypes.System.Object_1 --- [1] http://extf.googlecode.com/svn/vendor/IPCE-r6/SimpleSwarm.py --- I was going to come back to this tomorrow and begin to file bugs as, if, and where necessary but in the mean time if someone from MSFT could verify what seems to be the obvious -- that's there's "no implementation for interface method Microsoft.Scripting.Types.ISuperDynamicObject::get_Dict() in class IronPython.NewTypes.System.Object_1" as opposed to this being a Mono specific issue you could spare me the pain and suffering of having to fire up a Windows VM and test it for myself. That, or I could just get off my lazy a$$ and fire up the aforementioned VM myself, something of which I will do first thing A.M. unless, of course, someone beats me too it. ;-) :D Oh, and for what it's worth, the stack trace for both trial runs follows inline below. --- Mono 1.2.5 + MS.NET Compiled IP2a4 + SimpleSwarm.py --- m-david-petersons-computer:~/Projects/extf.googlecode.com/vendor/IronPython- 2.0A4 mdavid$ which mono /usr/bin/mono m-david-petersons-computer:~/Projects/extf.googlecode.com/vendor/IronPython- 2.0A4 mdavid$ mono -V Mono JIT compiler version 1.2.5 (tarball) Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC: Included Boehm (with typed GC) SIGSEGV: normal Architecture: x86 Disabled: none m-david-petersons-computer:~/Projects/extf.googlecode.com/vendor/IronPython- 2.0A4 mdavid$ mono ipy.exe ../IPCE-r6/SimpleSwarm.py ** ERROR **: file metadata.c: line 950 (mono_metadata_decode_row): assertion failed: (res_size == count) aborting... Stacktrace: at (wrapper managed-to-native) System.MonoType.GetFields_internal ( System.Reflection.BindingFlags,System.Type) <0x00004> at (wrapper managed-to-native) System.MonoType.GetFields_internal ( System.Reflection.BindingFlags,System.Type) <0xffffffff> at System.MonoType.GetFields (System.Reflection.BindingFlags) <0x00016> at System.Reflection.Emit.TypeBuilder.GetFields ( System.Reflection.BindingFlags) <0x00027> at System.Reflection.MonoGenericClass.initialize () <0x00093> at System.Reflection.MonoGenericClass.GetFields_impl ( System.Reflection.BindingFlags,System.Type) <0x00066> at System.Reflection.MonoGenericClass.GetFields ( System.Reflection.BindingFlags) <0x00082> at System.Type.GetFields () <0x00016> at Microsoft.Scripting.Actions.DynamicSiteHelpers.InitializeFields ( Microsoft.Scripting.CodeContext,System.Type,bool) <0x00020> at IronPython.Compiler.Generation.NewTypeMaker.GetNewType (string, IronPython.Runtime.Tuple,Microsoft.Scripting.IAttributesCollection) <0x00405> at IronPython.Runtime.Types.UserTypeBuilder.Build ( Microsoft.Scripting.CodeContext,string,IronPython.Runtime.Tuple, Microsoft.Scripting.IAttributesCollection) <0x00049> at IronPython.Runtime.Operations.PythonOps.MakeClass ( Microsoft.Scripting.CodeContext,string,object[],string,System.Delegate) <0x00325> at sets$mod_7.Initialize (Microsoft.Scripting.CodeContext) <0x0097f> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_object_CodeContext ( Microsoft.Scripting.CodeContext) <0xffffffff> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.CodeContext,bool) <0x00216> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext,bool) <0x0006a> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext) <0x00015> at Microsoft.Scripting.ScriptModule.Execute () <0x00093> at IronPython.Runtime.Importer.InitializeModule (string, Microsoft.Scripting.ScriptModule,bool) <0x00101> at IronPython.Runtime.Importer.LoadFromSourceUnit ( Microsoft.Scripting.Hosting.SourceUnit,string,string) <0x00046> at IronPython.Runtime.Importer.LoadModuleFromSource ( Microsoft.Scripting.CodeContext,string,string) <0x000ac> at IronPython.Runtime.Importer.ImportFromPath ( Microsoft.Scripting.CodeContext,string,string,IronPython.Runtime.List) <0x000de> at IronPython.Runtime.Importer.ImportTopAbsolute ( Microsoft.Scripting.CodeContext,string) <0x00156> at IronPython.Runtime.Importer.ImportModule ( Microsoft.Scripting.CodeContext,string,bool) <0x001cf> at IronPython.Runtime.Builtin.__import__ (Microsoft.Scripting.CodeContext,string,object,object,object) <0x000f4> at (wrapper dynamic-method) System.Object._stub_##2 (object[], Microsoft.Scripting.Actions.DynamicSite`6,Microsoft.Scripting.CodeContext ,object,string,Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`6.Invoke ( Microsoft.Scripting.CodeContext,object,string, Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0x00024> at IronPython.Runtime.Importer.Import (Microsoft.Scripting.CodeContext ,string,IronPython.Runtime.List) <0x0006c> at IronPython.Runtime.Operations.PythonOps.ImportTop ( Microsoft.Scripting.CodeContext,string) <0x00028> at Axon.util$mod_5.Initialize (Microsoft.Scripting.CodeContext) <0x000cf> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_object_CodeContext ( Microsoft.Scripting.CodeContext) <0xffffffff> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.CodeContext,bool) <0x00216> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext,bool) <0x0006a> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext) <0x00015> at Microsoft.Scripting.ScriptModule.Execute () <0x00093> at IronPython.Runtime.Importer.InitializeModule (string, Microsoft.Scripting.ScriptModule,bool) <0x00101> at IronPython.Runtime.Importer.LoadFromSourceUnit ( Microsoft.Scripting.Hosting.SourceUnit,string,string) <0x00046> at IronPython.Runtime.Importer.LoadModuleFromSource ( Microsoft.Scripting.CodeContext,string,string) <0x000ac> at IronPython.Runtime.Importer.ImportFromPath ( Microsoft.Scripting.CodeContext,string,string,IronPython.Runtime.List) <0x000de> at IronPython.Runtime.Importer.ImportTopRelative ( Microsoft.Scripting.CodeContext,string,string,IronPython.Runtime.List) <0x00022> at IronPython.Runtime.Importer.ImportModule ( Microsoft.Scripting.CodeContext,string,bool) <0x000ff> at IronPython.Runtime.Builtin.__import__ (Microsoft.Scripting.CodeContext,string,object,object,object) <0x000f4> at (wrapper dynamic-method) System.Object._stub_##2 (object[], Microsoft.Scripting.Actions.DynamicSite`6,Microsoft.Scripting.CodeContext ,object,string,Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`6.Invoke ( Microsoft.Scripting.CodeContext,object,string, Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0x00024> at IronPython.Runtime.Importer.Import (Microsoft.Scripting.CodeContext ,string,IronPython.Runtime.List) <0x0006c> at IronPython.Runtime.Operations.PythonOps.ImportWithNames ( Microsoft.Scripting.CodeContext,string,string[]) <0x0003c> at Axon.Component$mod_4.Initialize (Microsoft.Scripting.CodeContext) <0x000c4> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_object_CodeContext ( Microsoft.Scripting.CodeContext) <0xffffffff> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.CodeContext,bool) <0x00216> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext,bool) <0x0006a> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext) <0x00015> at Microsoft.Scripting.ScriptModule.Execute () <0x00093> at IronPython.Runtime.Importer.InitializeModule (string, Microsoft.Scripting.ScriptModule,bool) <0x00101> at IronPython.Runtime.Importer.LoadFromSourceUnit ( Microsoft.Scripting.Hosting.SourceUnit,string,string) <0x00046> at IronPython.Runtime.Importer.LoadModuleFromSource ( Microsoft.Scripting.CodeContext,string,string) <0x000ac> at IronPython.Runtime.Importer.ImportFromPath ( Microsoft.Scripting.CodeContext,string,string,IronPython.Runtime.List) <0x000de> at IronPython.Runtime.Importer.ImportTopRelative ( Microsoft.Scripting.CodeContext,string,string,IronPython.Runtime.List) <0x00022> at IronPython.Runtime.Importer.ImportModule ( Microsoft.Scripting.CodeContext,string,bool) <0x000ff> at IronPython.Runtime.Builtin.__import__ (Microsoft.Scripting.CodeContext,string,object,object,object) <0x000f4> at (wrapper dynamic-method) System.Object._stub_##2 (object[], Microsoft.Scripting.Actions.DynamicSite`6,Microsoft.Scripting.CodeContext ,object,string,Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`6.Invoke ( Microsoft.Scripting.CodeContext,object,string, Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0x00024> at IronPython.Runtime.Importer.Import (Microsoft.Scripting.CodeContext ,string,IronPython.Runtime.List) <0x0006c> at IronPython.Runtime.Operations.PythonOps.ImportTop ( Microsoft.Scripting.CodeContext,string) <0x00028> at Axon$mod_3.Initialize (Microsoft.Scripting.CodeContext) <0x0004b> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_object_CodeContext ( Microsoft.Scripting.CodeContext) <0xffffffff> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.CodeContext,bool) <0x00216> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext,bool) <0x0006a> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext) <0x00015> at Microsoft.Scripting.ScriptModule.Execute () <0x00093> at IronPython.Runtime.Importer.InitializeModule (string, Microsoft.Scripting.ScriptModule,bool) <0x00101> at IronPython.Runtime.Importer.LoadFromSourceUnit ( Microsoft.Scripting.Hosting.SourceUnit,string,string) <0x00046> at IronPython.Runtime.Importer.LoadModuleFromSource ( Microsoft.Scripting.CodeContext,string,string) <0x000ac> at IronPython.Runtime.Importer.LoadPackageFromSource ( Microsoft.Scripting.CodeContext,string,string) <0x0003c> at IronPython.Runtime.Importer.ImportFromPath ( Microsoft.Scripting.CodeContext,string,string,IronPython.Runtime.List) <0x0009f> at IronPython.Runtime.Importer.ImportTopAbsolute ( Microsoft.Scripting.CodeContext,string) <0x00156> at IronPython.Runtime.Importer.ImportModule ( Microsoft.Scripting.CodeContext,string,bool) <0x001cf> at IronPython.Runtime.Builtin.__import__ (Microsoft.Scripting.CodeContext,string,object,object,object) <0x000f4> at (wrapper dynamic-method) System.Object._stub_##2 (object[], Microsoft.Scripting.Actions.DynamicSite`6,Microsoft.Scripting.CodeContext ,object,string,Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`6.Invoke ( Microsoft.Scripting.CodeContext,object,string, Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0x00024> at IronPython.Runtime.Importer.Import (Microsoft.Scripting.CodeContext ,string,IronPython.Runtime.List) <0x0006c> at IronPython.Runtime.Operations.PythonOps.ImportTop ( Microsoft.Scripting.CodeContext,string) <0x00028> at __main__$mod_2.Initialize (Microsoft.Scripting.CodeContext) <0x0002a> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_object_CodeContext ( Microsoft.Scripting.CodeContext) <0xffffffff> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.CodeContext,bool) <0x00216> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext,bool) <0x0006a> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext) <0x00015> at Microsoft.Scripting.ScriptModule.Execute () <0x00093> at IronPython.Hosting.PythonCommandLine.RunFileWorker (string) <0x001dd> at IronPython.Hosting.PythonCommandLine.RunFile (string) <0x0007c> at Microsoft.Scripting.Shell.CommandLine.Run ( Microsoft.Scripting.Hosting.IScriptEngine,Microsoft.Scripting.Shell.IConsole ,Microsoft.Scripting.Shell.ConsoleOptions) <0x000f1> at Microsoft.Scripting.Hosting.ConsoleHost.RunCommandLine ( Microsoft.Scripting.OptionsParser) <0x001d8> at Microsoft.Scripting.Hosting.ConsoleHost.ExecuteInternal () <0x002d6> at Microsoft.Scripting.Hosting.ConsoleHost.Execute () <0x000be> at Microsoft.Scripting.Hosting.ConsoleHost.Run (string[]) <0x00129> at PythonConsoleHost.Main (string[]) <0x00030> at (wrapper runtime-invoke) PythonConsoleHost.runtime_invoke_int_string[] (object,intptr,intptr,intptr) <0xffffffff> Abort trap --- Mono 1.2.5./trunk/ r85523 + MS.NET Compiled IP2a4 + SimpleSwarm.py --- m-david-petersons-computer:~/Projects/extf.googlecode.com/vendor/IronPython- 2.0A4 mdavid$ ~/build/nuxleus/bin/mono -V Mono JIT compiler version 1.2.5 (/trunk/ r85523) Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC: Included Boehm (with typed GC) SIGSEGV: normal Notification: Thread + polling Architecture: x86 Disabled: none m-david-petersons-computer:~/Projects/extf.googlecode.com/vendor/IronPython- 2.0A4 mdavid$ ~/build/nuxleus/bin/mono ipy.exe../IPCE-r6/SimpleSwarm.py no implementation for interface method Microsoft.Scripting.Types.ISuperDynamicObject::get_Dict() in class IronPython.NewTypes.System.Object_1 no implementation for interface method Microsoft.Scripting.Types.ISuperDynamicObject::get_Dict() in class IronPython.NewTypes.System.Object_1 Stacktrace: at (wrapper managed-to-native) System.Reflection.MonoField.SetValueInternal (System.Reflection.FieldInfo,object,object) <0x00004> at (wrapper managed-to-native) System.Reflection.MonoField.SetValueInternal (System.Reflection.FieldInfo,object,object) <0xffffffff> at System.Reflection.MonoField.SetValue (object,object, System.Reflection.BindingFlags,System.Reflection.Binder, System.Globalization.CultureInfo) <0x00093> at System.Reflection.FieldInfo.SetValue (object,object) <0x00020> at Microsoft.Scripting.Actions.DynamicSiteHelpers.InitializeFields ( Microsoft.Scripting.CodeContext,System.Type,bool) <0x0015b> at IronPython.Compiler.Generation.NewTypeMaker.GetNewType (string, IronPython.Runtime.Tuple,Microsoft.Scripting.IAttributesCollection) <0x00405> at IronPython.Runtime.Types.UserTypeBuilder.Build ( Microsoft.Scripting.CodeContext,string,IronPython.Runtime.Tuple, Microsoft.Scripting.IAttributesCollection) <0x00049> at IronPython.Runtime.Operations.PythonOps.MakeClass ( Microsoft.Scripting.CodeContext,string,object[],string,System.Delegate) <0x00325> at sets$mod_7.Initialize (Microsoft.Scripting.CodeContext) <0x0097f> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_object_CodeContext ( Microsoft.Scripting.CodeContext) <0xffffffff> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.CodeContext,bool) <0x00216> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext,bool) <0x0006a> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext) <0x00015> at Microsoft.Scripting.ScriptModule.Execute () <0x00093> at IronPython.Runtime.Importer.InitializeModule (string, Microsoft.Scripting.ScriptModule,bool) <0x00101> at IronPython.Runtime.Importer.LoadFromSourceUnit ( Microsoft.Scripting.Hosting.SourceUnit,string,string) <0x00046> at IronPython.Runtime.Importer.LoadModuleFromSource ( Microsoft.Scripting.CodeContext,string,string) <0x000ac> at IronPython.Runtime.Importer.ImportFromPath ( Microsoft.Scripting.CodeContext,string,string,IronPython.Runtime.List) <0x000de> at IronPython.Runtime.Importer.ImportTopAbsolute ( Microsoft.Scripting.CodeContext,string) <0x00156> at IronPython.Runtime.Importer.ImportModule ( Microsoft.Scripting.CodeContext,string,bool) <0x001cf> at IronPython.Runtime.Builtin.__import__ (Microsoft.Scripting.CodeContext,string,object,object,object) <0x000f4> at (wrapper dynamic-method) System.Object._stub_##2 (object[], Microsoft.Scripting.Actions.DynamicSite`6,Microsoft.Scripting.CodeContext ,object,string,Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`6.Invoke ( Microsoft.Scripting.CodeContext,object,string, Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0x00024> at IronPython.Runtime.Importer.Import (Microsoft.Scripting.CodeContext ,string,IronPython.Runtime.List) <0x0006c> at IronPython.Runtime.Operations.PythonOps.ImportTop ( Microsoft.Scripting.CodeContext,string) <0x00028> at Axon.util$mod_5.Initialize (Microsoft.Scripting.CodeContext) <0x000cf> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_object_CodeContext ( Microsoft.Scripting.CodeContext) <0xffffffff> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.CodeContext,bool) <0x00216> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext,bool) <0x0006a> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext) <0x00015> at Microsoft.Scripting.ScriptModule.Execute () <0x00093> at IronPython.Runtime.Importer.InitializeModule (string, Microsoft.Scripting.ScriptModule,bool) <0x00101> at IronPython.Runtime.Importer.LoadFromSourceUnit ( Microsoft.Scripting.Hosting.SourceUnit,string,string) <0x00046> at IronPython.Runtime.Importer.LoadModuleFromSource ( Microsoft.Scripting.CodeContext,string,string) <0x000ac> at IronPython.Runtime.Importer.ImportFromPath ( Microsoft.Scripting.CodeContext,string,string,IronPython.Runtime.List) <0x000de> at IronPython.Runtime.Importer.ImportTopRelative ( Microsoft.Scripting.CodeContext,string,string,IronPython.Runtime.List) <0x00022> at IronPython.Runtime.Importer.ImportModule ( Microsoft.Scripting.CodeContext,string,bool) <0x000ff> at IronPython.Runtime.Builtin.__import__ (Microsoft.Scripting.CodeContext,string,object,object,object) <0x000f4> at (wrapper dynamic-method) System.Object._stub_##2 (object[], Microsoft.Scripting.Actions.DynamicSite`6,Microsoft.Scripting.CodeContext ,object,string,Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`6.Invoke ( Microsoft.Scripting.CodeContext,object,string, Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0x00024> at IronPython.Runtime.Importer.Import (Microsoft.Scripting.CodeContext ,string,IronPython.Runtime.List) <0x0006c> at IronPython.Runtime.Operations.PythonOps.ImportWithNames ( Microsoft.Scripting.CodeContext,string,string[]) <0x0003c> at Axon.Component$mod_4.Initialize (Microsoft.Scripting.CodeContext) <0x000c4> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_object_CodeContext ( Microsoft.Scripting.CodeContext) <0xffffffff> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.CodeContext,bool) <0x00216> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext,bool) <0x0006a> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext) <0x00015> at Microsoft.Scripting.ScriptModule.Execute () <0x00093> at IronPython.Runtime.Importer.InitializeModule (string, Microsoft.Scripting.ScriptModule,bool) <0x00101> at IronPython.Runtime.Importer.LoadFromSourceUnit ( Microsoft.Scripting.Hosting.SourceUnit,string,string) <0x00046> at IronPython.Runtime.Importer.LoadModuleFromSource ( Microsoft.Scripting.CodeContext,string,string) <0x000ac> at IronPython.Runtime.Importer.ImportFromPath ( Microsoft.Scripting.CodeContext,string,string,IronPython.Runtime.List) <0x000de> at IronPython.Runtime.Importer.ImportTopRelative ( Microsoft.Scripting.CodeContext,string,string,IronPython.Runtime.List) <0x00022> at IronPython.Runtime.Importer.ImportModule ( Microsoft.Scripting.CodeContext,string,bool) <0x000ff> at IronPython.Runtime.Builtin.__import__ (Microsoft.Scripting.CodeContext,string,object,object,object) <0x000f4> at (wrapper dynamic-method) System.Object._stub_##2 (object[], Microsoft.Scripting.Actions.DynamicSite`6,Microsoft.Scripting.CodeContext ,object,string,Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`6.Invoke ( Microsoft.Scripting.CodeContext,object,string, Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0x00024> at IronPython.Runtime.Importer.Import (Microsoft.Scripting.CodeContext ,string,IronPython.Runtime.List) <0x0006c> at IronPython.Runtime.Operations.PythonOps.ImportTop ( Microsoft.Scripting.CodeContext,string) <0x00028> at Axon$mod_3.Initialize (Microsoft.Scripting.CodeContext) <0x0004b> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_object_CodeContext ( Microsoft.Scripting.CodeContext) <0xffffffff> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.CodeContext,bool) <0x00216> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext,bool) <0x0006a> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext) <0x00015> at Microsoft.Scripting.ScriptModule.Execute () <0x00093> at IronPython.Runtime.Importer.InitializeModule (string, Microsoft.Scripting.ScriptModule,bool) <0x00101> at IronPython.Runtime.Importer.LoadFromSourceUnit ( Microsoft.Scripting.Hosting.SourceUnit,string,string) <0x00046> at IronPython.Runtime.Importer.LoadModuleFromSource ( Microsoft.Scripting.CodeContext,string,string) <0x000ac> at IronPython.Runtime.Importer.LoadPackageFromSource ( Microsoft.Scripting.CodeContext,string,string) <0x0003c> at IronPython.Runtime.Importer.ImportFromPath ( Microsoft.Scripting.CodeContext,string,string,IronPython.Runtime.List) <0x0009f> at IronPython.Runtime.Importer.ImportTopAbsolute ( Microsoft.Scripting.CodeContext,string) <0x00156> at IronPython.Runtime.Importer.ImportModule ( Microsoft.Scripting.CodeContext,string,bool) <0x001cf> at IronPython.Runtime.Builtin.__import__ (Microsoft.Scripting.CodeContext,string,object,object,object) <0x000f4> at (wrapper dynamic-method) System.Object._stub_##2 (object[], Microsoft.Scripting.Actions.DynamicSite`6,Microsoft.Scripting.CodeContext ,object,string,Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`6.Invoke ( Microsoft.Scripting.CodeContext,object,string, Microsoft.Scripting.IAttributesCollection, Microsoft.Scripting.IAttributesCollection,IronPython.Runtime.List) <0x00024> at IronPython.Runtime.Importer.Import (Microsoft.Scripting.CodeContext ,string,IronPython.Runtime.List) <0x0006c> at IronPython.Runtime.Operations.PythonOps.ImportTop ( Microsoft.Scripting.CodeContext,string) <0x00028> at __main__$mod_2.Initialize (Microsoft.Scripting.CodeContext) <0x0002a> at (wrapper delegate-invoke) System.MulticastDelegate.invoke_object_CodeContext ( Microsoft.Scripting.CodeContext) <0xffffffff> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.CodeContext,bool) <0x00216> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext,bool) <0x0006a> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.Scope, Microsoft.Scripting.ModuleContext) <0x00015> at Microsoft.Scripting.ScriptModule.Execute () <0x00093> at IronPython.Hosting.PythonCommandLine.RunFileWorker (string) <0x001dd> at IronPython.Hosting.PythonCommandLine.RunFile (string) <0x0007c> at Microsoft.Scripting.Shell.CommandLine.Run ( Microsoft.Scripting.Hosting.IScriptEngine,Microsoft.Scripting.Shell.IConsole ,Microsoft.Scripting.Shell.ConsoleOptions) <0x000f1> at Microsoft.Scripting.Hosting.ConsoleHost.RunCommandLine ( Microsoft.Scripting.OptionsParser) <0x001d8> at Microsoft.Scripting.Hosting.ConsoleHost.ExecuteInternal () <0x002d6> at Microsoft.Scripting.Hosting.ConsoleHost.Execute () <0x000be> at Microsoft.Scripting.Hosting.ConsoleHost.Run (string[]) <0x00129> at PythonConsoleHost.Main (string[]) <0x00030> at (wrapper runtime-invoke) PythonConsoleHost.runtime_invoke_int_string[] (object,intptr,intptr,intptr) <0xffffffff> Abort trap -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Sun Sep 9 07:34:39 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sat, 8 Sep 2007 23:34:39 -0600 Subject: [IronPython] Status of Nested Yield Support? Message-ID: As per the source of the issue mentioned in my previous post[1] my ultimate goal was to gain a deeper understanding of where things stood in regards to gaining support for nested yield statements and, as a result, a better idea of where things stand with gaining the ability to run Kamaelia and Kamaelia-based applications via IronPython. Can someone (Dino?) @ MSFT provide a quick status update? Thanks in advance! :D [1] http://lists.ironpython.com/pipermail/users-ironpython.com/2007-September/005530.html -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From textdirected at gmail.com Sun Sep 9 13:00:12 2007 From: textdirected at gmail.com (HEMMI, Shigeru) Date: Sun, 9 Sep 2007 20:00:12 +0900 Subject: [IronPython] Let me know how to make exe on IronPython2.0 with Pyc.py. Message-ID: Hello all, Let me know how to make exe on IronPython2.0 with Pyc.py. What I experienced was:: .?ipy.exe Pyc.py /target:exe /main:hello.py (snip) AttributeError: 'module' object had no attribute 'CompilerSink' Regards, From nico.rauhut at web.de Sun Sep 9 13:18:35 2007 From: nico.rauhut at web.de (nico rauhut) Date: Sun, 9 Sep 2007 13:18:35 +0200 Subject: [IronPython] Compatibility ofcPython PickledObjects w/IronPython In-Reply-To: <7AD436E4270DD54A94238001769C2227C08674863C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Hmm I thought if I open the pipes in binary-mode encoding/decoding-issues will not make any trouble. There is no particularly reason for me using pipes / stdout. I only need an IPC-mechanism between cPython an IronPython. Since I am really new to IPC (as well as to cPython and IronPython), Pipes were the first idea I had. Now I have run a few tests using sockets for IPC and implemented my application in this way. It seems that every protocol-version works accurate. That's really great :) Thanks for your help! ..and sorry if I have caused confusion. Kindly regards, Nico -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Dino Viehland Gesendet: Freitag, 7. September 2007 23:32 An: Discussion of IronPython Betreff: Re: [IronPython] Compatibility ofcPython PickledObjects w/IronPython This seems to be related to file I/O issues rather than Pickling - particularly the fact that the I/O is going through std-out / std-in. For example if I do: C:\Product\Released\IronPython-1.1 > cpy Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> import pickle >>> >>> l = [5, 12.45, True, 'testString'] >>> >>> pickledList = pickle.dumps(l, 1) >>> pickledList ']q\x00(K\x05G@(\xe6fffffI01\nU\ntestStringq\x01e.' >>> ^Z C:\Product\Released\IronPython-1.1 > .\ipy.exe IronPython 1.1 (1.1) on .NET 2.0.50727.1408 Copyright (c) Microsoft Corporation. All rights reserved. >>> import pickle >>> pickle.loads(']q\x00(K\x05G@(\xe6fffffI01\nU\ntestStringq\x01e.') [5, 12.45, True, 'testString'] I get the correct results. But I see the same odd behavior you do w/ the full repro. If I had a MessageBox.Show(repr(pList)) to child_pickle I get: ']q\x00(K\x05G@(\xb5fffffI01\nU\ntestStringq\x01e.' Vs: ']q\x00(K\x05G@(\xe6fffffI01\nU\ntestStringq\x01e.' As you can see the \xe6 byte has been replaced by the \xb5 byte - likely due to encoding issues (we open std-in w/ the default encoding of your console window). Is there any reason you need to do this through std out? I'm not actually entirely certain how we'd fix this - ultimately we need some encodings to be applied to the console input, maybe we could make a binary encoding. But that might break other scenarios where users are expecting to be able to input localized data. There does seem to be an interesting difference in the console behavior that deserves documentation though. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of nico rauhut Sent: Thursday, September 06, 2007 10:19 AM To: 'Discussion of IronPython' Subject: Re: [IronPython] Compatibility of cPython PickledObjects w/IronPython I don't make any modifications to the list, so it should be the same: I pickle the list in cPython and pass the picklestring through a pipe to IronPython. In IronPython I unpickle the list, pickle it again and send it through a pipe back to the cPython-Process. In cPython the list is unpickled one more time. All states of the list are logged into logfiles. Checking the logfiles I saw that the float-value 12.45 changed in IronPython to 12.3542968750. Also the string looks a little bit strange after the list was unpickled in cPython. I use Python 2.4.4 and IronPython 1.1 on WinXP. Below the code I used: cPython: import os import pickle l = [5, 12.45, True, 'testString'] log = open("log_python.pkl", "wb") cin, cout = os.popen2("D:\Dev\IronPython-1.1\ipy.exe child_pickle.py", "b") pickledList = pickle.dumps(l, 1) log.write(pickledList) cin.write(pickledList) cin.close() pList = cout.read() log.write("\n") log.write(pList) myList = pickle.loads(pList) log.write("\n") for item in myList: log.write(str(item) + "\n") cout.close() log.close() IronPython: import pickle log = open("log_ipy.pkl", "wb") pList = sys.stdin.read() log.write(pList) myList = pickle.loads(pList) log.write("\n\n") for item in myList: log.write(str(item) + "\n") pResList = pickle.dumps(myList, 1) log.write("\n\n") log.write(pResList) sys.stdout.write(pResList) log.close() logfile log_python (without picklestrings): 5 12.45 1 testStringq logfile log_ipy (without picklestrings): 5 12.3542968750 True testString -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Dino Viehland Gesendet: Mittwoch, 5. September 2007 22:32 An: Discussion of IronPython Betreff: Re: [IronPython] Compatibility of cPython PickledObjects w/IronPython I don't believe we are aware of these issues - there are a couple of bugs open against pickling but they seem to be around types we apparently don't support (xrange, re) and features we don't support in cPickle (persistent load support) and .NET interop (System.DateTime). Is there anything other than floats w/ protocol 1? Are the lists all the same in each version? W/ a little more detail we can open a bug and look at getting the issues fixed. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of nico rauhut Sent: Wednesday, September 05, 2007 10:18 AM To: 'Discussion of IronPython' Subject: Re: [IronPython] Compatibility of cPython Pickled Objects w/IronPython Hello, I have run a few tests passing values from cPython to IronPython (and back) using a pickled list (in order to integrate .NET-Components in Zope). Unfortunately the results were not as good as expected. The only protocol that seemed to be useful is version 0 of the pickle-module. Using this protocol I was able to pass a list including some floats, boolean and integer to IronPython, use these values in a .NET-class and return the result-values to cPython. Only strings made some difficulties (insecure string pickle). Protocol-version 1 doesn't work properly. Especially float-values make some trouble. When I unpickle my list in IronPython these values seemed to be adulterated (...hmm don't know if this is the right word :) Protocol-version 2 seemed to be entire useless as I wasn't able to unpickle my list in cPython. I tested the cPickle-module, too. But as expected the results were even worse. Are there any plans to improve the pickle-compatibility in future releases of IronPython? Has somebody else made some other experiences with Pickle/cPickle? Kindly regards, Nico Rauhut -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Michael Foord Gesendet: Sonntag, 15. Juli 2007 20:33 An: Discussion of IronPython Betreff: Re: [IronPython] Compatibility of cPython Pickled Objects w/IronPython M. David Peterson wrote: > As per the subject line, is there any reason why passing pickled > objects between cPython and IronPython wouldn't just work? Of course I > could just try and find out, but I hesitate to jump into unchartered > territory as (and I assume I am not alone in this) I have a tendency > to become infatuated with forcing things into submission when they > don't "just work", eating away an entire dev day or two in the process. > > Anyone care to help a brother save a couple dev days and a few strands > of hair? :D > > Thanks in advance! I haven't tried it, but they *should* be compatible. Pickle uses its own stack based language to write out objects - so for pure Python it should work fine. As pickle is a pure Python module which works (I'm pretty sure I tried it back in the past !?!) with IronPython, the semantics should be unchanged. Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml > > -- > /M:D > > M. David Peterson > http://mdavid.name | > http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 > ------------------------------------------------------------------------ > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From andy.sy at neotitans.com Sun Sep 9 15:20:44 2007 From: andy.sy at neotitans.com (Andy Sy) Date: Sun, 09 Sep 2007 21:20:44 +0800 Subject: [IronPython] Managed DirectX via IronPython tutorials Message-ID: <46E3F32C.1000807@neotitans.com> My 3-part tutorial for how to use MDX via IronPython is now finally up. The problem with the IronPython / MDX tutorials I've seen out there (including the one that comes with IronPython) are that they all rely on MDX 2.0 for which the DLLs have already time-bombed and no longer work, thus a return to MDX 1.1 is necessary [1]. Part 1 deals with how to properly import the MDX 1.1 assemblies in case the assemblies for MDX 2.0 lying around on your system: http://neotitans.com/resources/mdx-ironpython-1.html Part 2 shows you how to interact with a Direct3D device while you are on the IronPython command line: http://neotitans.com/resources/mdx-ironpython-2.html Part 3 shows you how to use the D3DX Sprite class to display and animate alpha-blended sprites: http://neotitans.com/resources/mdx-ironpython-3.html [1] MDX 1.1 actually encapsulates a good chunk of DirectX 9 functionality and will be around for a long long time, so relying on it is not something to worry about. Additionally, XNA, the replacement for MDX 2.0 has some annoyances associated with it as outlined below: http://slimdx.mdxinfo.com/wiki/index.php ------------------------ http://www.neotitans.com IT and Web Consulting From xmlhacker at gmail.com Sun Sep 9 16:20:03 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sun, 9 Sep 2007 08:20:03 -0600 Subject: [IronPython] IP2a4 and/or Mono Bug? > "no implementation for interface method Microsoft.Scripting.Types.ISuperDynamicObject::get_Dict() ..." In-Reply-To: References: Message-ID: On 9/8/07, M. David Peterson wrote: > > > I was going to come back to this tomorrow and begin to file bugs as, if, > and where necessary but in the mean time if someone from MSFT could verify > what seems to be the obvious -- that's there's "no implementation for > interface method Microsoft.Scripting.Types.ISuperDynamicObject::get_Dict() > in class IronPython.NewTypes.System.Object_1" as opposed to this being a > Mono specific issue you could spare me the pain and suffering of having to > fire up a Windows VM and test it for myself. Oddly enough (well it seems odd to me, anyway) the problem I am currently encountering with IPY2a4 on Windows is, PS C:\Users\m.david\Projects\IronPython-2.0A4> .\ipy.exe SimpleSwarm.py > Traceback (most recent call last): > File SimpleSwarm.py, line 27, in Initialize > File , line 0, in _stub_##2 > ImportError: No module named likefile > So it seems that the subject line issue is specific to Mono. Will re-build from source to see if that helps, but in the mean time: A quick Google for 'likefile.py' turns up some IRC logs that may help pinpoint this issue to something specific to Windows that happens with cPython as well. Once I return from b-fast I plan to hit up the Kamaelia IRC channel to see if I can get to the bottom of this, but wanted to quickly update this thread with the above info. Will update again once more info is available. -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Sun Sep 9 18:23:27 2007 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sun, 9 Sep 2007 09:23:27 -0700 Subject: [IronPython] Status of Nested Yield Support? In-Reply-To: References: Message-ID: Nested yields (a.k.a. yields occurring in a more than one nested try blocks) are supported in IronPython 2.0 alpha releases. Martin From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of M. David Peterson Sent: Saturday, September 08, 2007 10:35 PM To: Discussion of IronPython Cc: kamaelia-list at lists.sourceforge.net Subject: [IronPython] Status of Nested Yield Support? As per the source of the issue mentioned in my previous post[1] my ultimate goal was to gain a deeper understanding of where things stood in regards to gaining support for nested yield statements and, as a result, a better idea of where things stand with gaining the ability to run Kamaelia and Kamaelia-based applications via IronPython. Can someone (Dino?) @ MSFT provide a quick status update? Thanks in advance! :D [1] http://lists.ironpython.com/pipermail/users-ironpython.com/2007-September/005530.html -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Sun Sep 9 18:31:12 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sun, 9 Sep 2007 10:31:12 -0600 Subject: [IronPython] IP2a4 and/or Mono Bug? > "no implementation for interface method Microsoft.Scripting.Types.ISuperDynamicObject::get_Dict() ..." In-Reply-To: References: Message-ID: On 9/9/07, M. David Peterson wrote: > > > Will update again once more info is available. > So I incur the same problems with cPython on Linux as I do with IronPython 2.0 a4 on Windows so it seems it's more about user error in the way I have things setup than it is a specific problem with IP. That said, the results of the Axon and Kamaelia tests run against IP2a4 are located @ http://extf.googlecode.com/svn/vendor/IronPython-2.0A4/Axon-Kamaelia_TestReults.txt -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Sun Sep 9 18:46:29 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sun, 9 Sep 2007 10:46:29 -0600 Subject: [IronPython] [Kamaelia-list] Status of Nested Yield Support? In-Reply-To: References: Message-ID: Hi Martin, On 9/9/07, Martin Maly wrote: > > Nested yields (a.k.a. yields occurring in a more than one nested try > blocks) are supported in IronPython 2.0 alpha releases. > Nice! I just ran a quick test and verified things are now working as they should be. Did this make it into the alpha 3 release or is this new to alpha 4? To be honest, I didn't check when a3 came out as Dino had mentioned he didn't think it would make into that release. Guess I should have checked, but regardless, thanks for getting this handled so quickly! *VERY* much appreciated! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Sun Sep 9 19:18:46 2007 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sun, 9 Sep 2007 10:18:46 -0700 Subject: [IronPython] [Kamaelia-list] Status of Nested Yield Support? In-Reply-To: References: Message-ID: Alpha 3 (and I am pretty sure even Alpha 2) include the nested yields implementation. Martin From: M. David Peterson [mailto:xmlhacker at gmail.com] Sent: Sunday, September 09, 2007 9:46 AM To: Martin Maly Cc: Discussion of IronPython; kamaelia-list at lists.sourceforge.net Subject: Re: [Kamaelia-list] [IronPython] Status of Nested Yield Support? Hi Martin, On 9/9/07, Martin Maly > wrote: Nested yields (a.k.a. yields occurring in a more than one nested try blocks) are supported in IronPython 2.0 alpha releases. Nice! I just ran a quick test and verified things are now working as they should be. Did this make it into the alpha 3 release or is this new to alpha 4? To be honest, I didn't check when a3 came out as Dino had mentioned he didn't think it would make into that release. Guess I should have checked, but regardless, thanks for getting this handled so quickly! *VERY* much appreciated! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Sun Sep 9 21:31:04 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sun, 9 Sep 2007 13:31:04 -0600 Subject: [IronPython] [Kamaelia-list] Status of Nested Yield Support? In-Reply-To: References: Message-ID: On 9/9/07, Martin Maly wrote: > > Alpha 3 (and I am pretty sure even Alpha 2) include the nested yields > implementation. > Yikes! I guess I need to pay better attention. :) On a related note, two things, 1) Any chance someone @MSFT could updated the issue tracker @ http://www.codeplex.com/IronPython/WorkItem/AdvancedList.aspx 2) Thanks for listening to the requests of the community and following through with the delivery of this feature! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Sep 10 14:35:22 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 10 Sep 2007 13:35:22 +0100 Subject: [IronPython] IronPython in Action Book: Early Access Message-ID: <46E53A0A.9070607@voidspace.org.uk> Hello all, Just in case you didn't spot it through 'the usual channels', the first part of "IronPython in Action" is now available via Manning's early access program: http://www.voidspace.org.uk/python/weblog/arch_d7_2007_09_08.shtml#e819 http://www.manning.com/foord The first chapter is free to download, but you'll have to sign up for early access to read the other chapters that are already done. Chapter 5 is also complete, but still making its way 'through the system', and should appear in early access soon... An anonymous source stated that this book is 'a ripping yarn', and another hailed the author as 'the shakespeare of geek', so highly recommended. ;-) Michael Foord http://www.ironpython.info/ From xmlhacker at gmail.com Mon Sep 10 15:19:54 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Mon, 10 Sep 2007 07:19:54 -0600 Subject: [IronPython] IronPython in Action Book: Early Access In-Reply-To: <46E53A0A.9070607@voidspace.org.uk> References: <46E53A0A.9070607@voidspace.org.uk> Message-ID: On 9/10/07, Michael Foord wrote: > > Hello all, > > Just in case you didn't spot it through 'the usual channels', I did notice, but didn't have a chance to congratulate you on your success! As such, congratulations Michael! An anonymous source stated that this book is 'a ripping yarn', and > another hailed the author as 'the shakespeare of geek', so highly > recommended. ;-) Nice! Of course others, including you, might disagree but personally I like the sound of 'Fuzzyspeare" :D -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Mon Sep 10 18:36:59 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 10 Sep 2007 09:36:59 -0700 Subject: [IronPython] [Kamaelia-list] Status of Nested Yield Support? In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227C086748785@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Me too ? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of M. David Peterson Sent: Sunday, September 09, 2007 12:31 PM To: Martin Maly Cc: kamaelia-list at lists.sourceforge.net; Discussion of IronPython Subject: Re: [IronPython] [Kamaelia-list] Status of Nested Yield Support? On 9/9/07, Martin Maly > wrote: Alpha 3 (and I am pretty sure even Alpha 2) include the nested yields implementation. Yikes! I guess I need to pay better attention. :) On a related note, two things, 1) Any chance someone @MSFT could updated the issue tracker @ http://www.codeplex.com/IronPython/WorkItem/AdvancedList.aspx 2) Thanks for listening to the requests of the community and following through with the delivery of this feature! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Mon Sep 10 19:31:27 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Mon, 10 Sep 2007 11:31:27 -0600 Subject: [IronPython] Test Results: IronPython 2.0 Alpha 3/4, Kamaelia, Nested Yields, MS.NET and Mono 1.2.5./trunk/ r85570 Message-ID: I'll be filing a proper bug report to Mono Bugzilla shortly, but in follow-up to a conversation Michael Sparks and I had in #kamaelia earlier this morning the following is the result of running a simple test on IronPython 2.0 Alpha 4 on Windows and Alpha 3 and 4 on Mono 1.2.5./trunk/r85570. Firstly, on MS.NET/IP2a4, which works as would be expected, >>> class microprocess(object): ... def __init__(self): ... super(microprocess, self).__init__() ... def main(self): #<--- Look its here!!! ... yield 1 ... >>> class printer(microprocess): ... def __init__(self, tag): ... super(printer, self).__init__() ... self.tag = tag ... def main(self): ... while 1: ... yield 1 # Must be a generator ... print self.tag ... >>> X = printer("Hello World") >>> Secondly on Mono 1.2.5./trunk/ r85570 and the stock IP2a4 (there's a compilation error at the moment with the same mentioned Mono SVN version) m-david-petersons-computer:~/Projects/extf.googlecode.com/vendor/IronPython- 2.0A4 mdavid$ mono -V Mono JIT compiler version 1.2.5 (/trunk/ r85570) Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC: Included Boehm (with typed GC) SIGSEGV: normal Notification: Thread + polling Architecture: x86 Disabled: none m-david-petersons-computer:~/Projects/extf.googlecode.com/vendor/IronPython- 2.0A4 mdavid$ mono ipy.exe -X:TabCompletion -X:ColorfulConsole IronPython console: IronPython 2.0A4 (2.0.10904.02) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class microprocess(object): ... def __init__(self): ... super(microprocess, self).__init__() ... def main(self): #<--- Look its here!!! ... yield 1 ... >>> class printer(microprocess): ... def __init__(self, tag): ... super(printer, self).__init__() ... self.tag = tag ... def main(self): ... while 1: ... yield 1 # Must be a generator ... print self.tag ... >>> X = printer("Hello World") ** ERROR **: file mini.c: line 4020 (mono_method_to_ir): assertion failed: (!sig->has_type_parameters) aborting... Stacktrace: at IronPython.NewTypes.System.Object_1.GetRule ( Microsoft.Scripting.Actions.Action,Microsoft.Scripting.CodeContext,object[]) <0xffffffff> at IronPython.NewTypes.System.Object_1.GetRule ( Microsoft.Scripting.Actions.Action,Microsoft.Scripting.CodeContext,object[]) <0x00017> at Microsoft.Scripting.Actions.ActionBinder.GetRule ( Microsoft.Scripting.CodeContext,Microsoft.Scripting.Actions.Action,object[]) <0x00108> at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke ( Microsoft.Scripting.CodeContext,object,object) <0x00162> at UninitializedTargetHelper`7.Invoke2 ( Microsoft.Scripting.Actions.DynamicSite`3,Microsoft.Scripting.CodeContext,object,object) <0x00019> at Microsoft.Scripting.Actions.DynamicSite`3.Invoke ( Microsoft.Scripting.CodeContext,object,object) <0x0001e> at (wrapper dynamic-method) System.Object.__init__$5##17 (object[], Microsoft.Scripting.CodeContext,object,object) <0xffffffff> at (wrapper dynamic-method) System.Object._stub_##23 (object[], Microsoft.Scripting.Actions.DynamicSite`4,Microsoft.Scripting.CodeContext,object,object,string) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`4.UpdateBindingAndInvoke ( Microsoft.Scripting.CodeContext,object,object,string) <0x00282> at UninitializedTargetHelper`7.Invoke3 ( Microsoft.Scripting.Actions.DynamicSite`4,Microsoft.Scripting.CodeContext,object,object,string) <0x0001f> at Microsoft.Scripting.Actions.DynamicSite`4.Invoke ( Microsoft.Scripting.CodeContext,object,object,string) <0x00021> at (wrapper dynamic-method) System.Object._stub_##22 (object[], Microsoft.Scripting.Actions.DynamicSite`3,Microsoft.Scripting.CodeContext,object,string) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke ( Microsoft.Scripting.CodeContext,object,string) <0x00252> at UninitializedTargetHelper`7.Invoke2 ( Microsoft.Scripting.Actions.DynamicSite`3,Microsoft.Scripting.CodeContext,object,string) <0x00019> at Microsoft.Scripting.Actions.DynamicSite`3.Invoke ( Microsoft.Scripting.CodeContext,object,string) <0x0001e> at (wrapper dynamic-method) System.Object._stub_##21 (object[], Microsoft.Scripting.Actions.DynamicSite`3,Microsoft.Scripting.CodeContext,object,string) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke ( Microsoft.Scripting.CodeContext,object,string) <0x00252> at UninitializedTargetHelper`7.Invoke2 ( Microsoft.Scripting.Actions.DynamicSite`3,Microsoft.Scripting.CodeContext,object,string) <0x00019> at Microsoft.Scripting.Actions.DynamicSite`3.Invoke ( Microsoft.Scripting.CodeContext,object,string) <0x0001e> at (wrapper dynamic-method) System.Object.##20 (object[], Microsoft.Scripting.CodeContext) <0xffffffff> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.CodeContext,bool) <0x00232> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.ScriptModule) <0x00087> at Microsoft.Scripting.Hosting.CompiledCode.Evaluate ( Microsoft.Scripting.IScriptModule) <0x00068> at Microsoft.Scripting.Hosting.ScriptEngine.ExecuteInteractiveCode(string, Microsoft.Scripting.IScriptModule) <0x00038> at Microsoft.Scripting.Hosting.ScriptEngine.ExecuteCommand (string, Microsoft.Scripting.IScriptModule) <0x00140> at Microsoft.Scripting.Shell.CommandLine.RunOneInteraction () <0x000c4> at Microsoft.Scripting.Shell.CommandLine.TryInteractiveAction () <0x00032> at IronPython.Hosting.PythonCommandLine.TryInteractiveAction () <0x00023> at Microsoft.Scripting.Shell.CommandLine.RunInteractiveLoop () <0x00094> at IronPython.Hosting.PythonCommandLine.RunInteractive () <0x0009c> at Microsoft.Scripting.Shell.CommandLine.Run ( Microsoft.Scripting.Hosting.IScriptEngine,Microsoft.Scripting.Shell.IConsole ,Microsoft.Scripting.Shell.ConsoleOptions) <0x00104> at Microsoft.Scripting.Hosting.ConsoleHost.RunCommandLine ( Microsoft.Scripting.OptionsParser) <0x001d8> at Microsoft.Scripting.Hosting.ConsoleHost.ExecuteInternal () <0x002d6> at Microsoft.Scripting.Hosting.ConsoleHost.Execute () <0x000be> at Microsoft.Scripting.Hosting.ConsoleHost.Run (string[]) <0x00129> at PythonConsoleHost.Main (string[]) <0x00030> at (wrapper runtime-invoke) PythonConsoleHost.runtime_invoke_int_string[] (object,intptr,intptr,intptr) <0xffffffff> Abort trap Secondly on Mono 1.2.5./trunk/ r85570 and IP2a3 compiled w/ the same diff and nant build file provided by Miguel and Seo @ http://www.nabble.com/-IronPython--IronPython-2.0a3-Unix-Makefiles-t4233684.html m-david-petersons-computer:~/Projects/extf.googlecode.com/vendor/IronPython- 2.0A3/Src mdavid$ mono ipy.exe -X:TabCompletion -X:ColorfulConsole IronPython console: IronPython 2.0A3 (2.0.10724.00) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class microprocess(object): ... def __init__(self): ... super(microprocess, self).__init__() ... def main(self): #<--- Look its here!!! ... yield 1 ... >>> class printer(microprocess): ... def __init__(self, tag): ... super(printer, self).__init__() ... self.tag = tag ... def main(self): ... while 1: ... yield 1 # Must be a generator ... print self.tag ... >>> X = printer("Hello World") ** ERROR **: file mini.c: line 4020 (mono_method_to_ir): assertion failed: (!sig->has_type_parameters) aborting... Stacktrace: at IronPython.NewTypes.System.Object_1.GetRule ( Microsoft.Scripting.Actions.Action,Microsoft.Scripting.CodeContext,object[]) <0xffffffff> at IronPython.NewTypes.System.Object_1.GetRule ( Microsoft.Scripting.Actions.Action,Microsoft.Scripting.CodeContext,object[]) <0x00017> at Microsoft.Scripting.Actions.ActionBinder.GetRule ( Microsoft.Scripting.CodeContext,Microsoft.Scripting.Actions.Action,object[]) <0x001b9> at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke ( Microsoft.Scripting.CodeContext,object,object) <0x000ca> at UninitializedTargetHelper`7.Invoke2 ( Microsoft.Scripting.Actions.DynamicSite`3,Microsoft.Scripting.CodeContext,object,object) <0x00019> at Microsoft.Scripting.Actions.DynamicSite`3.Invoke ( Microsoft.Scripting.CodeContext,object,object) <0x0001e> at (wrapper dynamic-method) System.Object.__init__$5##12 (object[], Microsoft.Scripting.CodeContext,object,object) <0xffffffff> at IronPython.Runtime.Calls.FunctionWithContext2.Call ( Microsoft.Scripting.CodeContext,object,object) <0x00030> at IronPython.Runtime.Calls.PythonFunction.CallInstance ( Microsoft.Scripting.CodeContext,object,object) <0x00017> at IronPython.Runtime.Calls.Method.Call (Microsoft.Scripting.CodeContext,object) <0x0004a> at Microsoft.Scripting.RuntimeHelpers.CallWithContext ( Microsoft.Scripting.CodeContext,object,object) <0x0003b> at (wrapper dynamic-method) System.Object._stub_##17 (object[], Microsoft.Scripting.Actions.DynamicSite`3,Microsoft.Scripting.CodeContext,object,string) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke ( Microsoft.Scripting.CodeContext,object,string) <0x00155> at UninitializedTargetHelper`7.Invoke2 ( Microsoft.Scripting.Actions.DynamicSite`3,Microsoft.Scripting.CodeContext,object,string) <0x00019> at Microsoft.Scripting.Actions.DynamicSite`3.Invoke ( Microsoft.Scripting.CodeContext,object,string) <0x0001e> at (wrapper dynamic-method) System.Object._stub_##16 (object[], Microsoft.Scripting.Actions.DynamicSite`3,Microsoft.Scripting.CodeContext,object,string) <0xffffffff> at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke ( Microsoft.Scripting.CodeContext,object,string) <0x00155> at UninitializedTargetHelper`7.Invoke2 ( Microsoft.Scripting.Actions.DynamicSite`3,Microsoft.Scripting.CodeContext,object,string) <0x00019> at Microsoft.Scripting.Actions.DynamicSite`3.Invoke ( Microsoft.Scripting.CodeContext,object,string) <0x0001e> at (wrapper dynamic-method) System.Object.##15 (object[], Microsoft.Scripting.CodeContext) <0xffffffff> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.CodeContext) <0x0010c> at Microsoft.Scripting.ScriptCode.Run (Microsoft.Scripting.ScriptModule) <0x00074> at Microsoft.Scripting.Hosting.CompiledCode.Evaluate ( Microsoft.Scripting.IScriptModule) <0x00068> at Microsoft.Scripting.Hosting.ScriptEngine.ExecuteInteractiveCode(string, Microsoft.Scripting.IScriptModule) <0x0003a> at Microsoft.Scripting.Hosting.ScriptEngine.ExecuteCommand (string, Microsoft.Scripting.IScriptModule) <0x0015a> at Microsoft.Scripting.Shell.CommandLine.RunOneInteraction () <0x000c4> at Microsoft.Scripting.Shell.CommandLine.TryInteractiveAction () <0x0004e> at IronPython.Hosting.PythonCommandLine.TryInteractiveAction () <0x00023> at Microsoft.Scripting.Shell.CommandLine.RunInteractiveLoop () <0x000a0> at IronPython.Hosting.PythonCommandLine.RunInteractive () <0x000b6> at Microsoft.Scripting.Shell.CommandLine.Run ( Microsoft.Scripting.Hosting.IScriptEngine,Microsoft.Scripting.Shell.IConsole ,Microsoft.Scripting.Shell.ConsoleOptions) <0x000f0> at Microsoft.Scripting.Hosting.ConsoleHost.RunCommandLine ( Microsoft.Scripting.OptionsParser) <0x0018c> at Microsoft.Scripting.Hosting.ConsoleHost.ExecuteInternal () <0x002a1> at Microsoft.Scripting.Hosting.ConsoleHost.Execute () <0x000be> at Microsoft.Scripting.Hosting.ConsoleHost.Run (string[]) <0x00162> at PythonConsoleHost.Main (string[]) <0x00032> at (wrapper runtime-invoke) PythonConsoleHost.runtime_invoke_int_string[] (object,intptr,intptr,intptr) <0xffffffff> [1]+ Killed mono ipy.exe -X:TabCompletion -X:ColorfulConsole Abort trap -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Mon Sep 10 19:59:31 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Mon, 10 Sep 2007 11:59:31 -0600 Subject: [IronPython] Test Results: IronPython 2.0 Alpha 3/4, Kamaelia, Nested Yields, MS.NET and Mono 1.2.5./trunk/ r85570 In-Reply-To: References: Message-ID: On 9/10/07, M. David Peterson wrote: > > I'll be filing a proper bug report to Mono Bugzilla shortly, Done > http://bugzilla.ximian.com/show_bug.cgi?id=82782 -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Mon Sep 10 22:13:25 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Mon, 10 Sep 2007 14:13:25 -0600 Subject: [IronPython] Test Results: IronPython 2.0 Alpha 3/4, Kamaelia, Nested Yields, MS.NET and Mono 1.2.5./trunk/ r85570 In-Reply-To: References: Message-ID: On 9/10/07, M. David Peterson wrote: > > On 9/10/07, M. David Peterson wrote: > > > > I'll be filing a proper bug report to Mono Bugzilla shortly, > > > Done > http://bugzilla.ximian.com/show_bug.cgi?id=82782 > Absolutely astounding, ------- Additional Comments From Zoltan Varga 2007-09-10 16:22 ------- > > Fixed in SVN. > Which if you look at the time the bug was posted, Opened by m.david at xmlhacker.com (M. David Peterson) on 2007-09-10 14:27 ... means it took less than two hours to locate, fix, recompile, and test the fix to ensure it works. Ahhh, the power of open source. That *ROCKS*! Thanks, Zoltan! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Mon Sep 10 22:56:14 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Mon, 10 Sep 2007 14:56:14 -0600 Subject: [IronPython] Test Results: IronPython 2.0 Alpha 3/4, Kamaelia, Nested Yields, MS.NET and Mono 1.2.5./trunk/ r85570 In-Reply-To: References: Message-ID: On 9/10/07, M. David Peterson wrote: > > > Ahhh, the power of open source. That *ROCKS*! Thanks, Zoltan! > Beautiful, m-david-petersons-computer:~/Projects/extf.googlecode.com/vendor/IronPython- > 2.0A4 mdavid$ which mono > /Users/mdavid/build/nuxleus/bin/mono > > m-david-petersons-computer:~/Projects/extf.googlecode.com/vendor/IronPython- > 2.0A4 mdavid$ mono -V > Mono JIT compiler version 1.2.5 (/trunk/ r85598) > Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com > TLS: normal > GC: Included Boehm (with typed GC) > SIGSEGV: normal > Notification: Thread + polling > Architecture: x86 > Disabled: none > > > m-david-petersons-computer:~/Projects/extf.googlecode.com/vendor/IronPython- > 2.0A4 mdavid$ mono ipy.exe -X:TabCompletion -X:ColorfulConsole > IronPython console: IronPython 2.0A4 (2.0.10904.02) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> class microprocess(object): > ... def __init__(self): > ... super(microprocess, self).__init__() > ... def main(self): #<--- Look its here!!! > ... yield 1 > ... > >>> class printer(microprocess): > ... def __init__(self, tag): > ... super(printer, self).__init__() > ... self.tag = tag > ... def main(self): > ... while 1: > ... yield 1 # Must be a generator > ... print self.tag > ... > >>> X = printer("Hello World") > >>> > Michael (Sparks): So what's the next step in testing Kamaelia compatibility with IronPython alpha 4 on both MS.NET and Mono? With IP 2.0 still in alpha releases, and with the combination of Silverlight/Moonlight/DLR both under active and heavy development it seems now is the time to hit the testing process hard to ensure Kamaelia compatibility with the final release(s). I'm ready to hit it hard, as is Sylvain (he arrives here in our US offices in three days), at which point we both plan to spend a considerable amount of time w/ IronPython 2.0 running via Mono and focus our time on getting the the Kamaelia-based message queue system he developed in place and working properly, to then place focus on extending that message queue as seems appropriate for each desired functionality. One of the first projects we plan to tackle is getting a P2P streaming audio system in place and accessible via a Silverlight-based browser application. In this regard, where would suggest we place our primary focus for compatibility tests? -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Mon Sep 10 23:48:34 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Mon, 10 Sep 2007 15:48:34 -0600 Subject: [IronPython] Test Results: IronPython 2.0 Alpha 3/4, Kamaelia, Nested Yields, MS.NET and Mono 1.2.5./trunk/ r85570 In-Reply-To: References: Message-ID: On 9/10/07, M. David Peterson wrote: > > I'm ready to hit it hard, as is Sylvain (he arrives here in our US offices > in three days), at which point we both plan to spend a considerable amount > of time w/ IronPython 2.0 running via Mono and focus our time on getting > the the Kamaelia-based message queue system he developed in place and > working properly, > BTW, for those with interest, the mentioned Kamaelia-based message queue is @ http://trac.defuze.org/browser/oss/bucker/bucker and is licensed under your typical BSD-like license, to then place focus on extending that message queue as seems appropriate for > each desired functionality. > ... as will the rest of the code that ties together Xameleon (a data access and transformation engine built on top of OpenID authentication and memcached[1]) at which point we plan to extend things in various directions such as, > One of the first projects we plan to tackle is getting a P2P streaming > audio system in place and accessible via a Silverlight-based browser > application. > More details to follow for those with interest in playing with/using/contributing to the code base. [1] http://extf.googlecode.com/svn/branches/development-0.2.3/ -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfugate at microsoft.com Tue Sep 11 02:46:29 2007 From: dfugate at microsoft.com (Dave Fugate) Date: Mon, 10 Sep 2007 17:46:29 -0700 Subject: [IronPython] Managed DirectX via IronPython tutorials In-Reply-To: <46E3F32C.1000807@neotitans.com> References: <46E3F32C.1000807@neotitans.com> Message-ID: <7346A825E148B049A9AD1D3ED46A2D91169A52254A@NA-EXMSG-C106.redmond.corp.microsoft.com> It's great to see more tutorials and usage of IronPython, so thanks for putting this out for everyone. Just in case there's something in the Direct3D tutorial we put out that you do not also cover, our tutorial was updated to work with MDX 1.1 and IronPython 1.0.1. The DLR Team -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Andy Sy Sent: Sunday, September 09, 2007 6:21 AM To: users at lists.ironpython.com Subject: [IronPython] Managed DirectX via IronPython tutorials My 3-part tutorial for how to use MDX via IronPython is now finally up. The problem with the IronPython / MDX tutorials I've seen out there (including the one that comes with IronPython) are that they all rely on MDX 2.0 for which the DLLs have already time-bombed and no longer work, thus a return to MDX 1.1 is necessary [1]. Part 1 deals with how to properly import the MDX 1.1 assemblies in case the assemblies for MDX 2.0 lying around on your system: http://neotitans.com/resources/mdx-ironpython-1.html Part 2 shows you how to interact with a Direct3D device while you are on the IronPython command line: http://neotitans.com/resources/mdx-ironpython-2.html Part 3 shows you how to use the D3DX Sprite class to display and animate alpha-blended sprites: http://neotitans.com/resources/mdx-ironpython-3.html [1] MDX 1.1 actually encapsulates a good chunk of DirectX 9 functionality and will be around for a long long time, so relying on it is not something to worry about. Additionally, XNA, the replacement for MDX 2.0 has some annoyances associated with it as outlined below: http://slimdx.mdxinfo.com/wiki/index.php ------------------------ http://www.neotitans.com IT and Web Consulting _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From David.Lawler at franke.com Tue Sep 11 15:39:50 2007 From: David.Lawler at franke.com (David.Lawler at franke.com) Date: Tue, 11 Sep 2007 09:39:50 -0400 Subject: [IronPython] Ironpython 2 Alpha 4 Message-ID: The following ugly hack works fine with IronPython 1.1 and with 2.0 alpha 3 but raises an exception on line 28 with IronPython 2.0 alpha 4. To run this you need a copy of the ICSharpCode.TextEditor.dll from SharpDevelop (http://www.icsharpcode.net/OpenSource/SD). Is this a bug or a new 'feature'? Is there a work-around? Thanks. DJL import clr import sys clr.AddReference('System.Windows.Forms') clr.AddReference('System.Drawing') clr.AddReference('ICSharpCode.TextEditor') from System.IO import (Path, Directory, FileInfo) from System.Windows.Forms import * from System.Drawing import (Color, Font, FontStyle, GraphicsUnit, Point, Size) from ICSharpCode.TextEditor import * from ICSharpCode.TextEditor.Document import * class ExecuteForm(Form): def __init__(self): self.Size = Size(1024, 768) self.Text = "IronPythonDev" self.editor = TextEditorControl() self.editor.Location = Point(0,20) self.editor.Enabled = True self.editor.Size = Size(1000, 700) self.editor.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom HighlightingManager.Manager.AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); self.editor.Document.HighlightingStrategy = HighlightingManager.Manager.FindHighlighter("Python"); self.editor.ShowEOLMarkers = False self.editor.ConvertTabsToSpaces = True self.Controls.Add(self.editor) # Create the menu mainMenu1 = MainMenu() fileMenu = MenuItem() fileMenu.Text = "File" menuItemOpen = MenuItem() menuItemOpen.Text = "Open..." menuItemOpen.Click += self.OpenMenuHandler menuItemSave = MenuItem() menuItemSave.Text = "Save..." menuItemSave.Click += self.SaveMenuHandler menuItemExit = MenuItem() menuItemExit.Text = "Exit" menuItemExit.Click += self.ExitMenuHandler fileMenu.MenuItems.Add(menuItemOpen) fileMenu.MenuItems.Add(menuItemSave) fileMenu.MenuItems.Add(menuItemExit) mainMenu1.MenuItems.Add(fileMenu) self.Menu = mainMenu1 self.OpenDialog = OpenFileDialog() self.OpenDialog.Filter = "*.py|*.*" self.FileName = None self.InitCurrDir = Directory.GetCurrentDirectory() def OpenMenuHandler(self, source, ev): if self.OpenDialog.ShowDialog() == DialogResult.OK: self.FileName = self.OpenDialog.FileName self.editor.LoadFile(self.FileName) ext = self.FileName.lower().split(".")[-1] def SaveMenuHandler(self, source, ev): self.editor.SaveFile(self.FileName) def ExitMenuHandler(self, source, ev): self.Close() Application.EnableVisualStyles() form = ExecuteForm() Application.Run(form) From dinov at exchange.microsoft.com Tue Sep 11 17:20:48 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 11 Sep 2007 08:20:48 -0700 Subject: [IronPython] Ironpython 2 Alpha 4 In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227CA60C5B950@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Is line 28: HighlightingManager.Manager.AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); ? Can you provide the text of the exception (even better w/ the -X:ExceptionDetail command line option) ? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com Sent: Tuesday, September 11, 2007 6:40 AM To: users at lists.ironpython.com Subject: [IronPython] Ironpython 2 Alpha 4 The following ugly hack works fine with IronPython 1.1 and with 2.0 alpha 3 but raises an exception on line 28 with IronPython 2.0 alpha 4. To run this you need a copy of the ICSharpCode.TextEditor.dll from SharpDevelop (http://www.icsharpcode.net/OpenSource/SD). Is this a bug or a new 'feature'? Is there a work-around? Thanks. DJL import clr import sys clr.AddReference('System.Windows.Forms') clr.AddReference('System.Drawing') clr.AddReference('ICSharpCode.TextEditor') from System.IO import (Path, Directory, FileInfo) from System.Windows.Forms import * from System.Drawing import (Color, Font, FontStyle, GraphicsUnit, Point, Size) from ICSharpCode.TextEditor import * from ICSharpCode.TextEditor.Document import * class ExecuteForm(Form): def __init__(self): self.Size = Size(1024, 768) self.Text = "IronPythonDev" self.editor = TextEditorControl() self.editor.Location = Point(0,20) self.editor.Enabled = True self.editor.Size = Size(1000, 700) self.editor.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom HighlightingManager.Manager.AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); self.editor.Document.HighlightingStrategy = HighlightingManager.Manager.FindHighlighter("Python"); self.editor.ShowEOLMarkers = False self.editor.ConvertTabsToSpaces = True self.Controls.Add(self.editor) # Create the menu mainMenu1 = MainMenu() fileMenu = MenuItem() fileMenu.Text = "File" menuItemOpen = MenuItem() menuItemOpen.Text = "Open..." menuItemOpen.Click += self.OpenMenuHandler menuItemSave = MenuItem() menuItemSave.Text = "Save..." menuItemSave.Click += self.SaveMenuHandler menuItemExit = MenuItem() menuItemExit.Text = "Exit" menuItemExit.Click += self.ExitMenuHandler fileMenu.MenuItems.Add(menuItemOpen) fileMenu.MenuItems.Add(menuItemSave) fileMenu.MenuItems.Add(menuItemExit) mainMenu1.MenuItems.Add(fileMenu) self.Menu = mainMenu1 self.OpenDialog = OpenFileDialog() self.OpenDialog.Filter = "*.py|*.*" self.FileName = None self.InitCurrDir = Directory.GetCurrentDirectory() def OpenMenuHandler(self, source, ev): if self.OpenDialog.ShowDialog() == DialogResult.OK: self.FileName = self.OpenDialog.FileName self.editor.LoadFile(self.FileName) ext = self.FileName.lower().split(".")[-1] def SaveMenuHandler(self, source, ev): self.editor.SaveFile(self.FileName) def ExitMenuHandler(self, source, ev): self.Close() Application.EnableVisualStyles() form = ExecuteForm() Application.Run(form) _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From lo.maximo73 at gmail.com Tue Sep 11 17:41:54 2007 From: lo.maximo73 at gmail.com (luis cota) Date: Tue, 11 Sep 2007 11:41:54 -0400 Subject: [IronPython] Creating GUI Controls with IronPython Message-ID: <2e598d7f0709110841n4ea91b34yd2516502e9f364fc@mail.gmail.com> I have downloaded the VS2005 Addin for IronPython (found on the msdn Blogs). This is a fantastic way to have access to Intellisense for the .NET libraries. I'd like to use this to create a few GUI controls, though cannot find this option when selecting Add New Item in the Solution Explorer. It allows me to create a WinForm however. Do any of you know how to take the auto-generated source for a WinForm and convert this to a User Control? Thanks, - Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From darren at ontrenet.com Tue Sep 11 17:49:06 2007 From: darren at ontrenet.com (darren at ontrenet.com) Date: Tue, 11 Sep 2007 11:49:06 -0400 (EDT) Subject: [IronPython] Creating GUI Controls with IronPython In-Reply-To: <2e598d7f0709110841n4ea91b34yd2516502e9f364fc@mail.gmail.com> References: <2e598d7f0709110841n4ea91b34yd2516502e9f364fc@mail.gmail.com> Message-ID: <53171.65.222.148.229.1189525746.squirrel@webmail12.pair.com> IIRC, there should be a drop-in control for "User Control", or the appropriate reference needs to be "checked" in the toolbox options. > I have downloaded the VS2005 Addin for IronPython (found on the msdn > Blogs). This is a fantastic way to have access to Intellisense for the > .NET > libraries. I'd like to use this to create a few GUI controls, though > cannot > find this option when selecting Add New Item in the Solution Explorer. It > allows me to create a WinForm however. Do any of you know how to take the > auto-generated source for a WinForm and convert this to a User Control? > > Thanks, > > - Luis > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From David.Lawler at franke.com Tue Sep 11 17:51:31 2007 From: David.Lawler at franke.com (David.Lawler at franke.com) Date: Tue, 11 Sep 2007 11:51:31 -0400 Subject: [IronPython] Ironpython 2 Alpha 4 In-Reply-To: <7AD436E4270DD54A94238001769C2227CA60C5B950@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Yes I can - thanks for the quick reply! >"C:\Program Files\IronPython2A4\ipy.exe" -X:ExceptionDetail "IronPythonDev.py" ICSharpCode.TextEditor.Document.DefaultDocument.set_HighlightingStrategy(ICSharpCode.TextEditor.Document.IHighlightingStrategy) at _stub_##40(Object[] , DynamicSite`3 , CodeContext , Object , Object ) at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) at __main__$mod_2.__init__$3(CodeContext $context, Object self) in IronPythonDev.py:line 28 at _stub_##15(Object[] , DynamicSite`3 , CodeContext , Object , Object ) at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) at _stub_##14(Object[] , DynamicSite`2 , CodeContext , Object ) at Microsoft.Scripting.Actions.DynamicSite`2.UpdateBindingAndInvoke(CodeContext context, T0 arg0) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke1(DynamicSite`2 site, CodeContext context, T0 arg0) at Microsoft.Scripting.Actions.DynamicSite`2.Invoke(CodeContext context, T0 arg0) at _stub_##12(Object[] , FastDynamicSite`2 , Object ) at Microsoft.Scripting.Actions.FastDynamicSite`2.UpdateBindingAndInvoke(T0 arg0) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.FastInvoke1(FastDynamicSite`2 site, T0 arg0) at Microsoft.Scripting.Actions.FastDynamicSite`2.Invoke(T0 arg0) at __main__$mod_2.Initialize(CodeContext ) in IronPythonDev.py:line 75 at Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean tryEvaluate) at Microsoft.Scripting.ScriptModule.Execute() at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String filename) SystemError: ICSharpCode.TextEditor.Document.DefaultDocument.set_HighlightingStrategy(ICSharpCode.TextEditor.Document.IHighlightingStrategy) >Exit code: 1 users-bounces at lists.ironpython.com wrote on 09/11/2007 11:20:48 AM: > Is line 28: > > HighlightingManager.Manager. > AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); > > ? > > Can you provide the text of the exception (even better w/ the -X: > ExceptionDetail command line option) ? > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com > Sent: Tuesday, September 11, 2007 6:40 AM > To: users at lists.ironpython.com > Subject: [IronPython] Ironpython 2 Alpha 4 > > The following ugly hack works fine with IronPython 1.1 and with 2.0 alpha > 3 but raises an exception on line 28 with IronPython 2.0 alpha 4. > To run this you need a copy of the ICSharpCode.TextEditor.dll from > SharpDevelop (http://www.icsharpcode.net/OpenSource/SD). > Is this a bug or a new 'feature'? Is there a work-around? Thanks. DJL > > import clr > import sys > > clr.AddReference('System.Windows.Forms') > clr.AddReference('System.Drawing') > clr.AddReference('ICSharpCode.TextEditor') > > from System.IO import (Path, Directory, FileInfo) > from System.Windows.Forms import * > from System.Drawing import (Color, Font, FontStyle, GraphicsUnit, Point, > Size) > from ICSharpCode.TextEditor import * > from ICSharpCode.TextEditor.Document import * > > class ExecuteForm(Form): > > def __init__(self): > > self.Size = Size(1024, 768) > self.Text = "IronPythonDev" > > self.editor = TextEditorControl() > self.editor.Location = Point(0,20) > self.editor.Enabled = True > self.editor.Size = Size(1000, 700) > self.editor.Anchor = AnchorStyles.Top | AnchorStyles.Left | > AnchorStyles.Right | AnchorStyles.Bottom > > > HighlightingManager.Manager. > AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); > > self.editor.Document.HighlightingStrategy = > HighlightingManager.Manager.FindHighlighter("Python"); > self.editor.ShowEOLMarkers = False > self.editor.ConvertTabsToSpaces = True > self.Controls.Add(self.editor) > > # Create the menu > mainMenu1 = MainMenu() > > fileMenu = MenuItem() > fileMenu.Text = "File" > menuItemOpen = MenuItem() > menuItemOpen.Text = "Open..." > menuItemOpen.Click += self.OpenMenuHandler > menuItemSave = MenuItem() > menuItemSave.Text = "Save..." > menuItemSave.Click += self.SaveMenuHandler > menuItemExit = MenuItem() > menuItemExit.Text = "Exit" > menuItemExit.Click += self.ExitMenuHandler > fileMenu.MenuItems.Add(menuItemOpen) > fileMenu.MenuItems.Add(menuItemSave) > fileMenu.MenuItems.Add(menuItemExit) > > mainMenu1.MenuItems.Add(fileMenu) > self.Menu = mainMenu1 > > self.OpenDialog = OpenFileDialog() > self.OpenDialog.Filter = "*.py|*.*" > self.FileName = None > self.InitCurrDir = Directory.GetCurrentDirectory() > > def OpenMenuHandler(self, source, ev): > > if self.OpenDialog.ShowDialog() == DialogResult.OK: > > self.FileName = self.OpenDialog.FileName > self.editor.LoadFile(self.FileName) > ext = self.FileName.lower().split(".")[-1] > > def SaveMenuHandler(self, source, ev): > > self.editor.SaveFile(self.FileName) > > def ExitMenuHandler(self, source, ev): > self.Close() > > Application.EnableVisualStyles() > form = ExecuteForm() > Application.Run(form) > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Sep 11 18:02:49 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 11 Sep 2007 09:02:49 -0700 Subject: [IronPython] Ironpython 2 Alpha 4 In-Reply-To: References: <7AD436E4270DD54A94238001769C2227CA60C5B950@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227CA60C5B967@DF-GRTDANE-MSG.exchange.corp.microsoft.com> It definitely looks like a bug - maybe related to the fact that these are interface methods & properties. Could I get you to do one more thing and re-run w/ -X:ExceptionDetail and -X:ShowClrExceptions? I've opened a bug (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12708) to track the issue. We're in bug fixing mode for the next 4 weeks so hopefully we can get this (and many other issues that have been piling up) fixed for the next release. Thanks for the report. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com Sent: Tuesday, September 11, 2007 8:52 AM To: Discussion of IronPython Subject: Re: [IronPython] Ironpython 2 Alpha 4 Yes I can - thanks for the quick reply! >"C:\Program Files\IronPython2A4\ipy.exe" -X:ExceptionDetail "IronPythonDev.py" ICSharpCode.TextEditor.Document.DefaultDocument.set_HighlightingStrategy(ICSharpCode.TextEditor.Document.IHighlightingStrategy) at _stub_##40(Object[] , DynamicSite`3 , CodeContext , Object , Object ) at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) at __main__$mod_2.__init__$3(CodeContext $context, Object self) in IronPythonDev.py:line 28 at _stub_##15(Object[] , DynamicSite`3 , CodeContext , Object , Object ) at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) at _stub_##14(Object[] , DynamicSite`2 , CodeContext , Object ) at Microsoft.Scripting.Actions.DynamicSite`2.UpdateBindingAndInvoke(CodeContext context, T0 arg0) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke1(DynamicSite`2 site, CodeContext context, T0 arg0) at Microsoft.Scripting.Actions.DynamicSite`2.Invoke(CodeContext context, T0 arg0) at _stub_##12(Object[] , FastDynamicSite`2 , Object ) at Microsoft.Scripting.Actions.FastDynamicSite`2.UpdateBindingAndInvoke(T0 arg0) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.FastInvoke1(FastDynamicSite`2 site, T0 arg0) at Microsoft.Scripting.Actions.FastDynamicSite`2.Invoke(T0 arg0) at __main__$mod_2.Initialize(CodeContext ) in IronPythonDev.py:line 75 at Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean tryEvaluate) at Microsoft.Scripting.ScriptModule.Execute() at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String filename) SystemError: ICSharpCode.TextEditor.Document.DefaultDocument.set_HighlightingStrategy(ICSharpCode.TextEditor.Document.IHighlightingStrategy) >Exit code: 1 users-bounces at lists.ironpython.com wrote on 09/11/2007 11:20:48 AM: > Is line 28: > > HighlightingManager.Manager. > AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); > > ? > > Can you provide the text of the exception (even better w/ the -X: > ExceptionDetail command line option) ? > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com > Sent: Tuesday, September 11, 2007 6:40 AM > To: users at lists.ironpython.com > Subject: [IronPython] Ironpython 2 Alpha 4 > > The following ugly hack works fine with IronPython 1.1 and with 2.0 alpha > 3 but raises an exception on line 28 with IronPython 2.0 alpha 4. > To run this you need a copy of the ICSharpCode.TextEditor.dll from > SharpDevelop (http://www.icsharpcode.net/OpenSource/SD). > Is this a bug or a new 'feature'? Is there a work-around? Thanks. DJL > > import clr > import sys > > clr.AddReference('System.Windows.Forms') > clr.AddReference('System.Drawing') > clr.AddReference('ICSharpCode.TextEditor') > > from System.IO import (Path, Directory, FileInfo) > from System.Windows.Forms import * > from System.Drawing import (Color, Font, FontStyle, GraphicsUnit, Point, > Size) > from ICSharpCode.TextEditor import * > from ICSharpCode.TextEditor.Document import * > > class ExecuteForm(Form): > > def __init__(self): > > self.Size = Size(1024, 768) > self.Text = "IronPythonDev" > > self.editor = TextEditorControl() > self.editor.Location = Point(0,20) > self.editor.Enabled = True > self.editor.Size = Size(1000, 700) > self.editor.Anchor = AnchorStyles.Top | AnchorStyles.Left | > AnchorStyles.Right | AnchorStyles.Bottom > > > HighlightingManager.Manager. > AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); > > self.editor.Document.HighlightingStrategy = > HighlightingManager.Manager.FindHighlighter("Python"); > self.editor.ShowEOLMarkers = False > self.editor.ConvertTabsToSpaces = True > self.Controls.Add(self.editor) > > # Create the menu > mainMenu1 = MainMenu() > > fileMenu = MenuItem() > fileMenu.Text = "File" > menuItemOpen = MenuItem() > menuItemOpen.Text = "Open..." > menuItemOpen.Click += self.OpenMenuHandler > menuItemSave = MenuItem() > menuItemSave.Text = "Save..." > menuItemSave.Click += self.SaveMenuHandler > menuItemExit = MenuItem() > menuItemExit.Text = "Exit" > menuItemExit.Click += self.ExitMenuHandler > fileMenu.MenuItems.Add(menuItemOpen) > fileMenu.MenuItems.Add(menuItemSave) > fileMenu.MenuItems.Add(menuItemExit) > > mainMenu1.MenuItems.Add(fileMenu) > self.Menu = mainMenu1 > > self.OpenDialog = OpenFileDialog() > self.OpenDialog.Filter = "*.py|*.*" > self.FileName = None > self.InitCurrDir = Directory.GetCurrentDirectory() > > def OpenMenuHandler(self, source, ev): > > if self.OpenDialog.ShowDialog() == DialogResult.OK: > > self.FileName = self.OpenDialog.FileName > self.editor.LoadFile(self.FileName) > ext = self.FileName.lower().split(".")[-1] > > def SaveMenuHandler(self, source, ev): > > self.editor.SaveFile(self.FileName) > > def ExitMenuHandler(self, source, ev): > self.Close() > > Application.EnableVisualStyles() > form = ExecuteForm() > Application.Run(form) > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Sep 11 18:28:44 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 11 Sep 2007 09:28:44 -0700 Subject: [IronPython] Ironpython 2 Alpha 4 In-Reply-To: <7AD436E4270DD54A94238001769C2227CA60C5B967@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227CA60C5B950@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227CA60C5B967@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227CA60C5B971@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Well, I don't need any more info actually... here's the bug: // Private class class PrivateClass : IPublicInterface { public IPublicInterface Hello { get { return null; } set { } } } // Public Interface public interface IPublicInterface { IPublicInterface Hello { get; set; } } // Access the private class via the public interface public class InteraceOnlyTest { private static IPublicInterface _hw; public static IPublicInterface HW { get { if (_hw == null) _hw = new PrivateClass(); return _hw; } set { _hw = value; } } } InteraceOnlyTest.HW.Hello = InteraceOnlyTest.HW Because the class is private we need to dispatch through the interface and we're failing to do that. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Tuesday, September 11, 2007 9:03 AM To: Discussion of IronPython Subject: Re: [IronPython] Ironpython 2 Alpha 4 It definitely looks like a bug - maybe related to the fact that these are interface methods & properties. Could I get you to do one more thing and re-run w/ -X:ExceptionDetail and -X:ShowClrExceptions? I've opened a bug (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12708) to track the issue. We're in bug fixing mode for the next 4 weeks so hopefully we can get this (and many other issues that have been piling up) fixed for the next release. Thanks for the report. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com Sent: Tuesday, September 11, 2007 8:52 AM To: Discussion of IronPython Subject: Re: [IronPython] Ironpython 2 Alpha 4 Yes I can - thanks for the quick reply! >"C:\Program Files\IronPython2A4\ipy.exe" -X:ExceptionDetail "IronPythonDev.py" ICSharpCode.TextEditor.Document.DefaultDocument.set_HighlightingStrategy(ICSharpCode.TextEditor.Document.IHighlightingStrategy) at _stub_##40(Object[] , DynamicSite`3 , CodeContext , Object , Object ) at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) at __main__$mod_2.__init__$3(CodeContext $context, Object self) in IronPythonDev.py:line 28 at _stub_##15(Object[] , DynamicSite`3 , CodeContext , Object , Object ) at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) at _stub_##14(Object[] , DynamicSite`2 , CodeContext , Object ) at Microsoft.Scripting.Actions.DynamicSite`2.UpdateBindingAndInvoke(CodeContext context, T0 arg0) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke1(DynamicSite`2 site, CodeContext context, T0 arg0) at Microsoft.Scripting.Actions.DynamicSite`2.Invoke(CodeContext context, T0 arg0) at _stub_##12(Object[] , FastDynamicSite`2 , Object ) at Microsoft.Scripting.Actions.FastDynamicSite`2.UpdateBindingAndInvoke(T0 arg0) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.FastInvoke1(FastDynamicSite`2 site, T0 arg0) at Microsoft.Scripting.Actions.FastDynamicSite`2.Invoke(T0 arg0) at __main__$mod_2.Initialize(CodeContext ) in IronPythonDev.py:line 75 at Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean tryEvaluate) at Microsoft.Scripting.ScriptModule.Execute() at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String filename) SystemError: ICSharpCode.TextEditor.Document.DefaultDocument.set_HighlightingStrategy(ICSharpCode.TextEditor.Document.IHighlightingStrategy) >Exit code: 1 users-bounces at lists.ironpython.com wrote on 09/11/2007 11:20:48 AM: > Is line 28: > > HighlightingManager.Manager. > AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); > > ? > > Can you provide the text of the exception (even better w/ the -X: > ExceptionDetail command line option) ? > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com > Sent: Tuesday, September 11, 2007 6:40 AM > To: users at lists.ironpython.com > Subject: [IronPython] Ironpython 2 Alpha 4 > > The following ugly hack works fine with IronPython 1.1 and with 2.0 alpha > 3 but raises an exception on line 28 with IronPython 2.0 alpha 4. > To run this you need a copy of the ICSharpCode.TextEditor.dll from > SharpDevelop (http://www.icsharpcode.net/OpenSource/SD). > Is this a bug or a new 'feature'? Is there a work-around? Thanks. DJL > > import clr > import sys > > clr.AddReference('System.Windows.Forms') > clr.AddReference('System.Drawing') > clr.AddReference('ICSharpCode.TextEditor') > > from System.IO import (Path, Directory, FileInfo) > from System.Windows.Forms import * > from System.Drawing import (Color, Font, FontStyle, GraphicsUnit, Point, > Size) > from ICSharpCode.TextEditor import * > from ICSharpCode.TextEditor.Document import * > > class ExecuteForm(Form): > > def __init__(self): > > self.Size = Size(1024, 768) > self.Text = "IronPythonDev" > > self.editor = TextEditorControl() > self.editor.Location = Point(0,20) > self.editor.Enabled = True > self.editor.Size = Size(1000, 700) > self.editor.Anchor = AnchorStyles.Top | AnchorStyles.Left | > AnchorStyles.Right | AnchorStyles.Bottom > > > HighlightingManager.Manager. > AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); > > self.editor.Document.HighlightingStrategy = > HighlightingManager.Manager.FindHighlighter("Python"); > self.editor.ShowEOLMarkers = False > self.editor.ConvertTabsToSpaces = True > self.Controls.Add(self.editor) > > # Create the menu > mainMenu1 = MainMenu() > > fileMenu = MenuItem() > fileMenu.Text = "File" > menuItemOpen = MenuItem() > menuItemOpen.Text = "Open..." > menuItemOpen.Click += self.OpenMenuHandler > menuItemSave = MenuItem() > menuItemSave.Text = "Save..." > menuItemSave.Click += self.SaveMenuHandler > menuItemExit = MenuItem() > menuItemExit.Text = "Exit" > menuItemExit.Click += self.ExitMenuHandler > fileMenu.MenuItems.Add(menuItemOpen) > fileMenu.MenuItems.Add(menuItemSave) > fileMenu.MenuItems.Add(menuItemExit) > > mainMenu1.MenuItems.Add(fileMenu) > self.Menu = mainMenu1 > > self.OpenDialog = OpenFileDialog() > self.OpenDialog.Filter = "*.py|*.*" > self.FileName = None > self.InitCurrDir = Directory.GetCurrentDirectory() > > def OpenMenuHandler(self, source, ev): > > if self.OpenDialog.ShowDialog() == DialogResult.OK: > > self.FileName = self.OpenDialog.FileName > self.editor.LoadFile(self.FileName) > ext = self.FileName.lower().split(".")[-1] > > def SaveMenuHandler(self, source, ev): > > self.editor.SaveFile(self.FileName) > > def ExitMenuHandler(self, source, ev): > self.Close() > > Application.EnableVisualStyles() > form = ExecuteForm() > Application.Run(form) > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From David.Lawler at franke.com Tue Sep 11 18:31:53 2007 From: David.Lawler at franke.com (David.Lawler at franke.com) Date: Tue, 11 Sep 2007 12:31:53 -0400 Subject: [IronPython] Ironpython 2 Alpha 4 In-Reply-To: <7AD436E4270DD54A94238001769C2227CA60C5B967@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Hi Dino, Here it is. Thanks for taking a look at it. "C:\Program Files\IronPython2A4\ipy.exe" -X:ExceptionDetail -X:ShowClrExceptions "IronPythonDev.py" ICSharpCode.TextEditor.Document.DefaultDocument.set_HighlightingStrategy(ICSharpCode.TextEditor.Document.IHighlightingStrategy) at _stub_##40(Object[] , DynamicSite`3 , CodeContext , Object , Object ) at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) at __main__$mod_2.__init__$3(CodeContext $context, Object self) in IronPythonDev.py:line 28 at _stub_##15(Object[] , DynamicSite`3 , CodeContext , Object , Object ) at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) at _stub_##14(Object[] , DynamicSite`2 , CodeContext , Object ) at Microsoft.Scripting.Actions.DynamicSite`2.UpdateBindingAndInvoke(CodeContext context, T0 arg0) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke1(DynamicSite`2 site, CodeContext context, T0 arg0) at Microsoft.Scripting.Actions.DynamicSite`2.Invoke(CodeContext context, T0 arg0) at _stub_##12(Object[] , FastDynamicSite`2 , Object ) at Microsoft.Scripting.Actions.FastDynamicSite`2.UpdateBindingAndInvoke(T0 arg0) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.FastInvoke1(FastDynamicSite`2 site, T0 arg0) at Microsoft.Scripting.Actions.FastDynamicSite`2.Invoke(T0 arg0) at __main__$mod_2.Initialize(CodeContext ) in IronPythonDev.py:line 75 at Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean tryEvaluate) at Microsoft.Scripting.ScriptModule.Execute() at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String filename) SystemError: ICSharpCode.TextEditor.Document.DefaultDocument.set_HighlightingStrategy(ICSharpCode.TextEditor.Document.IHighlightingStrategy) CLR Exception: MethodAccessException : ICSharpCode.TextEditor.Document.DefaultDocument.set_HighlightingStrategy(ICSharpCode.TextEditor.Document.IHighlightingStrategy) >Exit code: 1 users-bounces at lists.ironpython.com wrote on 09/11/2007 12:02:49 PM: > It definitely looks like a bug - maybe related to the fact that > these are interface methods & properties. Could I get you to do one > more thing and re-run w/ -X:ExceptionDetail and -X:ShowClrExceptions? > > I've opened a bug (http://www.codeplex.com/IronPython/WorkItem/View. > aspx?WorkItemId=12708) to track the issue. We're in bug fixing mode > for the next 4 weeks so hopefully we can get this (and many other > issues that have been piling up) fixed for the next release. Thanks > for the report. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com > Sent: Tuesday, September 11, 2007 8:52 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Ironpython 2 Alpha 4 > > Yes I can - thanks for the quick reply! > > >"C:\Program Files\IronPython2A4\ipy.exe" -X:ExceptionDetail > "IronPythonDev.py" > ICSharpCode.TextEditor.Document.DefaultDocument. > set_HighlightingStrategy(ICSharpCode.TextEditor.Document. > IHighlightingStrategy) > at _stub_##40(Object[] , DynamicSite`3 , CodeContext , Object , Object > ) > at > Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext > context, T0 arg0, T1 arg1) > at > Microsoft.Scripting.Actions.DynamicSiteHelpers. > UninitializedTargetHelper`7.Invoke2(DynamicSite`3 > site, CodeContext context, T0 arg0, T1 arg1) > at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext > context, T0 arg0, T1 arg1) > at __main__$mod_2.__init__$3(CodeContext $context, Object self) in > IronPythonDev.py:line 28 > at _stub_##15(Object[] , DynamicSite`3 , CodeContext , Object , Object > ) > at > Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext > context, T0 arg0, T1 arg1) > at > Microsoft.Scripting.Actions.DynamicSiteHelpers. > UninitializedTargetHelper`7.Invoke2(DynamicSite`3 > site, CodeContext context, T0 arg0, T1 arg1) > at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext > context, T0 arg0, T1 arg1) > at _stub_##14(Object[] , DynamicSite`2 , CodeContext , Object ) > at > Microsoft.Scripting.Actions.DynamicSite`2.UpdateBindingAndInvoke(CodeContext > context, T0 arg0) > at > Microsoft.Scripting.Actions.DynamicSiteHelpers. > UninitializedTargetHelper`7.Invoke1(DynamicSite`2 > site, CodeContext context, T0 arg0) > at Microsoft.Scripting.Actions.DynamicSite`2.Invoke(CodeContext > context, T0 arg0) > at _stub_##12(Object[] , FastDynamicSite`2 , Object ) > at > Microsoft.Scripting.Actions.FastDynamicSite`2.UpdateBindingAndInvoke(T0 > arg0) > at > Microsoft.Scripting.Actions.DynamicSiteHelpers. > UninitializedTargetHelper`7.FastInvoke1(FastDynamicSite`2 > site, T0 arg0) > at Microsoft.Scripting.Actions.FastDynamicSite`2.Invoke(T0 arg0) > at __main__$mod_2.Initialize(CodeContext ) in IronPythonDev.py:line 75 > at Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean > tryEvaluate) > at Microsoft.Scripting.ScriptModule.Execute() > at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) > at IronPython.Hosting.PythonCommandLine.RunFile(String filename) > > SystemError: > ICSharpCode.TextEditor.Document.DefaultDocument. > set_HighlightingStrategy(ICSharpCode.TextEditor.Document. > IHighlightingStrategy) > > >Exit code: 1 > > > users-bounces at lists.ironpython.com wrote on 09/11/2007 11:20:48 AM: > > > Is line 28: > > > > HighlightingManager.Manager. > > AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); > > > > ? > > > > Can you provide the text of the exception (even better w/ the -X: > > ExceptionDetail command line option) ? > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com > > Sent: Tuesday, September 11, 2007 6:40 AM > > To: users at lists.ironpython.com > > Subject: [IronPython] Ironpython 2 Alpha 4 > > > > The following ugly hack works fine with IronPython 1.1 and with 2.0 > alpha > > 3 but raises an exception on line 28 with IronPython 2.0 alpha 4. > > To run this you need a copy of the ICSharpCode.TextEditor.dll from > > SharpDevelop (http://www.icsharpcode.net/OpenSource/SD). > > Is this a bug or a new 'feature'? Is there a work-around? Thanks. DJL > > > > import clr > > import sys > > > > clr.AddReference('System.Windows.Forms') > > clr.AddReference('System.Drawing') > > clr.AddReference('ICSharpCode.TextEditor') > > > > from System.IO import (Path, Directory, FileInfo) > > from System.Windows.Forms import * > > from System.Drawing import (Color, Font, FontStyle, GraphicsUnit, Point, > > Size) > > from ICSharpCode.TextEditor import * > > from ICSharpCode.TextEditor.Document import * > > > > class ExecuteForm(Form): > > > > def __init__(self): > > > > self.Size = Size(1024, 768) > > self.Text = "IronPythonDev" > > > > self.editor = TextEditorControl() > > self.editor.Location = Point(0,20) > > self.editor.Enabled = True > > self.editor.Size = Size(1000, 700) > > self.editor.Anchor = AnchorStyles.Top | AnchorStyles.Left | > > AnchorStyles.Right | AnchorStyles.Bottom > > > > > > HighlightingManager.Manager. > > AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); > > > > self.editor.Document.HighlightingStrategy = > > HighlightingManager.Manager.FindHighlighter("Python"); > > self.editor.ShowEOLMarkers = False > > self.editor.ConvertTabsToSpaces = True > > self.Controls.Add(self.editor) > > > > # Create the menu > > mainMenu1 = MainMenu() > > > > fileMenu = MenuItem() > > fileMenu.Text = "File" > > menuItemOpen = MenuItem() > > menuItemOpen.Text = "Open..." > > menuItemOpen.Click += self.OpenMenuHandler > > menuItemSave = MenuItem() > > menuItemSave.Text = "Save..." > > menuItemSave.Click += self.SaveMenuHandler > > menuItemExit = MenuItem() > > menuItemExit.Text = "Exit" > > menuItemExit.Click += self.ExitMenuHandler > > fileMenu.MenuItems.Add(menuItemOpen) > > fileMenu.MenuItems.Add(menuItemSave) > > fileMenu.MenuItems.Add(menuItemExit) > > > > mainMenu1.MenuItems.Add(fileMenu) > > self.Menu = mainMenu1 > > > > self.OpenDialog = OpenFileDialog() > > self.OpenDialog.Filter = "*.py|*.*" > > self.FileName = None > > self.InitCurrDir = Directory.GetCurrentDirectory() > > > > def OpenMenuHandler(self, source, ev): > > > > if self.OpenDialog.ShowDialog() == DialogResult.OK: > > > > self.FileName = self.OpenDialog.FileName > > self.editor.LoadFile(self.FileName) > > ext = self.FileName.lower().split(".")[-1] > > > > def SaveMenuHandler(self, source, ev): > > > > self.editor.SaveFile(self.FileName) > > > > def ExitMenuHandler(self, source, ev): > > self.Close() > > > > Application.EnableVisualStyles() > > form = ExecuteForm() > > Application.Run(form) > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From lo.maximo73 at gmail.com Tue Sep 11 18:33:22 2007 From: lo.maximo73 at gmail.com (luis cota) Date: Tue, 11 Sep 2007 12:33:22 -0400 Subject: [IronPython] Creating GUI Controls with IronPython In-Reply-To: <53171.65.222.148.229.1189525746.squirrel@webmail12.pair.com> References: <2e598d7f0709110841n4ea91b34yd2516502e9f364fc@mail.gmail.com> <53171.65.222.148.229.1189525746.squirrel@webmail12.pair.com> Message-ID: <2e598d7f0709110933s38d5cd93ke1bb00aac91687c0@mail.gmail.com> I may be misunderstanding your response, or I misstated my question. What I'd like to do is create a new User Control using the IronPython plugin for VS 2005. When I create a new project or add a new Item to my project, I cannot see User Control as an option, only a Form. Is there a way around this so that I can select a User Control to be created insetad of a Form? - Luis On 9/11/07, darren at ontrenet.com wrote: > > IIRC, there should be a drop-in control for "User Control", or the > appropriate reference needs to be "checked" in the toolbox options. > > > I have downloaded the VS2005 Addin for IronPython (found on the msdn > > Blogs). This is a fantastic way to have access to Intellisense for the > > .NET > > libraries. I'd like to use this to create a few GUI controls, though > > cannot > > find this option when selecting Add New Item in the Solution > Explorer. It > > allows me to create a WinForm however. Do any of you know how to take > the > > auto-generated source for a WinForm and convert this to a User Control? > > > > Thanks, > > > > - Luis > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > 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: From dinov at exchange.microsoft.com Tue Sep 11 18:37:12 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 11 Sep 2007 09:37:12 -0700 Subject: [IronPython] Ironpython 2 Alpha 4 In-Reply-To: References: <7AD436E4270DD54A94238001769C2227CA60C5B967@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227CA60C5B977@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Ahh, so the fix for this particular issue if you want to patch your own copy of IronPython. In Microsoft.Scripting.Actions.SetMemberBinderHelper there's a method called MakePropertyRule. There's lines that look like: if (setter != null) { if (IsStaticProperty(info, setter)) { and you just need to add one line: if (setter != null) { setter = CompilerHelpers.GetCallableMethod(setter); if (IsStaticProperty(info, setter)) { and we call the interface method instead. Now I just need to find out what other members we have this bug on too :). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com Sent: Tuesday, September 11, 2007 9:32 AM To: Discussion of IronPython Subject: Re: [IronPython] Ironpython 2 Alpha 4 Hi Dino, Here it is. Thanks for taking a look at it. "C:\Program Files\IronPython2A4\ipy.exe" -X:ExceptionDetail -X:ShowClrExceptions "IronPythonDev.py" ICSharpCode.TextEditor.Document.DefaultDocument.set_HighlightingStrategy(ICSharpCode.TextEditor.Document.IHighlightingStrategy) at _stub_##40(Object[] , DynamicSite`3 , CodeContext , Object , Object ) at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) at __main__$mod_2.__init__$3(CodeContext $context, Object self) in IronPythonDev.py:line 28 at _stub_##15(Object[] , DynamicSite`3 , CodeContext , Object , Object ) at Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) at _stub_##14(Object[] , DynamicSite`2 , CodeContext , Object ) at Microsoft.Scripting.Actions.DynamicSite`2.UpdateBindingAndInvoke(CodeContext context, T0 arg0) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke1(DynamicSite`2 site, CodeContext context, T0 arg0) at Microsoft.Scripting.Actions.DynamicSite`2.Invoke(CodeContext context, T0 arg0) at _stub_##12(Object[] , FastDynamicSite`2 , Object ) at Microsoft.Scripting.Actions.FastDynamicSite`2.UpdateBindingAndInvoke(T0 arg0) at Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.FastInvoke1(FastDynamicSite`2 site, T0 arg0) at Microsoft.Scripting.Actions.FastDynamicSite`2.Invoke(T0 arg0) at __main__$mod_2.Initialize(CodeContext ) in IronPythonDev.py:line 75 at Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean tryEvaluate) at Microsoft.Scripting.ScriptModule.Execute() at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String filename) SystemError: ICSharpCode.TextEditor.Document.DefaultDocument.set_HighlightingStrategy(ICSharpCode.TextEditor.Document.IHighlightingStrategy) CLR Exception: MethodAccessException : ICSharpCode.TextEditor.Document.DefaultDocument.set_HighlightingStrategy(ICSharpCode.TextEditor.Document.IHighlightingStrategy) >Exit code: 1 users-bounces at lists.ironpython.com wrote on 09/11/2007 12:02:49 PM: > It definitely looks like a bug - maybe related to the fact that > these are interface methods & properties. Could I get you to do one > more thing and re-run w/ -X:ExceptionDetail and -X:ShowClrExceptions? > > I've opened a bug (http://www.codeplex.com/IronPython/WorkItem/View. > aspx?WorkItemId=12708) to track the issue. We're in bug fixing mode > for the next 4 weeks so hopefully we can get this (and many other > issues that have been piling up) fixed for the next release. Thanks > for the report. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com > Sent: Tuesday, September 11, 2007 8:52 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Ironpython 2 Alpha 4 > > Yes I can - thanks for the quick reply! > > >"C:\Program Files\IronPython2A4\ipy.exe" -X:ExceptionDetail > "IronPythonDev.py" > ICSharpCode.TextEditor.Document.DefaultDocument. > set_HighlightingStrategy(ICSharpCode.TextEditor.Document. > IHighlightingStrategy) > at _stub_##40(Object[] , DynamicSite`3 , CodeContext , Object , Object > ) > at > Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext > context, T0 arg0, T1 arg1) > at > Microsoft.Scripting.Actions.DynamicSiteHelpers. > UninitializedTargetHelper`7.Invoke2(DynamicSite`3 > site, CodeContext context, T0 arg0, T1 arg1) > at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext > context, T0 arg0, T1 arg1) > at __main__$mod_2.__init__$3(CodeContext $context, Object self) in > IronPythonDev.py:line 28 > at _stub_##15(Object[] , DynamicSite`3 , CodeContext , Object , Object > ) > at > Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext > context, T0 arg0, T1 arg1) > at > Microsoft.Scripting.Actions.DynamicSiteHelpers. > UninitializedTargetHelper`7.Invoke2(DynamicSite`3 > site, CodeContext context, T0 arg0, T1 arg1) > at Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext > context, T0 arg0, T1 arg1) > at _stub_##14(Object[] , DynamicSite`2 , CodeContext , Object ) > at > Microsoft.Scripting.Actions.DynamicSite`2.UpdateBindingAndInvoke(CodeContext > context, T0 arg0) > at > Microsoft.Scripting.Actions.DynamicSiteHelpers. > UninitializedTargetHelper`7.Invoke1(DynamicSite`2 > site, CodeContext context, T0 arg0) > at Microsoft.Scripting.Actions.DynamicSite`2.Invoke(CodeContext > context, T0 arg0) > at _stub_##12(Object[] , FastDynamicSite`2 , Object ) > at > Microsoft.Scripting.Actions.FastDynamicSite`2.UpdateBindingAndInvoke(T0 > arg0) > at > Microsoft.Scripting.Actions.DynamicSiteHelpers. > UninitializedTargetHelper`7.FastInvoke1(FastDynamicSite`2 > site, T0 arg0) > at Microsoft.Scripting.Actions.FastDynamicSite`2.Invoke(T0 arg0) > at __main__$mod_2.Initialize(CodeContext ) in IronPythonDev.py:line 75 > at Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean > tryEvaluate) > at Microsoft.Scripting.ScriptModule.Execute() > at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) > at IronPython.Hosting.PythonCommandLine.RunFile(String filename) > > SystemError: > ICSharpCode.TextEditor.Document.DefaultDocument. > set_HighlightingStrategy(ICSharpCode.TextEditor.Document. > IHighlightingStrategy) > > >Exit code: 1 > > > users-bounces at lists.ironpython.com wrote on 09/11/2007 11:20:48 AM: > > > Is line 28: > > > > HighlightingManager.Manager. > > AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); > > > > ? > > > > Can you provide the text of the exception (even better w/ the -X: > > ExceptionDetail command line option) ? > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com > > Sent: Tuesday, September 11, 2007 6:40 AM > > To: users at lists.ironpython.com > > Subject: [IronPython] Ironpython 2 Alpha 4 > > > > The following ugly hack works fine with IronPython 1.1 and with 2.0 > alpha > > 3 but raises an exception on line 28 with IronPython 2.0 alpha 4. > > To run this you need a copy of the ICSharpCode.TextEditor.dll from > > SharpDevelop (http://www.icsharpcode.net/OpenSource/SD). > > Is this a bug or a new 'feature'? Is there a work-around? Thanks. DJL > > > > import clr > > import sys > > > > clr.AddReference('System.Windows.Forms') > > clr.AddReference('System.Drawing') > > clr.AddReference('ICSharpCode.TextEditor') > > > > from System.IO import (Path, Directory, FileInfo) > > from System.Windows.Forms import * > > from System.Drawing import (Color, Font, FontStyle, GraphicsUnit, Point, > > Size) > > from ICSharpCode.TextEditor import * > > from ICSharpCode.TextEditor.Document import * > > > > class ExecuteForm(Form): > > > > def __init__(self): > > > > self.Size = Size(1024, 768) > > self.Text = "IronPythonDev" > > > > self.editor = TextEditorControl() > > self.editor.Location = Point(0,20) > > self.editor.Enabled = True > > self.editor.Size = Size(1000, 700) > > self.editor.Anchor = AnchorStyles.Top | AnchorStyles.Left | > > AnchorStyles.Right | AnchorStyles.Bottom > > > > > > HighlightingManager.Manager. > > AddSyntaxModeFileProvider(FileSyntaxModeProvider(sys.path[0])); > > > > self.editor.Document.HighlightingStrategy = > > HighlightingManager.Manager.FindHighlighter("Python"); > > self.editor.ShowEOLMarkers = False > > self.editor.ConvertTabsToSpaces = True > > self.Controls.Add(self.editor) > > > > # Create the menu > > mainMenu1 = MainMenu() > > > > fileMenu = MenuItem() > > fileMenu.Text = "File" > > menuItemOpen = MenuItem() > > menuItemOpen.Text = "Open..." > > menuItemOpen.Click += self.OpenMenuHandler > > menuItemSave = MenuItem() > > menuItemSave.Text = "Save..." > > menuItemSave.Click += self.SaveMenuHandler > > menuItemExit = MenuItem() > > menuItemExit.Text = "Exit" > > menuItemExit.Click += self.ExitMenuHandler > > fileMenu.MenuItems.Add(menuItemOpen) > > fileMenu.MenuItems.Add(menuItemSave) > > fileMenu.MenuItems.Add(menuItemExit) > > > > mainMenu1.MenuItems.Add(fileMenu) > > self.Menu = mainMenu1 > > > > self.OpenDialog = OpenFileDialog() > > self.OpenDialog.Filter = "*.py|*.*" > > self.FileName = None > > self.InitCurrDir = Directory.GetCurrentDirectory() > > > > def OpenMenuHandler(self, source, ev): > > > > if self.OpenDialog.ShowDialog() == DialogResult.OK: > > > > self.FileName = self.OpenDialog.FileName > > self.editor.LoadFile(self.FileName) > > ext = self.FileName.lower().split(".")[-1] > > > > def SaveMenuHandler(self, source, ev): > > > > self.editor.SaveFile(self.FileName) > > > > def ExitMenuHandler(self, source, ev): > > self.Close() > > > > Application.EnableVisualStyles() > > form = ExecuteForm() > > Application.Run(form) > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Sep 11 18:59:41 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 11 Sep 2007 09:59:41 -0700 Subject: [IronPython] Creating GUI Controls with IronPython In-Reply-To: <2e598d7f0709110933s38d5cd93ke1bb00aac91687c0@mail.gmail.com> References: <2e598d7f0709110841n4ea91b34yd2516502e9f364fc@mail.gmail.com> <53171.65.222.148.229.1189525746.squirrel@webmail12.pair.com> <2e598d7f0709110933s38d5cd93ke1bb00aac91687c0@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227CA60C5B990@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I talked to one of the VS SDK guys and they haven't tested / used this scenario so it's likely you'll run into some issues with it. What does work is consuming a user control that's been written in C# but unfortunately not in IronPython. If you're feeling adventurous you could try creating a form and then just tweaking the Python code so that it inherits from UserControl instead of Form and see how far you get but I'd be a little amazed if it just worked :(. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of luis cota Sent: Tuesday, September 11, 2007 9:33 AM To: Discussion of IronPython Subject: Re: [IronPython] Creating GUI Controls with IronPython I may be misunderstanding your response, or I misstated my question. What I'd like to do is create a new User Control using the IronPython plugin for VS 2005. When I create a new project or add a new Item to my project, I cannot see User Control as an option, only a Form. Is there a way around this so that I can select a User Control to be created insetad of a Form? - Luis On 9/11/07, darren at ontrenet.com > wrote: IIRC, there should be a drop-in control for "User Control", or the appropriate reference needs to be "checked" in the toolbox options. > I have downloaded the VS2005 Addin for IronPython (found on the msdn > Blogs). This is a fantastic way to have access to Intellisense for the > .NET > libraries. I'd like to use this to create a few GUI controls, though > cannot > find this option when selecting Add New Item in the Solution Explorer. It > allows me to create a WinForm however. Do any of you know how to take the > auto-generated source for a WinForm and convert this to a User Control? > > Thanks, > > - Luis > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ 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: From lo.maximo73 at gmail.com Wed Sep 12 12:51:27 2007 From: lo.maximo73 at gmail.com (luis cota) Date: Wed, 12 Sep 2007 06:51:27 -0400 Subject: [IronPython] Eclipse-Like Framework for .NET Message-ID: <2e598d7f0709120351v6378f135rc995e7b114f1cadf@mail.gmail.com> Do any of you know of an eclipse-like framework for building applications in .NET? I'm looking for a plug-in style architecture that provides a shell of an application with the developer creating different "views" and "plugins" for use within the framework. it looks like VS 2008 is going in this direction, but Vista IMO is not looking like a worthwhile upgrade and I'd like to get onto a framework style platform such as Eclipse with IronPython. Enthought's Tool Suite along with Envisage is another similar platform, though that is for standard Python only. Any tips are greatly appreciated - thanks! - Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbelugin at gmail.com Wed Sep 12 13:11:50 2007 From: mbelugin at gmail.com (Max Belugin) Date: Wed, 12 Sep 2007 15:11:50 +0400 Subject: [IronPython] Eclipse-Like Framework for .NET In-Reply-To: <2e598d7f0709120351v6378f135rc995e7b114f1cadf@mail.gmail.com> References: <2e598d7f0709120351v6378f135rc995e7b114f1cadf@mail.gmail.com> Message-ID: <86aeb4640709120411v37428611h7d4eba19b35f2f9b@mail.gmail.com> #develop? On 9/12/07, luis cota wrote: > Do any of you know of an eclipse-like framework for building applications in > .NET? I'm looking for a plug-in style architecture that provides a shell of > an application with the developer creating different "views" and "plugins" > for use within the framework. it looks like VS 2008 is going in this > direction, but Vista IMO is not looking like a worthwhile upgrade and I'd > like to get onto a framework style platform such as Eclipse with IronPython. > Enthought's Tool Suite along with Envisage is another similar platform, > though that is for standard Python only. > > Any tips are greatly appreciated - thanks! > > - Luis > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- Max Belugin, http://belugin.info , ICQ:9406811 From redmoon17 at gmail.com Wed Sep 12 18:20:51 2007 From: redmoon17 at gmail.com (Kevin Chu) Date: Thu, 13 Sep 2007 00:20:51 +0800 Subject: [IronPython] Eclipse-Like Framework for .NET In-Reply-To: <86aeb4640709120411v37428611h7d4eba19b35f2f9b@mail.gmail.com> References: <2e598d7f0709120351v6378f135rc995e7b114f1cadf@mail.gmail.com> <86aeb4640709120411v37428611h7d4eba19b35f2f9b@mail.gmail.com> Message-ID: <41d7f4a90709120920r6ad4ccf7kfe3164c7f08a4bd4@mail.gmail.com> Visual Studio 2008 Shell On 9/12/07, Max Belugin wrote: > > #develop? > > On 9/12/07, luis cota wrote: > > Do any of you know of an eclipse-like framework for building > applications in > > .NET? I'm looking for a plug-in style architecture that provides a > shell of > > an application with the developer creating different "views" and > "plugins" > > for use within the framework. it looks like VS 2008 is going in this > > direction, but Vista IMO is not looking like a worthwhile upgrade and > I'd > > like to get onto a framework style platform such as Eclipse with > IronPython. > > Enthought's Tool Suite along with Envisage is another similar platform, > > though that is for standard Python only. > > > > Any tips are greatly appreciated - thanks! > > > > - Luis > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > -- > Max Belugin, http://belugin.info , ICQ:9406811 > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Once in a Redmoon -------------- next part -------------- An HTML attachment was scrubbed... URL: From kf9150 at gmail.com Wed Sep 12 19:29:00 2007 From: kf9150 at gmail.com (Kelie) Date: Wed, 12 Sep 2007 07:29:00 -1000 Subject: [IronPython] COM Interop: Why does this code only work in IronPython Console? Message-ID: <42b9a3ff0709121029n769ae71ag3624e6ebf3d0bdd0@mail.gmail.com> Hello, The following code works when typed into IronPython console. But when I save the code into a file named excel.py and run ipy.exe excel.py, the event handling does not seem to work. Nothing happens when a new workbook is created. Any suggestion? Thanks a lot. import clr clr.AddReference("Microsoft.Office.Interop.Excel") import Microsoft.Office.Interop.Excel as Excel clr.AddReference('System.Windows.Forms') import System.Windows.Forms.MessageBox as MessageBox def getActiveObject(appId): from System.Runtime.InteropServices import Marshal return Marshal.GetActiveObject(appId) def getActiveExcelApplication(): return getActiveObject("Excel.Application") def onNewWorkbook(workbook): print "Creating a new workbook..." MessageBox.Show("Creating a new workbook...") xlApp = getActiveExcelApplication() MessageBox.Show(xlApp.ActiveWorkbook.Name) #This line works. Excel.AppEvents_Event.add_NewWorkbook(xlApp, onNewWorkbook) #This line does not work. -- Kelie From fuzzyman at voidspace.org.uk Wed Sep 12 19:31:18 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 12 Sep 2007 18:31:18 +0100 Subject: [IronPython] COM Interop: Why does this code only work in IronPython Console? In-Reply-To: <42b9a3ff0709121029n769ae71ag3624e6ebf3d0bdd0@mail.gmail.com> References: <42b9a3ff0709121029n769ae71ag3624e6ebf3d0bdd0@mail.gmail.com> Message-ID: <46E82266.80200@voidspace.org.uk> Hello Kelie, Not sure, but it looks to me like your program will just exit after the last line... Try doing a while True loop with a Thread.Sleep() in it to keep the interpreter alive... Michael Foord http://www.manning.com/foord Kelie wrote: > Hello, > > The following code works when typed into IronPython console. But when > I save the code into a file named excel.py and run ipy.exe excel.py, > the event handling does not seem to work. Nothing happens when a new > workbook is created. > > Any suggestion? Thanks a lot. > > import clr > clr.AddReference("Microsoft.Office.Interop.Excel") > import Microsoft.Office.Interop.Excel as Excel > clr.AddReference('System.Windows.Forms') > import System.Windows.Forms.MessageBox as MessageBox > > def getActiveObject(appId): > from System.Runtime.InteropServices import Marshal > return Marshal.GetActiveObject(appId) > > def getActiveExcelApplication(): > return getActiveObject("Excel.Application") > > def onNewWorkbook(workbook): > print "Creating a new workbook..." > MessageBox.Show("Creating a new workbook...") > > xlApp = getActiveExcelApplication() > MessageBox.Show(xlApp.ActiveWorkbook.Name) #This line works. > Excel.AppEvents_Event.add_NewWorkbook(xlApp, onNewWorkbook) #This line > does not work. > > From beppler at gmail.com Wed Sep 12 23:12:17 2007 From: beppler at gmail.com (Carlos Alberto Costa Beppler) Date: Wed, 12 Sep 2007 18:12:17 -0300 Subject: [IronPython] Eclipse-Like Framework for .NET In-Reply-To: <2e598d7f0709120351v6378f135rc995e7b114f1cadf@mail.gmail.com> References: <2e598d7f0709120351v6378f135rc995e7b114f1cadf@mail.gmail.com> Message-ID: Try Composite UI Application Block if you are using Visual Studio 2005 or Acropolis if using VS 2008. 2007/9/12, luis cota : > Do any of you know of an eclipse-like framework for building applications in > .NET? I'm looking for a plug-in style architecture that provides a shell of > an application with the developer creating different "views" and "plugins" > for use within the framework. it looks like VS 2008 is going in this > direction, but Vista IMO is not looking like a worthwhile upgrade and I'd > like to get onto a framework style platform such as Eclipse with IronPython. > Enthought's Tool Suite along with Envisage is another similar platform, > though that is for standard Python only. > > Any tips are greatly appreciated - thanks! > > - Luis > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From kf9150 at gmail.com Thu Sep 13 00:42:11 2007 From: kf9150 at gmail.com (Kelie) Date: Wed, 12 Sep 2007 12:42:11 -1000 Subject: [IronPython] COM Interop: Why does this code only work in IronPython Console? In-Reply-To: <46E82266.80200@voidspace.org.uk> References: <42b9a3ff0709121029n769ae71ag3624e6ebf3d0bdd0@mail.gmail.com> <46E82266.80200@voidspace.org.uk> Message-ID: <42b9a3ff0709121542y62b3637cqfbda5ab1b86d40c3@mail.gmail.com> On 9/12/07, Michael Foord wrote: > Hello Kelie, > > Not sure, but it looks to me like your program will just exit after the > last line... Try doing a while True loop with a Thread.Sleep() in it to > keep the interpreter alive... > > Michael Foord > http://www.manning.com/foord Thanks Michael, that fixed the problem. From David.Lawler at franke.com Thu Sep 13 01:20:56 2007 From: David.Lawler at franke.com (David.Lawler at franke.com) Date: Wed, 12 Sep 2007 19:20:56 -0400 Subject: [IronPython] how to get mdbg to work with IP - or is it even possible? Message-ID: I can debug IP 2 programs fairly nicely with clrdbg even setting break points and examining variables but I have tried to get mdbg (and cordbg) to work with no success. I am interested in mdbg because I would like to learn more about how debugging support works with the clr and with IP in particular and the source is available for mdbg. Has anyone had success with mdbg and Ironpython or does this just not work. If it can work can you give me some clues about the commands that make it work? Thanks! David From dfugate at microsoft.com Thu Sep 13 01:48:26 2007 From: dfugate at microsoft.com (Dave Fugate) Date: Wed, 12 Sep 2007 16:48:26 -0700 Subject: [IronPython] how to get mdbg to work with IP - or is it even possible? In-Reply-To: References: Message-ID: <7346A825E148B049A9AD1D3ED46A2D91169A5F661D@NA-EXMSG-C106.redmond.corp.microsoft.com> This link (http://blogs.msdn.com/jmstall/archive/2005/08/31/Mdbg_Python_ext.aspx) is a bit out of date, but hopefully points you in the right direction. Dave -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com Sent: Wednesday, September 12, 2007 4:21 PM To: Discussion of IronPython Subject: [IronPython] how to get mdbg to work with IP - or is it even possible? I can debug IP 2 programs fairly nicely with clrdbg even setting break points and examining variables but I have tried to get mdbg (and cordbg) to work with no success. I am interested in mdbg because I would like to learn more about how debugging support works with the clr and with IP in particular and the source is available for mdbg. Has anyone had success with mdbg and Ironpython or does this just not work. If it can work can you give me some clues about the commands that make it work? Thanks! David _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From David.Lawler at franke.com Thu Sep 13 14:20:48 2007 From: David.Lawler at franke.com (David.Lawler at franke.com) Date: Thu, 13 Sep 2007 08:20:48 -0400 Subject: [IronPython] how to get mdbg to work with IP - or is it even possible? In-Reply-To: <7346A825E148B049A9AD1D3ED46A2D91169A5F661D@NA-EXMSG-C106.redmond.corp.microsoft.com> Message-ID: Hi - Thanks Dave, But while that shows how to embed Ironpython in Mdbg, I am looking to use Mdbg to debug IronPython programs/scripts. When I do this now with Clrdbg I can load the source and step through it, set break points etc. With Mdbg, if I use a self compiled version of Ironpython with the pdb files in place I can see the IronPython source and put breakpoints in it. However, I cannot do anything at the Ironpython program/script level. If I use a release version of Ironpython (or the binary) then I can't get anything useful to happen. David users-bounces at lists.ironpython.com wrote on 09/12/2007 07:48:26 PM: > This link (http://blogs.msdn. > com/jmstall/archive/2005/08/31/Mdbg_Python_ext.aspx) is a bit out of > date, but hopefully points you in the right direction. > > Dave > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com > Sent: Wednesday, September 12, 2007 4:21 PM > To: Discussion of IronPython > Subject: [IronPython] how to get mdbg to work with IP - or is it > even possible? > > I can debug IP 2 programs fairly nicely with clrdbg even setting break > points and examining variables but I have tried to get mdbg (and cordbg) > to work with no success. I am interested in mdbg because I would like to > learn more about how debugging support works with the clr and with IP in > particular and the source is available for mdbg. Has anyone had success > with mdbg and Ironpython or does this just not work. If it can work can > you give me some clues about the commands that make it work? > > Thanks! > > David > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Thu Sep 13 17:33:30 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 13 Sep 2007 08:33:30 -0700 Subject: [IronPython] how to get mdbg to work with IP - or is it even possible? In-Reply-To: References: <7346A825E148B049A9AD1D3ED46A2D91169A5F661D@NA-EXMSG-C106.redmond.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227CA60C5BE3C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> What are you trying to debug in particular? Is it a file of Python code or code you enter at the console? Code in a file is generally debuggable (presumably by all debuggers) where code entered at the console, via eval or exec, is not debuggable - by any debugger. The reason for this is that the latter is generated using DynamicMethod's (which are fully collectable by the GC) but don't have any debugging support at the CLR level. Additionally we did run into some issues when we tried testing IronPython w/ MDBG and these could be what you're hitting. If we compile a file such as: def foo(): print 'hello' def bar(): print 'goodbye' foo() bar() We end up creating 3 (really more, but only 3 are important) methods in a single type. The first two methods are foo and bar. The 3rd method is an Initialize method which is the file of code which contains foo and bar. Because of this and the fact that the code gets generated w/ Ref Emit MDBG receives multiple notifications of when a symbols are loaded. On those notifications it updates it's source mapping and because there is overlap between the methods it gets confused. The MDBG team has a bug on this issue as they recognize it'll be a common problem w/ dynamic languages. Unfortunately I'm not sure if they fixed it yet - they're busy working on Silverlight and we haven't pushed them very hard on the issue. In theory it should be possible to write an MDBG extension that can successfully set breakpoints in this case (or fix the bug in the publicly available mdbg source code) but by default you're going to have a difficult time with it. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com Sent: Thursday, September 13, 2007 5:21 AM To: Discussion of IronPython Subject: Re: [IronPython] how to get mdbg to work with IP - or is it even possible? Hi - Thanks Dave, But while that shows how to embed Ironpython in Mdbg, I am looking to use Mdbg to debug IronPython programs/scripts. When I do this now with Clrdbg I can load the source and step through it, set break points etc. With Mdbg, if I use a self compiled version of Ironpython with the pdb files in place I can see the IronPython source and put breakpoints in it. However, I cannot do anything at the Ironpython program/script level. If I use a release version of Ironpython (or the binary) then I can't get anything useful to happen. David users-bounces at lists.ironpython.com wrote on 09/12/2007 07:48:26 PM: > This link (http://blogs.msdn. > com/jmstall/archive/2005/08/31/Mdbg_Python_ext.aspx) is a bit out of > date, but hopefully points you in the right direction. > > Dave > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com > Sent: Wednesday, September 12, 2007 4:21 PM > To: Discussion of IronPython > Subject: [IronPython] how to get mdbg to work with IP - or is it > even possible? > > I can debug IP 2 programs fairly nicely with clrdbg even setting break > points and examining variables but I have tried to get mdbg (and cordbg) > to work with no success. I am interested in mdbg because I would like to > learn more about how debugging support works with the clr and with IP in > particular and the source is available for mdbg. Has anyone had success > with mdbg and Ironpython or does this just not work. If it can work can > you give me some clues about the commands that make it work? > > Thanks! > > David > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From lo.maximo73 at gmail.com Thu Sep 13 18:51:03 2007 From: lo.maximo73 at gmail.com (luis cota) Date: Thu, 13 Sep 2007 12:51:03 -0400 Subject: [IronPython] 3rd Party Controls & IronPython Message-ID: <2e598d7f0709130951h89dc046k4c73ae0092c7251f@mail.gmail.com> Have any of you been able to use the VS 2005 plugin to build a WinForms application that uses 3rd party controls? Each time I try to add a control to the form, the rendering of the form goes to hell and throws a ton of exceptions. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Fri Sep 14 00:22:16 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 13 Sep 2007 23:22:16 +0100 Subject: [IronPython] [python] Re: Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) In-Reply-To: <918705E903F4714CB713D89AB5F1857D712D9F7E95@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <46DF1E4B.4080901@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D712D9F7E95@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <46E9B818.3070005@voidspace.org.uk> John Messerly wrote: > Sounds like a bug in XAML event binding... > > In the Silverlight 1.1 alpha, if the XAML contains an x:Code element, then the XAML parser will always go to DLR/IronPython for event hookup. That is to say, it will never use reflection to hook the event to a statically defined C# method. That is a known limitation. > > I thought this behavior was per-XAML file, but from what you're describing it sounds like it's per application. > > The only workaround I can think of would be to define a function in your Python code for that event ("PulseStoryboardCompleted"), and then from that function call into the "real" event handler. > That means I need to know the details of what the XAML is hooking up (which I don't) and it also means that I can't use prebuilt controls from IronPython which is a major restriction. :-( Can you apply some gentle pressure in the right places? Jim Hugunin showed this working in their Vegas Mix talk - so it would be a shame to lose it as basically it means that you can't use IronPython to create rich user interfaces except completely from scratch. All the best, Michael Foord http://www.ironpython.info/ > Hope this helps, > John > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Wednesday, September 05, 2007 2:23 PM > To: Discussion of IronPython > Subject: [IronPython] Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) > > Hello all, > > I'm having an issue using Silverlight controls (compiled assemblies) > from C#. Something is going wrong with member name resolution and XAML > interactions. > > I've had this with controls I've created myself, but it also happens > with the sample controls project in the Silverlight 1.1 Refresh SDK. > > If you try adding a reference to the 'Button' class and using it from > IronPython, then Silverlight bombs out with the following message: > > Exception Details: System.MissingMethodException: Event handler > 'PulseStoryboardCompleted' is not defined > > PulseStoryBoardCompleted is setup in XAML (embedded as a resource in the > assembly). This exception kills Silverlight - it cannot be caught at the > IronPython level. > > To illustrate this, try the following IronPython code: > > import clr > clr.AddReference("Silverlight.Samples.Controls, Version=1.0.0.0, > Culture=neutral, PublicKeyToken=null") > from Silverlight.Samples.Controls import Button > > b = Button() > > > Any suggestions as to a way round this ? > > > All the best, > > > Michael Foord > http://www.ironpython.info/ > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > From vizcaynot at gmail.com Fri Sep 14 03:22:47 2007 From: vizcaynot at gmail.com (Vizcayno Tamparantan) Date: Thu, 13 Sep 2007 21:22:47 -0400 Subject: [IronPython] Having problems in connecting to an Oracle Database using last version of ODP.NET Message-ID: Hello: I recently installed Oracle 11g ODAC 11.1.0.5.10 Beta in my Win XP SP2 machine and began to type next code under "IronPython console: IronPython 2.0A4 (2.0.10904.02) on .NET 2.0.50727.42": import clr import System clr.AddReference("System.Data") clr.AddReference("Oracle.DataAccess") from System.Data import DataSet import Oracle.DataAccess Just after last instruction, next error is issued: Traceback (most recent call last): File , line 0, in ##172 File , line 0, in _stub_##2 File c:\os\ipy\src\Oracle.py, line 8, in Initialize File , line 0, in _stub_##176 AttributeError: 'module' object has no attribute 'OracleConnection' In C# I made similar operations including data recovery without problems, I show you the code where the first line shows the way I compiled: // csc oracle.cs/r:C:\oracle\product\11.1.0\client_1\odp.net\bin\2.x\Oracle.DataAccess.dll using System; using System.Data; using Oracle.DataAccess.Client; public class uracle { public static void Main() { OracleConnection con = new OracleConnection(); con.ConnectionString = "User ID=xxx;Password=yyy;Data Source=zzz"; try { con.Open(); Console.WriteLine("Conn opened."); string cmdQuery = "SELECT EMPLOYEE_ID FROM PERSON"; OracleCommand cmd = new OracleCommand(cmdQuery); cmd.Connection = con; cmd.CommandType = CommandType.Text; OracleDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { Console.WriteLine(reader.GetDecimal(0)); } } catch (Exception ex) { Console.WriteLine(ex.Message); } con.Close(); con.Dispose(); } } What do you think is happening? what is wrong with my ipy code? Thanks for your attention and HELP!!!! Vizcayno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Lawler at franke.com Thu Sep 13 23:13:54 2007 From: David.Lawler at franke.com (David.Lawler at franke.com) Date: Thu, 13 Sep 2007 17:13:54 -0400 Subject: [IronPython] how to get mdbg to work with IP - solved In-Reply-To: <7AD436E4270DD54A94238001769C2227CA60C5BE3C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Thanks for your help (again) Dino. It turns out after a lot more playing around that mdbg does work fairly well. I found out that there is a bit more of a learning curve to mdbg than I thought (who knew that you had to tell it which thread to attach to for goodness sake)! Anyhow, I got it far enough along for my purposes - so thanks. I am trying to debug code in a file fortunately. For those people tempted to try this....you need to start mdbg and then issue the following commands and you too can debug your IP code through mdbg: mode nc on (run your stuff in a seperate process) path (do not use double quotes) run "" " " (do use double quotes - how consistent) t 0 b : g when it does stop you can enter sh - to list lines of code. p - to print out local variables etc. If you try to single step - that does not work so well (you will end up in IP itself or some other oddball place)....but you can set lots of breakpoints and use those. For those of you who can compile things you can get the source for mdbg and then load the semi-gui extension and that might help. David users-bounces at lists.ironpython.com wrote on 09/13/2007 11:33:30 AM: > What are you trying to debug in particular? Is it a file of Python > code or code you enter at the console? > > Code in a file is generally debuggable (presumably by all debuggers) > where code entered at the console, via eval or exec, is not > debuggable - by any debugger. The reason for this is that the > latter is generated using DynamicMethod's (which are fully > collectable by the GC) but don't have any debugging support at the CLR level. > > Additionally we did run into some issues when we tried testing > IronPython w/ MDBG and these could be what you're hitting. If we > compile a file such as: > > def foo(): > print 'hello' > > def bar(): > print 'goodbye' > > foo() > bar() > > We end up creating 3 (really more, but only 3 are important) methods > in a single type. The first two methods are foo and bar. The 3rd > method is an Initialize method which is the file of code which > contains foo and bar. Because of this and the fact that the code > gets generated w/ Ref Emit MDBG receives multiple notifications of > when a symbols are loaded. On those notifications it updates it's > source mapping and because there is overlap between the methods it > gets confused. The MDBG team has a bug on this issue as they > recognize it'll be a common problem w/ dynamic languages. > Unfortunately I'm not sure if they fixed it yet - they're busy > working on Silverlight and we haven't pushed them very hard on the issue. > > In theory it should be possible to write an MDBG extension that can > successfully set breakpoints in this case (or fix the bug in the > publicly available mdbg source code) but by default you're going to > have a difficult time with it. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com > Sent: Thursday, September 13, 2007 5:21 AM > To: Discussion of IronPython > Subject: Re: [IronPython] how to get mdbg to work with IP - or is it > even possible? > > Hi - Thanks Dave, > > But while that shows how to embed Ironpython in Mdbg, I am looking to use > Mdbg to debug IronPython > programs/scripts. When I do this now with Clrdbg I can load the source > and step through it, set break points etc. > With Mdbg, if I use a self compiled version of Ironpython with the pdb > files in place I can see the IronPython source > and put breakpoints in it. However, I cannot do anything at the > Ironpython program/script level. If I use a release version > of Ironpython (or the binary) then I can't get anything useful to happen. > > David > > users-bounces at lists.ironpython.com wrote on 09/12/2007 07:48:26 PM: > > > This link (http://blogs.msdn. > > com/jmstall/archive/2005/08/31/Mdbg_Python_ext.aspx) is a bit out of > > date, but hopefully points you in the right direction. > > > > Dave > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of David.Lawler at franke.com > > Sent: Wednesday, September 12, 2007 4:21 PM > > To: Discussion of IronPython > > Subject: [IronPython] how to get mdbg to work with IP - or is it > > even possible? > > > > I can debug IP 2 programs fairly nicely with clrdbg even setting break > > points and examining variables but I have tried to get mdbg (and cordbg) > > to work with no success. I am interested in mdbg because I would like > to > > learn more about how debugging support works with the clr and with IP in > > particular and the source is available for mdbg. Has anyone had success > > with mdbg and Ironpython or does this just not work. If it can work can > > you give me some clues about the commands that make it work? > > > > Thanks! > > > > David > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Fri Sep 14 04:55:08 2007 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 13 Sep 2007 19:55:08 -0700 Subject: [IronPython] [python] Re: Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) In-Reply-To: <46E9B818.3070005@voidspace.org.uk> References: <46DF1E4B.4080901@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D712D9F7E95@NA-EXMSG-C116.redmond.corp.microsoft.com> <46E9B818.3070005@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF27F5F@NA-EXMSG-C116.redmond.corp.microsoft.com> Michael, Thanks for finding this. Like John said, this is a known issue, however we were not aware it was per application! We are investigating how best to fix this, be it talking to the right people to get the XAML parser updated or removing the dependency on x:Code, whichever comes first. =) We're already in the progress of removing x:Code, since it's the root of this and other Silverlight+DLR integration issues. Rest-assured, using C# controls in a DLR language is a scenario we definitely want to enable! As a "today" work-around, you could do as John suggests, however you can't call into that "real" event handler since it's private. You either have to pass on the event handler (which in this case isn't a big deal as it's just an event to continue the button hover animation), or rebuild the event handler in Python. In this case, it's simply: def PulseStoryboardCompleted(s, e): s.Begin() For other situations, you have the code for the controls, so building them in Python *should* be trivial. I agree, it's a completely un-ideal solution, but that'll get you working today. ~Jimmy > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, September 13, 2007 3:22 PM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] Re: Using Silverlight Controls from > IronPython (Uhmm... it doesn't look like you can) > > John Messerly wrote: > > Sounds like a bug in XAML event binding... > > > > In the Silverlight 1.1 alpha, if the XAML contains an x:Code element, > then the XAML parser will always go to DLR/IronPython for event hookup. > That is to say, it will never use reflection to hook the event to a > statically defined C# method. That is a known limitation. > > > > I thought this behavior was per-XAML file, but from what you're > describing it sounds like it's per application. > > > > The only workaround I can think of would be to define a function in > your Python code for that event ("PulseStoryboardCompleted"), and then > from that function call into the "real" event handler. > > > > That means I need to know the details of what the XAML is hooking up > (which I don't) and it also means that I can't use prebuilt controls > from IronPython which is a major restriction. :-( > > Can you apply some gentle pressure in the right places? Jim Hugunin > showed this working in their Vegas Mix talk - so it would be a shame to > lose it as basically it means that you can't use IronPython to create > rich user interfaces except completely from scratch. > > All the best, > > > Michael Foord > http://www.ironpython.info/ > > > Hope this helps, > > John > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > > Sent: Wednesday, September 05, 2007 2:23 PM > > To: Discussion of IronPython > > Subject: [IronPython] Using Silverlight Controls from IronPython > (Uhmm... it doesn't look like you can) > > > > Hello all, > > > > I'm having an issue using Silverlight controls (compiled assemblies) > > from C#. Something is going wrong with member name resolution and > XAML > > interactions. > > > > I've had this with controls I've created myself, but it also happens > > with the sample controls project in the Silverlight 1.1 Refresh SDK. > > > > If you try adding a reference to the 'Button' class and using it from > > IronPython, then Silverlight bombs out with the following message: > > > > Exception Details: System.MissingMethodException: Event handler > > 'PulseStoryboardCompleted' is not defined > > > > PulseStoryBoardCompleted is setup in XAML (embedded as a resource in > the > > assembly). This exception kills Silverlight - it cannot be caught at > the > > IronPython level. > > > > To illustrate this, try the following IronPython code: > > > > import clr > > clr.AddReference("Silverlight.Samples.Controls, Version=1.0.0.0, > > Culture=neutral, PublicKeyToken=null") > > from Silverlight.Samples.Controls import Button > > > > b = Button() > > > > > > Any suggestions as to a way round this ? > > > > > > All the best, > > > > > > Michael Foord > > http://www.ironpython.info/ > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Fri Sep 14 10:49:20 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 14 Sep 2007 09:49:20 +0100 Subject: [IronPython] [python] Re: Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF27F5F@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <46DF1E4B.4080901@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D712D9F7E95@NA-EXMSG-C116.redmond.corp.microsoft.com> <46E9B818.3070005@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF27F5F@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <46EA4B10.70105@voidspace.org.uk> Ok Jimmy - I'm reassured. When you say "We're already in the progress of removing x:Code", does that mean that the technique for creating Silverlight / IronPython applications will change ? All the best, Michael Foord http://www.manning.com/foord Jimmy Schementi wrote: > Michael, > > Thanks for finding this. Like John said, this is a known issue, however we were not aware it was per application! We are investigating how best to fix this, be it talking to the right people to get the XAML parser updated or removing the dependency on x:Code, whichever comes first. =) We're already in the progress of removing x:Code, since it's the root of this and other Silverlight+DLR integration issues. > > Rest-assured, using C# controls in a DLR language is a scenario we definitely want to enable! > > As a "today" work-around, you could do as John suggests, however you can't call into that "real" event handler since it's private. You either have to pass on the event handler (which in this case isn't a big deal as it's just an event to continue the button hover animation), or rebuild the event handler in Python. In this case, it's simply: > > def PulseStoryboardCompleted(s, e): > s.Begin() > > For other situations, you have the code for the controls, so building them in Python *should* be trivial. I agree, it's a completely un-ideal solution, but that'll get you working today. > > ~Jimmy > > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Thursday, September 13, 2007 3:22 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] [python] Re: Using Silverlight Controls from >> IronPython (Uhmm... it doesn't look like you can) >> >> John Messerly wrote: >> >>> Sounds like a bug in XAML event binding... >>> >>> In the Silverlight 1.1 alpha, if the XAML contains an x:Code element, >>> >> then the XAML parser will always go to DLR/IronPython for event hookup. >> That is to say, it will never use reflection to hook the event to a >> statically defined C# method. That is a known limitation. >> >>> I thought this behavior was per-XAML file, but from what you're >>> >> describing it sounds like it's per application. >> >>> The only workaround I can think of would be to define a function in >>> >> your Python code for that event ("PulseStoryboardCompleted"), and then >> from that function call into the "real" event handler. >> >> That means I need to know the details of what the XAML is hooking up >> (which I don't) and it also means that I can't use prebuilt controls >> from IronPython which is a major restriction. :-( >> >> Can you apply some gentle pressure in the right places? Jim Hugunin >> showed this working in their Vegas Mix talk - so it would be a shame to >> lose it as basically it means that you can't use IronPython to create >> rich user interfaces except completely from scratch. >> >> All the best, >> >> >> Michael Foord >> http://www.ironpython.info/ >> >> >>> Hope this helps, >>> John >>> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> >>> Sent: Wednesday, September 05, 2007 2:23 PM >>> To: Discussion of IronPython >>> Subject: [IronPython] Using Silverlight Controls from IronPython >>> >> (Uhmm... it doesn't look like you can) >> >>> Hello all, >>> >>> I'm having an issue using Silverlight controls (compiled assemblies) >>> from C#. Something is going wrong with member name resolution and >>> >> XAML >> >>> interactions. >>> >>> I've had this with controls I've created myself, but it also happens >>> with the sample controls project in the Silverlight 1.1 Refresh SDK. >>> >>> If you try adding a reference to the 'Button' class and using it from >>> IronPython, then Silverlight bombs out with the following message: >>> >>> Exception Details: System.MissingMethodException: Event handler >>> 'PulseStoryboardCompleted' is not defined >>> >>> PulseStoryBoardCompleted is setup in XAML (embedded as a resource in >>> >> the >> >>> assembly). This exception kills Silverlight - it cannot be caught at >>> >> the >> >>> IronPython level. >>> >>> To illustrate this, try the following IronPython code: >>> >>> import clr >>> clr.AddReference("Silverlight.Samples.Controls, Version=1.0.0.0, >>> Culture=neutral, PublicKeyToken=null") >>> from Silverlight.Samples.Controls import Button >>> >>> b = Button() >>> >>> >>> Any suggestions as to a way round this ? >>> >>> >>> All the best, >>> >>> >>> Michael Foord >>> http://www.ironpython.info/ >>> >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> >>> >>> >>> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From Jimmy.Schementi at microsoft.com Fri Sep 14 19:06:23 2007 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 14 Sep 2007 10:06:23 -0700 Subject: [IronPython] [python] Re: Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) In-Reply-To: <46EA4B10.70105@voidspace.org.uk> References: <46DF1E4B.4080901@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D712D9F7E95@NA-EXMSG-C116.redmond.corp.microsoft.com> <46E9B818.3070005@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF27F5F@NA-EXMSG-C116.redmond.corp.microsoft.com>, <46EA4B10.70105@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF02AF4@NA-EXMSG-C116.redmond.corp.microsoft.com> Michael, You've got it. The programming model for Silverlight 1.1 C# apps will be similar to WPF (aka. code-first and optional XAML loading). We will be adhering to that general idea, but making it fit right with dynamic languages. ~Jimmy ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Michael Foord [fuzzyman at voidspace.org.uk] Sent: Friday, September 14, 2007 1:49 AM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) Ok Jimmy - I'm reassured. When you say "We're already in the progress of removing x:Code", does that mean that the technique for creating Silverlight / IronPython applications will change ? All the best, Michael Foord http://www.manning.com/foord Jimmy Schementi wrote: > Michael, > > Thanks for finding this. Like John said, this is a known issue, however we were not aware it was per application! We are investigating how best to fix this, be it talking to the right people to get the XAML parser updated or removing the dependency on x:Code, whichever comes first. =) We're already in the progress of removing x:Code, since it's the root of this and other Silverlight+DLR integration issues. > > Rest-assured, using C# controls in a DLR language is a scenario we definitely want to enable! > > As a "today" work-around, you could do as John suggests, however you can't call into that "real" event handler since it's private. You either have to pass on the event handler (which in this case isn't a big deal as it's just an event to continue the button hover animation), or rebuild the event handler in Python. In this case, it's simply: > > def PulseStoryboardCompleted(s, e): > s.Begin() > > For other situations, you have the code for the controls, so building them in Python *should* be trivial. I agree, it's a completely un-ideal solution, but that'll get you working today. > > ~Jimmy > > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Thursday, September 13, 2007 3:22 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] [python] Re: Using Silverlight Controls from >> IronPython (Uhmm... it doesn't look like you can) >> >> John Messerly wrote: >> >>> Sounds like a bug in XAML event binding... >>> >>> In the Silverlight 1.1 alpha, if the XAML contains an x:Code element, >>> >> then the XAML parser will always go to DLR/IronPython for event hookup. >> That is to say, it will never use reflection to hook the event to a >> statically defined C# method. That is a known limitation. >> >>> I thought this behavior was per-XAML file, but from what you're >>> >> describing it sounds like it's per application. >> >>> The only workaround I can think of would be to define a function in >>> >> your Python code for that event ("PulseStoryboardCompleted"), and then >> from that function call into the "real" event handler. >> >> That means I need to know the details of what the XAML is hooking up >> (which I don't) and it also means that I can't use prebuilt controls >> from IronPython which is a major restriction. :-( >> >> Can you apply some gentle pressure in the right places? Jim Hugunin >> showed this working in their Vegas Mix talk - so it would be a shame to >> lose it as basically it means that you can't use IronPython to create >> rich user interfaces except completely from scratch. >> >> All the best, >> >> >> Michael Foord >> http://www.ironpython.info/ >> >> >>> Hope this helps, >>> John >>> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> >>> Sent: Wednesday, September 05, 2007 2:23 PM >>> To: Discussion of IronPython >>> Subject: [IronPython] Using Silverlight Controls from IronPython >>> >> (Uhmm... it doesn't look like you can) >> >>> Hello all, >>> >>> I'm having an issue using Silverlight controls (compiled assemblies) >>> from C#. Something is going wrong with member name resolution and >>> >> XAML >> >>> interactions. >>> >>> I've had this with controls I've created myself, but it also happens >>> with the sample controls project in the Silverlight 1.1 Refresh SDK. >>> >>> If you try adding a reference to the 'Button' class and using it from >>> IronPython, then Silverlight bombs out with the following message: >>> >>> Exception Details: System.MissingMethodException: Event handler >>> 'PulseStoryboardCompleted' is not defined >>> >>> PulseStoryBoardCompleted is setup in XAML (embedded as a resource in >>> >> the >> >>> assembly). This exception kills Silverlight - it cannot be caught at >>> >> the >> >>> IronPython level. >>> >>> To illustrate this, try the following IronPython code: >>> >>> import clr >>> clr.AddReference("Silverlight.Samples.Controls, Version=1.0.0.0, >>> Culture=neutral, PublicKeyToken=null") >>> from Silverlight.Samples.Controls import Button >>> >>> b = Button() >>> >>> >>> Any suggestions as to a way round this ? >>> >>> >>> All the best, >>> >>> >>> Michael Foord >>> http://www.ironpython.info/ >>> >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> >>> >>> >>> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Fri Sep 14 20:09:35 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 14 Sep 2007 19:09:35 +0100 Subject: [IronPython] [python] Re: Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF02AF4@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <46DF1E4B.4080901@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D712D9F7E95@NA-EXMSG-C116.redmond.corp.microsoft.com> <46E9B818.3070005@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF27F5F@NA-EXMSG-C116.redmond.corp.microsoft.com>, <46EA4B10.70105@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF02AF4@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <46EACE5F.9010909@voidspace.org.uk> Well.... it sounds like the new model is going to be a great improvement for Python developers on several fronts - buuuuut.... that means every online example currently available will be wrong (and I can't write my Silverlight chapter until you make the changes) ! :-) Michael Foord http://www.manning.com/foord Jimmy Schementi wrote: > Michael, > > You've got it. The programming model for Silverlight 1.1 C# apps will be similar to WPF (aka. code-first and optional XAML loading). We will be adhering to that general idea, but making it fit right with dynamic languages. > > ~Jimmy > > ________________________________________ > From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Michael Foord [fuzzyman at voidspace.org.uk] > Sent: Friday, September 14, 2007 1:49 AM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] Re: Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) > > Ok Jimmy - I'm reassured. > > When you say "We're already in the progress of removing x:Code", does > that mean that the technique for creating Silverlight / IronPython > applications will change ? > > All the best, > > Michael Foord > http://www.manning.com/foord > > > Jimmy Schementi wrote: > >> Michael, >> >> Thanks for finding this. Like John said, this is a known issue, however we were not aware it was per application! We are investigating how best to fix this, be it talking to the right people to get the XAML parser updated or removing the dependency on x:Code, whichever comes first. =) We're already in the progress of removing x:Code, since it's the root of this and other Silverlight+DLR integration issues. >> >> Rest-assured, using C# controls in a DLR language is a scenario we definitely want to enable! >> >> As a "today" work-around, you could do as John suggests, however you can't call into that "real" event handler since it's private. You either have to pass on the event handler (which in this case isn't a big deal as it's just an event to continue the button hover animation), or rebuild the event handler in Python. In this case, it's simply: >> >> def PulseStoryboardCompleted(s, e): >> s.Begin() >> >> For other situations, you have the code for the controls, so building them in Python *should* be trivial. I agree, it's a completely un-ideal solution, but that'll get you working today. >> >> ~Jimmy >> >> >> >> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>> Sent: Thursday, September 13, 2007 3:22 PM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] [python] Re: Using Silverlight Controls from >>> IronPython (Uhmm... it doesn't look like you can) >>> >>> John Messerly wrote: >>> >>> >>>> Sounds like a bug in XAML event binding... >>>> >>>> In the Silverlight 1.1 alpha, if the XAML contains an x:Code element, >>>> >>>> >>> then the XAML parser will always go to DLR/IronPython for event hookup. >>> That is to say, it will never use reflection to hook the event to a >>> statically defined C# method. That is a known limitation. >>> >>> >>>> I thought this behavior was per-XAML file, but from what you're >>>> >>>> >>> describing it sounds like it's per application. >>> >>> >>>> The only workaround I can think of would be to define a function in >>>> >>>> >>> your Python code for that event ("PulseStoryboardCompleted"), and then >>> from that function call into the "real" event handler. >>> >>> That means I need to know the details of what the XAML is hooking up >>> (which I don't) and it also means that I can't use prebuilt controls >>> from IronPython which is a major restriction. :-( >>> >>> Can you apply some gentle pressure in the right places? Jim Hugunin >>> showed this working in their Vegas Mix talk - so it would be a shame to >>> lose it as basically it means that you can't use IronPython to create >>> rich user interfaces except completely from scratch. >>> >>> All the best, >>> >>> >>> Michael Foord >>> http://www.ironpython.info/ >>> >>> >>> >>>> Hope this helps, >>>> John >>>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> >>>> >>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>> >>> >>>> Sent: Wednesday, September 05, 2007 2:23 PM >>>> To: Discussion of IronPython >>>> Subject: [IronPython] Using Silverlight Controls from IronPython >>>> >>>> >>> (Uhmm... it doesn't look like you can) >>> >>> >>>> Hello all, >>>> >>>> I'm having an issue using Silverlight controls (compiled assemblies) >>>> from C#. Something is going wrong with member name resolution and >>>> >>>> >>> XAML >>> >>> >>>> interactions. >>>> >>>> I've had this with controls I've created myself, but it also happens >>>> with the sample controls project in the Silverlight 1.1 Refresh SDK. >>>> >>>> If you try adding a reference to the 'Button' class and using it from >>>> IronPython, then Silverlight bombs out with the following message: >>>> >>>> Exception Details: System.MissingMethodException: Event handler >>>> 'PulseStoryboardCompleted' is not defined >>>> >>>> PulseStoryBoardCompleted is setup in XAML (embedded as a resource in >>>> >>>> >>> the >>> >>> >>>> assembly). This exception kills Silverlight - it cannot be caught at >>>> >>>> >>> the >>> >>> >>>> IronPython level. >>>> >>>> To illustrate this, try the following IronPython code: >>>> >>>> import clr >>>> clr.AddReference("Silverlight.Samples.Controls, Version=1.0.0.0, >>>> Culture=neutral, PublicKeyToken=null") >>>> from Silverlight.Samples.Controls import Button >>>> >>>> b = Button() >>>> >>>> >>>> Any suggestions as to a way round this ? >>>> >>>> >>>> All the best, >>>> >>>> >>>> Michael Foord >>>> http://www.ironpython.info/ >>>> >>>> >>>> _______________________________________________ >>>> Users mailing list >>>> Users at lists.ironpython.com >>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>> _______________________________________________ >>>> Users mailing list >>>> Users at lists.ironpython.com >>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From Jimmy.Schementi at microsoft.com Fri Sep 14 20:59:32 2007 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 14 Sep 2007 11:59:32 -0700 Subject: [IronPython] [python] Re: Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) In-Reply-To: <46EACE5F.9010909@voidspace.org.uk> References: <46DF1E4B.4080901@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D712D9F7E95@NA-EXMSG-C116.redmond.corp.microsoft.com> <46E9B818.3070005@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF27F5F@NA-EXMSG-C116.redmond.corp.microsoft.com>, <46EA4B10.70105@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF02AF4@NA-EXMSG-C116.redmond.corp.microsoft.com> <46EACE5F.9010909@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF2813A@NA-EXMSG-C116.redmond.corp.microsoft.com> A way to mitigate the incompatibility is to have a transition period before the 1.1 release where you can use either code-first or x:Code. I can't speak on behalf of C# apps, but that will most likely happen for "Dynamic Silverlight" anyway due to the way we're integrating it. However, the Silverlight programming model is changing in future releases, so I wouldn't write a book about it yet. =P As soon as we can get bits into your hands ... we will. ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, September 14, 2007 11:10 AM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] Re: Using Silverlight Controls from > IronPython (Uhmm... it doesn't look like you can) > > Well.... it sounds like the new model is going to be a great > improvement > for Python developers on several fronts - buuuuut.... that means every > online example currently available will be wrong (and I can't write my > Silverlight chapter until you make the changes) ! > > :-) > > Michael Foord > http://www.manning.com/foord > > Jimmy Schementi wrote: > > Michael, > > > > You've got it. The programming model for Silverlight 1.1 C# apps will > be similar to WPF (aka. code-first and optional XAML loading). We will > be adhering to that general idea, but making it fit right with dynamic > languages. > > > > ~Jimmy > > > > ________________________________________ > > From: users-bounces at lists.ironpython.com [users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > [fuzzyman at voidspace.org.uk] > > Sent: Friday, September 14, 2007 1:49 AM > > To: Discussion of IronPython > > Subject: Re: [IronPython] [python] Re: Using Silverlight Controls > from IronPython (Uhmm... it doesn't look like you can) > > > > Ok Jimmy - I'm reassured. > > > > When you say "We're already in the progress of removing x:Code", does > > that mean that the technique for creating Silverlight / IronPython > > applications will change ? > > > > All the best, > > > > Michael Foord > > http://www.manning.com/foord > > > > > > Jimmy Schementi wrote: > > > >> Michael, > >> > >> Thanks for finding this. Like John said, this is a known issue, > however we were not aware it was per application! We are investigating > how best to fix this, be it talking to the right people to get the XAML > parser updated or removing the dependency on x:Code, whichever comes > first. =) We're already in the progress of removing x:Code, since it's > the root of this and other Silverlight+DLR integration issues. > >> > >> Rest-assured, using C# controls in a DLR language is a scenario we > definitely want to enable! > >> > >> As a "today" work-around, you could do as John suggests, however you > can't call into that "real" event handler since it's private. You > either have to pass on the event handler (which in this case isn't a > big deal as it's just an event to continue the button hover animation), > or rebuild the event handler in Python. In this case, it's simply: > >> > >> def PulseStoryboardCompleted(s, e): > >> s.Begin() > >> > >> For other situations, you have the code for the controls, so > building them in Python *should* be trivial. I agree, it's a completely > un-ideal solution, but that'll get you working today. > >> > >> ~Jimmy > >> > >> > >> > >> > >>> -----Original Message----- > >>> From: users-bounces at lists.ironpython.com [mailto:users- > >>> bounces at lists.ironpython.com] On Behalf Of Michael Foord > >>> Sent: Thursday, September 13, 2007 3:22 PM > >>> To: Discussion of IronPython > >>> Subject: Re: [IronPython] [python] Re: Using Silverlight Controls > from > >>> IronPython (Uhmm... it doesn't look like you can) > >>> > >>> John Messerly wrote: > >>> > >>> > >>>> Sounds like a bug in XAML event binding... > >>>> > >>>> In the Silverlight 1.1 alpha, if the XAML contains an x:Code > element, > >>>> > >>>> > >>> then the XAML parser will always go to DLR/IronPython for event > hookup. > >>> That is to say, it will never use reflection to hook the event to a > >>> statically defined C# method. That is a known limitation. > >>> > >>> > >>>> I thought this behavior was per-XAML file, but from what you're > >>>> > >>>> > >>> describing it sounds like it's per application. > >>> > >>> > >>>> The only workaround I can think of would be to define a function > in > >>>> > >>>> > >>> your Python code for that event ("PulseStoryboardCompleted"), and > then > >>> from that function call into the "real" event handler. > >>> > >>> That means I need to know the details of what the XAML is hooking > up > >>> (which I don't) and it also means that I can't use prebuilt > controls > >>> from IronPython which is a major restriction. :-( > >>> > >>> Can you apply some gentle pressure in the right places? Jim Hugunin > >>> showed this working in their Vegas Mix talk - so it would be a > shame to > >>> lose it as basically it means that you can't use IronPython to > create > >>> rich user interfaces except completely from scratch. > >>> > >>> All the best, > >>> > >>> > >>> Michael Foord > >>> http://www.ironpython.info/ > >>> > >>> > >>> > >>>> Hope this helps, > >>>> John > >>>> > >>>> -----Original Message----- > >>>> From: users-bounces at lists.ironpython.com [mailto:users- > >>>> > >>>> > >>> bounces at lists.ironpython.com] On Behalf Of Michael Foord > >>> > >>> > >>>> Sent: Wednesday, September 05, 2007 2:23 PM > >>>> To: Discussion of IronPython > >>>> Subject: [IronPython] Using Silverlight Controls from IronPython > >>>> > >>>> > >>> (Uhmm... it doesn't look like you can) > >>> > >>> > >>>> Hello all, > >>>> > >>>> I'm having an issue using Silverlight controls (compiled > assemblies) > >>>> from C#. Something is going wrong with member name resolution and > >>>> > >>>> > >>> XAML > >>> > >>> > >>>> interactions. > >>>> > >>>> I've had this with controls I've created myself, but it also > happens > >>>> with the sample controls project in the Silverlight 1.1 Refresh > SDK. > >>>> > >>>> If you try adding a reference to the 'Button' class and using it > from > >>>> IronPython, then Silverlight bombs out with the following message: > >>>> > >>>> Exception Details: System.MissingMethodException: Event handler > >>>> 'PulseStoryboardCompleted' is not defined > >>>> > >>>> PulseStoryBoardCompleted is setup in XAML (embedded as a resource > in > >>>> > >>>> > >>> the > >>> > >>> > >>>> assembly). This exception kills Silverlight - it cannot be caught > at > >>>> > >>>> > >>> the > >>> > >>> > >>>> IronPython level. > >>>> > >>>> To illustrate this, try the following IronPython code: > >>>> > >>>> import clr > >>>> clr.AddReference("Silverlight.Samples.Controls, Version=1.0.0.0, > >>>> Culture=neutral, PublicKeyToken=null") > >>>> from Silverlight.Samples.Controls import Button > >>>> > >>>> b = Button() > >>>> > >>>> > >>>> Any suggestions as to a way round this ? > >>>> > >>>> > >>>> All the best, > >>>> > >>>> > >>>> Michael Foord > >>>> http://www.ironpython.info/ > >>>> > >>>> > >>>> _______________________________________________ > >>>> Users mailing list > >>>> Users at lists.ironpython.com > >>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >>>> _______________________________________________ > >>>> Users mailing list > >>>> Users at lists.ironpython.com > >>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>> _______________________________________________ > >>> Users mailing list > >>> Users at lists.ironpython.com > >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >>> > >>> > >> _______________________________________________ > >> Users mailing list > >> Users at lists.ironpython.com > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >> > >> > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Fri Sep 14 21:16:33 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 14 Sep 2007 20:16:33 +0100 Subject: [IronPython] [python] Re: Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can) In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF2813A@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <46DF1E4B.4080901@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D712D9F7E95@NA-EXMSG-C116.redmond.corp.microsoft.com> <46E9B818.3070005@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF27F5F@NA-EXMSG-C116.redmond.corp.microsoft.com>, <46EA4B10.70105@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF02AF4@NA-EXMSG-C116.redmond.corp.microsoft.com> <46EACE5F.9010909@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32841FCF2813A@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <46EADE11.4060209@voidspace.org.uk> Jimmy Schementi wrote: > [snip..] > > However, the Silverlight programming model is changing in future releases, so I wouldn't write a book about it yet. =P As soon as we can get bits into your hands ... we will. > > Well I'm already part way through writing a book on IronPython and I will *definitely* be including a chapter on Silverlight - so you ought to make the changes as soon as possible if for no other reason than it will make my life easier. ;-) All the best, Michael Foord http://www.manning.com/foord > ~js > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Friday, September 14, 2007 11:10 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] [python] Re: Using Silverlight Controls from >> IronPython (Uhmm... it doesn't look like you can) >> >> Well.... it sounds like the new model is going to be a great >> improvement >> for Python developers on several fronts - buuuuut.... that means every >> online example currently available will be wrong (and I can't write my >> Silverlight chapter until you make the changes) ! >> >> :-) >> >> Michael Foord >> http://www.manning.com/foord >> >> Jimmy Schementi wrote: >> >>> Michael, >>> >>> You've got it. The programming model for Silverlight 1.1 C# apps will >>> >> be similar to WPF (aka. code-first and optional XAML loading). We will >> be adhering to that general idea, but making it fit right with dynamic >> languages. >> >>> ~Jimmy >>> >>> ________________________________________ >>> From: users-bounces at lists.ironpython.com [users- >>> >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> [fuzzyman at voidspace.org.uk] >> >>> Sent: Friday, September 14, 2007 1:49 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] [python] Re: Using Silverlight Controls >>> >> from IronPython (Uhmm... it doesn't look like you can) >> >>> Ok Jimmy - I'm reassured. >>> >>> When you say "We're already in the progress of removing x:Code", does >>> that mean that the technique for creating Silverlight / IronPython >>> applications will change ? >>> >>> All the best, >>> >>> Michael Foord >>> http://www.manning.com/foord >>> >>> >>> Jimmy Schementi wrote: >>> >>> >>>> Michael, >>>> >>>> Thanks for finding this. Like John said, this is a known issue, >>>> >> however we were not aware it was per application! We are investigating >> how best to fix this, be it talking to the right people to get the XAML >> parser updated or removing the dependency on x:Code, whichever comes >> first. =) We're already in the progress of removing x:Code, since it's >> the root of this and other Silverlight+DLR integration issues. >> >>>> Rest-assured, using C# controls in a DLR language is a scenario we >>>> >> definitely want to enable! >> >>>> As a "today" work-around, you could do as John suggests, however you >>>> >> can't call into that "real" event handler since it's private. You >> either have to pass on the event handler (which in this case isn't a >> big deal as it's just an event to continue the button hover animation), >> or rebuild the event handler in Python. In this case, it's simply: >> >>>> def PulseStoryboardCompleted(s, e): >>>> s.Begin() >>>> >>>> For other situations, you have the code for the controls, so >>>> >> building them in Python *should* be trivial. I agree, it's a completely >> un-ideal solution, but that'll get you working today. >> >>>> ~Jimmy >>>> >>>> >>>> >>>> >>>> >>>>> -----Original Message----- >>>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>>>> Sent: Thursday, September 13, 2007 3:22 PM >>>>> To: Discussion of IronPython >>>>> Subject: Re: [IronPython] [python] Re: Using Silverlight Controls >>>>> >> from >> >>>>> IronPython (Uhmm... it doesn't look like you can) >>>>> >>>>> John Messerly wrote: >>>>> >>>>> >>>>> >>>>>> Sounds like a bug in XAML event binding... >>>>>> >>>>>> In the Silverlight 1.1 alpha, if the XAML contains an x:Code >>>>>> >> element, >> >>>>>> >>>>> then the XAML parser will always go to DLR/IronPython for event >>>>> >> hookup. >> >>>>> That is to say, it will never use reflection to hook the event to a >>>>> statically defined C# method. That is a known limitation. >>>>> >>>>> >>>>> >>>>>> I thought this behavior was per-XAML file, but from what you're >>>>>> >>>>>> >>>>>> >>>>> describing it sounds like it's per application. >>>>> >>>>> >>>>> >>>>>> The only workaround I can think of would be to define a function >>>>>> >> in >> >>>>>> >>>>> your Python code for that event ("PulseStoryboardCompleted"), and >>>>> >> then >> >>>>> from that function call into the "real" event handler. >>>>> >>>>> That means I need to know the details of what the XAML is hooking >>>>> >> up >> >>>>> (which I don't) and it also means that I can't use prebuilt >>>>> >> controls >> >>>>> from IronPython which is a major restriction. :-( >>>>> >>>>> Can you apply some gentle pressure in the right places? Jim Hugunin >>>>> showed this working in their Vegas Mix talk - so it would be a >>>>> >> shame to >> >>>>> lose it as basically it means that you can't use IronPython to >>>>> >> create >> >>>>> rich user interfaces except completely from scratch. >>>>> >>>>> All the best, >>>>> >>>>> >>>>> Michael Foord >>>>> http://www.ironpython.info/ >>>>> >>>>> >>>>> >>>>> >>>>>> Hope this helps, >>>>>> John >>>>>> >>>>>> -----Original Message----- >>>>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>>>> >>>>>> >>>>>> >>>>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>>>> >>>>> >>>>> >>>>>> Sent: Wednesday, September 05, 2007 2:23 PM >>>>>> To: Discussion of IronPython >>>>>> Subject: [IronPython] Using Silverlight Controls from IronPython >>>>>> >>>>>> >>>>>> >>>>> (Uhmm... it doesn't look like you can) >>>>> >>>>> >>>>> >>>>>> Hello all, >>>>>> >>>>>> I'm having an issue using Silverlight controls (compiled >>>>>> >> assemblies) >> >>>>>> from C#. Something is going wrong with member name resolution and >>>>>> >>>>>> >>>>>> >>>>> XAML >>>>> >>>>> >>>>> >>>>>> interactions. >>>>>> >>>>>> I've had this with controls I've created myself, but it also >>>>>> >> happens >> >>>>>> with the sample controls project in the Silverlight 1.1 Refresh >>>>>> >> SDK. >> >>>>>> If you try adding a reference to the 'Button' class and using it >>>>>> >> from >> >>>>>> IronPython, then Silverlight bombs out with the following message: >>>>>> >>>>>> Exception Details: System.MissingMethodException: Event handler >>>>>> 'PulseStoryboardCompleted' is not defined >>>>>> >>>>>> PulseStoryBoardCompleted is setup in XAML (embedded as a resource >>>>>> >> in >> >>>>>> >>>>> the >>>>> >>>>> >>>>> >>>>>> assembly). This exception kills Silverlight - it cannot be caught >>>>>> >> at >> >>>>>> >>>>> the >>>>> >>>>> >>>>> >>>>>> IronPython level. >>>>>> >>>>>> To illustrate this, try the following IronPython code: >>>>>> >>>>>> import clr >>>>>> clr.AddReference("Silverlight.Samples.Controls, Version=1.0.0.0, >>>>>> Culture=neutral, PublicKeyToken=null") >>>>>> from Silverlight.Samples.Controls import Button >>>>>> >>>>>> b = Button() >>>>>> >>>>>> >>>>>> Any suggestions as to a way round this ? >>>>>> >>>>>> >>>>>> All the best, >>>>>> >>>>>> >>>>>> Michael Foord >>>>>> http://www.ironpython.info/ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Users mailing list >>>>>> Users at lists.ironpython.com >>>>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>>>> _______________________________________________ >>>>>> Users mailing list >>>>>> Users at lists.ironpython.com >>>>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> _______________________________________________ >>>>> Users mailing list >>>>> Users at lists.ironpython.com >>>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>>> >>>>> >>>>> >>>> _______________________________________________ >>>> Users mailing list >>>> Users at lists.ironpython.com >>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>> >>>> >>>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From anakinnani at hotmail.com Sun Sep 16 10:49:55 2007 From: anakinnani at hotmail.com (jane janet) Date: Sun, 16 Sep 2007 08:49:55 +0000 Subject: [IronPython] Send data from PDA to PC Message-ID: An HTML attachment was scrubbed... URL: From redmoon17 at gmail.com Sun Sep 16 15:19:30 2007 From: redmoon17 at gmail.com (Kevin Chu) Date: Sun, 16 Sep 2007 21:19:30 +0800 Subject: [IronPython] Send data from PDA to PC In-Reply-To: References: Message-ID: <41d7f4a90709160619h228b366cmcad3aa278b269716@mail.gmail.com> IronPython now can't run on .NET Compact Framework, So you can do it on PC. On 9/16/07, jane janet wrote: > > > Hello all, > > I have no idea to send data from PDA to personal computer. > > My Application is about RFID technology. I use Intermec Hanheld Reader 700 > series(PDA). The OS. of this device is Window 2003. I want to use this > devide read RFID Tags and Barcodes (It's can read both of these.) and send > the read data to my personal computer. What should I do by IronPython? > > Please help me. > > All the best. > > ------------------------------ > Get the device you want, with the Hotmail(r) you love. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- Once in a Redmoon -------------- next part -------------- An HTML attachment was scrubbed... URL: From anakinnani at hotmail.com Sun Sep 16 18:12:13 2007 From: anakinnani at hotmail.com (jane janet) Date: Sun, 16 Sep 2007 16:12:13 +0000 Subject: [IronPython] (no subject) Message-ID: An HTML attachment was scrubbed... URL: From joesox at gmail.com Mon Sep 17 04:19:19 2007 From: joesox at gmail.com (JoeSox) Date: Sun, 16 Sep 2007 19:19:19 -0700 Subject: [IronPython] Please vote on WorkItemId=12283 (sys.argv always empty) Message-ID: <785694cd0709161919h3f7fd306g4075f9d6dea9015a@mail.gmail.com> Everyone loves WorkItem Voting right?? :) sys.argv always empty regardless of params passed to ipyw.exe http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=12283 I even have a proposed fix (not complete fix just a get start perhaps): FileInfo myfileinfo = new FileInfo(Environment.CurrentDirectory + "\\" + "passedfilenamearg"); Console.WriteLine(myfileinfo.FullName); and I noticed in Alpha4 there was no SystemState.Instance.argv so I am guessing that would be worked in somewhere. It would be nice to have this in the next release, hint hint vote vote! :) -- Later, JoeSox From vizcaynot at gmail.com Mon Sep 17 05:16:31 2007 From: vizcaynot at gmail.com (Vizcayno Tamparantan) Date: Sun, 16 Sep 2007 23:16:31 -0400 Subject: [IronPython] An error using cPickle Message-ID: Hello: >From my WIN XP SP2, using: IronPython console: IronPython 2.0A4 (2.0.10904.02) on .NET 2.0.50727.42 I accessed to Active Directory data at my office in the next way: import sys import clr import System clr.AddReferenceByPartialName("System.DirectoryServices") root=System.DirectoryServices.DirectoryEntry() s=System.DirectoryServices.DirectorySearcher() s.Filter = "(cn=*smith*)" s.SizeLimit = 1000 s.PageSize = 1000 r=s.FindAll() r.Count # Gives me 5 so, it worked Now I want to Pickle variable r but get an error: import cPickle ad = open("actdir", "w") cPickle.dump(r, ad) Traceback (most recent call last): File , line 0, in ##234 File , line 0, in _stub_##235 TypeError: default __new__ does not take parameters What am I missing? -------------- next part -------------- An HTML attachment was scrubbed... URL: From vizcaynot at gmail.com Mon Sep 17 05:22:35 2007 From: vizcaynot at gmail.com (Vizcayno Tamparantan) Date: Sun, 16 Sep 2007 23:22:35 -0400 Subject: [IronPython] Having problems in connecting to an Oracle Database using last version of ODP.NET (solved) Message-ID: I solved the problem related to: import clr import System clr.AddReference("System.Data") clr.AddReference("Oracle.DataAccess") from System.Data import DataSet import Oracle.DataAccess Just after last instruction, next error is issued: Traceback (most recent call last): File , line 0, in ##172 File , line 0, in _stub_##2 File c:\os\ipy\src\Oracle.py, line 8, in Initialize File , line 0, in _stub_##176 AttributeError: 'module' object has no attribute 'OracleConnection' I had a script file called oracle.py into my disk folder and instead of importing Oracle.DataAccess it was importing data from the script file. Sorry!!!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From SFOX2 at dot.state.tx.us Mon Sep 17 15:47:35 2007 From: SFOX2 at dot.state.tx.us (Shawn Fox) Date: Mon, 17 Sep 2007 08:47:35 -0500 Subject: [IronPython] (no subject) In-Reply-To: References: Message-ID: <46EE3F27020000B600004203@gwia.dot.state.tx.us> The easiest solution is to setup a bluetooth serial port. This can easily be addressed by your code on the PC. Serial Communication is very easy, and while not the fastest thing on the block, is still suitable for many purposes. IronPython can't run under the compact framework, so you will need to use a different language on that side. >>> "jane janet" 2007-09-16 11:12 AM >>> Hello all,I must apologise for a few mistakes. The Intermec has Windows Mobile 2003 for Pocket PC's O.S.I wonder how can I send data from Pocket PC to my PC through Bluetooth, wireless or something.And I'm looking forward for all suggestions.All the best. Share your special parenting moments! From dinov at exchange.microsoft.com Mon Sep 17 17:42:39 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 17 Sep 2007 08:42:39 -0700 Subject: [IronPython] An error using cPickle In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227CA60C5C2FD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We haven't extended Pickle to support arbitrary (presumably serializable) .NET objects. For that you'll need to use normal .NET serialization (if the object is serializable) or serialize this manually. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vizcayno Tamparantan Sent: Sunday, September 16, 2007 8:17 PM To: users at lists.ironpython.com Subject: [IronPython] An error using cPickle Hello: >From my WIN XP SP2, using: IronPython console: IronPython 2.0A4 (2.0.10904.02) on .NET 2.0.50727.42 I accessed to Active Directory data at my office in the next way: import sys import clr import System clr.AddReferenceByPartialName("System.DirectoryServices") root=System.DirectoryServices.DirectoryEntry () s=System.DirectoryServices.DirectorySearcher() s.Filter = "(cn=*smith*)" s.SizeLimit = 1000 s.PageSize = 1000 r=s.FindAll() r.Count # Gives me 5 so, it worked Now I want to Pickle variable r but get an error: import cPickle ad = open("actdir", "w") cPickle.dump(r, ad) Traceback (most recent call last): File , line 0, in ##234 File , line 0, in _stub_##235 TypeError: default __new__ does not take parameters What am I missing? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Mon Sep 17 21:39:48 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 17 Sep 2007 12:39:48 -0700 Subject: [IronPython] Please vote on WorkItemId=12283 (sys.argv always empty) In-Reply-To: <785694cd0709161919h3f7fd306g4075f9d6dea9015a@mail.gmail.com> References: <785694cd0709161919h3f7fd306g4075f9d6dea9015a@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227CA60C5C426@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We'll fix this for the next release (I'm looking at it right now! :) ). I still see argv existing in SystemState but I think the actual problem is somewhere in the command line parser for ipyw. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Sunday, September 16, 2007 7:19 PM To: Discussion of IronPython Subject: [IronPython] Please vote on WorkItemId=12283 (sys.argv always empty) Everyone loves WorkItem Voting right?? :) sys.argv always empty regardless of params passed to ipyw.exe http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=12283 I even have a proposed fix (not complete fix just a get start perhaps): FileInfo myfileinfo = new FileInfo(Environment.CurrentDirectory + "\\" + "passedfilenamearg"); Console.WriteLine(myfileinfo.FullName); and I noticed in Alpha4 there was no SystemState.Instance.argv so I am guessing that would be worked in somewhere. It would be nice to have this in the next release, hint hint vote vote! :) -- Later, JoeSox _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From joesox at gmail.com Tue Sep 18 00:52:38 2007 From: joesox at gmail.com (JoeSox) Date: Mon, 17 Sep 2007 15:52:38 -0700 Subject: [IronPython] Please vote on WorkItemId=12283 (sys.argv always empty) In-Reply-To: <7AD436E4270DD54A94238001769C2227CA60C5C426@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <785694cd0709161919h3f7fd306g4075f9d6dea9015a@mail.gmail.com> <7AD436E4270DD54A94238001769C2227CA60C5C426@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <785694cd0709171552h1ceb95b0j4b29be8a6d90ac1b@mail.gmail.com> On 9/17/07, Dino Viehland wrote: > We'll fix this for the next release (I'm looking at it right now! :) ). I still see argv existing in SystemState but I think the actual problem is somewhere in the command line parser for ipyw. > Excellent. Thanks. -- Later, JoeSox From pillar2012 at gmail.com Tue Sep 18 07:25:33 2007 From: pillar2012 at gmail.com (Newell Jensen) Date: Mon, 17 Sep 2007 22:25:33 -0700 Subject: [IronPython] Mono classes will not import Message-ID: <3fa429ba0709172225x118edf6g969b0e37362ad539@mail.gmail.com> I just installed mono (version 1.2.5) and IPCE (IronPython version 1.1 (1.1) on .NET 2.0.50727.42. I am having troubles import the Mono classes. That is something like this, $ mono ipy.exe >>> import Mono give me the error that their is no module Mono. I also tried mono etc. It works when I do to import .NET classes such as System etc. I made sure that all my dependencies were taken care of. Is there something that I am missing? Thanks for your help. -- Newell Jensen -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Tue Sep 18 07:34:39 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 18 Sep 2007 14:34:39 +0900 Subject: [IronPython] Mono classes will not import In-Reply-To: <3fa429ba0709172225x118edf6g969b0e37362ad539@mail.gmail.com> References: <3fa429ba0709172225x118edf6g969b0e37362ad539@mail.gmail.com> Message-ID: <5b0248170709172234k113cf3f6x27e6664bc21912d2@mail.gmail.com> 2007/9/18, Newell Jensen : > I just installed mono (version 1.2.5) and IPCE (IronPython version 1.1 (1.1) > on .NET 2.0.50727.42. I am having troubles import the Mono classes. That is > something like this, > > $ mono ipy.exe > >>> import Mono > > give me the error that their is no module Mono. I also tried mono etc. It > works when I do to import .NET classes such as System etc. I made sure that > all my dependencies were taken care of. Is there something that I am > missing? Thanks for your help. You need to add reference to appropriate assemblies. For example, this works for me: $ mono ipy.exe >>> import clr >>> clr.AddReference('Mono.Posix') >>> import Mono -- Seo Sanghyeon From pillar2012 at gmail.com Tue Sep 18 07:37:54 2007 From: pillar2012 at gmail.com (Newell Jensen) Date: Mon, 17 Sep 2007 22:37:54 -0700 Subject: [IronPython] Mono classes will not import In-Reply-To: <5b0248170709172234k113cf3f6x27e6664bc21912d2@mail.gmail.com> References: <3fa429ba0709172225x118edf6g969b0e37362ad539@mail.gmail.com> <5b0248170709172234k113cf3f6x27e6664bc21912d2@mail.gmail.com> Message-ID: <3fa429ba0709172237m50bda1fdx77dba4667b9f49ea@mail.gmail.com> Thanks...I can't believe I missed that. While I am writing this email, does anyone know a good site that has lots of examples of IronPython code? On 9/17/07, Sanghyeon Seo wrote: > > 2007/9/18, Newell Jensen : > > I just installed mono (version 1.2.5) and IPCE (IronPython version 1.1 ( > 1.1) > > on .NET 2.0.50727.42. I am having troubles import the Mono classes. > That is > > something like this, > > > > $ mono ipy.exe > > >>> import Mono > > > > give me the error that their is no module Mono. I also tried mono > etc. It > > works when I do to import .NET classes such as System etc. I made sure > that > > all my dependencies were taken care of. Is there something that I am > > missing? Thanks for your help. > > You need to add reference to appropriate assemblies. For example, this > works for me: > > $ mono ipy.exe > >>> import clr > >>> clr.AddReference('Mono.Posix') > >>> import Mono > > -- > Seo Sanghyeon > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Newell Jensen Software Developer Global Energy Decisions 2379 Gateway Oaks Dr Sacramento, CA 95833 (916) 609-7811 njensen at globalenergy.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Tue Sep 18 07:40:28 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 18 Sep 2007 14:40:28 +0900 Subject: [IronPython] Mono classes will not import In-Reply-To: <3fa429ba0709172237m50bda1fdx77dba4667b9f49ea@mail.gmail.com> References: <3fa429ba0709172225x118edf6g969b0e37362ad539@mail.gmail.com> <5b0248170709172234k113cf3f6x27e6664bc21912d2@mail.gmail.com> <3fa429ba0709172237m50bda1fdx77dba4667b9f49ea@mail.gmail.com> Message-ID: <5b0248170709172240s5d2bd430i9b16f246ef9b7356@mail.gmail.com> 2007/9/18, Newell Jensen : > Thanks...I can't believe I missed that. > While I am writing this email, does anyone know a good site that has lots of > examples of IronPython code? There is IronPython Cookbook. Your contribution is welcome! http://www.ironpython.info/ -- Seo Sanghyeon From sanxiyn at gmail.com Tue Sep 18 11:16:40 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 18 Sep 2007 18:16:40 +0900 Subject: [IronPython] IronPython 2.0 Alpha 4 and Mono Message-ID: <5b0248170709180216r1ddad439u600f8ec56452915@mail.gmail.com> This is a call for help. Have anyone managed to compile IronPython 2.0 Alpha 4 from source with Mono tools? I haven't yet. The relevant Mono bug is: https://bugzilla.novell.com/show_bug.cgi?id=MONO82811 -- Seo Sanghyeon From David.Lawler at franke.com Tue Sep 18 22:51:52 2007 From: David.Lawler at franke.com (David.Lawler at franke.com) Date: Tue, 18 Sep 2007 16:51:52 -0400 Subject: [IronPython] Using mdbg from IronPython Message-ID: I am experimenting and learning about debugging by playing with the source code to mdbg and the various samples. I thought it would be fun to take the mdbg c# example program that prints out modules as they are loaded and make a version in IronPython (I tried IP 1.1 and 2.0A3): import clr clr.AddReference('mdbgeng') from Microsoft.Samples.Debugging.MdbgEngine import * debugger = MDbgEngine() debugger.Options.CreateProcessWithNewConsole = True debugger.Options.StopOnModuleLoad = True proc = debugger.CreateProcess("ipy.exe", "", DebugModeFlag.Debug, None) while (proc.IsAlive): proc.Go().WaitOne() o = proc.StopReason if (isinstance(o) == ModuleLoadedStopReason): print o.Module.CorModule.Name print "done" Original c# program link: http://blogs.msdn.com/jmstall/archive/2004/11/19/267135.aspx Unfortunately, it does not work. The call to proc.Go().WaitOne() never returns and ipy.exe launches - but nothing is displayed in the window. What am I doing wrong (or is this just too weird for IronPython to handle)? Thanks, David From Christian2.Schmidt at gmx.de Tue Sep 18 23:47:39 2007 From: Christian2.Schmidt at gmx.de (Christian Schmidt) Date: Tue, 18 Sep 2007 23:47:39 +0200 Subject: [IronPython] Python as embedded expression evaluator Message-ID: <46F0477B.4050903@gmx.de> Hi all, I'm using IronPython 1.1 as an expression evaluator in an C# application. These expressions are evaluated repeatedly with different variables. Therefore I should use CreateLambda instead of Evaluate. I have the variables in an IDictionary. But I don't know what the CreateLambda equivalent of Evaluate(expression, module, locals) is, where I hand over the variables in a dictionary. Another question is, how I can determine the variables used by the expression (dependencies). Is there an easy way, or do I have to use the parser? Furthermore I'd like to add functions to be available in expressions. By adding objects to a module's globals property, I can access their methods in an expression, but how can I add user defined C# functions (public static) without the need to write the class name in front? For example write Pow(a,b) instead of Math.Pow(a,b). Is there a tutorial on how to use IronPython as an expression evaluator? I'd be thankful for any hints on that topic. Thanks, Christian From fuzzyman at voidspace.org.uk Wed Sep 19 14:50:41 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 19 Sep 2007 13:50:41 +0100 Subject: [IronPython] IronPython 2 Bug - code module and InteractiveInterpreter (stdout swallowed or not appearing) Message-ID: <46F11B21.5070305@voidspace.org.uk> Hello all, There is an annoying bug with IronPython 2 which is blocking me from implementing an 'interactive interpreter in the browser'. I'm afraid I can only show how to reproduce the bug rather than diagnose the cause. When executing code with the 'InteractiveInterpreter' class from the standard library code module, the result of the last expression is sent to stdout. This mirrors the behaviour of the normal Python interactive interpreter. In IronPython 1.1 this works fine - and I can trap the output by replacing 'sys.stdout' with my own Python object. In IronPython 2, this output just doesn't appear. :-( If you run 'test_console.py' (with the other attached files in the same directory) with IronPython 1.1 it will print the following line to standard out "Received (out) : 3Received (out) :". If you run it with IronPython 2 (I've tried it with both Silverlight and 2.0a4) it outputs nothing. This is a darn shame because having an interactive interpreter in the browser is way cool... Michael Foord http://www.manning.com/foord -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: test_console.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: traceback.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: types.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: __future__.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ipcode.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ipcodeop.py URL: From fuzzyman at voidspace.org.uk Wed Sep 19 15:22:57 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 19 Sep 2007 14:22:57 +0100 Subject: [IronPython] IronPython 2 Bug - code module and InteractiveInterpreter (stdout swallowed or not appearing) In-Reply-To: <46F11B21.5070305@voidspace.org.uk> References: <46F11B21.5070305@voidspace.org.uk> Message-ID: <46F122B1.6080506@voidspace.org.uk> Hello all (again), A simpler way of reproducing the bug is as follows: IronPython 1 and CPython >>> c = compile('3', 'test', 'single', 0, 1) >>> exec c 3 >>> IronPython 2 >>> c = compile('3', 'test', 'single', 0, 1) >>> exec c >>> I have a 'proof-of-concept' interpreter that runs in the browser, but this bug makes it not so fun. :-( Michael Foord http://www.ironpython.info/ Michael Foord wrote: > Hello all, > > There is an annoying bug with IronPython 2 which is blocking me from > implementing an 'interactive interpreter in the browser'. > > I'm afraid I can only show how to reproduce the bug rather than > diagnose the cause. > > When executing code with the 'InteractiveInterpreter' class from the > standard library code module, the result of the last expression is > sent to stdout. This mirrors the behaviour of the normal Python > interactive interpreter. > > In IronPython 1.1 this works fine - and I can trap the output by > replacing 'sys.stdout' with my own Python object. > > In IronPython 2, this output just doesn't appear. :-( > > If you run 'test_console.py' (with the other attached files in the > same directory) with IronPython 1.1 it will print the following line > to standard out "Received (out) : 3Received (out) :". > > If you run it with IronPython 2 (I've tried it with both Silverlight > and 2.0a4) it outputs nothing. > > This is a darn shame because having an interactive interpreter in the > browser is way cool... > > Michael Foord > http://www.manning.com/foord > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Sep 19 18:17:07 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 19 Sep 2007 09:17:07 -0700 Subject: [IronPython] IronPython 2 Bug - code module and InteractiveInterpreter (stdout swallowed or not appearing) In-Reply-To: <46F122B1.6080506@voidspace.org.uk> References: <46F11B21.5070305@voidspace.org.uk> <46F122B1.6080506@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227CC5D2AEB0C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> This is because Builtin.compile is setting the SourceCodeKind to SourceCodeKind.SingleStatement and we don't turn on printExpressions for SingleStatements. In IronPython.Compiler.Parser there is a method ParseSingleStatement. You just need to change the last parameter when newing up the PythonAst to true from false and it'll work. It should be a perfectly safe change as this is the only place in the world that uses SourceCodeKind.SingleStatement. I'll probably check-in the fix today and add a test case so we don't break it in the future - so you'll see this in the next release. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, September 19, 2007 6:23 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2 Bug - code module and InteractiveInterpreter (stdout swallowed or not appearing) Hello all (again), A simpler way of reproducing the bug is as follows: IronPython 1 and CPython >>> c = compile('3', 'test', 'single', 0, 1) >>> exec c 3 >>> IronPython 2 >>> c = compile('3', 'test', 'single', 0, 1) >>> exec c >>> I have a 'proof-of-concept' interpreter that runs in the browser, but this bug makes it not so fun. :-( Michael Foord http://www.ironpython.info/ Michael Foord wrote: > Hello all, > > There is an annoying bug with IronPython 2 which is blocking me from > implementing an 'interactive interpreter in the browser'. > > I'm afraid I can only show how to reproduce the bug rather than > diagnose the cause. > > When executing code with the 'InteractiveInterpreter' class from the > standard library code module, the result of the last expression is > sent to stdout. This mirrors the behaviour of the normal Python > interactive interpreter. > > In IronPython 1.1 this works fine - and I can trap the output by > replacing 'sys.stdout' with my own Python object. > > In IronPython 2, this output just doesn't appear. :-( > > If you run 'test_console.py' (with the other attached files in the > same directory) with IronPython 1.1 it will print the following line > to standard out "Received (out) : 3Received (out) :". > > If you run it with IronPython 2 (I've tried it with both Silverlight > and 2.0a4) it outputs nothing. > > This is a darn shame because having an interactive interpreter in the > browser is way cool... > > Michael Foord > http://www.manning.com/foord > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Wed Sep 19 18:29:40 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 19 Sep 2007 17:29:40 +0100 Subject: [IronPython] IronPython 2 Bug - code module and InteractiveInterpreter (stdout swallowed or not appearing) In-Reply-To: <7AD436E4270DD54A94238001769C2227CC5D2AEB0C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <46F11B21.5070305@voidspace.org.uk> <46F122B1.6080506@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AEB0C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <46F14E74.3000200@voidspace.org.uk> Cool - you're a legend. :-) Of course I'll have to wait for the next release of Silverlight to really see this (unless I can figure out how to compile the DLR as a Silverlight project - I failed *last* time I tried). Thanks Michael http://www.manning.com/foord Dino Viehland wrote: > This is because Builtin.compile is setting the SourceCodeKind to SourceCodeKind.SingleStatement and we don't turn on printExpressions for SingleStatements. > > In IronPython.Compiler.Parser there is a method ParseSingleStatement. You just need to change the last parameter when newing up the PythonAst to true from false and it'll work. It should be a perfectly safe change as this is the only place in the world that uses SourceCodeKind.SingleStatement. > > I'll probably check-in the fix today and add a test case so we don't break it in the future - so you'll see this in the next release. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Wednesday, September 19, 2007 6:23 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 2 Bug - code module and InteractiveInterpreter (stdout swallowed or not appearing) > > Hello all (again), > > A simpler way of reproducing the bug is as follows: > > IronPython 1 and CPython > >>> c = compile('3', 'test', 'single', 0, 1) > >>> exec c > 3 > >>> > > IronPython 2 > >>> c = compile('3', 'test', 'single', 0, 1) > >>> exec c > >>> > > I have a 'proof-of-concept' interpreter that runs in the browser, but > this bug makes it not so fun. :-( > > Michael Foord > http://www.ironpython.info/ > > > > > Michael Foord wrote: > >> Hello all, >> >> There is an annoying bug with IronPython 2 which is blocking me from >> implementing an 'interactive interpreter in the browser'. >> >> I'm afraid I can only show how to reproduce the bug rather than >> diagnose the cause. >> >> When executing code with the 'InteractiveInterpreter' class from the >> standard library code module, the result of the last expression is >> sent to stdout. This mirrors the behaviour of the normal Python >> interactive interpreter. >> >> In IronPython 1.1 this works fine - and I can trap the output by >> replacing 'sys.stdout' with my own Python object. >> >> In IronPython 2, this output just doesn't appear. :-( >> >> If you run 'test_console.py' (with the other attached files in the >> same directory) with IronPython 1.1 it will print the following line >> to standard out "Received (out) : 3Received (out) :". >> >> If you run it with IronPython 2 (I've tried it with both Silverlight >> and 2.0a4) it outputs nothing. >> >> This is a darn shame because having an interactive interpreter in the >> browser is way cool... >> >> Michael Foord >> http://www.manning.com/foord >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From David.Lawler at franke.com Wed Sep 19 20:06:00 2007 From: David.Lawler at franke.com (David.Lawler at franke.com) Date: Wed, 19 Sep 2007 14:06:00 -0400 Subject: [IronPython] Using mdbg from IronPython In-Reply-To: Message-ID: Ok I solved my own problem (a small miracle there). The reason that it did not work is that you have to call anything that uses mscordbi (like mdbg), from an thread that is running in ApartmentState.MTA. Therefore, I needed to create a second worker thread in my IronPython script running in MTA mode, shove all the debugger related stuff in there, and then call it from my main thread. David Lawler/FKS/FRANKE wrote on 09/18/2007 04:51:52 PM: > I am experimenting and learning about debugging by playing with the > source code to mdbg and the various samples. > I thought it would be fun to take the mdbg c# example program that > prints out modules as they are loaded and make a > version in IronPython (I tried IP 1.1 and 2.0A3): > > import clr > > clr.AddReference('mdbgeng') > > from Microsoft.Samples.Debugging.MdbgEngine import * > > debugger = MDbgEngine() > debugger.Options.CreateProcessWithNewConsole = True > debugger.Options.StopOnModuleLoad = True > > proc = debugger.CreateProcess("ipy.exe", "", DebugModeFlag.Debug, None) > > while (proc.IsAlive): > proc.Go().WaitOne() > o = proc.StopReason > if (isinstance(o) == ModuleLoadedStopReason): > print o.Module.CorModule.Name > > print "done" > > Original c# program link: http://blogs.msdn. > com/jmstall/archive/2004/11/19/267135.aspx > > Unfortunately, it does not work. The call to proc.Go().WaitOne() > never returns and ipy.exe launches - but nothing is > displayed in the window. What am I doing wrong (or is this just too > weird for IronPython to handle)? Thanks, > > David From kpadmasola at gmail.com Thu Sep 20 12:14:00 2007 From: kpadmasola at gmail.com (Krishna Padmasola) Date: Thu, 20 Sep 2007 15:44:00 +0530 Subject: [IronPython] help with activex error Message-ID: <2451105e0709200314n35b231d6mc1534edda20a174e@mail.gmail.com> Hi, I'm trying to add the remote desktop activex control to a windows form and am getting the following error. How can I fix this? thanks for your help, Krishna. C:\IronPython-1.1>ipy -X:TabCompletion IronPython 1.1 (1.1) on .NET 2.0.50727.312 Copyright (c) Microsoft Corporation. All rights reserved. >>> import winforms >>> import System >>> import System.Windows.Forms as wf >>> f = wf.Form() >>> f.Show() >>> import clr >>> clr.AddReferenceToFile("AxMSTSCLib.dll") >>> import AxMSTSCLib as mstsc >>> rdp = mstsc.AxMsRdpClient2() Traceback (most recent call last): SystemError: ActiveX control '9059f30f-4eb1-4bd2-9fdc-36f43a218f4a' cannot be instantiated because the current thread is not in a single-threaded apartment. >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From amm at selektro.dk Thu Sep 20 12:53:39 2007 From: amm at selektro.dk (Anders M. Mikkelsen) Date: Thu, 20 Sep 2007 12:53:39 +0200 Subject: [IronPython] Accessing call stack Message-ID: <001d01c7fb74$808cd5c0$1600a8c0@PC52> Hi Is there any way of accessing the python call stack in IronPython. I'we tried using System.Diagnostics.StackTrace but most calls on the clr call stack seem to be ironpython 'internals': def Log(msg): '''General logging function''' print "%s: %s" % (StackTrace(1).GetFrame(0).GetMethod().Name, msg) I could search the stack trace for actual python functions (I guess) as their clr name seem to end in $fN; but I'm guessing that there must be an easier way? /anders -------------- next part -------------- An HTML attachment was scrubbed... URL: From David.Lawler at franke.com Thu Sep 20 14:58:36 2007 From: David.Lawler at franke.com (David.Lawler at franke.com) Date: Thu, 20 Sep 2007 08:58:36 -0400 Subject: [IronPython] help with activex error In-Reply-To: <2451105e0709200314n35b231d6mc1534edda20a174e@mail.gmail.com> Message-ID: This is all due to the wonderful issue created by COM components that can be single-threaded or multi-threaded 'apartment'. I do not really fully understand what this means (you can google about it and find lots of information) - but I have run into it before and know how to fix it. The winforms.py that comes with the examples allows you to program windows forms interactively by creating a second thread for you. You just need to put that thread into STA 'mode': Make a copy of winforms.py and at the top add: from System.Threading import ApartmentState. Then near the bottom, before the line: t.Start() add a line like this: t.ApartmentState = ApartmentState.STA Then your example will work! Enjoy! David users-bounces at lists.ironpython.com wrote on 09/20/2007 06:14:00 AM: > Hi, > > I'm trying to add the remote desktop activex control to a windows > form and am getting the following error. How can I fix this? > > thanks for your help, > Krishna. > > C:\IronPython-1.1>ipy -X:TabCompletion > IronPython 1.1 (1.1) on .NET 2.0.50727.312 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import winforms > >>> import System > >>> import System.Windows.Forms as wf > >>> f = wf.Form() > >>> f.Show() > >>> import clr > >>> clr.AddReferenceToFile("AxMSTSCLib.dll ") > >>> import AxMSTSCLib as mstsc > >>> rdp = mstsc.AxMsRdpClient2() > Traceback (most recent call last): > SystemError: ActiveX control '9059f30f-4eb1-4bd2-9fdc-36f43a218f4a' > cannot be instantiated because the current thread is not in a > single-threaded apartment. > >>> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Thu Sep 20 18:01:00 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 20 Sep 2007 09:01:00 -0700 Subject: [IronPython] Accessing call stack In-Reply-To: <001d01c7fb74$808cd5c0$1600a8c0@PC52> References: <001d01c7fb74$808cd5c0$1600a8c0@PC52> Message-ID: <7AD436E4270DD54A94238001769C2227CC5D2AEE1F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Unfortunately there's no good way to do this. We have logic in PythonEngine to filter stack frames but it's only exposed for doing this on exceptions, not on arbitrary stack traces. And unfortunately v2.0 is in about the same shape - all of its support revolves around exceptions too and it's filtering is probably even less useful than v1.x's for these purposes. I've opened up a feature request to add this because it does seem like something that will be fundamentally needed (especially as more languages run on the DLR) and it's pretty basic functionality. The bug tracking it is here: http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12876 Unfortunately it may not be entirely simple because DynamicMethod's have no debugging info (and that's what much of the code gets generated as) but we should be able to do something here. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anders M. Mikkelsen Sent: Thursday, September 20, 2007 3:54 AM To: Discussion of IronPython Subject: [IronPython] Accessing call stack Hi Is there any way of accessing the python call stack in IronPython. I'we tried using System.Diagnostics.StackTrace but most calls on the clr call stack seem to be ironpython 'internals': def Log(msg): '''General logging function''' print "%s: %s" % (StackTrace(1).GetFrame(0).GetMethod().Name, msg) I could search the stack trace for actual python functions (I guess) as their clr name seem to end in $fN; but I'm guessing that there must be an easier way? /anders -------------- next part -------------- An HTML attachment was scrubbed... URL: From leculver at microsoft.com Thu Sep 20 22:35:07 2007 From: leculver at microsoft.com (Lee Culver) Date: Thu, 20 Sep 2007 13:35:07 -0700 Subject: [IronPython] Accessing call stack In-Reply-To: <7AD436E4270DD54A94238001769C2227CC5D2AEE1F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <001d01c7fb74$808cd5c0$1600a8c0@PC52> <7AD436E4270DD54A94238001769C2227CC5D2AEE1F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <6512F99DEFF77C418E6738CE6E12FD4E5BB70B226D@NA-EXMSG-C105.redmond.corp.microsoft.com> In a related problem, could you guys take another look at sys._getframe when implementing this feature? There is a lot going on in the returned frame object from that function, but I think the big holdup for this is the stack frame information. If the answer is still "no we aren't ready for that," this is ok, but I figure after implementing stack frame support within the DLR would be a good time to look at this. This function is required to support several things which cPython has, but most importantly I'm pretty sure this is the major stumbling block towards getting IPython working with IronPython. I go through IPython withdrawals every time I use the IronPython console. :) Thanks, -Lee From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, September 20, 2007 9:01 AM To: Discussion of IronPython Subject: Re: [IronPython] Accessing call stack Unfortunately there's no good way to do this. We have logic in PythonEngine to filter stack frames but it's only exposed for doing this on exceptions, not on arbitrary stack traces. And unfortunately v2.0 is in about the same shape - all of its support revolves around exceptions too and it's filtering is probably even less useful than v1.x's for these purposes. I've opened up a feature request to add this because it does seem like something that will be fundamentally needed (especially as more languages run on the DLR) and it's pretty basic functionality. The bug tracking it is here: http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12876 Unfortunately it may not be entirely simple because DynamicMethod's have no debugging info (and that's what much of the code gets generated as) but we should be able to do something here. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anders M. Mikkelsen Sent: Thursday, September 20, 2007 3:54 AM To: Discussion of IronPython Subject: [IronPython] Accessing call stack Hi Is there any way of accessing the python call stack in IronPython. I'we tried using System.Diagnostics.StackTrace but most calls on the clr call stack seem to be ironpython 'internals': def Log(msg): '''General logging function''' print "%s: %s" % (StackTrace(1).GetFrame(0).GetMethod().Name, msg) I could search the stack trace for actual python functions (I guess) as their clr name seem to end in $fN; but I'm guessing that there must be an easier way? /anders -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Sep 20 23:50:56 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 20 Sep 2007 14:50:56 -0700 Subject: [IronPython] Accessing call stack In-Reply-To: <6512F99DEFF77C418E6738CE6E12FD4E5BB70B226D@NA-EXMSG-C105.redmond.corp.microsoft.com> References: <001d01c7fb74$808cd5c0$1600a8c0@PC52> <7AD436E4270DD54A94238001769C2227CC5D2AEE1F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <6512F99DEFF77C418E6738CE6E12FD4E5BB70B226D@NA-EXMSG-C105.redmond.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227CC5D2AEF97@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Yeah, that's a reasonable idea... I've added a comment to the bug to take a look at that too. Even if we expose the frame information via sys._getframe() there will still be some missing information that's hard for us to produce, but it might be able to unblock a number of useful scenarios. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, September 20, 2007 1:35 PM To: Discussion of IronPython Subject: Re: [IronPython] Accessing call stack In a related problem, could you guys take another look at sys._getframe when implementing this feature? There is a lot going on in the returned frame object from that function, but I think the big holdup for this is the stack frame information. If the answer is still "no we aren't ready for that," this is ok, but I figure after implementing stack frame support within the DLR would be a good time to look at this. This function is required to support several things which cPython has, but most importantly I'm pretty sure this is the major stumbling block towards getting IPython working with IronPython. I go through IPython withdrawals every time I use the IronPython console. :) Thanks, -Lee From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, September 20, 2007 9:01 AM To: Discussion of IronPython Subject: Re: [IronPython] Accessing call stack Unfortunately there's no good way to do this. We have logic in PythonEngine to filter stack frames but it's only exposed for doing this on exceptions, not on arbitrary stack traces. And unfortunately v2.0 is in about the same shape - all of its support revolves around exceptions too and it's filtering is probably even less useful than v1.x's for these purposes. I've opened up a feature request to add this because it does seem like something that will be fundamentally needed (especially as more languages run on the DLR) and it's pretty basic functionality. The bug tracking it is here: http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12876 Unfortunately it may not be entirely simple because DynamicMethod's have no debugging info (and that's what much of the code gets generated as) but we should be able to do something here. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anders M. Mikkelsen Sent: Thursday, September 20, 2007 3:54 AM To: Discussion of IronPython Subject: [IronPython] Accessing call stack Hi Is there any way of accessing the python call stack in IronPython. I'we tried using System.Diagnostics.StackTrace but most calls on the clr call stack seem to be ironpython 'internals': def Log(msg): '''General logging function''' print "%s: %s" % (StackTrace(1).GetFrame(0).GetMethod().Name, msg) I could search the stack trace for actual python functions (I guess) as their clr name seem to end in $fN; but I'm guessing that there must be an easier way? /anders -------------- next part -------------- An HTML attachment was scrubbed... URL: From kpadmasola at gmail.com Fri Sep 21 15:47:05 2007 From: kpadmasola at gmail.com (kpadmasola) Date: Fri, 21 Sep 2007 13:47:05 -0000 Subject: [IronPython] help with activex error In-Reply-To: References: <2451105e0709200314n35b231d6mc1534edda20a174e@mail.gmail.com> Message-ID: <1190382425.780174.155670@t8g2000prg.googlegroups.com> Thanks, that worked! On Sep 20, 5:58 pm, David.Law... at franke.com wrote: > This is all due to the wonderful issue created by COM components that can > be single-threaded or multi-threaded 'apartment'. I do not really fully > understand what this means (you can google about it and find lots of > information) - but I have run into it before and know how to fix it. The > winforms.py that comes with the examples allows you to program windows > forms interactively by creating a second thread for you. You just need to > put that thread into STA 'mode': > > Make a copy of winforms.py and at the top add: from System.Threading > import ApartmentState. Then near the bottom, before the line: t.Start() > add a line like this: t.ApartmentState = ApartmentState.STA > > Then your example will work! Enjoy! > > David > > users-boun... at lists.ironpython.com wrote on 09/20/2007 06:14:00 AM: > > > > > > > Hi, > > > I'm trying to add the remote desktop activex control to a windows > > form and am getting the following error. How can I fix this? > > > thanks for your help, > > Krishna. > > > C:\IronPython-1.1>ipy -X:TabCompletion > > IronPython 1.1 (1.1) on .NET 2.0.50727.312 > > Copyright (c) Microsoft Corporation. All rights reserved. > > >>> import winforms > > >>> import System > > >>> import System.Windows.Forms as wf > > >>> f = wf.Form() > > >>> f.Show() > > >>> import clr > > >>> clr.AddReferenceToFile("AxMSTSCLib.dll ") > > >>> import AxMSTSCLib as mstsc > > >>> rdp = mstsc.AxMsRdpClient2() > > Traceback (most recent call last): > > SystemError: ActiveX control '9059f30f-4eb1-4bd2-9fdc-36f43a218f4a' > > cannot be instantiated because the current thread is not in a > > single-threaded apartment. > > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.com > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com- Hide quoted text - > > - Show quoted text - From fuzzyman at voidspace.org.uk Fri Sep 21 21:56:30 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 21 Sep 2007 20:56:30 +0100 Subject: [IronPython] Missing Compiler Flag Message-ID: <46F421EE.4020806@voidspace.org.uk> Hello all, There's another problem with the interactive interpreter in IronPython (it affects the ability to use the code standard library module). The PyCF_DONT_IMPLY_DEDENT compiler flag is not recognised in IronPython. The flag is defined in the 'codeop' standard library module: PyCF_DONT_IMPLY_DEDENT = 0x200 # Matches pythonrun.h Attempting to use this in IronPython: >>> compile('print x', 'test', 'single', 0x200, 1) Traceback (most recent call last): File , line 0, in ##1 File , line 0, in Compile##4 ValueError: unrecognized flags Without this flag the code module can't recognize blocks of code with several indented lines. :-( All the best, Michael Foord http://www.manning.com/foord From dinov at exchange.microsoft.com Fri Sep 21 22:11:34 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 21 Sep 2007 13:11:34 -0700 Subject: [IronPython] Missing Compiler Flag In-Reply-To: <46F421EE.4020806@voidspace.org.uk> References: <46F421EE.4020806@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227CC5D2AF1C2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Strangely it doesn't seem to be in the documentation for compile() either :( Do you know what this option does by any chance :) ? I've opened bug #12908 (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12908) so we at least have it tracked... -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, September 21, 2007 12:57 PM To: Discussion of IronPython Subject: [IronPython] Missing Compiler Flag Hello all, There's another problem with the interactive interpreter in IronPython (it affects the ability to use the code standard library module). The PyCF_DONT_IMPLY_DEDENT compiler flag is not recognised in IronPython. The flag is defined in the 'codeop' standard library module: PyCF_DONT_IMPLY_DEDENT = 0x200 # Matches pythonrun.h Attempting to use this in IronPython: >>> compile('print x', 'test', 'single', 0x200, 1) Traceback (most recent call last): File , line 0, in ##1 File , line 0, in Compile##4 ValueError: unrecognized flags Without this flag the code module can't recognize blocks of code with several indented lines. :-( All the best, Michael Foord http://www.manning.com/foord _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Fri Sep 21 22:23:16 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 21 Sep 2007 21:23:16 +0100 Subject: [IronPython] [python] Re: Missing Compiler Flag In-Reply-To: <7AD436E4270DD54A94238001769C2227CC5D2AF1C2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <46F421EE.4020806@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AF1C2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <46F42834.1030003@voidspace.org.uk> Dino Viehland wrote: > Strangely it doesn't seem to be in the documentation for compile() either :( > > Do you know what this option does by any chance :) ? > > I've opened bug #12908 Great - it can go with 12907. :-) It is something to do with dedenting. ;-) I can't find much about it on the intarwebz. It is defined in pythonrun.h and seems to be used in pythonrun.c and it is involved with parsing which makes sense. I'll try asking around. *sigh* Michael Foord http://www.manning.com/foord > (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12908) so we at least have it tracked... > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, September 21, 2007 12:57 PM > To: Discussion of IronPython > Subject: [IronPython] Missing Compiler Flag > > Hello all, > > There's another problem with the interactive interpreter in IronPython > (it affects the ability to use the code standard library module). > > The PyCF_DONT_IMPLY_DEDENT compiler flag is not recognised in IronPython. > > The flag is defined in the 'codeop' standard library module: > > PyCF_DONT_IMPLY_DEDENT = 0x200 # Matches pythonrun.h > > Attempting to use this in IronPython: > > >>> compile('print x', 'test', 'single', 0x200, 1) > Traceback (most recent call last): > File , line 0, in ##1 > File , line 0, in Compile##4 > ValueError: unrecognized flags > > Without this flag the code module can't recognize blocks of code with > several indented lines. :-( > > All the best, > > > Michael Foord > http://www.manning.com/foord > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From dinov at exchange.microsoft.com Fri Sep 21 22:29:44 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 21 Sep 2007 13:29:44 -0700 Subject: [IronPython] [python] Re: Missing Compiler Flag In-Reply-To: <46F42834.1030003@voidspace.org.uk> References: <46F421EE.4020806@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AF1C2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <46F42834.1030003@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227CC5D2AF1D5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Ok, I closed 12908 as a dup. If there's no info on it we can always try reverse engineering it (or see if test_codeop fails when we just ignore the flag instead of throwing - that might be the simplest thing to do). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, September 21, 2007 1:23 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Missing Compiler Flag Dino Viehland wrote: > Strangely it doesn't seem to be in the documentation for compile() either :( > > Do you know what this option does by any chance :) ? > > I've opened bug #12908 Great - it can go with 12907. :-) It is something to do with dedenting. ;-) I can't find much about it on the intarwebz. It is defined in pythonrun.h and seems to be used in pythonrun.c and it is involved with parsing which makes sense. I'll try asking around. *sigh* Michael Foord http://www.manning.com/foord > (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12908) so we at least have it tracked... > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, September 21, 2007 12:57 PM > To: Discussion of IronPython > Subject: [IronPython] Missing Compiler Flag > > Hello all, > > There's another problem with the interactive interpreter in IronPython > (it affects the ability to use the code standard library module). > > The PyCF_DONT_IMPLY_DEDENT compiler flag is not recognised in IronPython. > > The flag is defined in the 'codeop' standard library module: > > PyCF_DONT_IMPLY_DEDENT = 0x200 # Matches pythonrun.h > > Attempting to use this in IronPython: > > >>> compile('print x', 'test', 'single', 0x200, 1) > Traceback (most recent call last): > File , line 0, in ##1 > File , line 0, in Compile##4 > ValueError: unrecognized flags > > Without this flag the code module can't recognize blocks of code with > several indented lines. :-( > > All the best, > > > Michael Foord > http://www.manning.com/foord > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Fri Sep 21 22:40:57 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 21 Sep 2007 21:40:57 +0100 Subject: [IronPython] [python] Re: Missing Compiler Flag In-Reply-To: <7AD436E4270DD54A94238001769C2227CC5D2AF1D5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <46F421EE.4020806@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AF1C2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <46F42834.1030003@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AF1D5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <46F42C59.5020700@voidspace.org.uk> Dino Viehland wrote: > Ok, I closed 12908 as a dup. If there's no info on it we can always try reverse engineering it (or see if test_codeop fails when we just ignore the flag instead of throwing - that might be the simplest thing to do). > I've already tried not using the flag and it causes some odd behaviour (try my interactive interpreter in the browser with a function with several lines inside the body of the function): http://www.voidspace.org.uk/ironpython/silverlight-console/console.html So I don't think just ignoring it will work. I also took a look at the C (pythonrun.c) but I don't speak C. :-( I've asked one of the core developers for help, so we'll see what he comes back with. I'm also playing with the code in the DLRConsole as a temporary workaround - but it would be nice to get this working. Michael http://www.manning.com/foord > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, September 21, 2007 1:23 PM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] Re: Missing Compiler Flag > > Dino Viehland wrote: > >> Strangely it doesn't seem to be in the documentation for compile() either :( >> >> Do you know what this option does by any chance :) ? >> >> I've opened bug #12908 >> > > Great - it can go with 12907. :-) > > It is something to do with dedenting. ;-) > > I can't find much about it on the intarwebz. It is defined in > pythonrun.h and seems to be used in pythonrun.c and it is involved with > parsing which makes sense. > > I'll try asking around. *sigh* > > Michael Foord > http://www.manning.com/foord > > >> (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12908) so we at least have it tracked... >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Friday, September 21, 2007 12:57 PM >> To: Discussion of IronPython >> Subject: [IronPython] Missing Compiler Flag >> >> Hello all, >> >> There's another problem with the interactive interpreter in IronPython >> (it affects the ability to use the code standard library module). >> >> The PyCF_DONT_IMPLY_DEDENT compiler flag is not recognised in IronPython. >> >> The flag is defined in the 'codeop' standard library module: >> >> PyCF_DONT_IMPLY_DEDENT = 0x200 # Matches pythonrun.h >> >> Attempting to use this in IronPython: >> >> >>> compile('print x', 'test', 'single', 0x200, 1) >> Traceback (most recent call last): >> File , line 0, in ##1 >> File , line 0, in Compile##4 >> ValueError: unrecognized flags >> >> Without this flag the code module can't recognize blocks of code with >> several indented lines. :-( >> >> All the best, >> >> >> Michael Foord >> http://www.manning.com/foord >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From fuzzyman at voidspace.org.uk Fri Sep 21 23:53:26 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 21 Sep 2007 22:53:26 +0100 Subject: [IronPython] [python] Re: Missing Compiler Flag In-Reply-To: <7AD436E4270DD54A94238001769C2227CC5D2AF1D5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <46F421EE.4020806@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AF1C2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <46F42834.1030003@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AF1D5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <46F43D56.3090806@voidspace.org.uk> Hello Dino, I think I've got it. With this flag set, the compile function will return None *if* an indented line would be valid. This allows the interactive interpreter to decide which prompt to present the user with (and whether to execute the code it has buffered or to wait for more input). For example (from CPython): PyCF_DONT_IMPLY_DEDENT = 0x200 def _compile(source, filename, symbol): return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT) source = 'def x():\n print x' print _compile(source, 'test', 'single') None Without the flag set returns a code object. There is similar code in the DLRConsole but it uses "Microsoft.Scripting.SourceCodeUnit" which isn't present in 2.0a4. All the best, Michael http://www.ironpython.info/ Dino Viehland wrote: > Ok, I closed 12908 as a dup. If there's no info on it we can always try reverse engineering it (or see if test_codeop fails when we just ignore the flag instead of throwing - that might be the simplest thing to do). > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, September 21, 2007 1:23 PM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] Re: Missing Compiler Flag > > Dino Viehland wrote: > >> Strangely it doesn't seem to be in the documentation for compile() either :( >> >> Do you know what this option does by any chance :) ? >> >> I've opened bug #12908 >> > > Great - it can go with 12907. :-) > > It is something to do with dedenting. ;-) > > I can't find much about it on the intarwebz. It is defined in > pythonrun.h and seems to be used in pythonrun.c and it is involved with > parsing which makes sense. > > I'll try asking around. *sigh* > > Michael Foord > http://www.manning.com/foord > > >> (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12908) so we at least have it tracked... >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Friday, September 21, 2007 12:57 PM >> To: Discussion of IronPython >> Subject: [IronPython] Missing Compiler Flag >> >> Hello all, >> >> There's another problem with the interactive interpreter in IronPython >> (it affects the ability to use the code standard library module). >> >> The PyCF_DONT_IMPLY_DEDENT compiler flag is not recognised in IronPython. >> >> The flag is defined in the 'codeop' standard library module: >> >> PyCF_DONT_IMPLY_DEDENT = 0x200 # Matches pythonrun.h >> >> Attempting to use this in IronPython: >> >> >>> compile('print x', 'test', 'single', 0x200, 1) >> Traceback (most recent call last): >> File , line 0, in ##1 >> File , line 0, in Compile##4 >> ValueError: unrecognized flags >> >> Without this flag the code module can't recognize blocks of code with >> several indented lines. :-( >> >> All the best, >> >> >> Michael Foord >> http://www.manning.com/foord >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From fuzzyman at voidspace.org.uk Sat Sep 22 00:05:11 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 21 Sep 2007 23:05:11 +0100 Subject: [IronPython] [python] Re: Missing Compiler Flag In-Reply-To: <46F43D56.3090806@voidspace.org.uk> References: <46F421EE.4020806@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AF1C2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <46F42834.1030003@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AF1D5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <46F43D56.3090806@voidspace.org.uk> Message-ID: <46F44017.1090106@voidspace.org.uk> Michael Foord wrote: > Hello Dino, > > I think I've got it. With this flag set, the compile function will > return None *if* an indented line would be valid. > *so*... compile only returns a code object if the source code is complete. An indented code block is only complete when there is a dedent that completes the block. PyCF_DONT_IMPLY_DEDENT is a 'parser flag' which says "don't imply a dedent at the end of a block until we actually get an explicit dedent". All the best, Michael http://www.ironpython.info/ > This allows the interactive interpreter to decide which prompt to > present the user with (and whether to execute the code it has buffered > or to wait for more input). > > For example (from CPython): > > PyCF_DONT_IMPLY_DEDENT = 0x200 > def _compile(source, filename, symbol): > return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT) > > source = 'def x():\n print x' > print _compile(source, 'test', 'single') > None > > Without the flag set returns a code object. > > There is similar code in the DLRConsole but it uses > "Microsoft.Scripting.SourceCodeUnit" which isn't present in 2.0a4. > > All the best, > > Michael > http://www.ironpython.info/ > > > Dino Viehland wrote: > >> Ok, I closed 12908 as a dup. If there's no info on it we can always try reverse engineering it (or see if test_codeop fails when we just ignore the flag instead of throwing - that might be the simplest thing to do). >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Friday, September 21, 2007 1:23 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] [python] Re: Missing Compiler Flag >> >> Dino Viehland wrote: >> >> >>> Strangely it doesn't seem to be in the documentation for compile() either :( >>> >>> Do you know what this option does by any chance :) ? >>> >>> I've opened bug #12908 >>> >>> >> Great - it can go with 12907. :-) >> >> It is something to do with dedenting. ;-) >> >> I can't find much about it on the intarwebz. It is defined in >> pythonrun.h and seems to be used in pythonrun.c and it is involved with >> parsing which makes sense. >> >> I'll try asking around. *sigh* >> >> Michael Foord >> http://www.manning.com/foord >> >> >> >>> (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12908) so we at least have it tracked... >>> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >>> Sent: Friday, September 21, 2007 12:57 PM >>> To: Discussion of IronPython >>> Subject: [IronPython] Missing Compiler Flag >>> >>> Hello all, >>> >>> There's another problem with the interactive interpreter in IronPython >>> (it affects the ability to use the code standard library module). >>> >>> The PyCF_DONT_IMPLY_DEDENT compiler flag is not recognised in IronPython. >>> >>> The flag is defined in the 'codeop' standard library module: >>> >>> PyCF_DONT_IMPLY_DEDENT = 0x200 # Matches pythonrun.h >>> >>> Attempting to use this in IronPython: >>> >>> >>> compile('print x', 'test', 'single', 0x200, 1) >>> Traceback (most recent call last): >>> File , line 0, in ##1 >>> File , line 0, in Compile##4 >>> ValueError: unrecognized flags >>> >>> Without this flag the code module can't recognize blocks of code with >>> several indented lines. :-( >>> >>> All the best, >>> >>> >>> Michael Foord >>> http://www.manning.com/foord >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> >>> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From dinov at exchange.microsoft.com Sat Sep 22 01:20:14 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 21 Sep 2007 16:20:14 -0700 Subject: [IronPython] [python] Re: Missing Compiler Flag In-Reply-To: <46F44017.1090106@voidspace.org.uk> References: <46F421EE.4020806@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AF1C2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <46F42834.1030003@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AF1D5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <46F43D56.3090806@voidspace.org.uk> <46F44017.1090106@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227CC5D2AF282@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Awesome, thanks for tracking this down. I'll probably take a look at this next week. This might have also provided some insight into how the Python command line works - so maybe that can be improved as a well (I just fixed a couple of those bugs but I'm sure we've got more lurking out there). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, September 21, 2007 3:05 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Missing Compiler Flag Michael Foord wrote: > Hello Dino, > > I think I've got it. With this flag set, the compile function will > return None *if* an indented line would be valid. > *so*... compile only returns a code object if the source code is complete. An indented code block is only complete when there is a dedent that completes the block. PyCF_DONT_IMPLY_DEDENT is a 'parser flag' which says "don't imply a dedent at the end of a block until we actually get an explicit dedent". All the best, Michael http://www.ironpython.info/ > This allows the interactive interpreter to decide which prompt to > present the user with (and whether to execute the code it has buffered > or to wait for more input). > > For example (from CPython): > > PyCF_DONT_IMPLY_DEDENT = 0x200 > def _compile(source, filename, symbol): > return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT) > > source = 'def x():\n print x' > print _compile(source, 'test', 'single') > None > > Without the flag set returns a code object. > > There is similar code in the DLRConsole but it uses > "Microsoft.Scripting.SourceCodeUnit" which isn't present in 2.0a4. > > All the best, > > Michael > http://www.ironpython.info/ > > > Dino Viehland wrote: > >> Ok, I closed 12908 as a dup. If there's no info on it we can always try reverse engineering it (or see if test_codeop fails when we just ignore the flag instead of throwing - that might be the simplest thing to do). >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Friday, September 21, 2007 1:23 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] [python] Re: Missing Compiler Flag >> >> Dino Viehland wrote: >> >> >>> Strangely it doesn't seem to be in the documentation for compile() either :( >>> >>> Do you know what this option does by any chance :) ? >>> >>> I've opened bug #12908 >>> >>> >> Great - it can go with 12907. :-) >> >> It is something to do with dedenting. ;-) >> >> I can't find much about it on the intarwebz. It is defined in >> pythonrun.h and seems to be used in pythonrun.c and it is involved with >> parsing which makes sense. >> >> I'll try asking around. *sigh* >> >> Michael Foord >> http://www.manning.com/foord >> >> >> >>> (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12908) so we at least have it tracked... >>> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >>> Sent: Friday, September 21, 2007 12:57 PM >>> To: Discussion of IronPython >>> Subject: [IronPython] Missing Compiler Flag >>> >>> Hello all, >>> >>> There's another problem with the interactive interpreter in IronPython >>> (it affects the ability to use the code standard library module). >>> >>> The PyCF_DONT_IMPLY_DEDENT compiler flag is not recognised in IronPython. >>> >>> The flag is defined in the 'codeop' standard library module: >>> >>> PyCF_DONT_IMPLY_DEDENT = 0x200 # Matches pythonrun.h >>> >>> Attempting to use this in IronPython: >>> >>> >>> compile('print x', 'test', 'single', 0x200, 1) >>> Traceback (most recent call last): >>> File , line 0, in ##1 >>> File , line 0, in Compile##4 >>> ValueError: unrecognized flags >>> >>> Without this flag the code module can't recognize blocks of code with >>> several indented lines. :-( >>> >>> All the best, >>> >>> >>> Michael Foord >>> http://www.manning.com/foord >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> >>> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From leculver at microsoft.com Sat Sep 22 19:35:26 2007 From: leculver at microsoft.com (Lee Culver) Date: Sat, 22 Sep 2007 10:35:26 -0700 Subject: [IronPython] DLR Documentation? Message-ID: <6512F99DEFF77C418E6738CE6E12FD4E5BB70B297B@NA-EXMSG-C105.redmond.corp.microsoft.com> I took some time to play with IronPython 2.0 this weekend, and I see that the DLR is included with it. I'm interested playing with some of the interface and looking to see how new languages might be implemented on the DLR. Obviously I could dig through the source (and I have been), but I was wondering if there is any documentation available on using the DLR? (I understand that it would be subject to change at any time, being early in development and all.) Thanks, -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From leslie.ferguson at isoftnz.com Mon Sep 24 04:31:40 2007 From: leslie.ferguson at isoftnz.com (Leslie Ferguson) Date: Mon, 24 Sep 2007 14:31:40 +1200 Subject: [IronPython] What templating modules are usable? Message-ID: Hi all. I'm a bit of a fan of Python, but my (paying) development job is IIS/microsoft centered. I loved TurboGears, but can't see it being incorporated into our products at all. I would like to explore the best path for our .Net development in the near future, and would like to know what is available in the area of template processors, such as Kid or Cheetah. We would probably do a lot of the business logic and data layer in C#, but I want to have a better solution for rendering the final output than what we currently have (messy ASP pages mostly). Have any of you implemented something like this? Does it make sense to use a templating engine like this instead of ASPX etc. on .Net? -- Les Ferguson Health IT developer Auckland, New Zealand -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Mon Sep 24 06:43:54 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 24 Sep 2007 13:43:54 +0900 Subject: [IronPython] What templating modules are usable? In-Reply-To: References: Message-ID: <5b0248170709232143l673d0b6pa3e5ca6153b2ef8d@mail.gmail.com> 2007/9/24, Leslie Ferguson : > and would like to know what is available in the area of > template processors, such as Kid or Cheetah. Kid will need some serious love to run on IronPython. It currently doesn't. Cheetah already runs fine, but I think you would want to port Cheetah's optional C-coded template accelerator if you are serious. -- Seo Sanghyeon From leculver at microsoft.com Mon Sep 24 07:37:24 2007 From: leculver at microsoft.com (Lee Culver) Date: Sun, 23 Sep 2007 22:37:24 -0700 Subject: [IronPython] DLR Documentation? In-Reply-To: <6512F99DEFF77C418E6738CE6E12FD4E5BB70B297B@NA-EXMSG-C105.redmond.corp.microsoft.com> References: <6512F99DEFF77C418E6738CE6E12FD4E5BB70B297B@NA-EXMSG-C105.redmond.corp.microsoft.com> Message-ID: <6512F99DEFF77C418E6738CE6E12FD4E5BB70915AF@NA-EXMSG-C105.redmond.corp.microsoft.com> I should have been more specific here. I *am* interested in general DLR information, but specifically there is a problem I am trying to solve, and I'm wondering if anyone has some advice on this: I'd like to write a C# wrapper function which dynamically calls a method of a class. For a general method in the .Net library I would do something like this (where obj is an "object"): Type t = obj.GetType(); MethodInfo mi = t.GetMethod("Foo"); result = mi.Invoke(obj, parameters); (Just hacked this together, might be errors there). What I'd like to do is have a second code path so my function could also handle objects from the DLR itself. Is there a way of doing this for objects based on the DLR (e.g. IronPython 2.0)? How do you check if a general "object" is a DLR object? My goal is to create a function which will call Foo on the given object given no matter if the object is a C# object, an IronRuby object, IronPython object, etc. Thanks, -Lee ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Lee Culver [leculver at microsoft.com] Sent: Saturday, September 22, 2007 10:35 AM To: Discussion of IronPython Subject: [IronPython] DLR Documentation? I took some time to play with IronPython 2.0 this weekend, and I see that the DLR is included with it. I?m interested playing with some of the interface and looking to see how new languages might be implemented on the DLR. Obviously I could dig through the source (and I have been), but I was wondering if there is any documentation available on using the DLR? (I understand that it would be subject to change at any time, being early in development and all.) Thanks, -Lee From dinov at exchange.microsoft.com Mon Sep 24 17:56:53 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 24 Sep 2007 08:56:53 -0700 Subject: [IronPython] DLR Documentation? In-Reply-To: <6512F99DEFF77C418E6738CE6E12FD4E5BB70915AF@NA-EXMSG-C105.redmond.corp.microsoft.com> References: <6512F99DEFF77C418E6738CE6E12FD4E5BB70B297B@NA-EXMSG-C105.redmond.corp.microsoft.com> <6512F99DEFF77C418E6738CE6E12FD4E5BB70915AF@NA-EXMSG-C105.redmond.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227CC5D2AF407@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Unfortunately we don't have any great sources of documentation. The way you do any dynamic invocation is usually through a DynamicSite - which is the fastest way to do it. There's also another way you could do this which is via ScriptEngine.CallObject - which is the simplest way to do it. Ultimately we're still working on what the end story is for what the best way for doing these operations still from static languages. So let's look at these two ways. First we have the DynamicSite. There's a couple of different forms of DynamicSite's but we'll keep things simple and look at the normal one. You create a dynamic site like so: DynamicSite ds = DynamicSite.Create(CallAction.Simple); This creates a DynamicSite which takes 2 parameters (typed to object) and returns a parameter typed to object. The DynamicSite will attempt to perform a call operation on the 1st argument passing it the 2nd argument and returning the result. So then to invoke a site we'd do: object res = ds.Invoke(codeContext, callableObject, parameter); The one problem here is where do you get a CodeContext object from? My best advice to you now is if you're using IronPython objects just use IronPython.Runtime.Calls.DefaultContext.Default which is still public. Again we're still working on this part of the story :). So that will let you call something but one thing which is noticeably missing is that we never got "Foo". That can be done with a GetMemberAction, so we get another site: DynamicSite gmSite = DynamicSite.Create(GetMemberAction.Make("Foo")); Now we combine the two: object res = ds.Invoke(DefaultContext.Default, gmSite.Invoke(obj), parameter); and now we've gotten the Foo member and invoked it. Now the great thing about this is that this one code path will do what you want - it will work w/ a C# object, it will work w/ an IronPython object, and it'll work w/ a Ruby object. Doing this via ScriptEngine is basically the same thing - except for using site's were calling the SE's methods. So that becomes object callable; If(se.TryGetObjectMemberVariable(obj, "Foo",out callable)) { res = se.CallObject(callable, parameter); } Hopefully that will get you started. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Sunday, September 23, 2007 10:37 PM To: Discussion of IronPython Subject: Re: [IronPython] DLR Documentation? I should have been more specific here. I *am* interested in general DLR information, but specifically there is a problem I am trying to solve, and I'm wondering if anyone has some advice on this: I'd like to write a C# wrapper function which dynamically calls a method of a class. For a general method in the .Net library I would do something like this (where obj is an "object"): Type t = obj.GetType(); MethodInfo mi = t.GetMethod("Foo"); result = mi.Invoke(obj, parameters); (Just hacked this together, might be errors there). What I'd like to do is have a second code path so my function could also handle objects from the DLR itself. Is there a way of doing this for objects based on the DLR (e.g. IronPython 2.0)? How do you check if a general "object" is a DLR object? My goal is to create a function which will call Foo on the given object given no matter if the object is a C# object, an IronRuby object, IronPython object, etc. Thanks, -Lee ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Lee Culver [leculver at microsoft.com] Sent: Saturday, September 22, 2007 10:35 AM To: Discussion of IronPython Subject: [IronPython] DLR Documentation? I took some time to play with IronPython 2.0 this weekend, and I see that the DLR is included with it. I'm interested playing with some of the interface and looking to see how new languages might be implemented on the DLR. Obviously I could dig through the source (and I have been), but I was wondering if there is any documentation available on using the DLR? (I understand that it would be subject to change at any time, being early in development and all.) Thanks, -Lee _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Mon Sep 24 18:17:36 2007 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 24 Sep 2007 09:17:36 -0700 Subject: [IronPython] DLR Documentation? In-Reply-To: <7AD436E4270DD54A94238001769C2227CC5D2AF407@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <6512F99DEFF77C418E6738CE6E12FD4E5BB70B297B@NA-EXMSG-C105.redmond.corp.microsoft.com> <6512F99DEFF77C418E6738CE6E12FD4E5BB70915AF@NA-EXMSG-C105.redmond.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227CC5D2AF407@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: There is a MSDN article that very recently got published in October 2007 issue of MSDN magazine that can also help fill in some gaps: http://msdn.microsoft.com/msdnmag/issues/07/10/CLRInsideOut/default.aspx Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, September 24, 2007 8:57 AM To: Discussion of IronPython Subject: Re: [IronPython] DLR Documentation? Unfortunately we don't have any great sources of documentation. The way you do any dynamic invocation is usually through a DynamicSite - which is the fastest way to do it. There's also another way you could do this which is via ScriptEngine.CallObject - which is the simplest way to do it. Ultimately we're still working on what the end story is for what the best way for doing these operations still from static languages. So let's look at these two ways. First we have the DynamicSite. There's a couple of different forms of DynamicSite's but we'll keep things simple and look at the normal one. You create a dynamic site like so: DynamicSite ds = DynamicSite.Create(CallAction.Simple); This creates a DynamicSite which takes 2 parameters (typed to object) and returns a parameter typed to object. The DynamicSite will attempt to perform a call operation on the 1st argument passing it the 2nd argument and returning the result. So then to invoke a site we'd do: object res = ds.Invoke(codeContext, callableObject, parameter); The one problem here is where do you get a CodeContext object from? My best advice to you now is if you're using IronPython objects just use IronPython.Runtime.Calls.DefaultContext.Default which is still public. Again we're still working on this part of the story :). So that will let you call something but one thing which is noticeably missing is that we never got "Foo". That can be done with a GetMemberAction, so we get another site: DynamicSite gmSite = DynamicSite.Create(GetMemberAction.Make("Foo")); Now we combine the two: object res = ds.Invoke(DefaultContext.Default, gmSite.Invoke(obj), parameter); and now we've gotten the Foo member and invoked it. Now the great thing about this is that this one code path will do what you want - it will work w/ a C# object, it will work w/ an IronPython object, and it'll work w/ a Ruby object. Doing this via ScriptEngine is basically the same thing - except for using site's were calling the SE's methods. So that becomes object callable; If(se.TryGetObjectMemberVariable(obj, "Foo",out callable)) { res = se.CallObject(callable, parameter); } Hopefully that will get you started. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Sunday, September 23, 2007 10:37 PM To: Discussion of IronPython Subject: Re: [IronPython] DLR Documentation? I should have been more specific here. I *am* interested in general DLR information, but specifically there is a problem I am trying to solve, and I'm wondering if anyone has some advice on this: I'd like to write a C# wrapper function which dynamically calls a method of a class. For a general method in the .Net library I would do something like this (where obj is an "object"): Type t = obj.GetType(); MethodInfo mi = t.GetMethod("Foo"); result = mi.Invoke(obj, parameters); (Just hacked this together, might be errors there). What I'd like to do is have a second code path so my function could also handle objects from the DLR itself. Is there a way of doing this for objects based on the DLR (e.g. IronPython 2.0)? How do you check if a general "object" is a DLR object? My goal is to create a function which will call Foo on the given object given no matter if the object is a C# object, an IronRuby object, IronPython object, etc. Thanks, -Lee ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Lee Culver [leculver at microsoft.com] Sent: Saturday, September 22, 2007 10:35 AM To: Discussion of IronPython Subject: [IronPython] DLR Documentation? I took some time to play with IronPython 2.0 this weekend, and I see that the DLR is included with it. I'm interested playing with some of the interface and looking to see how new languages might be implemented on the DLR. Obviously I could dig through the source (and I have been), but I was wondering if there is any documentation available on using the DLR? (I understand that it would be subject to change at any time, being early in development and all.) Thanks, -Lee _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From leculver at microsoft.com Mon Sep 24 19:10:54 2007 From: leculver at microsoft.com (Lee Culver) Date: Mon, 24 Sep 2007 10:10:54 -0700 Subject: [IronPython] DLR Documentation? In-Reply-To: References: <6512F99DEFF77C418E6738CE6E12FD4E5BB70B297B@NA-EXMSG-C105.redmond.corp.microsoft.com> <6512F99DEFF77C418E6738CE6E12FD4E5BB70915AF@NA-EXMSG-C105.redmond.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227CC5D2AF407@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <6512F99DEFF77C418E6738CE6E12FD4E5BB70B2B2B@NA-EXMSG-C105.redmond.corp.microsoft.com> Excellent, thanks guys. This should definitely get me going. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Monday, September 24, 2007 9:18 AM To: Discussion of IronPython Subject: Re: [IronPython] DLR Documentation? There is a MSDN article that very recently got published in October 2007 issue of MSDN magazine that can also help fill in some gaps: http://msdn.microsoft.com/msdnmag/issues/07/10/CLRInsideOut/default.aspx Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, September 24, 2007 8:57 AM To: Discussion of IronPython Subject: Re: [IronPython] DLR Documentation? Unfortunately we don't have any great sources of documentation. The way you do any dynamic invocation is usually through a DynamicSite - which is the fastest way to do it. There's also another way you could do this which is via ScriptEngine.CallObject - which is the simplest way to do it. Ultimately we're still working on what the end story is for what the best way for doing these operations still from static languages. So let's look at these two ways. First we have the DynamicSite. There's a couple of different forms of DynamicSite's but we'll keep things simple and look at the normal one. You create a dynamic site like so: DynamicSite ds = DynamicSite.Create(CallAction.Simple); This creates a DynamicSite which takes 2 parameters (typed to object) and returns a parameter typed to object. The DynamicSite will attempt to perform a call operation on the 1st argument passing it the 2nd argument and returning the result. So then to invoke a site we'd do: object res = ds.Invoke(codeContext, callableObject, parameter); The one problem here is where do you get a CodeContext object from? My best advice to you now is if you're using IronPython objects just use IronPython.Runtime.Calls.DefaultContext.Default which is still public. Again we're still working on this part of the story :). So that will let you call something but one thing which is noticeably missing is that we never got "Foo". That can be done with a GetMemberAction, so we get another site: DynamicSite gmSite = DynamicSite.Create(GetMemberAction.Make("Foo")); Now we combine the two: object res = ds.Invoke(DefaultContext.Default, gmSite.Invoke(obj), parameter); and now we've gotten the Foo member and invoked it. Now the great thing about this is that this one code path will do what you want - it will work w/ a C# object, it will work w/ an IronPython object, and it'll work w/ a Ruby object. Doing this via ScriptEngine is basically the same thing - except for using site's were calling the SE's methods. So that becomes object callable; If(se.TryGetObjectMemberVariable(obj, "Foo",out callable)) { res = se.CallObject(callable, parameter); } Hopefully that will get you started. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Sunday, September 23, 2007 10:37 PM To: Discussion of IronPython Subject: Re: [IronPython] DLR Documentation? I should have been more specific here. I *am* interested in general DLR information, but specifically there is a problem I am trying to solve, and I'm wondering if anyone has some advice on this: I'd like to write a C# wrapper function which dynamically calls a method of a class. For a general method in the .Net library I would do something like this (where obj is an "object"): Type t = obj.GetType(); MethodInfo mi = t.GetMethod("Foo"); result = mi.Invoke(obj, parameters); (Just hacked this together, might be errors there). What I'd like to do is have a second code path so my function could also handle objects from the DLR itself. Is there a way of doing this for objects based on the DLR (e.g. IronPython 2.0)? How do you check if a general "object" is a DLR object? My goal is to create a function which will call Foo on the given object given no matter if the object is a C# object, an IronRuby object, IronPython object, etc. Thanks, -Lee ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Lee Culver [leculver at microsoft.com] Sent: Saturday, September 22, 2007 10:35 AM To: Discussion of IronPython Subject: [IronPython] DLR Documentation? I took some time to play with IronPython 2.0 this weekend, and I see that the DLR is included with it. I'm interested playing with some of the interface and looking to see how new languages might be implemented on the DLR. Obviously I could dig through the source (and I have been), but I was wondering if there is any documentation available on using the DLR? (I understand that it would be subject to change at any time, being early in development and all.) Thanks, -Lee _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at gmail.com Mon Sep 24 23:24:34 2007 From: fuzzyman at gmail.com (Michael Foord) Date: Mon, 24 Sep 2007 21:24:34 -0000 Subject: [IronPython] [python] Re: Missing Compiler Flag In-Reply-To: <46F43D56.3090806@voidspace.org.uk> References: <46F421EE.4020806@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AF1C2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <46F42834.1030003@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CC5D2AF1D5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <46F43D56.3090806@voidspace.org.uk> Message-ID: <1190669074.444074.315970@50g2000hsm.googlegroups.com> On Sep 21, 10:53 pm, Michael Foord wrote: > Hello Dino, > > I think I've got it. With this flag set, the compile function will > return None *if* an indented line would be valid. > > This allows the interactive interpreter to decide which prompt to > present the user with (and whether to execute the code it has buffered > or to wait for more input). > > For example (from CPython): > > PyCF_DONT_IMPLY_DEDENT = 0x200 > def _compile(source, filename, symbol): > return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT) > > source = 'def x():\n print x' > print _compile(source, 'test', 'single') > None I *swear* I got this result when I was experimenting on Friday. Actually as far as I can tell 'compile' never returns None - it is one of the functions in the codeop module that does this. I've just written up what I think is the real difference in my blog (with the flag set compile throws a SyntaxError for the source above that isn't newline terminated). Sorry for the misdirection - but I still think we've basically got the meaning of the flag nailed. Michael > > Without the flag set returns a code object. > > There is similar code in the DLRConsole but it uses > "Microsoft.Scripting.SourceCodeUnit" which isn't present in 2.0a4. > > All the best, > > Michaelhttp://www.ironpython.info/ > > > > Dino Viehland wrote: > > Ok, I closed 12908 as a dup. If there's no info on it we can always try reverse engineering it (or see if test_codeop fails when we just ignore the flag instead of throwing - that might be the simplest thing to do). > > > -----Original Message----- > > From: users-boun... at lists.ironpython.com [mailto:users-boun... at lists.ironpython.com] On Behalf Of Michael Foord > > Sent: Friday, September 21, 2007 1:23 PM > > To: Discussion of IronPython > > Subject: Re: [IronPython] [python] Re: Missing Compiler Flag > > > Dino Viehland wrote: > > >> Strangely it doesn't seem to be in the documentation for compile() either :( > > >> Do you know what this option does by any chance :) ? > > >> I've opened bug #12908 > > > Great - it can go with 12907. :-) > > > It is something to do with dedenting. ;-) > > > I can't find much about it on the intarwebz. It is defined in > > pythonrun.h and seems to be used in pythonrun.c and it is involved with > > parsing which makes sense. > > > I'll try asking around. *sigh* > > > Michael Foord > >http://www.manning.com/foord > > >> (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=12908) so we at least have it tracked... > > >> -----Original Message----- > >> From: users-boun... at lists.ironpython.com [mailto:users-boun... at lists.ironpython.com] On Behalf Of Michael Foord > >> Sent: Friday, September 21, 2007 12:57 PM > >> To: Discussion of IronPython > >> Subject: [IronPython] Missing Compiler Flag > > >> Hello all, > > >> There's another problem with the interactive interpreter in IronPython > >> (it affects the ability to use the code standard library module). > > >> The PyCF_DONT_IMPLY_DEDENT compiler flag is not recognised in IronPython. > > >> The flag is defined in the 'codeop' standard library module: > > >> PyCF_DONT_IMPLY_DEDENT = 0x200 # Matches pythonrun.h > > >> Attempting to use this in IronPython: > > >> >>> compile('print x', 'test', 'single', 0x200, 1) > >> Traceback (most recent call last): > >> File , line 0, in ##1 > >> File , line 0, in Compile##4 > >> ValueError: unrecognized flags > > >> Without this flag the code module can't recognize blocks of code with > >> several indented lines. :-( > > >> All the best, > > >> Michael Foord > >>http://www.manning.com/foord > >> _______________________________________________ > >> Users mailing list > >> Us... at lists.ironpython.com > >>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >> _______________________________________________ > >> Users mailing list > >> Us... at lists.ironpython.com > >>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.com > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.com > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Christian2.Schmidt at gmx.de Tue Sep 25 00:29:06 2007 From: Christian2.Schmidt at gmx.de (Christian Schmidt) Date: Tue, 25 Sep 2007 00:29:06 +0200 Subject: [IronPython] replacing engine.evaluate by CreateLambda Message-ID: <46F83A32.8070305@gmx.de> Hello community, How can I replace the 3 parameter Evaluate-function from PythonEngine engine.Evaluate(expression, module, locals) where expression is a string, module is a EngineModule and locals is a IDictionary by something like delegate object Expression(IDictionary locals) Expression expr = engine.CreateLambda(expression); ... expr(locals); I've asked the same question a few days before, but didn't get an answer so far. Is it not possible at all? Thanks for any help. Christian From empirebuilder at gmail.com Tue Sep 25 09:04:46 2007 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Tue, 25 Sep 2007 10:04:46 +0300 Subject: [IronPython] replacing engine.evaluate by CreateLambda In-Reply-To: <46F83A32.8070305@gmx.de> References: <46F83A32.8070305@gmx.de> Message-ID: <8cd017b80709250004paad90c4i63f8e68f1c04c92f@mail.gmail.com> Why not use CreateMethod instead of CreateLambda? Dody G. On 9/25/07, Christian Schmidt wrote: > > Hello community, > > How can I replace the 3 parameter Evaluate-function from PythonEngine > > engine.Evaluate(expression, module, locals) > > where expression is a string, module is a EngineModule and locals is a > IDictionary by something like > > delegate object Expression(IDictionary locals) > Expression expr = engine.CreateLambda(expression); > ... > expr(locals); > > I've asked the same question a few days before, but didn't get an answer > so far. Is it not possible at all? > > Thanks for any help. > > Christian > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Sep 25 18:04:58 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 25 Sep 2007 09:04:58 -0700 Subject: [IronPython] replacing engine.evaluate by CreateLambda In-Reply-To: <8cd017b80709250004paad90c4i63f8e68f1c04c92f@mail.gmail.com> References: <46F83A32.8070305@gmx.de> <8cd017b80709250004paad90c4i63f8e68f1c04c92f@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227CCBD18C697@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Unfortunately there isn't a great way to do this. If EngineModule.GetGlobalScope were public you could create your own EM that's bound to locals (Or if engine.GetModuleScope were public). That would let you use CreateLambdaUnscoped. It returns a ModuleBinder and the ModuleBinder returns the delegate of the type you want. That lets you do: ModuleBinder binder = Engine.CreateLambdaUnscoped(expression); binder(engineModule)(engineModule); but because you can't bind an EM to a new set of locals you're stuck. You could call those through reflection or re-build IronPython and make them public. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata Sent: Tuesday, September 25, 2007 12:05 AM To: Discussion of IronPython Subject: Re: [IronPython] replacing engine.evaluate by CreateLambda Why not use CreateMethod instead of CreateLambda? Dody G. On 9/25/07, Christian Schmidt > wrote: Hello community, How can I replace the 3 parameter Evaluate-function from PythonEngine engine.Evaluate(expression, module, locals) where expression is a string, module is a EngineModule and locals is a IDictionary by something like delegate object Expression(IDictionary locals) Expression expr = engine.CreateLambda(expression); ... expr(locals); I've asked the same question a few days before, but didn't get an answer so far. Is it not possible at all? Thanks for any help. Christian _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From leculver at microsoft.com Tue Sep 25 19:32:50 2007 From: leculver at microsoft.com (Lee Culver) Date: Tue, 25 Sep 2007 10:32:50 -0700 Subject: [IronPython] DLR and Iron* language types Message-ID: <6512F99DEFF77C418E6738CE6E12FD4E5BB7175B07@NA-EXMSG-C105.redmond.corp.microsoft.com> Both Ruby and Python have concepts of lists and dictionaries (though I think ruby calls them something different, and the details of how they are used are a bit different as well). Is the DLR going to (eventually) support passing these objects between each other? For example, let's say I have a piece of IronPython code as follows: def foo(d): "d is a dictionary" if "bar" in d: del d["bar"] d["meaning of life"] = 42 keys = d.keys() # call other dictionary functions on d here # ... # when this function returns, the Ruby hash object this # function was called with has been updated Can I call into this function, from IronRuby, with the Ruby equivalent of a dictionary (I think that's a "hash" if I'm not mistaken) and have that hash updated as the "foo" method suggests? I would imagine, from a programmer's perspective, that even though the Ruby hash class has different functions, it's basically the same thing as the Python dictionary. When you call into one language with the other's "equivalent objects" does the other language see it as their own type. My question is, do you plan on supporting this type of functionality in the DLR and the Iron* languages? If so, is that support implemented "now" (meaning when IronRuby is released will it support it)? Thanks, -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Sep 25 19:46:11 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 25 Sep 2007 10:46:11 -0700 Subject: [IronPython] DLR and Iron* language types In-Reply-To: <6512F99DEFF77C418E6738CE6E12FD4E5BB7175B07@NA-EXMSG-C105.redmond.corp.microsoft.com> References: <6512F99DEFF77C418E6738CE6E12FD4E5BB7175B07@NA-EXMSG-C105.redmond.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227CCBD18C70D@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Ruby hash and Python dictionary should interop just fine because Ruby's hash will be an IDictionary and Python's dictionary will also be an IDictionary. Therefore we'll be able to recognize the interface methods and dispatch to them appropriately. We don't currently support extension methods on interfaces (we have a bug to fix that) but when we do IDictionary will get methods like keys from Python so even the normal dictionary methods will be properly exposed. But it looks like Ruby's hash method is currently a subclass of Dictionary so I think you'll probably get a great level of interop today. But what might be more interesting is a user defined dictionary-like object. For this we'll end up getting all the rules directly through an IDynamicObject instead of the default binder and/or derived binders. The parts of this that Python could consume today are: del d["bar"] d["meaning of life"] = 42 That will work through DoOperationAction(Operators.GetItem)/DOA(Op.DelItem)/DOA(Op.SetItem). We have a "Contains" operator in our Operators enum but we don't yet use it for language interop. Once we start implementing that then the 'if "bar" in d' would also be consumable from Python. The .keys call is unlikely to ever work though. You'll need to call whatever the Ruby equivalent of .keys is. If it happens to be .keys then it'll work. Now you may have noticed that I said Python could consume objects from another language using these characteristics. I don't believe Ruby objects have an IDynamicObject implementation of sufficient fidelity to make this happen yet. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Tuesday, September 25, 2007 10:33 AM To: users at lists.ironpython.com Subject: [IronPython] DLR and Iron* language types Both Ruby and Python have concepts of lists and dictionaries (though I think ruby calls them something different, and the details of how they are used are a bit different as well). Is the DLR going to (eventually) support passing these objects between each other? For example, let's say I have a piece of IronPython code as follows: def foo(d): "d is a dictionary" if "bar" in d: del d["bar"] d["meaning of life"] = 42 keys = d.keys() # call other dictionary functions on d here # ... # when this function returns, the Ruby hash object this # function was called with has been updated Can I call into this function, from IronRuby, with the Ruby equivalent of a dictionary (I think that's a "hash" if I'm not mistaken) and have that hash updated as the "foo" method suggests? I would imagine, from a programmer's perspective, that even though the Ruby hash class has different functions, it's basically the same thing as the Python dictionary. When you call into one language with the other's "equivalent objects" does the other language see it as their own type. My question is, do you plan on supporting this type of functionality in the DLR and the Iron* languages? If so, is that support implemented "now" (meaning when IronRuby is released will it support it)? Thanks, -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Wed Sep 26 03:21:01 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 26 Sep 2007 10:21:01 +0900 Subject: [IronPython] DLR and Iron* language types In-Reply-To: <7AD436E4270DD54A94238001769C2227CCBD18C70D@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <6512F99DEFF77C418E6738CE6E12FD4E5BB7175B07@NA-EXMSG-C105.redmond.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227CCBD18C70D@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <5b0248170709251821q4fc691cbh67f1703b0575941a@mail.gmail.com> 2007/9/26, Dino Viehland : > The .keys call is unlikely to ever > work though. You'll need to call whatever the Ruby equivalent of .keys is. > If it happens to be .keys then it'll work. It happens to be .keys. :-) -- Seo Sanghyeon From igdev at hotmail.com Wed Sep 26 15:54:11 2007 From: igdev at hotmail.com (S C) Date: Wed, 26 Sep 2007 09:54:11 -0400 Subject: [IronPython] Slightly OT - Business Rule Engine Thoughts? Message-ID: I'm looking for a Python business rule engine that could be "worked into" IronPython. Simple is better of course. Any suggestions appreciated. Thanks. _________________________________________________________________ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Wed Sep 26 17:19:10 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 26 Sep 2007 16:19:10 +0100 Subject: [IronPython] Slightly OT - Business Rule Engine Thoughts? In-Reply-To: References: Message-ID: <46FA786E.2050106@voidspace.org.uk> S C wrote: > > I'm looking for a Python business rule engine that could be "worked > into" IronPython. Simple is better of course. Any suggestions appreciated. I think you should read this: http://worsethanfailure.com/Articles/The-Mythical-Business-Layer.aspx After which you might want to look at PyClips: http://pyclips.sourceforge.net/ This is (I assume) a CPython extension, but if it is the sort of thing you want then you could look for a .NET interface to the clips engine. Michael http://www.manning.com/foord > > > Thanks. > > > ------------------------------------------------------------------------ > Explore the seven wonders of the world Learn more! > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From hfoffani at gmail.com Wed Sep 26 17:38:48 2007 From: hfoffani at gmail.com (Hernan M Foffani) Date: Wed, 26 Sep 2007 17:38:48 +0200 Subject: [IronPython] Slightly OT - Business Rule Engine Thoughts? In-Reply-To: <46FA786E.2050106@voidspace.org.uk> References: <46FA786E.2050106@voidspace.org.uk> Message-ID: <11fab4bc0709260838v5f9b0fbcxaf5a01d84fa7f8c6@mail.gmail.com> > > I'm looking for a Python business rule engine that could be "worked > > into" IronPython. Simple is better of course. Any suggestions appreciated. > > I think you should read this: > > http://worsethanfailure.com/Articles/The-Mythical-Business-Layer.aspx > > After which you might want to look at PyClips: > > http://pyclips.sourceforge.net/ > > This is (I assume) a CPython extension, but if it is the sort of thing > you want then you could look for a .NET interface to the clips engine. > Or Drools for .NET http://droolsdotnet.codehaus.org/ Rergards, -H. From igdev at hotmail.com Thu Sep 27 21:07:03 2007 From: igdev at hotmail.com (S C) Date: Thu, 27 Sep 2007 15:07:03 -0400 Subject: [IronPython] Newbie Q - Simple HTTP XML Capture? Message-ID: This runs in the vanilla Python 2.4 interpreter on Win32 but not if I paste it into the Visual Studio 2005 (with IronPython VSSIP installed) IDE: import urllib from xml.dom import minidom remoteSock = urllib.urlopen("http://10.2.5.28:18/PolicyGroupServerAsset.xml") #policyXml = remoteSock.read() #print policyXml policyXmlDoc = minidom.parse(remoteSock) remoteSock.close() print policyXmlDoc.toxml() What steps should I take to convert this to something working? Thanks. _________________________________________________________________ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfugate at microsoft.com Thu Sep 27 21:30:54 2007 From: dfugate at microsoft.com (Dave Fugate) Date: Thu, 27 Sep 2007 12:30:54 -0700 Subject: [IronPython] Newbie Q - Simple HTTP XML Capture? In-Reply-To: References: Message-ID: <7346A825E148B049A9AD1D3ED46A2D91169A90ED25@NA-EXMSG-C106.redmond.corp.microsoft.com> Thanks for reporting this. Due to some issues with the implementation of IronPython's socket module (see http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=10825), urllib.urlopen does not currently work. I'll see if I can get the priority of this bug elevated as there are quite a few votes for it. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of S C Sent: Thursday, September 27, 2007 12:07 PM To: users at lists.ironpython.com Subject: [IronPython] Newbie Q - Simple HTTP XML Capture? This runs in the vanilla Python 2.4 interpreter on Win32 but not if I paste it into the Visual Studio 2005 (with IronPython VSSIP installed) IDE: import urllib from xml.dom import minidom remoteSock = urllib.urlopen("http://10.2.5.28:18/PolicyGroupServerAsset.xml") #policyXml = remoteSock.read() #print policyXml policyXmlDoc = minidom.parse(remoteSock) remoteSock.close() print policyXmlDoc.toxml() What steps should I take to convert this to something working? Thanks. ________________________________ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! Try it! -------------- next part -------------- An HTML attachment was scrubbed... URL: From daftspaniel at gmail.com Thu Sep 27 22:36:19 2007 From: daftspaniel at gmail.com (Davy Mitchell) Date: Thu, 27 Sep 2007 21:36:19 +0100 Subject: [IronPython] Newbie Q - Simple HTTP XML Capture? In-Reply-To: References: Message-ID: <20253b0c0709271336v79b6911ex6130164ac528be57@mail.gmail.com> On 9/27/07, S C wrote: > What steps should I take to convert this to something working? You can use the .Net webclient example http://www.ironpython.info/index.php/Talking_Twitter Cheers, Davy -- Davy Mitchell Blog - http://www.latedecember.co.uk/sites/personal/davy/ Twitter - http://twitter.com/daftspaniel Skype - daftspaniel needgod.com From Shri.Borde at microsoft.com Sat Sep 29 00:35:47 2007 From: Shri.Borde at microsoft.com (Shri Borde) Date: Fri, 28 Sep 2007 15:35:47 -0700 Subject: [IronPython] Hosting APIs walkthrough document Message-ID: <50B69702CA6E6D4E849D30CD4989AB8EAEB2FABDB2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> http://compilerlab.members.winisp.net/hosting-tour.doc has a good walk through of the hosting APIs in IPy 2.0. It may be a little out of sync with the current sources, but its still a very good source of information. There have been questions on using the hosting APIs, and this should help with getting started. Thanks, Shri -------------- next part -------------- An HTML attachment was scrubbed... URL: From mclinton at procard.com Sat Sep 29 00:42:17 2007 From: mclinton at procard.com (Matt Clinton) Date: Fri, 28 Sep 2007 16:42:17 -0600 Subject: [IronPython] Object DBs - Zope/Plone vs LINQ? In-Reply-To: <20253b0c0709271336v79b6911ex6130164ac528be57@mail.gmail.com> References: <20253b0c0709271336v79b6911ex6130164ac528be57@mail.gmail.com> Message-ID: <046C79B13A2D204A9FFB87C2EA406CA7028CF30A@glesexcc03.procard.local> Folks, I was recently reading the July issue of Visual Studio mag, and the opening few paragraphs of their article on "Layer Data Access..." reminded me strongly of the problem solved by Zope/Plone in CPython land: databases with linked objects, rather than tabled varchars, bytes, etc. They go on to talk about how LINQ will allow storage/retrieval (CRUD) of CLR objects through a SQL-like syntax. Will IronPython have access to both these approaches? If so, there could be very terse & clean crossovers through it. Any reflections on when to use which? Food for thought, -- Matt From kfarmer at thuban.org Sat Sep 29 01:11:51 2007 From: kfarmer at thuban.org (Keith J. Farmer) Date: Fri, 28 Sep 2007 16:11:51 -0700 Subject: [IronPython] Object DBs - Zope/Plone vs LINQ? References: <20253b0c0709271336v79b6911ex6130164ac528be57@mail.gmail.com> <046C79B13A2D204A9FFB87C2EA406CA7028CF30A@glesexcc03.procard.local> Message-ID: There are various degrees to which a language can support LINQ, in decreasing sweetness: A: adopt new, first-class syntax in the language to easily construct LINQ queries B: stop short of syntax, but include the features underlying LINQ: extension methods, expression trees, anonymous types, type inference, implicit typing C: allow access to the .NET libraries which implement the operations the LINQ pattern C#3, VB9, and a few others are at the fully-LINQ-enabled "A" level. They've modified the language to make access to the features listed in B and C transparent Unless Dino, Martin, & co have been hiding things from me, IronPython is still at the "C" level. Because it can access the .NET libraries, a programmer can manually do everything necessary for LINQ: make calls to the static methods on the new Enumerable and Queryable classes. Expression trees still need to be constructed manually to make LINQ to SQL work, but it's still doable, and helper methods could make things work a little smoother. You still get the same effect: you don't have to know SQL, you don't have to change your query language when you switch databases (TSQL != PL/SQL != MySQL != Matisse). Adding just the B-level of features would make IP very, very sweet. Incidentally, it should be pointed out for the record that LINQ isn't just databases. It's really any generalized data store: objects, RDBMS, and XML are just 3 featured applications of the pattern -- there are also web services, LDAP, file systems, etc. Also, in LINQ to SQL's case certainly, these are full-fledged queries, not simple CRUD: server-side calculated columns, arbitrary projections, paging operations, etc are translated into actual SQL and sent to the server. -- Keith J. Farmer [MSFT: LINQ to SQL] ________________________________ From: users-bounces at lists.ironpython.com on behalf of Matt Clinton Sent: Fri 9/28/2007 3:42 PM To: Discussion of IronPython Subject: [IronPython] Object DBs - Zope/Plone vs LINQ? Folks, I was recently reading the July issue of Visual Studio mag, and the opening few paragraphs of their article on "Layer Data Access..." reminded me strongly of the problem solved by Zope/Plone in CPython land: databases with linked objects, rather than tabled varchars, bytes, etc. They go on to talk about how LINQ will allow storage/retrieval (CRUD) of CLR objects through a SQL-like syntax. Will IronPython have access to both these approaches? If so, there could be very terse & clean crossovers through it. Any reflections on when to use which? Food for thought, -- Matt _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Sat Sep 29 01:17:21 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 29 Sep 2007 00:17:21 +0100 Subject: [IronPython] [python] Re: Object DBs - Zope/Plone vs LINQ? In-Reply-To: References: <20253b0c0709271336v79b6911ex6130164ac528be57@mail.gmail.com> <046C79B13A2D204A9FFB87C2EA406CA7028CF30A@glesexcc03.procard.local> Message-ID: <46FD8B81.5040207@voidspace.org.uk> Keith J. Farmer wrote: > There are various degrees to which a language can support LINQ, in decreasing sweetness: > > A: adopt new, first-class syntax in the language to easily construct LINQ queries > B: stop short of syntax, but include the features underlying LINQ: extension methods, expression trees, anonymous types, type inference, implicit typing > C: allow access to the .NET libraries which implement the operations the LINQ pattern > > I think there would be howls of protest from the Python community if the IP team opted for A - but it would be nice to see some of the B level features in IronPython. Maybe these could be provided at the DLR level to support all of the DLR languages? Michael Foord http://www.manning.com/foord > C#3, VB9, and a few others are at the fully-LINQ-enabled "A" level. They've modified the language to make access to the features listed in B and C transparent > > Unless Dino, Martin, & co have been hiding things from me, IronPython is still at the "C" level. Because it can access the .NET libraries, a programmer can manually do everything necessary for LINQ: make calls to the static methods on the new Enumerable and Queryable classes. Expression trees still need to be constructed manually to make LINQ to SQL work, but it's still doable, and helper methods could make things work a little smoother. You still get the same effect: you don't have to know SQL, you don't have to change your query language when you switch databases (TSQL != PL/SQL != MySQL != Matisse). > > Adding just the B-level of features would make IP very, very sweet. > > Incidentally, it should be pointed out for the record that LINQ isn't just databases. It's really any generalized data store: objects, RDBMS, and XML are just 3 featured applications of the pattern -- there are also web services, LDAP, file systems, etc. Also, in LINQ to SQL's case certainly, these are full-fledged queries, not simple CRUD: server-side calculated columns, arbitrary projections, paging operations, etc are translated into actual SQL and sent to the server. > > -- Keith J. Farmer [MSFT: LINQ to SQL] > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Matt Clinton > Sent: Fri 9/28/2007 3:42 PM > To: Discussion of IronPython > Subject: [IronPython] Object DBs - Zope/Plone vs LINQ? > > > > Folks, > > I was recently reading the July issue of Visual Studio mag, and the > opening few paragraphs of their article on "Layer Data Access..." > reminded me strongly of the problem solved by Zope/Plone in CPython > land: databases with linked objects, rather than tabled varchars, bytes, > etc. > > They go on to talk about how LINQ will allow storage/retrieval (CRUD) of > CLR objects through a SQL-like syntax. > > Will IronPython have access to both these approaches? > If so, there could be very terse & clean crossovers through it. > Any reflections on when to use which? > > Food for thought, > -- Matt > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From dinov at exchange.microsoft.com Sat Sep 29 01:39:46 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 28 Sep 2007 16:39:46 -0700 Subject: [IronPython] [python] Re: Object DBs - Zope/Plone vs LINQ? In-Reply-To: <46FD8B81.5040207@voidspace.org.uk> References: <20253b0c0709271336v79b6911ex6130164ac528be57@mail.gmail.com> <046C79B13A2D204A9FFB87C2EA406CA7028CF30A@glesexcc03.procard.local> <46FD8B81.5040207@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227CCBD18D1C0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We'll see if we can get implicit typing in there from section B ;) But seriously, from section B, we are likely to support the extension methods. In fact we support a form of extension methods today which is how all the Python methods show up on the .NET types today. And we support it in another form in bringing back the normal .NET methods when you import clr. Unfortunately we still have some more work to do to converge to the LINQ model (we're very type-based in doing extensions, LINQ is more method base - at least the levels where the attributes are applied). The expression trees are particularly interesting. For those who have been paying close attention to the DLR source code you may have noticed that DLR ASTs are remarkably similar to LINQ expression trees - they're pretty much a superset (with enough differences to make converging them non-trivial, but we're trying). I don't know exactly what that means for LINQ support off the top of my head, but hopefully it makes it easier in some form. Finally on A I'll just point out that list comprehensions and generator comprehensions map nicely onto LINQ as well. LINQ supports both a "grab all my results now" mode as well as a "give me an iterable that processes results one at a time". If you put all of that together we might end up with a decent LINQ story by simply using the language features we already have. But there's a lot of tricky parts in there such as do we need to carry our AST around, how do we know when we're calling out to something expecting an Expression tree or Func delegate (no types to help us here like in C#), how do we translate method calls in the list/generator comprehensions, etc... And I think it's this last bit we haven't figured out (unless Jim or Martin have it all figured out in their heads :) ). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, September 28, 2007 4:17 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Object DBs - Zope/Plone vs LINQ? Keith J. Farmer wrote: > There are various degrees to which a language can support LINQ, in decreasing sweetness: > > A: adopt new, first-class syntax in the language to easily construct LINQ queries > B: stop short of syntax, but include the features underlying LINQ: extension methods, expression trees, anonymous types, type inference, implicit typing > C: allow access to the .NET libraries which implement the operations the LINQ pattern > > I think there would be howls of protest from the Python community if the IP team opted for A - but it would be nice to see some of the B level features in IronPython. Maybe these could be provided at the DLR level to support all of the DLR languages? Michael Foord http://www.manning.com/foord > C#3, VB9, and a few others are at the fully-LINQ-enabled "A" level. They've modified the language to make access to the features listed in B and C transparent > > Unless Dino, Martin, & co have been hiding things from me, IronPython is still at the "C" level. Because it can access the .NET libraries, a programmer can manually do everything necessary for LINQ: make calls to the static methods on the new Enumerable and Queryable classes. Expression trees still need to be constructed manually to make LINQ to SQL work, but it's still doable, and helper methods could make things work a little smoother. You still get the same effect: you don't have to know SQL, you don't have to change your query language when you switch databases (TSQL != PL/SQL != MySQL != Matisse). > > Adding just the B-level of features would make IP very, very sweet. > > Incidentally, it should be pointed out for the record that LINQ isn't just databases. It's really any generalized data store: objects, RDBMS, and XML are just 3 featured applications of the pattern -- there are also web services, LDAP, file systems, etc. Also, in LINQ to SQL's case certainly, these are full-fledged queries, not simple CRUD: server-side calculated columns, arbitrary projections, paging operations, etc are translated into actual SQL and sent to the server. > > -- Keith J. Farmer [MSFT: LINQ to SQL] > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Matt Clinton > Sent: Fri 9/28/2007 3:42 PM > To: Discussion of IronPython > Subject: [IronPython] Object DBs - Zope/Plone vs LINQ? > > > > Folks, > > I was recently reading the July issue of Visual Studio mag, and the > opening few paragraphs of their article on "Layer Data Access..." > reminded me strongly of the problem solved by Zope/Plone in CPython > land: databases with linked objects, rather than tabled varchars, bytes, > etc. > > They go on to talk about how LINQ will allow storage/retrieval (CRUD) of > CLR objects through a SQL-like syntax. > > Will IronPython have access to both these approaches? > If so, there could be very terse & clean crossovers through it. > Any reflections on when to use which? > > Food for thought, > -- Matt > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kfarmer at thuban.org Sat Sep 29 01:52:52 2007 From: kfarmer at thuban.org (Keith J. Farmer) Date: Fri, 28 Sep 2007 16:52:52 -0700 Subject: [IronPython] [python] Re: Object DBs - Zope/Plone vs LINQ? References: <20253b0c0709271336v79b6911ex6130164ac528be57@mail.gmail.com><046C79B13A2D204A9FFB87C2EA406CA7028CF30A@glesexcc03.procard.local><46FD8B81.5040207@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CCBD18D1C0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Yup -- I've always believed supporting all the underlying tech was just a minor stretch from the existing IP, and having it available in the DLR would be a very lovely thing indeed. Somehow I keep managing to miss meeting Jim, and I haven't seen Martin since shortly after I was hired. I'm just 2 floors below y'all, and you never call, you never write... ________________________________ From: users-bounces at lists.ironpython.com on behalf of Dino Viehland Sent: Fri 9/28/2007 4:39 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Object DBs - Zope/Plone vs LINQ? We'll see if we can get implicit typing in there from section B ;) But seriously, from section B, we are likely to support the extension methods. In fact we support a form of extension methods today which is how all the Python methods show up on the .NET types today. And we support it in another form in bringing back the normal .NET methods when you import clr. Unfortunately we still have some more work to do to converge to the LINQ model (we're very type-based in doing extensions, LINQ is more method base - at least the levels where the attributes are applied). The expression trees are particularly interesting. For those who have been paying close attention to the DLR source code you may have noticed that DLR ASTs are remarkably similar to LINQ expression trees - they're pretty much a superset (with enough differences to make converging them non-trivial, but we're trying). I don't know exactly what that means for LINQ support off the top of my head, but hopefully it makes it easier in some form. Finally on A I'll just point out that list comprehensions and generator comprehensions map nicely onto LINQ as well. LINQ supports both a "grab all my results now" mode as well as a "give me an iterable that processes results one at a time". If you put all of that together we might end up with a decent LINQ story by simply using the language features we already have. But there's a lot of tricky parts in there such as do we need to carry our AST around, how do we know when we're calling out to something expecting an Expression tree or Func delegate (no types to help us here like in C#), how do we translate method calls in the list/generator comprehensions, etc... And I think it's this last bit we haven't figured out (unless Jim or Martin have it all figured out in their heads :) ). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, September 28, 2007 4:17 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Object DBs - Zope/Plone vs LINQ? Keith J. Farmer wrote: > There are various degrees to which a language can support LINQ, in decreasing sweetness: > > A: adopt new, first-class syntax in the language to easily construct LINQ queries > B: stop short of syntax, but include the features underlying LINQ: extension methods, expression trees, anonymous types, type inference, implicit typing > C: allow access to the .NET libraries which implement the operations the LINQ pattern > > I think there would be howls of protest from the Python community if the IP team opted for A - but it would be nice to see some of the B level features in IronPython. Maybe these could be provided at the DLR level to support all of the DLR languages? Michael Foord http://www.manning.com/foord > C#3, VB9, and a few others are at the fully-LINQ-enabled "A" level. They've modified the language to make access to the features listed in B and C transparent > > Unless Dino, Martin, & co have been hiding things from me, IronPython is still at the "C" level. Because it can access the .NET libraries, a programmer can manually do everything necessary for LINQ: make calls to the static methods on the new Enumerable and Queryable classes. Expression trees still need to be constructed manually to make LINQ to SQL work, but it's still doable, and helper methods could make things work a little smoother. You still get the same effect: you don't have to know SQL, you don't have to change your query language when you switch databases (TSQL != PL/SQL != MySQL != Matisse). > > Adding just the B-level of features would make IP very, very sweet. > > Incidentally, it should be pointed out for the record that LINQ isn't just databases. It's really any generalized data store: objects, RDBMS, and XML are just 3 featured applications of the pattern -- there are also web services, LDAP, file systems, etc. Also, in LINQ to SQL's case certainly, these are full-fledged queries, not simple CRUD: server-side calculated columns, arbitrary projections, paging operations, etc are translated into actual SQL and sent to the server. > > -- Keith J. Farmer [MSFT: LINQ to SQL] > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Matt Clinton > Sent: Fri 9/28/2007 3:42 PM > To: Discussion of IronPython > Subject: [IronPython] Object DBs - Zope/Plone vs LINQ? > > > > Folks, > > I was recently reading the July issue of Visual Studio mag, and the > opening few paragraphs of their article on "Layer Data Access..." > reminded me strongly of the problem solved by Zope/Plone in CPython > land: databases with linked objects, rather than tabled varchars, bytes, > etc. > > They go on to talk about how LINQ will allow storage/retrieval (CRUD) of > CLR objects through a SQL-like syntax. > > Will IronPython have access to both these approaches? > If so, there could be very terse & clean crossovers through it. > Any reflections on when to use which? > > Food for thought, > -- Matt > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Sat Sep 29 01:57:10 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 28 Sep 2007 16:57:10 -0700 Subject: [IronPython] [python] Re: Object DBs - Zope/Plone vs LINQ? In-Reply-To: References: <20253b0c0709271336v79b6911ex6130164ac528be57@mail.gmail.com><046C79B13A2D204A9FFB87C2EA406CA7028CF30A@glesexcc03.procard.local><46FD8B81.5040207@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227CCBD18D1C0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227CCBD18D1C8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> For a while you were all the way across the street though! :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Friday, September 28, 2007 4:53 PM To: Discussion of IronPython; Discussion of IronPython Subject: Re: [IronPython] [python] Re: Object DBs - Zope/Plone vs LINQ? Yup -- I've always believed supporting all the underlying tech was just a minor stretch from the existing IP, and having it available in the DLR would be a very lovely thing indeed. Somehow I keep managing to miss meeting Jim, and I haven't seen Martin since shortly after I was hired. I'm just 2 floors below y'all, and you never call, you never write... ________________________________ From: users-bounces at lists.ironpython.com on behalf of Dino Viehland Sent: Fri 9/28/2007 4:39 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Object DBs - Zope/Plone vs LINQ? We'll see if we can get implicit typing in there from section B ;) But seriously, from section B, we are likely to support the extension methods. In fact we support a form of extension methods today which is how all the Python methods show up on the .NET types today. And we support it in another form in bringing back the normal .NET methods when you import clr. Unfortunately we still have some more work to do to converge to the LINQ model (we're very type-based in doing extensions, LINQ is more method base - at least the levels where the attributes are applied). The expression trees are particularly interesting. For those who have been paying close attention to the DLR source code you may have noticed that DLR ASTs are remarkably similar to LINQ expression trees - they're pretty much a superset (with enough differences to make converging them non-trivial, but we're trying). I don't know exactly what that means for LINQ support off the top of my head, but hopefully it makes it easier in some form. Finally on A I'll just point out that list comprehensions and generator comprehensions map nicely onto LINQ as well. LINQ supports both a "grab all my results now" mode as well as a "give me an iterable that processes results one at a time". If you put all of that together we might end up with a decent LINQ story by simply using the language features we already have. But there's a lot of tricky parts in there such as do we need to carry our AST around, how do we know when we're calling out to something expecting an Expression tree or Func delegate (no types to help us here like in C#), how do we translate method calls in the list/generator comprehensions, etc... And I think it's this last bit we haven't figured out (unless Jim or Martin have it all figured out in their heads :) ). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, September 28, 2007 4:17 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Object DBs - Zope/Plone vs LINQ? Keith J. Farmer wrote: > There are various degrees to which a language can support LINQ, in decreasing sweetness: > > A: adopt new, first-class syntax in the language to easily construct LINQ queries > B: stop short of syntax, but include the features underlying LINQ: extension methods, expression trees, anonymous types, type inference, implicit typing > C: allow access to the .NET libraries which implement the operations the LINQ pattern > > I think there would be howls of protest from the Python community if the IP team opted for A - but it would be nice to see some of the B level features in IronPython. Maybe these could be provided at the DLR level to support all of the DLR languages? Michael Foord http://www.manning.com/foord > C#3, VB9, and a few others are at the fully-LINQ-enabled "A" level. They've modified the language to make access to the features listed in B and C transparent > > Unless Dino, Martin, & co have been hiding things from me, IronPython is still at the "C" level. Because it can access the .NET libraries, a programmer can manually do everything necessary for LINQ: make calls to the static methods on the new Enumerable and Queryable classes. Expression trees still need to be constructed manually to make LINQ to SQL work, but it's still doable, and helper methods could make things work a little smoother. You still get the same effect: you don't have to know SQL, you don't have to change your query language when you switch databases (TSQL != PL/SQL != MySQL != Matisse). > > Adding just the B-level of features would make IP very, very sweet. > > Incidentally, it should be pointed out for the record that LINQ isn't just databases. It's really any generalized data store: objects, RDBMS, and XML are just 3 featured applications of the pattern -- there are also web services, LDAP, file systems, etc. Also, in LINQ to SQL's case certainly, these are full-fledged queries, not simple CRUD: server-side calculated columns, arbitrary projections, paging operations, etc are translated into actual SQL and sent to the server. > > -- Keith J. Farmer [MSFT: LINQ to SQL] > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Matt Clinton > Sent: Fri 9/28/2007 3:42 PM > To: Discussion of IronPython > Subject: [IronPython] Object DBs - Zope/Plone vs LINQ? > > > > Folks, > > I was recently reading the July issue of Visual Studio mag, and the > opening few paragraphs of their article on "Layer Data Access..." > reminded me strongly of the problem solved by Zope/Plone in CPython > land: databases with linked objects, rather than tabled varchars, bytes, > etc. > > They go on to talk about how LINQ will allow storage/retrieval (CRUD) of > CLR objects through a SQL-like syntax. > > Will IronPython have access to both these approaches? > If so, there could be very terse & clean crossovers through it. > Any reflections on when to use which? > > Food for thought, > -- Matt > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kfarmer at thuban.org Sat Sep 29 02:10:15 2007 From: kfarmer at thuban.org (Keith J. Farmer) Date: Fri, 28 Sep 2007 17:10:15 -0700 Subject: [IronPython] [python] Re: Object DBs - Zope/Plone vs LINQ? References: <20253b0c0709271336v79b6911ex6130164ac528be57@mail.gmail.com> <046C79B13A2D204A9FFB87C2EA406CA7028CF30A@glesexcc03.procard.local> <46FD8B81.5040207@voidspace.org.uk> Message-ID: I agree, unless Guido decides to put query syntax in CPython. Thankfully, you don't need to add query syntax to get the benefits of LINQ, if you have the bits in B (especially type inference, implicit typing, and anonymous types). I'm just as happy writing: q = db.Customers.Where(c => c.City == "London").Select(c => new { c.Name, c.Age }) instead of q = from c in Customers where c.City == "London" select new { c.Name, c.Age } provided I don't have to specify generic types everywhere: q = db.Customers.Where(c => c.City == "London").Select(c => new { c.Name, c.Age }) ________________________________ From: users-bounces at lists.ironpython.com on behalf of Michael Foord Sent: Fri 9/28/2007 4:17 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Object DBs - Zope/Plone vs LINQ? Keith J. Farmer wrote: > There are various degrees to which a language can support LINQ, in decreasing sweetness: > > A: adopt new, first-class syntax in the language to easily construct LINQ queries > B: stop short of syntax, but include the features underlying LINQ: extension methods, expression trees, anonymous types, type inference, implicit typing > C: allow access to the .NET libraries which implement the operations the LINQ pattern > > I think there would be howls of protest from the Python community if the IP team opted for A - but it would be nice to see some of the B level features in IronPython. Maybe these could be provided at the DLR level to support all of the DLR languages? Michael Foord http://www.manning.com/foord > C#3, VB9, and a few others are at the fully-LINQ-enabled "A" level. They've modified the language to make access to the features listed in B and C transparent > > Unless Dino, Martin, & co have been hiding things from me, IronPython is still at the "C" level. Because it can access the .NET libraries, a programmer can manually do everything necessary for LINQ: make calls to the static methods on the new Enumerable and Queryable classes. Expression trees still need to be constructed manually to make LINQ to SQL work, but it's still doable, and helper methods could make things work a little smoother. You still get the same effect: you don't have to know SQL, you don't have to change your query language when you switch databases (TSQL != PL/SQL != MySQL != Matisse). > > Adding just the B-level of features would make IP very, very sweet. > > Incidentally, it should be pointed out for the record that LINQ isn't just databases. It's really any generalized data store: objects, RDBMS, and XML are just 3 featured applications of the pattern -- there are also web services, LDAP, file systems, etc. Also, in LINQ to SQL's case certainly, these are full-fledged queries, not simple CRUD: server-side calculated columns, arbitrary projections, paging operations, etc are translated into actual SQL and sent to the server. > > -- Keith J. Farmer [MSFT: LINQ to SQL] > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Matt Clinton > Sent: Fri 9/28/2007 3:42 PM > To: Discussion of IronPython > Subject: [IronPython] Object DBs - Zope/Plone vs LINQ? > > > > Folks, > > I was recently reading the July issue of Visual Studio mag, and the > opening few paragraphs of their article on "Layer Data Access..." > reminded me strongly of the problem solved by Zope/Plone in CPython > land: databases with linked objects, rather than tabled varchars, bytes, > etc. > > They go on to talk about how LINQ will allow storage/retrieval (CRUD) of > CLR objects through a SQL-like syntax. > > Will IronPython have access to both these approaches? > If so, there could be very terse & clean crossovers through it. > Any reflections on when to use which? > > Food for thought, > -- Matt > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From idmkid at yahoo.com Sun Sep 30 06:15:15 2007 From: idmkid at yahoo.com (David Seruyange) Date: Sat, 29 Sep 2007 21:15:15 -0700 (PDT) Subject: [IronPython] Static variables (Python basics) Message-ID: <670469.58009.qm@web30805.mail.mud.yahoo.com> Hey everyone, I'm wondering how one caches things in python in a manner similar to how a static variable or class member might in C#. I can only think of an equivalent in something like a global variable, but is there another? I'm not good enough yet to think in a manner "pythonic" but I've an inkling that a generator may do this? This program (where I want to cache a list of factorials once computed) is what prompted my questions: f = [1] def fact(n): if n == 1:return 1 if(n > len(f)): for i in range(len(f), n+1): f.append(i * f[i -1]) return f[n] print fact(4) #set it up print fact(3) #pulled from cache print fact(6) #grow it ____________________________________________________________________________________ Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=list&sid=396545469 -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe at notcharles.ca Sun Sep 30 06:52:17 2007 From: joe at notcharles.ca (Joe Mason) Date: Sun, 30 Sep 2007 00:52:17 -0400 Subject: [IronPython] Static variables (Python basics) In-Reply-To: <670469.58009.qm@web30805.mail.mud.yahoo.com> References: <670469.58009.qm@web30805.mail.mud.yahoo.com> Message-ID: On 9/30/07, David Seruyange wrote: > I'm wondering how one caches things in python in a manner similar to how a > static variable or class member might in C#. I can only think of an > equivalent in something like a global variable, but is there another? I'm > not good enough yet to think in a manner "pythonic" but I've an inkling that > a generator may do this? There are a couple of ways to do this. First (my favourite), a class with a "__call__" method can be used as a function: >>> class Func: ... def __init__(self): ... self.static = 0 ... def __call__(self, i): .... self.static += 1 .... print "called", self.static, "times" .... return i*2 .... >>> f = Func() >>> f(1) called 1 times 2 >>> f(3) called 2 times 6 Another trick is that functions are objects themselves, and you can add attributes to them. (The drawback here is that you need to initialize the static outside the function, otherwise you'll get an exception. Also, I find it really ugly to use the function's name inside the function itself.) >>> def func(i): ... func.static += 1 ... print "called", func.static, "times" ... return i*2 ... >>> func.static = 0 >>> func(1) called 1 times 2 >>> func(3) called 2 times 6 Another trick that's sometimes recommended, which I find really ugly, is to use a list as a hidden default parameter. The same list will be used for each call, so you can put items that you want to save between calls into it. Of course, if the user calls the function with their own list all the "static" parameters get messed up, which is why I don't like this solution. >>> def func(i, static = [0]): ... static[0] += 1 ... print "called", static[0], "times" ... return i*2 ... >>> func(1) called 1 times 2 >>> func(3) called 2 times 6 For your specific requirement, though... > This program (where I want to cache a list of > factorials once computed) is what prompted my questions: This is known as "memoization". Google for "python memoize" to get some good (if complex) recipes to take care of this. Joe From fuzzyman at voidspace.org.uk Sun Sep 30 16:51:28 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 30 Sep 2007 15:51:28 +0100 Subject: [IronPython] [python] Static variables (Python basics) In-Reply-To: <670469.58009.qm@web30805.mail.mud.yahoo.com> References: <670469.58009.qm@web30805.mail.mud.yahoo.com> Message-ID: <46FFB7F0.4020508@voidspace.org.uk> David Seruyange wrote: > Hey everyone, > > I'm wondering how one caches things in python in a manner similar to > how a static variable or class member might in C#. I can only think > of an equivalent in something like a global variable, but is there > another? I'm not good enough yet to think in a manner "pythonic" but > I've an inkling that a generator may do this? This program (where I > want to cache a list of factorials once computed) is what prompted my > questions: Well, if you're using a class then you can also use class members. For functions then using a global variable as a cache is fairly normal. There are various other approaches though - for example see the memoize decorator that caches function call results: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496879 This one uses an inner function and has the cache in the outer scope - so that each memoized function has its own cache. Michael http://www.manning.com/foord > > f = [1] > > def fact(n): > if n == 1:return 1 > if(n > len(f)): > for i in range(len(f), n+1): > f.append(i * f[i -1]) > return f[n] > > print fact(4) #set it up > print fact(3) #pulled from cache > print fact(6) #grow it > > > ------------------------------------------------------------------------ > Boardwalk for $500? In 2007? Ha! > Play Monopoly Here and Now > > (it's updated for today's economy) at Yahoo! Games. > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >