From empirebuilder at gmail.com Sun Aug 2 17:59:20 2009 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Sun, 2 Aug 2009 18:59:20 +0300 Subject: [IronPython] Platform comparison Message-ID: <8cd017b80908020859r762d7bacldb5102e07746abaa@mail.gmail.com> Is there any comparison between DLR and ParrotVM somewhere on the interwebs? -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce.bromberek at gmail.com Mon Aug 3 06:07:21 2009 From: bruce.bromberek at gmail.com (Bruce Bromberek) Date: Sun, 2 Aug 2009 23:07:21 -0500 Subject: [IronPython] Platform comparison In-Reply-To: <8cd017b80908020859r762d7bacldb5102e07746abaa@mail.gmail.com> References: <8cd017b80908020859r762d7bacldb5102e07746abaa@mail.gmail.com> Message-ID: <58ad4a110908022107o51f92440u9a08cd6f95aa83f7@mail.gmail.com> To my knowledge there is not a working python implementation under parrot nor is there an IronPerl implementation for the DLR. The comparison you ask for is not even apples and oranges, More like mushrooms and turnips :) ; On Sun, Aug 2, 2009 at 10:59 AM, Dody Gunawinata wrote: > Is there any comparison between DLR and ParrotVM somewhere on the > interwebs? > > -- > nomadlife.org > > > _______________________________________________ > 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 Jimmy.Schementi at microsoft.com Mon Aug 3 06:28:46 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 3 Aug 2009 04:28:46 +0000 Subject: [IronPython] Platform comparison In-Reply-To: <58ad4a110908022107o51f92440u9a08cd6f95aa83f7@mail.gmail.com> References: <8cd017b80908020859r762d7bacldb5102e07746abaa@mail.gmail.com> <58ad4a110908022107o51f92440u9a08cd6f95aa83f7@mail.gmail.com> Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC19BB4031@tk5ex14mbxc105.redmond.corp.microsoft.com> ParrotVM has a Python implementation ... though it's not a full implementation today (http://pirate.tangentcode.com/). Parrot seems to have a ton of language implementations build using it, but very few are complete implementations (with the exception of Perl); they are just tests of Parrot as a compiler infrastructure. The DLR has two fairly-complete language implementations (IronRuby and IronPython), along with some other test languages, that may or may not be available against the latest source code (JavaScript and Visual Basic existed against an older version, Scheme and Lisp are among the available ones today). However, regardless of whether similar languages are implemented on those frameworks, you can still make comparisons between the DLR and Parrot as dynamic language compiler tools. At a very high level, Parrot provides tools for the whole language development process, from a grammar engine, compiler tools, and a VM to run the generated code on. The DLR provides a way to get from a syntax tree to CLI code; it does not provide (or lock you into using) a specific parser to map your language to DLR syntax trees, and it uses any CLI-compatible VM to run on (CLR or Mono). The DLR also provides mechanisms to cache dynamic method calls, and make your language interoperate with existing CLI code. For further reading: Parrot Docs: http://docs.parrot.org/parrot/latest/html/ DLR Docs: http://dlr.codeplex.com/Wiki/View.aspx?title=Docs%20and%20specs ~Jimmy From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Bruce Bromberek Sent: Sunday, August 02, 2009 9:07 PM To: dody at nomadlife.org; Discussion of IronPython Subject: Re: [IronPython] Platform comparison To my knowledge there is not a working python implementation under parrot nor is there an IronPerl implementation for the DLR. The comparison you ask for is not even apples and oranges, More like mushrooms and turnips :) ; On Sun, Aug 2, 2009 at 10:59 AM, Dody Gunawinata > wrote: Is there any comparison between DLR and ParrotVM somewhere on the interwebs? -- nomadlife.org _______________________________________________ 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 diakopter at gmail.com Mon Aug 3 06:36:36 2009 From: diakopter at gmail.com (Matthew Wilson) Date: Sun, 2 Aug 2009 23:36:36 -0500 Subject: [IronPython] Platform comparison In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC19BB4031@tk5ex14mbxc105.redmond.corp.microsoft.com> References: <8cd017b80908020859r762d7bacldb5102e07746abaa@mail.gmail.com> <58ad4a110908022107o51f92440u9a08cd6f95aa83f7@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC19BB4031@tk5ex14mbxc105.redmond.corp.microsoft.com> Message-ID: Unripened fruit from the peanut gallery: Pynie would be a 3-years more appropriate example of a Python implementation on Parrot: see http://code.google.com/p/pynie/source/list -Matthew Wilson http://diakopter.blogspot.com/ http://jsmeta.org/ On Sun, Aug 2, 2009 at 11:28 PM, Jimmy Schementi wrote: > ParrotVM has a Python implementation ? though it?s not a full implementation > today (http://pirate.tangentcode.com/). Parrot seems to have a ton of > language implementations build using it, but very few are complete > implementations (with the exception of Perl); they are just tests of Parrot > as a compiler infrastructure. From empirebuilder at gmail.com Mon Aug 3 09:47:55 2009 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Mon, 3 Aug 2009 10:47:55 +0300 Subject: [IronPython] Platform comparison In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC19BB4031@tk5ex14mbxc105.redmond.corp.microsoft.com> References: <8cd017b80908020859r762d7bacldb5102e07746abaa@mail.gmail.com> <58ad4a110908022107o51f92440u9a08cd6f95aa83f7@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC19BB4031@tk5ex14mbxc105.redmond.corp.microsoft.com> Message-ID: <8cd017b80908030047x79fe99b6gb87d5c58a8d88d51@mail.gmail.com> For grammar engine, language development process, etc, there are a bunch of efforts notably the M language, albeit far more ambitious than just a language toolkit. Both are providing facilities for interoperability between dynamic languages (e.g. calling Python libraries from Perl) Both are targeted as platform for dynamic language implementations. Parrot VM has Perl6, a swiss army of a language that supports multitudes of programming styles, etc. The closest in .Net stack is C# 4.0. Btw, does C# 4.0 dynamic qualify the language as a DLR language? I mean it is possible to go dynamic crazy just with that keyword in C#. On Mon, Aug 3, 2009 at 7:28 AM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > ParrotVM has a Python implementation ? though it?s not a full > implementation today (http://pirate.tangentcode.com/). Parrot seems to > have a ton of language implementations build using it, but very few are > complete implementations (with the exception of Perl); they are just tests > of Parrot as a compiler infrastructure. The DLR has two fairly-complete > language implementations (IronRuby and IronPython), along with some other > test languages, that may or may not be available against the latest source > code (JavaScript and Visual Basic existed against an older version, Scheme > and Lisp are among the available ones today). > > > > However, regardless of whether similar languages are implemented on those > frameworks, you can still make comparisons between the DLR and Parrot as > dynamic language compiler tools. > > > > At a very high level, Parrot provides tools for the whole language > development process, from a grammar engine, compiler tools, and a VM to run > the generated code on. The DLR provides a way to get from a syntax tree to > CLI code; it does not provide (or lock you into using) a specific parser to > map your language to DLR syntax trees, and it uses any CLI-compatible VM to > run on (CLR or Mono). The DLR also provides mechanisms to cache dynamic > method calls, and make your language interoperate with existing CLI code. > > > > For further reading: > > Parrot Docs: http://docs.parrot.org/parrot/latest/html/ > > DLR Docs: http://dlr.codeplex.com/Wiki/View.aspx?title=Docs%20and%20specs > > > > ~Jimmy > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Bruce Bromberek > *Sent:* Sunday, August 02, 2009 9:07 PM > *To:* dody at nomadlife.org; Discussion of IronPython > *Subject:* Re: [IronPython] Platform comparison > > > > To my knowledge there is not a working python implementation under parrot > nor is there an IronPerl implementation for the DLR. The comparison you ask > for is not even apples and oranges, More like mushrooms and turnips :) > ; > > On Sun, Aug 2, 2009 at 10:59 AM, Dody Gunawinata > wrote: > > Is there any comparison between DLR and ParrotVM somewhere on the > interwebs? > > > -- > nomadlife.org > > > _______________________________________________ > 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 bruce.bromberek at gmail.com Mon Aug 3 15:51:15 2009 From: bruce.bromberek at gmail.com (Bruce Bromberek) Date: Mon, 3 Aug 2009 08:51:15 -0500 Subject: [IronPython] Platform comparison In-Reply-To: References: <8cd017b80908020859r762d7bacldb5102e07746abaa@mail.gmail.com> <58ad4a110908022107o51f92440u9a08cd6f95aa83f7@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC19BB4031@tk5ex14mbxc105.redmond.corp.microsoft.com> Message-ID: <58ad4a110908030651o6f38f762i353fb394e8137ee8@mail.gmail.com> On Sun, Aug 2, 2009 at 11:36 PM, Matthew Wilson wrote: > Unripened fruit from the peanut gallery: Pynie would be a 3-years > more appropriate example of a Python implementation on Parrot: see > http://code.google.com/p/pynie/source/list > > -Matthew Wilson > http://diakopter.blogspot.com/ > http://jsmeta.org/ > > On Sun, Aug 2, 2009 at 11:28 PM, Jimmy > Schementi wrote: > > ParrotVM has a Python implementation ? though it?s not a full > implementation > > today (http://pirate.tangentcode.com/). Parrot seems to have a ton of > > language implementations build using it, but very few are complete > > implementations (with the exception of Perl); they are just tests of > Parrot > > as a compiler infrastructure. > _______________________________________________ > 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 bruce.bromberek at gmail.com Mon Aug 3 16:25:57 2009 From: bruce.bromberek at gmail.com (Bruce Bromberek) Date: Mon, 3 Aug 2009 09:25:57 -0500 Subject: [IronPython] Platform comparison In-Reply-To: References: <8cd017b80908020859r762d7bacldb5102e07746abaa@mail.gmail.com> <58ad4a110908022107o51f92440u9a08cd6f95aa83f7@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC19BB4031@tk5ex14mbxc105.redmond.corp.microsoft.com> Message-ID: <58ad4a110908030725ia0e3ff3w6bc47b588722a92f@mail.gmail.com> Lets try this a second time :) Thanks for the link. I did not know about pynie. And if you don't know about it already, its effectively invisible for a google search of "python+parrot+vm". Parrot.org only links to pirate (which the nightly build shows 14 failed tests and 47 errors out of 62 written tests and the last activity in the CVS being ~ 3 years ago) The strength of Ironpython is IMHO, the ability to tap into the .NET framework. As a reformed perl hacker, that is more important to me than having python code that can use CPAN modules. -Bruce On Sun, Aug 2, 2009 at 11:36 PM, Matthew Wilson wrote: > Unripened fruit from the peanut gallery: Pynie would be a 3-years > more appropriate example of a Python implementation on Parrot: see > http://code.google.com/p/pynie/source/list > > -Matthew Wilson > http://diakopter.blogspot.com/ > http://jsmeta.org/ > > On Sun, Aug 2, 2009 at 11:28 PM, Jimmy > Schementi wrote: > > ParrotVM has a Python implementation ? though it?s not a full > implementation > > today (http://pirate.tangentcode.com/). Parrot seems to have a ton of > > language implementations build using it, but very few are complete > > implementations (with the exception of Perl); they are just tests of > Parrot > > as a compiler infrastructure. > _______________________________________________ > 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 diakopter at gmail.com Mon Aug 3 16:29:19 2009 From: diakopter at gmail.com (Matthew Wilson) Date: Mon, 3 Aug 2009 09:29:19 -0500 Subject: [IronPython] Platform comparison In-Reply-To: <58ad4a110908030725ia0e3ff3w6bc47b588722a92f@mail.gmail.com> References: <8cd017b80908020859r762d7bacldb5102e07746abaa@mail.gmail.com> <58ad4a110908022107o51f92440u9a08cd6f95aa83f7@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC19BB4031@tk5ex14mbxc105.redmond.corp.microsoft.com> <58ad4a110908030725ia0e3ff3w6bc47b588722a92f@mail.gmail.com> Message-ID: Honestly, I'll contribute to this thread something other than a snide-sounding clarification someday... :) http://www.parrot.org/languages does in fact link to Pynie... On Mon, Aug 3, 2009 at 9:25 AM, Bruce Bromberek wrote: > Parrot.org only links to pirate From merllab at microsoft.com Mon Aug 3 17:53:13 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 3 Aug 2009 08:53:13 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/57576. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPythonConsoleAny/IronPythonConsoleAny.csproj $/IronPython/IronPython_Main/Src/IronPythonWindowAny/IronPythonWindowAny.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/Microsoft.Scripting.Debugging.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Properties/ExtensionAssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Microsoft.Scripting.csproj $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Microsoft.Scripting.Silverlight.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Chiron.csproj $/IronPython/IronPython_Main/Src/Tests/ClrAssembly/ClrAssembly.csproj $/IronPython/IronPython_Main/Src/IronPythonWindow/IronPythonWindow.csproj $/IronPython/IronPython_Main/Src/IronPythonWindow/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/IronPythonTest/IronPythonTest.csproj $/IronPython/IronPython_Main/Src/IronPythonConsole/IronPythonConsole.csproj $/IronPython/IronPython_Main/Src/IronPythonConsole/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/IronPython.Modules.csproj $/IronPython/IronPython_Main/Src/IronPython/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/IronPython/IronPython.csproj From dinov at microsoft.com Tue Aug 4 01:33:56 2009 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 3 Aug 2009 23:33:56 +0000 Subject: [IronPython] [ANN]: IronPython 2.6 Beta 2 In-Reply-To: References: <7CEEC335D70FFE4B957737DDE836F51B01EA01@TK5EX14MBXC123.redmond.corp.microsoft.com> <4A68E577.5060705@bakalari.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD036EF147@TK5EX14MBXC118.redmond.corp.microsoft.com> Ok, I've finally got SQL server setup in a reasonable state where I can try and repro this. This is what I'm trying to do. I have a database called "mydatabase" which contains a table "Table_1" which contains 1 column of type binary(4). I then attempt to do: import System conn = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection")) connstr = "driver={SQL Server};Server=localhost;Database=mydatabase;Initial Catalog=mydatabase;Trusted_Connection=True;" conn.ConnectionString = connstr conn.Open() rs = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.RecordSet")) rs.Open("Table_2", conn, 1, 2, 2) # source, active connection, cursor type (adOpenKeyset), lock type (adLockPessimistic), CommmandType (adCmdTable) rs.AddNew() b = System.Array[System.Byte]((2,3,4,5)) x = rs['Test1'] x.AppendChunk(b) which fails with: EnvironmentError: System.Runtime.InteropServices.COMException (0x800A0C93): Operation is not allowed in this context. This is the same failure I get if I use Shri's proposed work around. Do you have any idea of what I'm doing wrong or any suggestions on how to tweak this to get the correct simple repro? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vernon Cole Sent: Thursday, July 23, 2009 10:11 PM To: Discussion of IronPython Subject: Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 Guys: Good work on the new release, and the 215 bug fixes. As usual, as soon as the new beta was announced I downloaded and tested it. Somehow I got the idea that the adodbapi test had been included in the IronPython test suite. Did you only include the tests that already pass? Issue 18222 is still unfixed -- so adodbapi still fails, and you still cannot pass a read-only buffer as a COM parameter. I realize that no one has voted up this rather obscure bug. Perhaps if it were titled "fully support DB API 2.0 compliant database access using ADO" it would have gotten more votes. Nevertheless, this issue has been outstanding for 11 months, and is the only remaining failure in adodbapi for versions 2.3 thru 3.1 of python. Please try to get to it before 2.6 final. Please !!!??? -- Vernon Cole P.S. -- I plan to make a version of adodbapi which uses real ADO.NET, rather than ADO via COM, but I want the current version to be solid before I start mucking it up. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Tue Aug 4 02:10:51 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 4 Aug 2009 00:10:51 +0000 Subject: [IronPython] IronPython ctypes on Linux In-Reply-To: <1A472770E042064698CB5ADC83A12ACD035FF7D9@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <5b0248170907250506o1f23d46bof2c7c4d8140d17b9@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD035FF72D@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD035FF7D9@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD036EF35D@TK5EX14MBXC118.redmond.corp.microsoft.com> Any thoughts on this? I can trivial add a DllImport to dlopen but I need to know where it's declared :) > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Monday, July 27, 2009 3:36 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython ctypes on Linux > > Is there one library name to rule them all on Linux, Mac OS/X, FreeBSD, > etc? (either common on all the OSes or something coming from a Mono > mapping?) > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of Slide > > Sent: Monday, July 27, 2009 3:23 PM > > To: Discussion of IronPython > > Subject: Re: [IronPython] IronPython ctypes on Linux > > > > #include > > > > void *dlopen(const char *filename, int flag); > > > > char *dlerror(void); > > > > void *dlsym(void *handle, const char *symbol); > > > > int dlclose(void *handle); > > > > Not quite the same as LoadLibrary. > > > > On Mon, Jul 27, 2009 at 3:13 PM, Dino Viehland > > wrote: > > > If we just aliased LoadLibrary to dlopen will that work? > > > > > > My hope was that we could basically rely upon Mono's P/Invoke > mapping > > > to handle running ctypes on Linux. But maybe LoadLibrary/dlopen > have > > > slightly different sigs and we need to handle that one specially. > > > > > >> -----Original Message----- > > >> From: users-bounces at lists.ironpython.com [mailto:users- > > >> bounces at lists.ironpython.com] On Behalf Of Seo Sanghyeon > > >> Sent: Saturday, July 25, 2009 5:07 AM > > >> To: Discussion of IronPython > > >> Subject: [IronPython] IronPython ctypes on Linux > > >> > > >> Hopefully I'm not too late on reporthing this... > > >> > > >> If you look at ctypes/__init__.py in Python 2.6, it imports > > different > > >> functions from _ctypes depending on os.name. So on Linux, it > expects > > >> dlopen to be available, instead of LoadLibrary. > > >> > > >> -- > > >> Seo Sanghyeon > > >> _______________________________________________ > > >> 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 > > > > > > > > > > > -- > > slide-o-blog > > http://slide-o-blog.blogspot.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 slide.o.mix at gmail.com Tue Aug 4 05:09:55 2009 From: slide.o.mix at gmail.com (Slide) Date: Mon, 3 Aug 2009 20:09:55 -0700 Subject: [IronPython] IronPython ctypes on Linux In-Reply-To: <1A472770E042064698CB5ADC83A12ACD036EF35D@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <5b0248170907250506o1f23d46bof2c7c4d8140d17b9@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD035FF72D@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD035FF7D9@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD036EF35D@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: I'm not sure if there is standard library that this is implemented on all *NIX platforms. It is possibly different. On Mon, Aug 3, 2009 at 5:10 PM, Dino Viehland wrote: > Any thoughts on this? ?I can trivial add a DllImport to dlopen but > I need to know where it's declared :) > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Dino Viehland >> Sent: Monday, July 27, 2009 3:36 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] IronPython ctypes on Linux >> >> Is there one library name to rule them all on Linux, Mac OS/X, FreeBSD, >> etc? ?(either common on all the OSes or something coming from a Mono >> mapping?) >> >> > -----Original Message----- >> > From: users-bounces at lists.ironpython.com [mailto:users- >> > bounces at lists.ironpython.com] On Behalf Of Slide >> > Sent: Monday, July 27, 2009 3:23 PM >> > To: Discussion of IronPython >> > Subject: Re: [IronPython] IronPython ctypes on Linux >> > >> > #include >> > >> > void *dlopen(const char *filename, int flag); >> > >> > char *dlerror(void); >> > >> > void *dlsym(void *handle, const char *symbol); >> > >> > int dlclose(void *handle); >> > >> > Not quite the same as LoadLibrary. >> > >> > On Mon, Jul 27, 2009 at 3:13 PM, Dino Viehland >> > wrote: >> > > If we just aliased LoadLibrary to dlopen will that work? >> > > >> > > My hope was that we could basically rely upon Mono's P/Invoke >> mapping >> > > to handle running ctypes on Linux. ?But maybe LoadLibrary/dlopen >> have >> > > slightly different sigs and we need to handle that one specially. >> > > >> > >> -----Original Message----- >> > >> From: users-bounces at lists.ironpython.com [mailto:users- >> > >> bounces at lists.ironpython.com] On Behalf Of Seo Sanghyeon >> > >> Sent: Saturday, July 25, 2009 5:07 AM >> > >> To: Discussion of IronPython >> > >> Subject: [IronPython] IronPython ctypes on Linux >> > >> >> > >> Hopefully I'm not too late on reporthing this... >> > >> >> > >> If you look at ctypes/__init__.py in Python 2.6, it imports >> > different >> > >> functions from _ctypes depending on os.name. So on Linux, it >> expects >> > >> dlopen to be available, instead of LoadLibrary. >> > >> >> > >> -- >> > >> Seo Sanghyeon >> > >> _______________________________________________ >> > >> 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 >> > > >> > >> > >> > >> > -- >> > slide-o-blog >> > http://slide-o-blog.blogspot.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 > -- slide-o-blog http://slide-o-blog.blogspot.com/ From sanxiyn at gmail.com Tue Aug 4 06:19:14 2009 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Tue, 4 Aug 2009 13:19:14 +0900 Subject: [IronPython] IronPython ctypes on Linux In-Reply-To: References: <5b0248170907250506o1f23d46bof2c7c4d8140d17b9@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD035FF72D@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD035FF7D9@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD036EF35D@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <5b0248170908032119g183c2bf1tb00f7048f6cd130@mail.gmail.com> 2009/8/4 Slide : > I'm not sure if there is standard library that this is implemented on > all *NIX platforms. It is possibly different. No. dlopen and friends are POSIX standard. http://www.opengroup.org/onlinepubs/009695399/functions/dlopen.html -- Seo Sanghyeon From sanxiyn at gmail.com Tue Aug 4 06:23:56 2009 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Tue, 4 Aug 2009 13:23:56 +0900 Subject: [IronPython] IronPython ctypes on Linux In-Reply-To: <1A472770E042064698CB5ADC83A12ACD036EF35D@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <5b0248170907250506o1f23d46bof2c7c4d8140d17b9@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD035FF72D@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD035FF7D9@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD036EF35D@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <5b0248170908032123i2af5f9f2k1b87568f86699aeb@mail.gmail.com> 2009/8/4 Dino Viehland : > Any thoughts on this? ?I can trivial add a DllImport to dlopen but > I need to know where it's declared :) I believe "libc" is the right one. From what I can tell, Mono maps DllImport("libc") to whatever real C library file for the target platform (this filename differs between Linux and Mac, etc). -- Seo Sanghyeon From sanxiyn at gmail.com Tue Aug 4 06:34:47 2009 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Tue, 4 Aug 2009 13:34:47 +0900 Subject: [IronPython] IronPython ctypes on Linux In-Reply-To: <5b0248170908032123i2af5f9f2k1b87568f86699aeb@mail.gmail.com> References: <5b0248170907250506o1f23d46bof2c7c4d8140d17b9@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD035FF72D@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD035FF7D9@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD036EF35D@TK5EX14MBXC118.redmond.corp.microsoft.com> <5b0248170908032123i2af5f9f2k1b87568f86699aeb@mail.gmail.com> Message-ID: <5b0248170908032134n7b6b822fwc8208bed157da895@mail.gmail.com> 2009/8/4 Seo Sanghyeon : > 2009/8/4 Dino Viehland : >> Any thoughts on this? ?I can trivial add a DllImport to dlopen but >> I need to know where it's declared :) > > I believe "libc" is the right one. From what I can tell, Mono maps > DllImport("libc") to whatever real C library file for the target > platform (this filename differs between Linux and Mac, etc). Oops, no. Although "libc" is mapped as I said, dlopen and friends are not in the C library, it seems. :( -- Seo Sanghyeon From slide.o.mix at gmail.com Tue Aug 4 14:10:31 2009 From: slide.o.mix at gmail.com (Slide) Date: Tue, 4 Aug 2009 05:10:31 -0700 Subject: [IronPython] IronPython ctypes on Linux In-Reply-To: <5b0248170908032119g183c2bf1tb00f7048f6cd130@mail.gmail.com> References: <5b0248170907250506o1f23d46bof2c7c4d8140d17b9@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD035FF72D@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD035FF7D9@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD036EF35D@TK5EX14MBXC118.redmond.corp.microsoft.com> <5b0248170908032119g183c2bf1tb00f7048f6cd130@mail.gmail.com> Message-ID: I knew that dlopen was POSIX standard, what I meant was that I didn't know if there was a standard shared library location (libc, etc) that it was contained in. On Mon, Aug 3, 2009 at 9:19 PM, Seo Sanghyeon wrote: > 2009/8/4 Slide : >> I'm not sure if there is standard library that this is implemented on >> all *NIX platforms. It is possibly different. > > No. dlopen and friends are POSIX standard. > http://www.opengroup.org/onlinepubs/009695399/functions/dlopen.html > > -- > Seo Sanghyeon > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- slide-o-blog http://slide-o-blog.blogspot.com/ From bruce.bromberek at gmail.com Tue Aug 4 16:04:38 2009 From: bruce.bromberek at gmail.com (Bruce Bromberek) Date: Tue, 4 Aug 2009 09:04:38 -0500 Subject: [IronPython] Platform comparison In-Reply-To: References: <8cd017b80908020859r762d7bacldb5102e07746abaa@mail.gmail.com> <58ad4a110908022107o51f92440u9a08cd6f95aa83f7@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC19BB4031@tk5ex14mbxc105.redmond.corp.microsoft.com> <58ad4a110908030725ia0e3ff3w6bc47b588722a92f@mail.gmail.com> Message-ID: <58ad4a110908040704m4924ac24l757f286888727a3f@mail.gmail.com> Wow. I completely missed it. And someday I'll learn to read closely. My snarky comments deserved some snide. On Mon, Aug 3, 2009 at 9:29 AM, Matthew Wilson wrote: > Honestly, I'll contribute to this thread something other than a > snide-sounding clarification someday... :) > http://www.parrot.org/languages does in fact link to Pynie... > > On Mon, Aug 3, 2009 at 9:25 AM, Bruce > Bromberek wrote: > > Parrot.org only links to pirate > _______________________________________________ > 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 merllab at microsoft.com Tue Aug 4 17:53:00 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 4 Aug 2009 08:53:00 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/57668. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/Shell/CommandLine.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Interpreter/LightCompiler.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Interpreter/Instruction.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/MetaPythonType.Calls.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonProtocol.Operations.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/ReflectedEvent.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_Main/Src/IronPythonTest/EngineTest.cs $/IronPython/IronPython_Main/Src/Tests/test_cliclass.py $/IronPython/IronPython_Main/Src/IronPython.Modules/cPickle.cs From adamb at silverkeytech.com Tue Aug 4 17:57:08 2009 From: adamb at silverkeytech.com (Adam Brand) Date: Tue, 4 Aug 2009 08:57:08 -0700 Subject: [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC14388ED7@tk5ex14mbxc105.redmond.corp.microsoft.com> References: <032301c9eb76$10ce3eb0$326abc10$@com> <0047ECBFA2E0DF4A834AA369282A5AFC14388ED7@tk5ex14mbxc105.redmond.corp.microsoft.com> Message-ID: <8bd92c0e0908040857p25b4727fq716249cdb104debd@mail.gmail.com> Any update on this? On Fri, Jun 12, 2009 at 2:47 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > Not sure if it?s by design or just failing to reload it correctly. I?ll > take a look shortly. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand > *Sent:* Friday, June 12, 2009 8:54 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] FW: App_Script Problem in latest IronPython for > ASP.Net > > > > Does anyone have any insight into this? > > > > Thanks, > > Adam > > > > Adam Brand > > SilverKey Technologies > > > > *From:* Adam Brand [mailto:adamb at silverkeytech.com] > *Sent:* Sunday, May 31, 2009 7:53 AM > *To:* 'Discussion of IronPython' > *Subject:* App_Script Problem in latest IronPython for ASP.Net > > > > I?ve noticed that with the latest bits for IronPython for ASP.Net, files in > app_script only seem to be revisited when the app pool is restarted. > > > > For example, if I have a file called hello_world.py in App_Script, and > delete that file, the app still executes code in that file as if it were > there. If I change a line in the file, that line is not shown as changed > until I restart the app pool. > > > > Is this by design, a bug, or something I?m doing wrong? > > > > Thanks, > > Adam > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- Adam Brand Managing Partner SilverKey Technologies Direct: +1-312-239-6722 Main: +1-312-951-7525 Skype: adamsilverkey Email: adamb at silverkeytech.com www.silverkeytech.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From adamb at silverkeytech.com Tue Aug 4 17:58:02 2009 From: adamb at silverkeytech.com (Adam Brand) Date: Tue, 4 Aug 2009 08:58:02 -0700 Subject: [IronPython] IronPython for ASP.Net In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC07C0DEB0@tk5ex14mbxc106.redmond.corp.microsoft.com> References: <8cd017b80905201321t3cf2c033x62353cb484a8905b@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC07C0CBCB@tk5ex14mbxc106.redmond.corp.microsoft.com> <8cd017b80905210422p1aa999ddh16591ce13a63bfe2@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC07C0DEB0@tk5ex14mbxc106.redmond.corp.microsoft.com> Message-ID: <8bd92c0e0908040858y1f73341fpb8ad51543ded3a91@mail.gmail.com> Any update on the source code availability for IPY for ASP.Net? Adam On Thu, May 21, 2009 at 3:11 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > I completely agree with your points; we have a finite amount of resources > and choose to focus on language compatibility over .NET web-stack > integration. Though IronPython has done that web-work in the past, we?re > purely focused on compat. I?ve forwarded on the previous mail to the > ASP.NET team; I want to see IronPython and IronRuby be used on the web > more too. =) > > > > That being said, *I?ve just finished packaging up > Microsoft.Web.Scripting.dll that works against the released IronPython 2 > Beta 1, and I?ll be releasing it either today to tomorrow* ? so end of > conversation? =P Na, I this is a good conversation to have, but in short > you?ll be able to use IronPython 2 Beta 1 in ASP.NET very soon again. > Hopefully the next beta of IronPython 2.6 will include the DLL and source, > otherwise I?ll make this package again. > > > > ~js > > > > *From:* Dody Gunawinata [mailto:empirebuilder at gmail.com] > *Sent:* Thursday, May 21, 2009 4:23 AM > *To:* Jimmy Schementi > *Cc:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython for ASP.Net > > > > The refresh was unusable because it contained the version of IronPyton that > is not compatible with .Net 3.5 framework (I think it was built on IP 2.0 > Beta 3/4); > > I'm griping about this issue in this list because I don't think this is a > completely separate issue from the DLR programming languages. Maybe it is > not a direct responsibility of this team, but the impact is direct for the > following reasons: > > - Nobody adopts a language as is. The libraries matters. The existing > community of Python and Ruby are not going to move to Windows platform just > because IronPython and IronRuby are being worked on and released. They have > had a multi platform runtimes with de facto standards that are capable of > doing wonderful things for more than a decade. > - There is much bigger market for language adoption for existing > .Net/Windows based developers (and new developers) and these guys/gals are > using mostly standard Microsoft stacks. And they are using .Net via mainly > C# and VB.Net. If the DLR languages do not have proper support at least for > the major technology stacks (I would consider ASP.Net/Silverlight as major > stacks), many people will not consider using the DLR based language for > their production systems. > - I know ASP.Net MVC is open source and it's free to be extended etc, > but ASP.Net WebForm have be en deployed massively and that's not going to > change anytime soon. And theres is already a support, albeit poor and not up > to date, for ASP.Net webform stacks in IronPython. Not having it fully > updated is a waste of opportunity. > - .Net 4.0 and C# vNext contains dynamic language support but really, > what is good for if the DLR languages can only be used in much more limited > scenarios because some major technology stacks are not supported. > - You raised correctly that Django and RoR are being used to validate > the languages. But I would argue that the existing technology stack support > validates the DLR platform, not just the languages. > > So yes, I'm not happy with the level of investment being put on supporting > the technology stacks because I think it is pretty short sighted. No, I > don't blame this team for this but at least if I complain on this list, it > might have a chance being forwarded internally because this is one of the > best community mailing list for Microsoft technologies. > > Dody Gunawinata > > On Thu, May 21, 2009 at 5:17 AM, Jimmy Schementi < > Jimmy.Schementi at microsoft.com> wrote: > > First off, it hasn?t been three years: a refresh was released 8 months ago, > and sent to this very list: > > > http://lists.ironpython.com/pipermail/users-ironpython.com/2008-September/008497.html > > > > Secondly, rather than just producing these one off releases (where are very > taxing on the team), we?re doing it right and getting the source code > released and Ms-Pl?d, so we can include it on Codeplex sources, builds, and > nightly builds. Then it can be included in each IronPython release, just > like Silverlight binaries are. > > > > Lastly, IronRuby and IronPython are programming languages, made by > programming language teams. We?re very interested in running as many > existing Ruby and Python programs as possible. It just so happens that > Django and Rails are popular, complex pieces of software that help find > bugs, and give the languages street cred for running them. If those web > frameworks didn?t run, theirs probably something wrong with our language. > > > > Running in ASP.NET and MVC require a significant amount of work *outside*of the language, so it really isn?t a language team?s purpose to build that. > Sure they provide good demos as conferences or blog posts, but they?ll only > be toys. We?ve invested in those technologies before, which is why the > ASP.NET and Silverlight integration exists, but no one is working on > enabling web-technologies full-time (though I have spurts of diving back > into Silverlight from time to time). If you don?t like the level of > investment in dynamic languages for Microsoft web technologies, that?s > something that you should communicate to the ASP.NET team; Phil Haack ( > http://www.haacked.com) or Dmitry Robsman (http://blogs.msdn.com/dmitryr) > are good people to address. > > > > ~Jimmy > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Dody Gunawinata > *Sent:* Wednesday, May 20, 2009 1:22 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] IronPython for ASP.Net > > > > Is there any update for IronPython for ASP.Net? > > > > It has been three years since IronPython support for ASP.Net introduced > with the release of the whitepaper ( > http://www.asp.net/DynamicLanguages/whitepaper/) and the first binary. > Since then I think we've had Katrina, a Beijing Olympic, a new President, a > financial collapse and two James Bond movies - yet until now there is still > no up to date support for the technology. I know that the legal team, etc > are working on the source release, but I think it is pretty galling that > Microsoft's own web framework stack is barely supported by its own dynamic > language technology, both on the 'classic' ASP.Net and MVC stack. I mean > there is more energy put into having IronPython and IronRuby to run Django > and RubyOnRails web framework instead of ASP.Net stack. This just doesn't > make sense to me. > > -- > nomadlife.org > > > > > -- > nomadlife.org > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- Adam Brand Managing Partner SilverKey Technologies Direct: +1-312-239-6722 Main: +1-312-951-7525 Skype: adamsilverkey Email: adamb at silverkeytech.com www.silverkeytech.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Tue Aug 4 18:13:16 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 4 Aug 2009 16:13:16 +0000 Subject: [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net In-Reply-To: <8bd92c0e0908040857p25b4727fq716249cdb104debd@mail.gmail.com> References: <032301c9eb76$10ce3eb0$326abc10$@com> <0047ECBFA2E0DF4A834AA369282A5AFC14388ED7@tk5ex14mbxc105.redmond.corp.microsoft.com> <8bd92c0e0908040857p25b4727fq716249cdb104debd@mail.gmail.com> Message-ID: Not yet, sorry. I think I can fix that for the next release and make them reload if they've been modified, but I haven't checked if there is a way to do that today. I'll take a look now... ~Jimmy Sent from my phone On Aug 4, 2009, at 8:57 AM, "Adam Brand" > wrote: Any update on this? On Fri, Jun 12, 2009 at 2:47 PM, Jimmy Schementi <Jimmy.Schementi at microsoft.com> wrote: Not sure if it?s by design or just failing to reload it correctly. I?ll take a look shortly. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Brand Sent: Friday, June 12, 2009 8:54 AM To: Discussion of IronPython Subject: [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net Does anyone have any insight into this? Thanks, Adam Adam Brand SilverKey Technologies From: Adam Brand [mailto:adamb at silverkeytech.com] Sent: Sunday, May 31, 2009 7:53 AM To: 'Discussion of IronPython' Subject: App_Script Problem in latest IronPython for ASP.Net I?ve noticed that with the latest bits for IronPython for ASP.Net, files in app_script only seem to be revisited when the app pool is restarted. For example, if I have a file called hello_world.py in App_Script, and delete that file, the app still executes code in that file as if it were there. If I change a line in the file, that line is not shown as changed until I restart the app pool. Is this by design, a bug, or something I?m doing wrong? Thanks, Adam _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- Adam Brand Managing Partner SilverKey Technologies Direct: +1-312-239-6722 Main: +1-312-951-7525 Skype: adamsilverkey Email: adamb at silverkeytech.com www.silverkeytech.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 adamb at silverkeytech.com Tue Aug 4 18:14:53 2009 From: adamb at silverkeytech.com (Adam Brand) Date: Tue, 4 Aug 2009 09:14:53 -0700 Subject: [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net In-Reply-To: References: <032301c9eb76$10ce3eb0$326abc10$@com> <0047ECBFA2E0DF4A834AA369282A5AFC14388ED7@tk5ex14mbxc105.redmond.corp.microsoft.com> <8bd92c0e0908040857p25b4727fq716249cdb104debd@mail.gmail.com> Message-ID: <058401ca151e$b3a09c10$1ae1d430$@com> Thanks. The previous release had the correct behavior, so hopefully it isn?t hard to do. Adam Adam Brand SilverKey Technologies *From:* users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] *On Behalf Of *Jimmy Schementi *Sent:* Tuesday, August 04, 2009 9:13 AM *To:* Discussion of IronPython *Subject:* Re: [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net Not yet, sorry. I think I can fix that for the next release and make them reload if they've been modified, but I haven't checked if there is a way to do that today. I'll take a look now... ~Jimmy Sent from my phone On Aug 4, 2009, at 8:57 AM, "Adam Brand" wrote: Any update on this? On Fri, Jun 12, 2009 at 2:47 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: Not sure if it?s by design or just failing to reload it correctly. I?ll take a look shortly. *From:* users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand *Sent:* Friday, June 12, 2009 8:54 AM *To:* Discussion of IronPython *Subject:* [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net Does anyone have any insight into this? Thanks, Adam Adam Brand SilverKey Technologies *From:* Adam Brand [mailto:adamb at silverkeytech.com] *Sent:* Sunday, May 31, 2009 7:53 AM *To:* 'Discussion of IronPython' *Subject:* App_Script Problem in latest IronPython for ASP.Net I?ve noticed that with the latest bits for IronPython for ASP.Net, files in app_script only seem to be revisited when the app pool is restarted. For example, if I have a file called hello_world.py in App_Script, and delete that file, the app still executes code in that file as if it were there. If I change a line in the file, that line is not shown as changed until I restart the app pool. Is this by design, a bug, or something I?m doing wrong? Thanks, Adam _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- Adam Brand Managing Partner SilverKey Technologies Direct: +1-312-239-6722 Main: +1-312-951-7525 Skype: adamsilverkey Email: adamb at silverkeytech.com www.silverkeytech.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 Jimmy.Schementi at microsoft.com Tue Aug 4 18:16:17 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 4 Aug 2009 16:16:17 +0000 Subject: [IronPython] IronPython for ASP.Net In-Reply-To: <8bd92c0e0908040858y1f73341fpb8ad51543ded3a91@mail.gmail.com> References: <8cd017b80905201321t3cf2c033x62353cb484a8905b@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC07C0CBCB@tk5ex14mbxc106.redmond.corp.microsoft.com> <8cd017b80905210422p1aa999ddh16591ce13a63bfe2@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC07C0DEB0@tk5ex14mbxc106.redmond.corp.microsoft.com> <8bd92c0e0908040858y1f73341fpb8ad51543ded3a91@mail.gmail.com> Message-ID: Not yet :( you'll know when we know. ~Jimmy Sent from my phone On Aug 4, 2009, at 8:58 AM, "Adam Brand" > wrote: Any update on the source code availability for IPY for ASP.Net? Adam On Thu, May 21, 2009 at 3:11 PM, Jimmy Schementi <Jimmy.Schementi at microsoft.com> wrote: I completely agree with your points; we have a finite amount of resources and choose to focus on language compatibility over .NET web-stack integration. Though IronPython has done that web-work in the past, we?re purely focused on compat. I?ve forwarded on the previous mail to the ASP.NET team; I want to see IronPython and IronRuby be used on the web more too. =) That being said, I?ve just finished packaging up Microsoft.Web.Scripting.dll that works against the released IronPython 2 Beta 1, and I?ll be releasing it either today to tomorrow ? so end of conversation? =P Na, I this is a good conversation to have, but in short you?ll be able to use IronPython 2 Beta 1 in ASP.NET very soon again. Hopefully the next beta of IronPython 2.6 will include the DLL and source, otherwise I?ll make this package again. ~js From: Dody Gunawinata [mailto:empirebuilder at gmail.com] Sent: Thursday, May 21, 2009 4:23 AM To: Jimmy Schementi Cc: Discussion of IronPython Subject: Re: [IronPython] IronPython for ASP.Net The refresh was unusable because it contained the version of IronPyton that is not compatible with .Net 3.5 framework (I think it was built on IP 2.0 Beta 3/4); I'm griping about this issue in this list because I don't think this is a completely separate issue from the DLR programming languages. Maybe it is not a direct responsibility of this team, but the impact is direct for the following reasons: * Nobody adopts a language as is. The libraries matters. The existing community of Python and Ruby are not going to move to Windows platform just because IronPython and IronRuby are being worked on and released. They have had a multi platform runtimes with de facto standards that are capable of doing wonderful things for more than a decade. * There is much bigger market for language adoption for existing .Net/Windows based developers (and new developers) and these guys/gals are using mostly standard Microsoft stacks. And they are using .Net via mainly C# and VB.Net. If the DLR languages do not have proper support at least for the major technology stacks (I would consider ASP.Net/Silverlight as major stacks), many people will not consider using the DLR based language for their production systems. * I know ASP.Net MVC is open source and it's free to be extended etc, but ASP.Net WebForm have be en deployed massively and that's not going to change anytime soon. And theres is already a support, albeit poor and not up to date, for ASP.Net webform stacks in IronPython. Not having it fully updated is a waste of opportunity. * .Net 4.0 and C# vNext contains dynamic language support but really, what is good for if the DLR languages can only be used in much more limited scenarios because some major technology stacks are not supported. * You raised correctly that Django and RoR are being used to validate the languages. But I would argue that the existing technology stack support validates the DLR platform, not just the languages. So yes, I'm not happy with the level of investment being put on supporting the technology stacks because I think it is pretty short sighted. No, I don't blame this team for this but at least if I complain on this list, it might have a chance being forwarded internally because this is one of the best community mailing list for Microsoft technologies. Dody Gunawinata On Thu, May 21, 2009 at 5:17 AM, Jimmy Schementi <Jimmy.Schementi at microsoft.com> wrote: First off, it hasn?t been three years: a refresh was released 8 months ago, and sent to this very list: http://lists.ironpython.com/pipermail/users-ironpython.com/2008-September/008497.html Secondly, rather than just producing these one off releases (where are very taxing on the team), we?re doing it right and getting the source code released and Ms-Pl?d, so we can include it on Codeplex sources, builds, and nightly builds. Then it can be included in each IronPython release, just like Silverlight binaries are. Lastly, IronRuby and IronPython are programming languages, made by programming language teams. We?re very interested in running as many existing Ruby and Python programs as possible. It just so happens that Django and Rails are popular, complex pieces of software that help find bugs, and give the languages street cred for running them. If those web frameworks didn?t run, theirs probably something wrong with our language. Running in ASP.NET and MVC require a significant amount of work outside of the language, so it really isn?t a language team?s purpose to build that. Sure they provide good demos as conferences or blog posts, but they?ll only be toys. We?ve invested in those technologies before, which is why the ASP.NET and Silverlight integration exists, but no one is working on enabling web-technologies full-time (though I have spurts of diving back into Silverlight from time to time). If you don?t like the level of investment in dynamic languages for Microsoft web technologies, that?s something that you should communicate to the ASP.NET team; Phil Haack (http://www.haacked.com) or Dmitry Robsman (http://blogs.msdn.com/dmitryr) are good people to address. ~Jimmy From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata Sent: Wednesday, May 20, 2009 1:22 PM To: Discussion of IronPython Subject: [IronPython] IronPython for ASP.Net Is there any update for IronPython for ASP.Net? It has been three years since IronPython support for ASP.Net introduced with the release of the whitepaper (http://www.asp.net/DynamicLanguages/whitepaper/) and the first binary. Since then I think we've had Katrina, a Beijing Olympic, a new President, a financial collapse and two James Bond movies - yet until now there is still no up to date support for the technology. I know that the legal team, etc are working on the source release, but I think it is pretty galling that Microsoft's own web framework stack is barely supported by its own dynamic language technology, both on the 'classic' ASP.Net and MVC stack. I mean there is more energy put into having IronPython and IronRuby to run Django and RubyOnRails web framework instead of ASP.Net stack. This just doesn't make sense to me. -- nomadlife.org -- nomadlife.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- Adam Brand Managing Partner SilverKey Technologies Direct: +1-312-239-6722 Main: +1-312-951-7525 Skype: adamsilverkey Email: adamb at silverkeytech.com www.silverkeytech.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 mads.weitling at gmail.com Wed Aug 5 09:54:04 2009 From: mads.weitling at gmail.com (Mads Weitling) Date: Wed, 5 Aug 2009 09:54:04 +0200 Subject: [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) Message-ID: Hi all and many thanks to Dino Viehland for answering my previous question re: sys.builtin_module_names and embedding. I am trying to use the IronPython profiler ( http://blogs.msdn.com/curth/archive/2009/03/29/an-ironpython-profiler.aspx) from an embedded interpreter but cannot figure out how to pass the -X:EnableProfiler to my ScriptEngine instance. _engine = Python.CreateEngine(); Debug.WriteLine(_engine.Runtime.Setup.HostArguments.IsReadOnly); // prints True _engine.Runtime.Setup.HostArguments.Add("-X:EnableProfiler") // throws an System.NotSupportedException How do I set up the Runtime.Setup.HostArguments before calling Python.CreateEngine()? /Mads -------------- next part -------------- An HTML attachment was scrubbed... URL: From merllab at microsoft.com Wed Aug 5 19:41:50 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 5 Aug 2009 10:41:50 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <2261632a-502a-486a-b4e1-c86f492a5a11@tk5-exsmh-c101.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/57718. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/PythonType.Generated.cs $/IronPython/IronPython_Main/Src/IronPythonTest/ClrType.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonTracebackListener.cs $/IronPython/IronPython_Main/Src/Tests/interop/net/type/test_clrtype.py $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/Shell/BasicConsole.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/DefaultBinder.SetMember.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonBinder.Create.cs $/IronPython/IronPython_Main/Src/Tests/interop/net/derivation/test_ctor_override.py $/IronPython/IronPython_Main/Src/Tests/interop/net/test_accessibility.py $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/MetaPythonType.Calls.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/MetaUserObject.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/NewTypeMaker.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/TypeInfo.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/ModuleDictionaryStorage.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/CommonDictionaryStorage.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/BuiltinFunction.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/PythonType.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/ReflectedGetterSetter.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonTypeOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonTuple.cs $/IronPython/IronPython_Main/Src/Tests/test_nt.py $/IronPython/IronPython_Main/Src/Tests/test_sys.py $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/InstanceOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_Main/Src/Tests/test_tuple.py $/IronPython/IronPython_Main/Src/Tests/test_superconsole.py $/IronPython/IronPython_Main/Src/Tests/test_marshal.py $/IronPython/IronPython_Main/Src/Tests/test_function.py $/IronPython/IronPython_Main/Src/Tests/test_dict.py $/IronPython/IronPython_Main/Src/IronPython.Modules/re.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/nt.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/marshal.cs $/IronPython/IronPython_Main/Src/Tests/test_cliclass.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1043594 Date: 8/5/2009 9:18:17 AM (dfugate) - test_mailbox.py: at least part of CodePlex 13702 has been fixed - test_print.py: CodePlex 23132 has been fixed - test_sys.py: added small regression for sys.dont_write_bytecode (Shelveset: CP67;REDMOND\dfugate | SNAP CheckinId: 9088) -------------------------------------------------------------------------------- Changeset Id: 1043510 Date: 8/5/2009 8:00:13 AM Reverted framework.py (Direct3D sample) to a previous version after a bug fix by Dino. From ddicato at microsoft.com Wed Aug 5 21:58:53 2009 From: ddicato at microsoft.com (David DiCato) Date: Wed, 5 Aug 2009 19:58:53 +0000 Subject: [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) In-Reply-To: References: Message-ID: You have to pass the required options to Python.CreateEngine, like so: var options = new Dictionary(); options["EnableProfiler"] = ScriptingRuntimeHelpers.True; ver engine = Python.CreateEngine(options); Hope this helps, - David From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mads Weitling Sent: Wednesday, August 05, 2009 12:54 AM To: users at lists.ironpython.com Subject: [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) Hi all and many thanks to Dino Viehland for answering my previous question re: sys.builtin_module_names and embedding. I am trying to use the IronPython profiler (http://blogs.msdn.com/curth/archive/2009/03/29/an-ironpython-profiler.aspx) from an embedded interpreter but cannot figure out how to pass the -X:EnableProfiler to my ScriptEngine instance. _engine = Python.CreateEngine(); Debug.WriteLine(_engine.Runtime.Setup.HostArguments.IsReadOnly); // prints True _engine.Runtime.Setup.HostArguments.Add("-X:EnableProfiler") // throws an System.NotSupportedException How do I set up the Runtime.Setup.HostArguments before calling Python.CreateEngine()? /Mads -------------- next part -------------- An HTML attachment was scrubbed... URL: From sapiki at appropriatesolutions.com Wed Aug 5 21:58:16 2009 From: sapiki at appropriatesolutions.com (Steve Apiki) Date: Wed, 5 Aug 2009 15:58:16 -0400 (EDT) Subject: [IronPython] DataBinding from IronPython Object to WPF Property In-Reply-To: <10393772.61249502300406.JavaMail.SYSTEM@PCDaveR2007> Message-ID: <20703168.81249502683593.JavaMail.SYSTEM@PCDaveR2007> Hello, I'm working with IronPython 2.6 Beta 1. I have the following Python class: class Person(object): def __init__(self, name): self.name = name I'd like to be able to bind the name property of an instance of this class to a WPF textbox control. I can do this easily enough either in XAML or in code. When the application starts, the textbox displays the person's name as expected. However, if I make changes to the name, say, in response to a button click: def button_click(sender, args): a_person.name += ", jr." I don't see these changes reflected in the textbox. I can make this work by calling UpdateTarget on the binding expression explicitly: exp = BindingOperations.GetBindingExpression(textbox, TextBox.TextProperty) exp.UpdateTarget() but I had thought this would work without the explicit step, since it appears that IronPython supports INotifyPropertyChange. Two questions: (1) Is it possible to get databinding to work this way without having to explicity UpdateTarget? (2) Say instead of the click handler above, we had: def button_click(sender, args): global a_person a_person = Person("Fred") In this case, the textbox remains bound to the first Person (which is no longer accessible from Python). Is there any way to get the binding to re-sync to the new object, short of setting a completely new binding to Person("Fred") in code? Full example follows. Thanks, --Steve ----------------------------------------- import clr clr.AddReferenceByName("PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") clr.AddReferenceByName("PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") clr.AddReferenceByPartialName("IronPython") clr.AddReference("IronPython.Modules") from System.Windows import Application, Window from System.Windows.Controls import StackPanel, Button, TextBox from System.Windows.Data import Binding, BindingMode, BindingOperations class Person(object): def __init__(self, name): self.name = name a_person = Person("Al") button = Button() button.Content = "Test" textbox = TextBox() textbox.DataContext = a_person binding = Binding("name") binding.Source = a_person binding.Mode = BindingMode.OneWay textbox.SetBinding(TextBox.TextProperty, binding) def button_click(sender, args): """ click handler """ a_person.name += ", jr." # if you uncomment the following, the textbox is updated # with each button click. If you don't, the text never changes. #exp = BindingOperations.GetBindingExpression(textbox, TextBox.TextProperty) #exp.UpdateTarget() button.Click += button_click window = Window() stackpanel = StackPanel() stackpanel.Children.Add(button) stackpanel.Children.Add(textbox) window.Content = stackpanel Application().Run(window) From dinov at microsoft.com Wed Aug 5 22:11:26 2009 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 5 Aug 2009 20:11:26 +0000 Subject: [IronPython] DataBinding from IronPython Object to WPF Property In-Reply-To: <20703168.81249502683593.JavaMail.SYSTEM@PCDaveR2007> References: <10393772.61249502300406.JavaMail.SYSTEM@PCDaveR2007> <20703168.81249502683593.JavaMail.SYSTEM@PCDaveR2007> Message-ID: <1A472770E042064698CB5ADC83A12ACD03724474@TK5EX14MBXC116.redmond.corp.microsoft.com> IronPython doesn't actually support INotifyPropertyChanged - it only supports custom type descriptor so that WPF can get at the values but it doesn't get the change notifications. You could make an instance of ExpandoObject which does support it: import clr clr.AddReference('Microsoft.Scripting.Core') from Microsoft.Dynamic import ExpandoObject a = ExpandoObject() a.name = 'Foo' Or you could implement INotifiyPropertyChanged on the Person object and use a property which fires the event changed notification. My only thought on #2 would be to add another point of indirection. So rather than updating the global a_person update a_person.real_value and have that update fire a bunch of changed events. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Steve Apiki > Sent: Wednesday, August 05, 2009 12:58 PM > To: users at lists.ironpython.com > Subject: [IronPython] DataBinding from IronPython Object to WPF > Property > > Hello, > > I'm working with IronPython 2.6 Beta 1. > > I have the following Python class: > > class Person(object): > def __init__(self, name): > self.name = name > > I'd like to be able to bind the name property of an instance of this > class to a WPF textbox control. > > I can do this easily enough either in XAML or in code. When the > application starts, the textbox displays the person's name as expected. > > However, if I make changes to the name, say, in response to a button > click: > > def button_click(sender, args): > a_person.name += ", jr." > > I don't see these changes reflected in the textbox. > > I can make this work by calling UpdateTarget on the binding expression > explicitly: > > exp = BindingOperations.GetBindingExpression(textbox, > TextBox.TextProperty) > exp.UpdateTarget() > > but I had thought this would work without the explicit step, since it > appears that IronPython supports INotifyPropertyChange. > > Two questions: > > (1) Is it possible to get databinding to work this way without having > to explicity UpdateTarget? > > > (2) Say instead of the click handler above, we had: > > def button_click(sender, args): > global a_person > a_person = Person("Fred") > > In this case, the textbox remains bound to the first Person (which is > no longer accessible from Python). Is there any way to get the binding > to re-sync to the new object, short of setting a completely new binding > to Person("Fred") in code? > > > Full example follows. > > Thanks, > > --Steve > > ----------------------------------------- > > import clr > clr.AddReferenceByName("PresentationFramework, Version=3.0.0.0, > Culture=neutral, PublicKeyToken=31bf3856ad364e35") > clr.AddReferenceByName("PresentationCore, Version=3.0.0.0, > Culture=neutral, PublicKeyToken=31bf3856ad364e35") > clr.AddReferenceByPartialName("IronPython") > clr.AddReference("IronPython.Modules") > > from System.Windows import Application, Window > from System.Windows.Controls import StackPanel, Button, TextBox > from System.Windows.Data import Binding, BindingMode, BindingOperations > > class Person(object): > def __init__(self, name): > self.name = name > a_person = Person("Al") > > button = Button() > button.Content = "Test" > > textbox = TextBox() > textbox.DataContext = a_person > binding = Binding("name") > binding.Source = a_person > binding.Mode = BindingMode.OneWay > textbox.SetBinding(TextBox.TextProperty, binding) > > def button_click(sender, args): > """ click handler """ > a_person.name += ", jr." > > # if you uncomment the following, the textbox is updated > # with each button click. If you don't, the text never changes. > #exp = BindingOperations.GetBindingExpression(textbox, > TextBox.TextProperty) > #exp.UpdateTarget() > > button.Click += button_click > > > window = Window() > stackpanel = StackPanel() > stackpanel.Children.Add(button) > stackpanel.Children.Add(textbox) > window.Content = stackpanel > > Application().Run(window) > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sapiki at appropriatesolutions.com Wed Aug 5 22:50:56 2009 From: sapiki at appropriatesolutions.com (Steve Apiki) Date: Wed, 5 Aug 2009 16:50:56 -0400 (EDT) Subject: [IronPython] DataBinding from IronPython Object to WPF Property In-Reply-To: <7782204.121249505760250.JavaMail.SYSTEM@PCDaveR2007> Message-ID: <27288864.141249505844875.JavaMail.SYSTEM@PCDaveR2007> Hi Dino, Thanks for your quick answer and for making things clear on INotifyPropertyChanged. I'd like to have my own derived classes for this project so I think I'm going to steer clear of ExpandoObject and look into implementing INotifyPropertyChanged. And I tried out your suggestion for #2, creating a new class: class Context(object): def __init__(self): self.person = Person("Alfred") and then assigning a new Person as the person attribute of the context: label.DataContext = a_context def button_click(sender, args): a_context.person = Person("Mathilda") which works (for now) as long as I do the UpdateTarget() and presumably will work as well with implementing INotifyPropertyChanged. Thanks, --Steve ----- Original Message ----- From: "Dino Viehland" To: "Discussion of IronPython" Sent: Wednesday, August 5, 2009 4:11:26 PM GMT -05:00 US/Canada Eastern Subject: Re: [IronPython] DataBinding from IronPython Object to WPF Property IronPython doesn't actually support INotifyPropertyChanged - it only supports custom type descriptor so that WPF can get at the values but it doesn't get the change notifications. You could make an instance of ExpandoObject which does support it: import clr clr.AddReference('Microsoft.Scripting.Core') from Microsoft.Dynamic import ExpandoObject a = ExpandoObject() a.name = 'Foo' Or you could implement INotifiyPropertyChanged on the Person object and use a property which fires the event changed notification. My only thought on #2 would be to add another point of indirection. So rather than updating the global a_person update a_person.real_value and have that update fire a bunch of changed events. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Steve Apiki > Sent: Wednesday, August 05, 2009 12:58 PM > To: users at lists.ironpython.com > Subject: [IronPython] DataBinding from IronPython Object to WPF > Property > > Hello, > > I'm working with IronPython 2.6 Beta 1. > > I have the following Python class: > > class Person(object): > def __init__(self, name): > self.name = name > > I'd like to be able to bind the name property of an instance of this > class to a WPF textbox control. > > I can do this easily enough either in XAML or in code. When the > application starts, the textbox displays the person's name as expected. > > However, if I make changes to the name, say, in response to a button > click: > > def button_click(sender, args): > a_person.name += ", jr." > > I don't see these changes reflected in the textbox. > > I can make this work by calling UpdateTarget on the binding expression > explicitly: > > exp = BindingOperations.GetBindingExpression(textbox, > TextBox.TextProperty) > exp.UpdateTarget() > > but I had thought this would work without the explicit step, since it > appears that IronPython supports INotifyPropertyChange. > > Two questions: > > (1) Is it possible to get databinding to work this way without having > to explicity UpdateTarget? > > > (2) Say instead of the click handler above, we had: > > def button_click(sender, args): > global a_person > a_person = Person("Fred") > > In this case, the textbox remains bound to the first Person (which is > no longer accessible from Python). Is there any way to get the binding > to re-sync to the new object, short of setting a completely new binding > to Person("Fred") in code? > > > Full example follows. > > Thanks, > > --Steve > > ----------------------------------------- > > import clr > clr.AddReferenceByName("PresentationFramework, Version=3.0.0.0, > Culture=neutral, PublicKeyToken=31bf3856ad364e35") > clr.AddReferenceByName("PresentationCore, Version=3.0.0.0, > Culture=neutral, PublicKeyToken=31bf3856ad364e35") > clr.AddReferenceByPartialName("IronPython") > clr.AddReference("IronPython.Modules") > > from System.Windows import Application, Window > from System.Windows.Controls import StackPanel, Button, TextBox > from System.Windows.Data import Binding, BindingMode, BindingOperations > > class Person(object): > def __init__(self, name): > self.name = name > a_person = Person("Al") > > button = Button() > button.Content = "Test" > > textbox = TextBox() > textbox.DataContext = a_person > binding = Binding("name") > binding.Source = a_person > binding.Mode = BindingMode.OneWay > textbox.SetBinding(TextBox.TextProperty, binding) > > def button_click(sender, args): > """ click handler """ > a_person.name += ", jr." > > # if you uncomment the following, the textbox is updated > # with each button click. If you don't, the text never changes. > #exp = BindingOperations.GetBindingExpression(textbox, > TextBox.TextProperty) > #exp.UpdateTarget() > > button.Click += button_click > > > window = Window() > stackpanel = StackPanel() > stackpanel.Children.Add(button) > stackpanel.Children.Add(textbox) > window.Content = stackpanel > > Application().Run(window) > > > > > > > _______________________________________________ > 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 Thu Aug 6 01:06:46 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 06 Aug 2009 00:06:46 +0100 Subject: [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) In-Reply-To: References: Message-ID: <4A7A1086.3040909@voidspace.org.uk> David DiCato wrote: > > You have to pass the required options to Python.CreateEngine, like so: > > var options = new Dictionary(); > > options[?EnableProfiler?] = ScriptingRuntimeHelpers.True; > > ver engine = Python.CreateEngine(options); > Are these options for IronPython 2.6 documented anywhere? Michael > Hope this helps, > > - David > > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Mads Weitling > *Sent:* Wednesday, August 05, 2009 12:54 AM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) > > Hi all and many thanks to Dino Viehland for answering my previous > question re: sys.builtin_module_names and embedding. > > I am trying to use the IronPython profiler > (http://blogs.msdn.com/curth/archive/2009/03/29/an-ironpython-profiler.aspx) > from an embedded interpreter but cannot figure out how to pass the > -X:EnableProfiler to my ScriptEngine instance. > > _engine = Python.CreateEngine(); > > Debug.WriteLine(_engine.Runtime.Setup.HostArguments.IsReadOnly); > > // prints True > > _engine.Runtime.Setup.HostArguments.Add("-X:EnableProfiler") > > // throws an System.NotSupportedException > > How do I set up the Runtime.Setup.HostArguments before calling > Python.CreateEngine()? > > > /Mads > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From curt at hagenlocher.org Thu Aug 6 02:35:15 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 5 Aug 2009 17:35:15 -0700 Subject: [IronPython] DataBinding from IronPython Object to WPF Property In-Reply-To: <27288864.141249505844875.JavaMail.SYSTEM@PCDaveR2007> References: <7782204.121249505760250.JavaMail.SYSTEM@PCDaveR2007> <27288864.141249505844875.JavaMail.SYSTEM@PCDaveR2007> Message-ID: Python's __setattr__ hook makes INotifyPropertyChanged easy to implement if you're willing to pay the performance penalty. Just derive from a class like this one: class PropertyChangeNotifier(INotifyPropertyChanged): def __init__(self, *trackedNames): self._PropertyChanged, self._OnPropertyChanged = pyevent.MakeEvent() self._trackedNames = trackedNames def add_PropertyChanged(self, handler): self._PropertyChanged += handler def remove_PropertyChanged(self, handler): self._PropertyChanged -= handler def __setattr__(self, name, value): object.__setattr__(self, name,value) if name != "_PropertyChanged" and name != "_OnPropertyChanged": if len(self._trackedNames) == 0 or name in self._trackedNames: self._OnPropertyChanged(self, PropertyChangedEventArgs(name)) On Wed, Aug 5, 2009 at 1:50 PM, Steve Apiki wrote: > Hi Dino, > > Thanks for your quick answer and for making things clear on > INotifyPropertyChanged. > > I'd like to have my own derived classes for this project so I think I'm > going to steer clear of ExpandoObject and look into implementing > INotifyPropertyChanged. > > And I tried out your suggestion for #2, creating a new class: > > class Context(object): > def __init__(self): > self.person = Person("Alfred") > > and then assigning a new Person as the person attribute of the context: > > label.DataContext = a_context > > def button_click(sender, args): > a_context.person = Person("Mathilda") > > which works (for now) as long as I do the UpdateTarget() and presumably > will work as well with implementing INotifyPropertyChanged. > > Thanks, > > --Steve > > ----- Original Message ----- > From: "Dino Viehland" > To: "Discussion of IronPython" > Sent: Wednesday, August 5, 2009 4:11:26 PM GMT -05:00 US/Canada Eastern > Subject: Re: [IronPython] DataBinding from IronPython Object to WPF > Property > > IronPython doesn't actually support INotifyPropertyChanged - it only > supports custom type descriptor so that WPF can get at the values > but it doesn't get the change notifications. > > You could make an instance of ExpandoObject which does support it: > > import clr > clr.AddReference('Microsoft.Scripting.Core') > from Microsoft.Dynamic import ExpandoObject > a = ExpandoObject() > a.name = 'Foo' > > Or you could implement INotifiyPropertyChanged on the Person object > and use a property which fires the event changed notification. > > My only thought on #2 would be to add another point of indirection. > So rather than updating the global a_person update a_person.real_value > and have that update fire a bunch of changed events. > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of Steve Apiki > > Sent: Wednesday, August 05, 2009 12:58 PM > > To: users at lists.ironpython.com > > Subject: [IronPython] DataBinding from IronPython Object to WPF > > Property > > > > Hello, > > > > I'm working with IronPython 2.6 Beta 1. > > > > I have the following Python class: > > > > class Person(object): > > def __init__(self, name): > > self.name = name > > > > I'd like to be able to bind the name property of an instance of this > > class to a WPF textbox control. > > > > I can do this easily enough either in XAML or in code. When the > > application starts, the textbox displays the person's name as expected. > > > > However, if I make changes to the name, say, in response to a button > > click: > > > > def button_click(sender, args): > > a_person.name += ", jr." > > > > I don't see these changes reflected in the textbox. > > > > I can make this work by calling UpdateTarget on the binding expression > > explicitly: > > > > exp = BindingOperations.GetBindingExpression(textbox, > > TextBox.TextProperty) > > exp.UpdateTarget() > > > > but I had thought this would work without the explicit step, since it > > appears that IronPython supports INotifyPropertyChange. > > > > Two questions: > > > > (1) Is it possible to get databinding to work this way without having > > to explicity UpdateTarget? > > > > > > (2) Say instead of the click handler above, we had: > > > > def button_click(sender, args): > > global a_person > > a_person = Person("Fred") > > > > In this case, the textbox remains bound to the first Person (which is > > no longer accessible from Python). Is there any way to get the binding > > to re-sync to the new object, short of setting a completely new binding > > to Person("Fred") in code? > > > > > > Full example follows. > > > > Thanks, > > > > --Steve > > > > ----------------------------------------- > > > > import clr > > clr.AddReferenceByName("PresentationFramework, Version=3.0.0.0, > > Culture=neutral, PublicKeyToken=31bf3856ad364e35") > > clr.AddReferenceByName("PresentationCore, Version=3.0.0.0, > > Culture=neutral, PublicKeyToken=31bf3856ad364e35") > > clr.AddReferenceByPartialName("IronPython") > > clr.AddReference("IronPython.Modules") > > > > from System.Windows import Application, Window > > from System.Windows.Controls import StackPanel, Button, TextBox > > from System.Windows.Data import Binding, BindingMode, BindingOperations > > > > class Person(object): > > def __init__(self, name): > > self.name = name > > a_person = Person("Al") > > > > button = Button() > > button.Content = "Test" > > > > textbox = TextBox() > > textbox.DataContext = a_person > > binding = Binding("name") > > binding.Source = a_person > > binding.Mode = BindingMode.OneWay > > textbox.SetBinding(TextBox.TextProperty, binding) > > > > def button_click(sender, args): > > """ click handler """ > > a_person.name += ", jr." > > > > # if you uncomment the following, the textbox is updated > > # with each button click. If you don't, the text never changes. > > #exp = BindingOperations.GetBindingExpression(textbox, > > TextBox.TextProperty) > > #exp.UpdateTarget() > > > > button.Click += button_click > > > > > > window = Window() > > stackpanel = StackPanel() > > stackpanel.Children.Add(button) > > stackpanel.Children.Add(textbox) > > window.Content = stackpanel > > > > Application().Run(window) > > > > > > > > > > > > > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Thu Aug 6 02:38:15 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 5 Aug 2009 17:38:15 -0700 Subject: [IronPython] DataBinding from IronPython Object to WPF Property In-Reply-To: References: <7782204.121249505760250.JavaMail.SYSTEM@PCDaveR2007> <27288864.141249505844875.JavaMail.SYSTEM@PCDaveR2007> Message-ID: Oops -- I should have pointed out that pyevent.py is in the standard IronPython distribution; probably in a directory called "samples" or "tutorial". (Network service in the bus is flaky, so I'm finding it hard to check.) On Wed, Aug 5, 2009 at 5:35 PM, Curt Hagenlocher wrote: > Python's __setattr__ hook makes INotifyPropertyChanged easy to implement if > you're willing to pay the performance penalty. Just derive from a class like > this one: > > class PropertyChangeNotifier(INotifyPropertyChanged): > def __init__(self, *trackedNames): > self._PropertyChanged, self._OnPropertyChanged = > pyevent.MakeEvent() > self._trackedNames = trackedNames > def add_PropertyChanged(self, handler): > self._PropertyChanged += handler > def remove_PropertyChanged(self, handler): > self._PropertyChanged -= handler > def __setattr__(self, name, value): > object.__setattr__(self, name,value) > if name != "_PropertyChanged" and name != "_OnPropertyChanged": > if len(self._trackedNames) == 0 or name in self._trackedNames: > self._OnPropertyChanged(self, > PropertyChangedEventArgs(name)) > On Wed, Aug 5, 2009 at 1:50 PM, Steve Apiki < > sapiki at appropriatesolutions.com> wrote: > >> Hi Dino, >> >> Thanks for your quick answer and for making things clear on >> INotifyPropertyChanged. >> >> I'd like to have my own derived classes for this project so I think I'm >> going to steer clear of ExpandoObject and look into implementing >> INotifyPropertyChanged. >> >> And I tried out your suggestion for #2, creating a new class: >> >> class Context(object): >> def __init__(self): >> self.person = Person("Alfred") >> >> and then assigning a new Person as the person attribute of the context: >> >> label.DataContext = a_context >> >> def button_click(sender, args): >> a_context.person = Person("Mathilda") >> >> which works (for now) as long as I do the UpdateTarget() and presumably >> will work as well with implementing INotifyPropertyChanged. >> >> Thanks, >> >> --Steve >> >> ----- Original Message ----- >> From: "Dino Viehland" >> To: "Discussion of IronPython" >> Sent: Wednesday, August 5, 2009 4:11:26 PM GMT -05:00 US/Canada Eastern >> Subject: Re: [IronPython] DataBinding from IronPython Object to WPF >> Property >> >> IronPython doesn't actually support INotifyPropertyChanged - it only >> supports custom type descriptor so that WPF can get at the values >> but it doesn't get the change notifications. >> >> You could make an instance of ExpandoObject which does support it: >> >> import clr >> clr.AddReference('Microsoft.Scripting.Core') >> from Microsoft.Dynamic import ExpandoObject >> a = ExpandoObject() >> a.name = 'Foo' >> >> Or you could implement INotifiyPropertyChanged on the Person object >> and use a property which fires the event changed notification. >> >> My only thought on #2 would be to add another point of indirection. >> So rather than updating the global a_person update a_person.real_value >> and have that update fire a bunch of changed events. >> >> >> > -----Original Message----- >> > From: users-bounces at lists.ironpython.com [mailto:users- >> > bounces at lists.ironpython.com] On Behalf Of Steve Apiki >> > Sent: Wednesday, August 05, 2009 12:58 PM >> > To: users at lists.ironpython.com >> > Subject: [IronPython] DataBinding from IronPython Object to WPF >> > Property >> > >> > Hello, >> > >> > I'm working with IronPython 2.6 Beta 1. >> > >> > I have the following Python class: >> > >> > class Person(object): >> > def __init__(self, name): >> > self.name = name >> > >> > I'd like to be able to bind the name property of an instance of this >> > class to a WPF textbox control. >> > >> > I can do this easily enough either in XAML or in code. When the >> > application starts, the textbox displays the person's name as expected. >> > >> > However, if I make changes to the name, say, in response to a button >> > click: >> > >> > def button_click(sender, args): >> > a_person.name += ", jr." >> > >> > I don't see these changes reflected in the textbox. >> > >> > I can make this work by calling UpdateTarget on the binding expression >> > explicitly: >> > >> > exp = BindingOperations.GetBindingExpression(textbox, >> > TextBox.TextProperty) >> > exp.UpdateTarget() >> > >> > but I had thought this would work without the explicit step, since it >> > appears that IronPython supports INotifyPropertyChange. >> > >> > Two questions: >> > >> > (1) Is it possible to get databinding to work this way without having >> > to explicity UpdateTarget? >> > >> > >> > (2) Say instead of the click handler above, we had: >> > >> > def button_click(sender, args): >> > global a_person >> > a_person = Person("Fred") >> > >> > In this case, the textbox remains bound to the first Person (which is >> > no longer accessible from Python). Is there any way to get the binding >> > to re-sync to the new object, short of setting a completely new binding >> > to Person("Fred") in code? >> > >> > >> > Full example follows. >> > >> > Thanks, >> > >> > --Steve >> > >> > ----------------------------------------- >> > >> > import clr >> > clr.AddReferenceByName("PresentationFramework, Version=3.0.0.0, >> > Culture=neutral, PublicKeyToken=31bf3856ad364e35") >> > clr.AddReferenceByName("PresentationCore, Version=3.0.0.0, >> > Culture=neutral, PublicKeyToken=31bf3856ad364e35") >> > clr.AddReferenceByPartialName("IronPython") >> > clr.AddReference("IronPython.Modules") >> > >> > from System.Windows import Application, Window >> > from System.Windows.Controls import StackPanel, Button, TextBox >> > from System.Windows.Data import Binding, BindingMode, BindingOperations >> > >> > class Person(object): >> > def __init__(self, name): >> > self.name = name >> > a_person = Person("Al") >> > >> > button = Button() >> > button.Content = "Test" >> > >> > textbox = TextBox() >> > textbox.DataContext = a_person >> > binding = Binding("name") >> > binding.Source = a_person >> > binding.Mode = BindingMode.OneWay >> > textbox.SetBinding(TextBox.TextProperty, binding) >> > >> > def button_click(sender, args): >> > """ click handler """ >> > a_person.name += ", jr." >> > >> > # if you uncomment the following, the textbox is updated >> > # with each button click. If you don't, the text never changes. >> > #exp = BindingOperations.GetBindingExpression(textbox, >> > TextBox.TextProperty) >> > #exp.UpdateTarget() >> > >> > button.Click += button_click >> > >> > >> > window = Window() >> > stackpanel = StackPanel() >> > stackpanel.Children.Add(button) >> > stackpanel.Children.Add(textbox) >> > window.Content = stackpanel >> > >> > Application().Run(window) >> > >> > >> > >> > >> > >> > >> > _______________________________________________ >> > 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 >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sapiki at appropriatesolutions.com Thu Aug 6 07:23:18 2009 From: sapiki at appropriatesolutions.com (Steve Apiki) Date: Thu, 6 Aug 2009 01:23:18 -0400 (EDT) Subject: [IronPython] DataBinding from IronPython Object to WPF Property In-Reply-To: Message-ID: <1932515.221249536590515.JavaMail.SYSTEM@PCDaveR2007> Hi Curt, Thanks, just what I needed and the performance is definitely acceptable if you keep trackedNames to a minimum. --Steve ----- Original Message ----- From: "Curt Hagenlocher" To: "Discussion of IronPython" Sent: Wednesday, August 5, 2009 8:35:15 PM GMT -05:00 US/Canada Eastern Subject: Re: [IronPython] DataBinding from IronPython Object to WPF Property Python's __setattr__ hook makes INotifyPropertyChanged easy to implement if you're willing to pay the performance penalty. Just derive from a class like this one: class PropertyChangeNotifier(INotifyPropertyChanged): def __init__(self, *trackedNames): self._PropertyChanged, self._OnPropertyChanged = pyevent.MakeEvent() self._trackedNames = trackedNames def add_PropertyChanged(self, handler): self._PropertyChanged += handler def remove_PropertyChanged(self, handler): self._PropertyChanged -= handler def __setattr__(self, name, value): object.__setattr__(self, name,value) if name != "_PropertyChanged" and name != "_OnPropertyChanged": if len(self._trackedNames) == 0 or name in self._trackedNames: self._OnPropertyChanged(self, PropertyChangedEventArgs(name)) On Wed, Aug 5, 2009 at 1:50 PM, Steve Apiki < sapiki at appropriatesolutions.com > wrote: Hi Dino, Thanks for your quick answer and for making things clear on INotifyPropertyChanged. I'd like to have my own derived classes for this project so I think I'm going to steer clear of ExpandoObject and look into implementing INotifyPropertyChanged. And I tried out your suggestion for #2, creating a new class: class Context(object): def __init__(self): self.person = Person("Alfred") and then assigning a new Person as the person attribute of the context: label.DataContext = a_context def button_click(sender, args): a_context.person = Person("Mathilda") which works (for now) as long as I do the UpdateTarget() and presumably will work as well with implementing INotifyPropertyChanged. Thanks, --Steve ----- Original Message ----- From: "Dino Viehland" < dinov at microsoft.com > To: "Discussion of IronPython" < users at lists.ironpython.com > Sent: Wednesday, August 5, 2009 4:11:26 PM GMT -05:00 US/Canada Eastern Subject: Re: [IronPython] DataBinding from IronPython Object to WPF Property IronPython doesn't actually support INotifyPropertyChanged - it only supports custom type descriptor so that WPF can get at the values but it doesn't get the change notifications. You could make an instance of ExpandoObject which does support it: import clr clr.AddReference('Microsoft.Scripting.Core') from Microsoft.Dynamic import ExpandoObject a = ExpandoObject() a.name = 'Foo' Or you could implement INotifiyPropertyChanged on the Person object and use a property which fires the event changed notification. My only thought on #2 would be to add another point of indirection. So rather than updating the global a_person update a_person.real_value and have that update fire a bunch of changed events. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: users- > bounces at lists.ironpython.com ] On Behalf Of Steve Apiki > Sent: Wednesday, August 05, 2009 12:58 PM > To: users at lists.ironpython.com > Subject: [IronPython] DataBinding from IronPython Object to WPF > Property > > Hello, > > I'm working with IronPython 2.6 Beta 1. > > I have the following Python class: > > class Person(object): > def __init__(self, name): > self.name = name > > I'd like to be able to bind the name property of an instance of this > class to a WPF textbox control. > > I can do this easily enough either in XAML or in code. When the > application starts, the textbox displays the person's name as expected. > > However, if I make changes to the name, say, in response to a button > click: > > def button_click(sender, args): > a_person.name += ", jr." > > I don't see these changes reflected in the textbox. > > I can make this work by calling UpdateTarget on the binding expression > explicitly: > > exp = BindingOperations.GetBindingExpression(textbox, > TextBox.TextProperty) > exp.UpdateTarget() > > but I had thought this would work without the explicit step, since it > appears that IronPython supports INotifyPropertyChange. > > Two questions: > > (1) Is it possible to get databinding to work this way without having > to explicity UpdateTarget? > > > (2) Say instead of the click handler above, we had: > > def button_click(sender, args): > global a_person > a_person = Person("Fred") > > In this case, the textbox remains bound to the first Person (which is > no longer accessible from Python). Is there any way to get the binding > to re-sync to the new object, short of setting a completely new binding > to Person("Fred") in code? > > > Full example follows. > > Thanks, > > --Steve > > ----------------------------------------- > > import clr > clr.AddReferenceByName("PresentationFramework, Version=3.0.0.0, > Culture=neutral, PublicKeyToken=31bf3856ad364e35") > clr.AddReferenceByName("PresentationCore, Version=3.0.0.0, > Culture=neutral, PublicKeyToken=31bf3856ad364e35") > clr.AddReferenceByPartialName("IronPython") > clr.AddReference("IronPython.Modules") > > from System.Windows import Application, Window > from System.Windows.Controls import StackPanel, Button, TextBox > from System.Windows.Data import Binding, BindingMode, BindingOperations > > class Person(object): > def __init__(self, name): > self.name = name > a_person = Person("Al") > > button = Button() > button.Content = "Test" > > textbox = TextBox() > textbox.DataContext = a_person > binding = Binding("name") > binding.Source = a_person > binding.Mode = BindingMode.OneWay > textbox.SetBinding(TextBox.TextProperty, binding) > > def button_click(sender, args): > """ click handler """ > a_person.name += ", jr." > > # if you uncomment the following, the textbox is updated > # with each button click. If you don't, the text never changes. > #exp = BindingOperations.GetBindingExpression(textbox, > TextBox.TextProperty) > #exp.UpdateTarget() > > button.Click += button_click > > > window = Window() > stackpanel = StackPanel() > stackpanel.Children.Add(button) > stackpanel.Children.Add(textbox) > window.Content = stackpanel > > Application().Run(window) > > > > > > > _______________________________________________ > 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 mads.weitling at gmail.com Thu Aug 6 10:22:58 2009 From: mads.weitling at gmail.com (Mads Weitling) Date: Thu, 6 Aug 2009 10:22:58 +0200 Subject: [IronPython] -X:EnableProfiler and DLR hosting API Message-ID: Thank you for the answer :) I found this article which tells me that a script can now enable the profiler from within itself: http://blogs.msdn.com/curth/archive/2009/04/11/profiler-part-ii-poor-man-s-code-coverage.aspx So I used that method instead, like this: def begin_profiler(): import clr clr.EnableProfiler(True) clr.ClearProfilerData() def end_profiler(): ticks_to_ms = 0.00001 clr.EnableProfiler(False) # show top 20 sorted by exclusive time for p in itertools.islice(sorted(filter(lambda item: item.Calls != 0, clr.GetProfilerData(True)), key=lambda item: -item.InclusiveTime), 20): print '%s\n%f\t%f\t%d' % (p.Name, p.InclusiveTime * ticks_to_ms, p.ExclusiveTime * ticks_to_ms, p.Calls) Seems to work very well :) /Mads -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu Aug 6 10:33:40 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 6 Aug 2009 08:33:40 +0000 Subject: [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net In-Reply-To: <058401ca151e$b3a09c10$1ae1d430$@com> References: <032301c9eb76$10ce3eb0$326abc10$@com> <0047ECBFA2E0DF4A834AA369282A5AFC14388ED7@tk5ex14mbxc105.redmond.corp.microsoft.com> <8bd92c0e0908040857p25b4727fq716249cdb104debd@mail.gmail.com> <058401ca151e$b3a09c10$1ae1d430$@com> Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC19BCD9FF@tk5ex14mbxc106.redmond.corp.microsoft.com> I've reproduced this issue. Microsoft.Web.Scripting seems to be doing the right thing ... detecting changes in App_Script and calling runtime.ExecuteFile(path) for the files that changed. However, that's not having any effect. This definitely works stand-alone, so I'll drill into this more. Thanks for the bug report though! ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Brand Sent: Tuesday, August 04, 2009 9:15 AM To: Discussion of IronPython Subject: Re: [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net Thanks. The previous release had the correct behavior, so hopefully it isn't hard to do. Adam Adam Brand SilverKey Technologies From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Tuesday, August 04, 2009 9:13 AM To: Discussion of IronPython Subject: Re: [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net Not yet, sorry. I think I can fix that for the next release and make them reload if they've been modified, but I haven't checked if there is a way to do that today. I'll take a look now... ~Jimmy Sent from my phone On Aug 4, 2009, at 8:57 AM, "Adam Brand" > wrote: Any update on this? On Fri, Jun 12, 2009 at 2:47 PM, Jimmy Schementi > wrote: Not sure if it's by design or just failing to reload it correctly. I'll take a look shortly. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Brand Sent: Friday, June 12, 2009 8:54 AM To: Discussion of IronPython Subject: [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net Does anyone have any insight into this? Thanks, Adam Adam Brand SilverKey Technologies From: Adam Brand [mailto:adamb at silverkeytech.com] Sent: Sunday, May 31, 2009 7:53 AM To: 'Discussion of IronPython' Subject: App_Script Problem in latest IronPython for ASP.Net I've noticed that with the latest bits for IronPython for ASP.Net, files in app_script only seem to be revisited when the app pool is restarted. For example, if I have a file called hello_world.py in App_Script, and delete that file, the app still executes code in that file as if it were there. If I change a line in the file, that line is not shown as changed until I restart the app pool. Is this by design, a bug, or something I'm doing wrong? Thanks, Adam _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- Adam Brand Managing Partner SilverKey Technologies Direct: +1-312-239-6722 Main: +1-312-951-7525 Skype: adamsilverkey Email: adamb at silverkeytech.com www.silverkeytech.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 microsoft.com Thu Aug 6 17:24:08 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 6 Aug 2009 15:24:08 +0000 Subject: [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) In-Reply-To: <4A7A1086.3040909@voidspace.org.uk> References: <4A7A1086.3040909@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD03777203@TK5EX14MBXC116.redmond.corp.microsoft.com> All the options should be the same as the command line options. So they're documented via ipy.exe /? :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, August 05, 2009 4:07 PM To: Discussion of IronPython Subject: Re: [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) David DiCato wrote: > > You have to pass the required options to Python.CreateEngine, like so: > > var options = new Dictionary(); > > options["EnableProfiler"] = ScriptingRuntimeHelpers.True; > > ver engine = Python.CreateEngine(options); > Are these options for IronPython 2.6 documented anywhere? Michael > Hope this helps, > > - David > > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Mads > Weitling > *Sent:* Wednesday, August 05, 2009 12:54 AM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) > > Hi all and many thanks to Dino Viehland for answering my previous > question re: sys.builtin_module_names and embedding. > > I am trying to use the IronPython profiler > (http://blogs.msdn.com/curth/archive/2009/03/29/an-ironpython-profiler > .aspx) from an embedded interpreter but cannot figure out how to pass > the -X:EnableProfiler to my ScriptEngine instance. > > _engine = Python.CreateEngine(); > > Debug.WriteLine(_engine.Runtime.Setup.HostArguments.IsReadOnly); > > // prints True > > _engine.Runtime.Setup.HostArguments.Add("-X:EnableProfiler") > > // throws an System.NotSupportedException > > How do I set up the Runtime.Setup.HostArguments before calling > Python.CreateEngine()? > > > /Mads > > ---------------------------------------------------------------------- > -- > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Thu Aug 6 17:30:35 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 06 Aug 2009 16:30:35 +0100 Subject: [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) In-Reply-To: <1A472770E042064698CB5ADC83A12ACD03777203@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A7A1086.3040909@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD03777203@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A7AF71B.9070905@voidspace.org.uk> Dino Viehland wrote: > All the options should be the same as the command line options. So they're > documented via ipy.exe /? :) > C:\compile>"c:\Program Files\IronPython 2.6\ipy.exe" /? File /? does not exist. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Wednesday, August 05, 2009 4:07 PM > To: Discussion of IronPython > Subject: Re: [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) > > David DiCato wrote: > >> You have to pass the required options to Python.CreateEngine, like so: >> >> var options = new Dictionary(); >> >> options["EnableProfiler"] = ScriptingRuntimeHelpers.True; >> >> ver engine = Python.CreateEngine(options); >> >> > > Are these options for IronPython 2.6 documented anywhere? > > Michael > > >> Hope this helps, >> >> - David >> >> *From:* users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Mads >> Weitling >> *Sent:* Wednesday, August 05, 2009 12:54 AM >> *To:* users at lists.ironpython.com >> *Subject:* [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) >> >> Hi all and many thanks to Dino Viehland for answering my previous >> question re: sys.builtin_module_names and embedding. >> >> I am trying to use the IronPython profiler >> (http://blogs.msdn.com/curth/archive/2009/03/29/an-ironpython-profiler >> .aspx) from an embedded interpreter but cannot figure out how to pass >> the -X:EnableProfiler to my ScriptEngine instance. >> >> _engine = Python.CreateEngine(); >> >> Debug.WriteLine(_engine.Runtime.Setup.HostArguments.IsReadOnly); >> >> // prints True >> >> _engine.Runtime.Setup.HostArguments.Add("-X:EnableProfiler") >> >> // throws an System.NotSupportedException >> >> How do I set up the Runtime.Setup.HostArguments before calling >> Python.CreateEngine()? >> >> >> /Mads >> >> ---------------------------------------------------------------------- >> -- >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From dinov at microsoft.com Thu Aug 6 17:32:26 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 6 Aug 2009 15:32:26 +0000 Subject: [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) In-Reply-To: <4A7AF71B.9070905@voidspace.org.uk> References: <4A7A1086.3040909@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD03777203@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A7AF71B.9070905@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD0377767C@TK5EX14MBXC116.redmond.corp.microsoft.com> Err, I guess I mean -?. I think we have a bug to support /? :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Thursday, August 06, 2009 8:31 AM To: Discussion of IronPython Subject: Re: [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) Dino Viehland wrote: > All the options should be the same as the command line options. So > they're documented via ipy.exe /? :) > C:\compile>"c:\Program Files\IronPython 2.6\ipy.exe" /? File /? does not exist. > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Wednesday, August 05, 2009 4:07 PM > To: Discussion of IronPython > Subject: Re: [IronPython] -X:EnableProfiler and DLR hosting API > (2.6b2) > > David DiCato wrote: > >> You have to pass the required options to Python.CreateEngine, like so: >> >> var options = new Dictionary(); >> >> options["EnableProfiler"] = ScriptingRuntimeHelpers.True; >> >> ver engine = Python.CreateEngine(options); >> >> > > Are these options for IronPython 2.6 documented anywhere? > > Michael > > >> Hope this helps, >> >> - David >> >> *From:* users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Mads >> Weitling >> *Sent:* Wednesday, August 05, 2009 12:54 AM >> *To:* users at lists.ironpython.com >> *Subject:* [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) >> >> Hi all and many thanks to Dino Viehland for answering my previous >> question re: sys.builtin_module_names and embedding. >> >> I am trying to use the IronPython profiler >> (http://blogs.msdn.com/curth/archive/2009/03/29/an-ironpython-profile >> r >> .aspx) from an embedded interpreter but cannot figure out how to pass >> the -X:EnableProfiler to my ScriptEngine instance. >> >> _engine = Python.CreateEngine(); >> >> Debug.WriteLine(_engine.Runtime.Setup.HostArguments.IsReadOnly); >> >> // prints True >> >> _engine.Runtime.Setup.HostArguments.Add("-X:EnableProfiler") >> >> // throws an System.NotSupportedException >> >> How do I set up the Runtime.Setup.HostArguments before calling >> Python.CreateEngine()? >> >> >> /Mads >> >> --------------------------------------------------------------------- >> - >> -- >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Thu Aug 6 17:33:30 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 06 Aug 2009 16:33:30 +0100 Subject: [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) In-Reply-To: <1A472770E042064698CB5ADC83A12ACD0377767C@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A7A1086.3040909@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD03777203@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A7AF71B.9070905@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD0377767C@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A7AF7CA.5080803@voidspace.org.uk> Dino Viehland wrote: > Err, I guess I mean -?. I think we have a bug to support /? :) > Thanks Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, August 06, 2009 8:31 AM > To: Discussion of IronPython > Subject: Re: [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) > > Dino Viehland wrote: > >> All the options should be the same as the command line options. So >> they're documented via ipy.exe /? :) >> >> > > C:\compile>"c:\Program Files\IronPython 2.6\ipy.exe" /? > File /? does not exist. > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Wednesday, August 05, 2009 4:07 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] -X:EnableProfiler and DLR hosting API >> (2.6b2) >> >> David DiCato wrote: >> >> >>> You have to pass the required options to Python.CreateEngine, like so: >>> >>> var options = new Dictionary(); >>> >>> options["EnableProfiler"] = ScriptingRuntimeHelpers.True; >>> >>> ver engine = Python.CreateEngine(options); >>> >>> >>> >> Are these options for IronPython 2.6 documented anywhere? >> >> Michael >> >> >> >>> Hope this helps, >>> >>> - David >>> >>> *From:* users-bounces at lists.ironpython.com >>> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Mads >>> Weitling >>> *Sent:* Wednesday, August 05, 2009 12:54 AM >>> *To:* users at lists.ironpython.com >>> *Subject:* [IronPython] -X:EnableProfiler and DLR hosting API (2.6b2) >>> >>> Hi all and many thanks to Dino Viehland for answering my previous >>> question re: sys.builtin_module_names and embedding. >>> >>> I am trying to use the IronPython profiler >>> (http://blogs.msdn.com/curth/archive/2009/03/29/an-ironpython-profile >>> r >>> .aspx) from an embedded interpreter but cannot figure out how to pass >>> the -X:EnableProfiler to my ScriptEngine instance. >>> >>> _engine = Python.CreateEngine(); >>> >>> Debug.WriteLine(_engine.Runtime.Setup.HostArguments.IsReadOnly); >>> >>> // prints True >>> >>> _engine.Runtime.Setup.HostArguments.Add("-X:EnableProfiler") >>> >>> // throws an System.NotSupportedException >>> >>> How do I set up the Runtime.Setup.HostArguments before calling >>> Python.CreateEngine()? >>> >>> >>> /Mads >>> >>> --------------------------------------------------------------------- >>> - >>> -- >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/blog >> >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From merllab at microsoft.com Thu Aug 6 17:52:53 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Thu, 6 Aug 2009 08:52:53 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <6b66caa4-f52b-4840-aa53-d6e17c748249@tk5-exsmh-c102.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/57787. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Tests/interop/net/type/test_clrtype.py $/IronPython/IronPython_Main/Src/Tests/Modes/ConsoleFlags.ps1 $/IronPython/IronPython_Main/Src/Tests/regressions.py $/IronPython/IronPython_Main/Src/Tests/test_sys.py $/IronPython/IronPython_Main/Src/Tests/test_python25.py $/IronPython/IronPython_Main/Src/Tests/test_namebinding.py From sree_b_pillai at yahoo.com Thu Aug 6 20:57:28 2009 From: sree_b_pillai at yahoo.com (Sree Pillai) Date: Thu, 6 Aug 2009 11:57:28 -0700 (PDT) Subject: [IronPython] Accessing scope variables Message-ID: <575551.76177.qm@web34508.mail.mud.yahoo.com> Hello, We are hosting IronPython in our Windows forms-based application to allow our customers to write scripts. We allow customers to use our own variables within the script. public class Variable { string Name; int Value; .. } .. Variable v1 = new Variable("Length", 10); // Create a variable with Name=Length and Value=10 vars.Add(v1); Variable v2 = new Variable("Width", 10); vars.Add(v1); vars.Add(v2); We set custom variables in scriptScope like this. .. foreach (IVariable aVariable in vars) { scriptScope.SetVariable(aVariable.Name, aVariable); } .. With this, user can write a function like this def CalcArea() : return Length * Width In our application, we are dealing with hundreds of variables and functions. As the user deletes or modifies a Variable (here Length and Width), they would like to know where the variables are used. In this example, the variable Length and Width are used in CalcArea function. I can't find a way to identify the list of custom variables used within a function using the API. Any suggestions? Thanks a lot. Sree From dinov at microsoft.com Thu Aug 6 21:10:45 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 6 Aug 2009 19:10:45 +0000 Subject: [IronPython] Accessing scope variables In-Reply-To: <575551.76177.qm@web34508.mail.mud.yahoo.com> References: <575551.76177.qm@web34508.mail.mud.yahoo.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD0377B622@TK5EX14MBXC116.redmond.corp.microsoft.com> The only way I can think of doing this today would be to use our Parser And PythonWalker classes to parse the func def and then walk it and look for NameExpressions. You'd also need to look for GlobalStatement's, AssignmentStatement, and AugmentedAssignmentStatement to know if it was a global or not. OTOH if we fixed this bug (which you can vote on): http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=15398 you could walk the function objects, get their func_code, and then look at co_names: x = 42 def f(): print x y = 42 c = f.func_code c.co_varnames ('y',) c.co_names ('x',) Which looks like it has the global names which would be resolved against your scope. I've slowly been fixing more and more of function code but haven't gotten to this one yet :( > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Sree Pillai > Sent: Thursday, August 06, 2009 11:57 AM > To: users at lists.ironpython.com > Subject: [IronPython] Accessing scope variables > > Hello, > > We are hosting IronPython in our Windows forms-based application to > allow our customers to write scripts. We allow customers to use our own > variables within the script. > > public class Variable > { > string Name; > int Value; > .. > } > > .. > Variable v1 = new Variable("Length", 10); // Create a variable with > Name=Length and Value=10 > vars.Add(v1); > Variable v2 = new Variable("Width", 10); > vars.Add(v1); > vars.Add(v2); > > > We set custom variables in scriptScope like this. > > .. > foreach (IVariable aVariable in vars) > { > scriptScope.SetVariable(aVariable.Name, aVariable); > } > .. > > With this, user can write a function like this > > def CalcArea() : > return Length * Width > > > In our application, we are dealing with hundreds of variables and > functions. As the user deletes or modifies a Variable (here Length and > Width), they would like to know where the variables are used. In this > example, the variable Length and Width are used in CalcArea function. I > can't find a way to identify the list of custom variables used within a > function using the API. > > Any suggestions? Thanks a lot. > > Sree > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From robert at smallshire.org.uk Thu Aug 6 22:04:45 2009 From: robert at smallshire.org.uk (Robert Smallshire) Date: Thu, 6 Aug 2009 22:04:45 +0200 Subject: [IronPython] Reflection.Emit from IronPython: What is the equivalent of typeof() in C# ? Message-ID: <000001ca16d1$2592e400$0f00000a@LITTONDALE> Hello, I'm attempting to drive the Reflection.Emit API from IronPython. In C# typical Reflection.Emit use makes use typeof(...) facility in C#, to enable the determination of types without needing an instance of that type. For example, to create an array of .NET CTS Strings in IL from C# one might do: generator.Emit(OpCodes.Newarr, typeof(string)); where the second argument to Emit is the element type of the array. I've tried various alternatives from IronPython, including generator.Emit(OpCodes.Newarr, System.Type.GetType('System.String')) generator.Emit(OpCodes.Newarr, str().GetType()) generator.Emit(OpCodes.Newarr, System.String().GetType()) generator.Emit(OpCodes.Newarr, clr.GetClrType(System.String)) however, all of these result in RuntimeType[] rather than String[] in the generated CIL. How do I get typeof(System.String) from IronPython? Rob Robert Smallshire robert at smallshire.org.uk http://smallshire.org.uk/ Currently in Norway (UTC +2 hours) From fuzzyman at voidspace.org.uk Thu Aug 6 22:06:45 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 06 Aug 2009 21:06:45 +0100 Subject: [IronPython] Reflection.Emit from IronPython: What is the equivalent of typeof() in C# ? In-Reply-To: <000001ca16d1$2592e400$0f00000a@LITTONDALE> References: <000001ca16d1$2592e400$0f00000a@LITTONDALE> Message-ID: <4A7B37D5.20809@voidspace.org.uk> clr.GetClrType('') ? (on an instance of a string) Michael Robert Smallshire wrote: > Hello, > > I'm attempting to drive the Reflection.Emit API from IronPython. In C# > typical Reflection.Emit use makes use typeof(...) facility in C#, to enable > the determination of types without needing an instance of that type. > > For example, to create an array of .NET CTS Strings in IL from C# one might > do: > > generator.Emit(OpCodes.Newarr, typeof(string)); > > where the second argument to Emit is the element type of the array. > > I've tried various alternatives from IronPython, including > > generator.Emit(OpCodes.Newarr, System.Type.GetType('System.String')) > generator.Emit(OpCodes.Newarr, str().GetType()) > generator.Emit(OpCodes.Newarr, System.String().GetType()) > generator.Emit(OpCodes.Newarr, clr.GetClrType(System.String)) > > however, all of these result in RuntimeType[] rather than String[] in the > generated CIL. > > How do I get typeof(System.String) from IronPython? > > Rob > > Robert Smallshire > robert at smallshire.org.uk > http://smallshire.org.uk/ > Currently in Norway (UTC +2 hours) > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From robert at smallshire.org.uk Thu Aug 6 22:53:10 2009 From: robert at smallshire.org.uk (Robert Smallshire) Date: Thu, 6 Aug 2009 22:53:10 +0200 Subject: [IronPython] Reflection.Emit from IronPython: What is the equivalent of typeof() in C# ? In-Reply-To: <4A7B37D5.20809@voidspace.org.uk> Message-ID: <000001ca16d7$e8d31dd0$0f00000a@LITTONDALE> Hi Michael, I'm afraid not: >>> clr.GetClrType('') TypeError: expected Type, got str My hopes were momentarily raised when I discovered that your otherwise very comprehensive book mentions typeof in the index (page 398) - but then I found that you only use it from C#. Cheers, Rob > > clr.GetClrType('') ? (on an instance of a string) > > Michael > > Robert Smallshire wrote: > > Hello, > > > > I'm attempting to drive the Reflection.Emit API from > IronPython. In C# > > typical Reflection.Emit use makes use typeof(...) facility > in C#, to > > enable the determination of types without needing an > instance of that > > type. > > > > For example, to create an array of .NET CTS Strings in IL > from C# one > > might > > do: > > > > generator.Emit(OpCodes.Newarr, typeof(string)); > > > > where the second argument to Emit is the element type of the array. > > > > I've tried various alternatives from IronPython, including > > > > generator.Emit(OpCodes.Newarr, System.Type.GetType('System.String')) > > generator.Emit(OpCodes.Newarr, str().GetType()) > > generator.Emit(OpCodes.Newarr, System.String().GetType()) > > generator.Emit(OpCodes.Newarr, clr.GetClrType(System.String)) > > > > however, all of these result in RuntimeType[] rather than > String[] in > > the generated CIL. > > > > How do I get typeof(System.String) from IronPython? > > > > Rob > > > > Robert Smallshire > > robert at smallshire.org.uk > > http://smallshire.org.uk/ > > Currently in Norway (UTC +2 hours) > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > From dfugate at microsoft.com Thu Aug 6 23:06:39 2009 From: dfugate at microsoft.com (Dave Fugate) Date: Thu, 6 Aug 2009 21:06:39 +0000 Subject: [IronPython] Reflection.Emit from IronPython: What is the equivalent of typeof() in C# ? In-Reply-To: <000001ca16d7$e8d31dd0$0f00000a@LITTONDALE> References: <4A7B37D5.20809@voidspace.org.uk> <000001ca16d7$e8d31dd0$0f00000a@LITTONDALE> Message-ID: <7CEEC335D70FFE4B957737DDE836F51B8BE876@TK5EX14MBXC123.redmond.corp.microsoft.com> Try: clr.GetClrType(type('')) David Fugate Microsoft - IronPython http://knowbody.livejournal.com -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Robert Smallshire Sent: Thursday, August 06, 2009 1:53 PM To: 'Michael Foord'; 'Discussion of IronPython' Subject: Re: [IronPython] Reflection.Emit from IronPython: What is the equivalent of typeof() in C# ? Hi Michael, I'm afraid not: >>> clr.GetClrType('') TypeError: expected Type, got str My hopes were momentarily raised when I discovered that your otherwise very comprehensive book mentions typeof in the index (page 398) - but then I found that you only use it from C#. Cheers, Rob > > clr.GetClrType('') ? (on an instance of a string) > > Michael > > Robert Smallshire wrote: > > Hello, > > > > I'm attempting to drive the Reflection.Emit API from > IronPython. In C# > > typical Reflection.Emit use makes use typeof(...) facility > in C#, to > > enable the determination of types without needing an > instance of that > > type. > > > > For example, to create an array of .NET CTS Strings in IL > from C# one > > might > > do: > > > > generator.Emit(OpCodes.Newarr, typeof(string)); > > > > where the second argument to Emit is the element type of the array. > > > > I've tried various alternatives from IronPython, including > > > > generator.Emit(OpCodes.Newarr, System.Type.GetType('System.String')) > > generator.Emit(OpCodes.Newarr, str().GetType()) > > generator.Emit(OpCodes.Newarr, System.String().GetType()) > > generator.Emit(OpCodes.Newarr, clr.GetClrType(System.String)) > > > > however, all of these result in RuntimeType[] rather than > String[] in > > the generated CIL. > > > > How do I get typeof(System.String) from IronPython? > > > > Rob > > > > Robert Smallshire > > robert at smallshire.org.uk > > http://smallshire.org.uk/ > > Currently in Norway (UTC +2 hours) > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Shri.Borde at microsoft.com Thu Aug 6 23:17:25 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 6 Aug 2009 14:17:25 -0700 Subject: [IronPython] Reflection.Emit from IronPython: What is the equivalent of typeof() in C# ? In-Reply-To: <7CEEC335D70FFE4B957737DDE836F51B8BE876@TK5EX14MBXC123.redmond.corp.microsoft.com> References: <4A7B37D5.20809@voidspace.org.uk> <000001ca16d7$e8d31dd0$0f00000a@LITTONDALE> <7CEEC335D70FFE4B957737DDE836F51B8BE876@TK5EX14MBXC123.redmond.corp.microsoft.com> Message-ID: <9A92D7D99FC1564D8C8F18008B08098F499F07CF74@NA-EXMSG-C118.redmond.corp.microsoft.com> You can also just use the type like "System.String" to avoid having to create an instance of the type. >>> import System >>> import clr >>> clr.GetClrType(System.String) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dave Fugate Sent: Thursday, August 06, 2009 2:07 PM To: robert at smallshire.org.uk; Discussion of IronPython; 'Michael Foord' Subject: Re: [IronPython] Reflection.Emit from IronPython: What is the equivalent of typeof() in C# ? Try: clr.GetClrType(type('')) David Fugate Microsoft - IronPython http://knowbody.livejournal.com -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Robert Smallshire Sent: Thursday, August 06, 2009 1:53 PM To: 'Michael Foord'; 'Discussion of IronPython' Subject: Re: [IronPython] Reflection.Emit from IronPython: What is the equivalent of typeof() in C# ? Hi Michael, I'm afraid not: >>> clr.GetClrType('') TypeError: expected Type, got str My hopes were momentarily raised when I discovered that your otherwise very comprehensive book mentions typeof in the index (page 398) - but then I found that you only use it from C#. Cheers, Rob > > clr.GetClrType('') ? (on an instance of a string) > > Michael > > Robert Smallshire wrote: > > Hello, > > > > I'm attempting to drive the Reflection.Emit API from > IronPython. In C# > > typical Reflection.Emit use makes use typeof(...) facility > in C#, to > > enable the determination of types without needing an > instance of that > > type. > > > > For example, to create an array of .NET CTS Strings in IL > from C# one > > might > > do: > > > > generator.Emit(OpCodes.Newarr, typeof(string)); > > > > where the second argument to Emit is the element type of the array. > > > > I've tried various alternatives from IronPython, including > > > > generator.Emit(OpCodes.Newarr, System.Type.GetType('System.String')) > > generator.Emit(OpCodes.Newarr, str().GetType()) > > generator.Emit(OpCodes.Newarr, System.String().GetType()) > > generator.Emit(OpCodes.Newarr, clr.GetClrType(System.String)) > > > > however, all of these result in RuntimeType[] rather than > String[] in > > the generated CIL. > > > > How do I get typeof(System.String) from IronPython? > > > > Rob > > > > Robert Smallshire > > robert at smallshire.org.uk > > http://smallshire.org.uk/ > > Currently in Norway (UTC +2 hours) > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > _______________________________________________ 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 k.kanryu at gmail.com Fri Aug 7 10:03:24 2009 From: k.kanryu at gmail.com (KATO Kanryu) Date: Fri, 7 Aug 2009 17:03:24 +0900 Subject: [IronPython] UTF-8 script every 1024 bytes are broken Message-ID: Hi, When the IronPython parses UTF-8 scripts, it occars every 1024 bytes are broken. Because UTF-8 charmap has multibyte chars, but parser read only 1024 byte at once. Mr. Koichi Yamamoto had written a patch for the problem. http://knivez.homelinux.org/~spro/cs/utf-8_blocken-fix.patch I'm glad to commit official repository. Comments? Regards, KATO Kanryu From merllab at microsoft.com Fri Aug 7 17:52:41 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Fri, 7 Aug 2009 08:52:41 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/57861. ADDED SOURCES $/IronPython/IronPython_Main/Src/Tests/pickles $/IronPython/IronPython_Main/Src/Tests/pickles/cp18666.pickle DELETED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/ScriptScopeOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Exceptions/OverflowWarningException.Generated.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Tests/pickles/cp18666.pickle $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonFunction.Generated.cs $/IronPython/IronPython_Main/Src/Tests/versions/python26.py $/IronPython/IronPython_Main/Src/Tests/regressions.py $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonBinder.cs $/IronPython/IronPython_Main/Src/Tests/test_syntax.py $/IronPython/IronPython_Main/Src/Tests/test_nt.py $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Importer.cs $/IronPython/IronPython_Main/Src/Tests/test_struct.py $/IronPython/IronPython_Main/Src/Tests/test_set.py $/IronPython/IronPython_Main/Src/Tests/test_re.py $/IronPython/IronPython_Main/Src/Tests/test_privateBinding.py $/IronPython/IronPython_Main/Src/Tests/test_function.py $/IronPython/IronPython_Main/Src/Tests/test_datetime.py $/IronPython/IronPython_Main/Src/Tests/test_array.py $/IronPython/IronPython_Main/Src/Scripts/generate_calls.py $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/ErrorExpression.cs $/IronPython/IronPython_Main/Src/IronPython/IronPython.csproj CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1047371 Date: 8/6/2009 8:04:06 PM (dfugate) Small code coverage improvements for misc. modules. (Shelveset: COV01;REDMOND\dfugate | SNAP CheckinId: m9898) -------------------------------------------------------------------------------- Changeset Id: 1047367 Date: 8/6/2009 8:02:35 PM (dfugate) OverflowWarning was removed in CPython 2.5. Removed OverflowWarningException.cs. Added default constructor for ErrorExpression. Obviously this type gets generated by many IronPython tests, but code coverage runs weren't picking it up because ErrorExpression methods are either not hit or dead. Removed IronPython.Runtime.Operations.ScriptScopeOps outright. The comments indicate this was only needed for Nessie, and Dino thinks removing it will only affect "someScriptScope.__dict__ = 42". Added sanity test for IronPython.Runtime.Types.SlotFieldAttribute to test_privateBinding.py. There's no way to indirectly hit this piece of code. (Shelveset: IPY_FILE_CVG;REDMOND\dfugate | SNAP CheckinId: m9898) -------------------------------------------------------------------------------- Changeset Id: 1047272 Date: 8/6/2009 7:07:50 PM (dinov) 24169 Non-ASCII character error message (see PEP 263) does not include filename Include the filename instead of ?x.py? 24182 ArgumentNullException raised for functions with many arguments Title is required Fix the check to see if we can handle the function Also fixing 2 import bugs so pygments works out of the box: Subclasses of module aren?t handled right ? we go directly to the Scope and fetch the member which avoids calling __getattr__ if it?s defined When importing a nested module we don?t pull the resulting module out of sys.modules ? we return whatever we just imported. But we should check sys.modules so that the module can replace itself before the import is finished and have the replaced version returned. (Shelveset: SmallHighPriBugsFinal3;REDMOND\dinov | SNAP CheckinId: 9104) -------------------------------------------------------------------------------- Changeset Id: 1046486 Date: 8/6/2009 12:37:41 PM (dfugate) - test_bytes.py: 21361 has been fixed - test_array.py: 8736 has been fixed - test_datetime.py: extended regression for 18666. Not fixed (Shelveset: CP69;REDMOND\dfugate | SNAP CheckinId: 9098) From dinov at microsoft.com Fri Aug 7 17:58:03 2009 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 7 Aug 2009 15:58:03 +0000 Subject: [IronPython] UTF-8 script every 1024 bytes are broken In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD0379AFA8@TK5EX14MBXC116.redmond.corp.microsoft.com> I believe this is the same as bug #18637 http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=18637 This has been fixed in 2.6 already but thanks for reporting it. Unfortunately we don't current accept contributions back to IronPython. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of KATO Kanryu > Sent: Friday, August 07, 2009 1:03 AM > To: users at lists.ironpython.com > Subject: [IronPython] UTF-8 script every 1024 bytes are broken > > Hi, > > When the IronPython parses UTF-8 scripts, it occars every 1024 bytes > are broken. > Because UTF-8 charmap has multibyte chars, but parser read only 1024 > byte at once. > > Mr. Koichi Yamamoto had written a patch for the problem. > http://knivez.homelinux.org/~spro/cs/utf-8_blocken-fix.patch > > I'm glad to commit official repository. > > Comments? > > > Regards, > KATO Kanryu > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From robert at smallshire.org.uk Fri Aug 7 19:35:01 2009 From: robert at smallshire.org.uk (Robert Smallshire) Date: Fri, 7 Aug 2009 19:35:01 +0200 Subject: [IronPython] FW: Reflection.Emit from IronPython: What is theequivalent of typeof() in C# ? Message-ID: <000101ca1785$648075b0$0f00000a@LITTONDALE> Hi David, > Try: > clr.GetClrType(type('')) This still produces RuntimeType[] in the generated CIL :-( Thanks for trying! Rob > > > > > > > > > David Fugate > > Microsoft - IronPython > > http://knowbody.livejournal.com > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of > > Robert Smallshire > > Sent: Thursday, August 06, 2009 1:53 PM > > To: 'Michael Foord'; 'Discussion of IronPython' > > Subject: Re: [IronPython] Reflection.Emit from IronPython: > > What is the equivalent of typeof() in C# ? > > > > Hi Michael, > > > > I'm afraid not: > > > > >>> clr.GetClrType('') > > TypeError: expected Type, got str > > > > My hopes were momentarily raised when I discovered that your > > otherwise very comprehensive book mentions typeof in the > > index (page 398) - but then I found that you only use it from C#. > > > > Cheers, > > > > Rob > > > > > > > > clr.GetClrType('') ? (on an instance of a string) > > > > > > Michael > > > > > > Robert Smallshire wrote: > > > > Hello, > > > > > > > > I'm attempting to drive the Reflection.Emit API from > > > IronPython. In C# > > > > typical Reflection.Emit use makes use typeof(...) facility > > > in C#, to > > > > enable the determination of types without needing an > > > instance of that > > > > type. > > > > > > > > For example, to create an array of .NET CTS Strings in IL > > > from C# one > > > > might > > > > do: > > > > > > > > generator.Emit(OpCodes.Newarr, typeof(string)); > > > > > > > > where the second argument to Emit is the element type of > > the array. > > > > > > > > I've tried various alternatives from IronPython, including > > > > > > > > generator.Emit(OpCodes.Newarr, > > System.Type.GetType('System.String')) > > > > generator.Emit(OpCodes.Newarr, str().GetType()) > > > > generator.Emit(OpCodes.Newarr, System.String().GetType()) > > > > generator.Emit(OpCodes.Newarr, clr.GetClrType(System.String)) > > > > > > > > however, all of these result in RuntimeType[] rather than > > > String[] in > > > > the generated CIL. > > > > > > > > How do I get typeof(System.String) from IronPython? > > > > > > > > Rob > > > > > > > > Robert Smallshire > > > > robert at smallshire.org.uk > > > > http://smallshire.org.uk/ > > > > Currently in Norway (UTC +2 hours) > > > > > > > > _______________________________________________ > > > > Users mailing list > > > > Users at lists.ironpython.com > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > -- > > > http://www.ironpythoninaction.com/ > > > http://www.voidspace.org.uk/blog > > > > > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From dinov at microsoft.com Fri Aug 7 19:45:59 2009 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 7 Aug 2009 17:45:59 +0000 Subject: [IronPython] FW: Reflection.Emit from IronPython: What is theequivalent of typeof() in C# ? In-Reply-To: <000101ca1785$648075b0$0f00000a@LITTONDALE> References: <000101ca1785$648075b0$0f00000a@LITTONDALE> Message-ID: <1A472770E042064698CB5ADC83A12ACD0379BA67@TK5EX14MBXC116.redmond.corp.microsoft.com> Is this what you're trying to accomplish? from System.Reflection import * from System.Reflection.Emit import * import System import clr clr.AddReference('System.Core') dm = DynamicMethod("test", clr.GetClrType(System.Array[str]), System.Type.EmptyTypes) ilgen = dm.GetILGenerator() ilgen.Emit(OpCodes.Ldc_I4_4) ilgen.Emit(OpCodes.Newarr, str) ilgen.Emit(OpCodes.Ret) dlg = dm.CreateDelegate(System.Func[System.Array[str]]) print dlg() prints: Array[str]((None, None, None, None)) Here I'm just passing str as the type directly - there's a conversion defined from PythonType -> System.Type. But clr.GetClrType(str) and ''.GetType() both work fine for me (on 2.0.1 and 2.6B2). > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Robert Smallshire > Sent: Friday, August 07, 2009 10:35 AM > To: 'Discussion of IronPython' > Subject: [IronPython] FW: Reflection.Emit from IronPython: What is > theequivalent of typeof() in C# ? > > Hi David, > > > Try: > > clr.GetClrType(type('')) > > This still produces RuntimeType[] in the generated CIL :-( > > Thanks for trying! > > Rob > > > > > > > > > > > > > > > David Fugate > > > Microsoft - IronPython > > > http://knowbody.livejournal.com > > > > > > -----Original Message----- > > > From: users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of > > > Robert Smallshire > > > Sent: Thursday, August 06, 2009 1:53 PM > > > To: 'Michael Foord'; 'Discussion of IronPython' > > > Subject: Re: [IronPython] Reflection.Emit from IronPython: > > > What is the equivalent of typeof() in C# ? > > > > > > Hi Michael, > > > > > > I'm afraid not: > > > > > > >>> clr.GetClrType('') > > > TypeError: expected Type, got str > > > > > > My hopes were momentarily raised when I discovered that your > > > otherwise very comprehensive book mentions typeof in the > > > index (page 398) - but then I found that you only use it from C#. > > > > > > Cheers, > > > > > > Rob > > > > > > > > > > > clr.GetClrType('') ? (on an instance of a string) > > > > > > > > Michael > > > > > > > > Robert Smallshire wrote: > > > > > Hello, > > > > > > > > > > I'm attempting to drive the Reflection.Emit API from > > > > IronPython. In C# > > > > > typical Reflection.Emit use makes use typeof(...) facility > > > > in C#, to > > > > > enable the determination of types without needing an > > > > instance of that > > > > > type. > > > > > > > > > > For example, to create an array of .NET CTS Strings in IL > > > > from C# one > > > > > might > > > > > do: > > > > > > > > > > generator.Emit(OpCodes.Newarr, typeof(string)); > > > > > > > > > > where the second argument to Emit is the element type of > > > the array. > > > > > > > > > > I've tried various alternatives from IronPython, including > > > > > > > > > > generator.Emit(OpCodes.Newarr, > > > System.Type.GetType('System.String')) > > > > > generator.Emit(OpCodes.Newarr, str().GetType()) > > > > > generator.Emit(OpCodes.Newarr, System.String().GetType()) > > > > > generator.Emit(OpCodes.Newarr, clr.GetClrType(System.String)) > > > > > > > > > > however, all of these result in RuntimeType[] rather than > > > > String[] in > > > > > the generated CIL. > > > > > > > > > > How do I get typeof(System.String) from IronPython? > > > > > > > > > > Rob > > > > > > > > > > Robert Smallshire > > > > > robert at smallshire.org.uk > > > > > http://smallshire.org.uk/ > > > > > Currently in Norway (UTC +2 hours) > > > > > > > > > > _______________________________________________ > > > > > Users mailing list > > > > > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > > > -- > > > > http://www.ironpythoninaction.com/ > > > > http://www.voidspace.org.uk/blog > > > > > > > > > > > > > > _______________________________________________ > > > 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 robert at smallshire.org.uk Fri Aug 7 19:51:04 2009 From: robert at smallshire.org.uk (Robert Smallshire) Date: Fri, 7 Aug 2009 19:51:04 +0200 Subject: [IronPython] Reflection.Emit from IronPython: What is theequivalent of typeof() in C# ? In-Reply-To: <9A92D7D99FC1564D8C8F18008B08098F499F07CF74@NA-EXMSG-C118.redmond.corp.microsoft.com> Message-ID: <000001ca1787$a2994d20$0f00000a@LITTONDALE> Hi Shri, > You can also just use the type like "System.String" to avoid > having to create an instance of the type. > > >>> import System > >>> import clr > >>> clr.GetClrType(System.String) > That's the same as the fourth example in my original message and doesn't work. Prompted by your first sentence I've also tried simply, generator.Emit(OpCodes.Newarr, System.String) but I'm still getting RuntimeType[] rather than String[] in the generated IL. Thanks, Rob > > Robert Smallshire wrote: > > > Hello, > > > > > > I'm attempting to drive the Reflection.Emit API from > > IronPython. In C# > > > typical Reflection.Emit use makes use typeof(...) facility > > in C#, to > > > enable the determination of types without needing an > > instance of that > > > type. > > > > > > For example, to create an array of .NET CTS Strings in IL > > from C# one > > > might > > > do: > > > > > > generator.Emit(OpCodes.Newarr, typeof(string)); > > > > > > where the second argument to Emit is the element type of > the array. > > > > > > I've tried various alternatives from IronPython, including > > > > > > generator.Emit(OpCodes.Newarr, > System.Type.GetType('System.String')) > > > generator.Emit(OpCodes.Newarr, str().GetType()) > > > generator.Emit(OpCodes.Newarr, System.String().GetType()) > > > generator.Emit(OpCodes.Newarr, clr.GetClrType(System.String)) > > > > > > however, all of these result in RuntimeType[] rather than > > String[] in > > > the generated CIL. > > > > > > How do I get typeof(System.String) from IronPython? > > > > > > Rob > > > > > > Robert Smallshire > > > robert at smallshire.org.uk > > > http://smallshire.org.uk/ > > > Currently in Norway (UTC +2 hours) > > > > > > _______________________________________________ From robert at smallshire.org.uk Fri Aug 7 20:46:51 2009 From: robert at smallshire.org.uk (Robert Smallshire) Date: Fri, 7 Aug 2009 20:46:51 +0200 Subject: [IronPython] Reflection.Emit from IronPython: What is the equivalent of typeof() in C# ? In-Reply-To: <000001ca16d1$2592e400$0f00000a@LITTONDALE> Message-ID: <000001ca178f$6e569290$0f00000a@LITTONDALE> Hello, Here is the solution to my problem, which turns out to be as much a silly mistake on my part as to how to use the Reflection.Emit API, as it is an IronPython conundrum. It turns out the array type for the field, that I was seeing in Reflector and IL Disassembler was is set by the DefineField call (of course!), rather than the Emit(Newarr, type) call which simply puts a reference to the new array on the stack. The original how-to-do-typeof question still applies, since this method also takes a type parameter: Now I've made the change in the right place in my code, I can report that the following is known to work, a gives a String[] as you would expect in the generated assembly: type_builder.DefineField("foo", System.Type.GetType('System.String').MakeArrayType(1), FieldAttribute.Private) For the record, the following expressions supplied by me and others also work: str().GetType().MakeArrayType(1) System.String().GetType().MakeArrayType(1) clr.GetClrType(System.String).MakeArrayType(1) clr.GetClrType(type('')).MakeArrayType(1) Thank you to everybody for your correct answers, now I've figured out how to use them, and apologies for any confusion I may have caused by prematurely rejecting your answers before I'd got my act together. It seems there are many equivalents of C# typeof in IronPython. Thanks, Rob > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of > Robert Smallshire > Sent: 06 August 2009 22:05 > To: 'Discussion of IronPython' > Subject: [IronPython] Reflection.Emit from IronPython: What > is theequivalent of typeof() in C# ? > > > Hello, > > I'm attempting to drive the Reflection.Emit API from > IronPython. In C# typical Reflection.Emit use makes use > typeof(...) facility in C#, to enable the determination of > types without needing an instance of that type. > > For example, to create an array of .NET CTS Strings in IL > from C# one might > do: > > generator.Emit(OpCodes.Newarr, typeof(string)); > > where the second argument to Emit is the element type of the array. > > I've tried various alternatives from IronPython, including > > generator.Emit(OpCodes.Newarr, System.Type.GetType('System.String')) > generator.Emit(OpCodes.Newarr, str().GetType()) > generator.Emit(OpCodes.Newarr, System.String().GetType()) > generator.Emit(OpCodes.Newarr, clr.GetClrType(System.String)) > > however, all of these result in RuntimeType[] rather than > String[] in the generated CIL. > > How do I get typeof(System.String) from IronPython? > > Rob > > Robert Smallshire > robert at smallshire.org.uk > http://smallshire.org.uk/ > Currently in Norway (UTC +2 hours) > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From k.kanryu at gmail.com Sat Aug 8 03:43:12 2009 From: k.kanryu at gmail.com (KATO Kanryu) Date: Sat, 8 Aug 2009 10:43:12 +0900 Subject: [IronPython] UTF-8 script every 1024 bytes are broken In-Reply-To: <1A472770E042064698CB5ADC83A12ACD0379AFA8@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD0379AFA8@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: 2009/8/8 Dino Viehland wrote: > I believe this is the same as bug #18637 > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=18637 That's right. I think Mr. Koichi Yamamoto is yamakox. I see about fixed in 2.6 already, but it seems that there is no fix about 2.0.2 ? I fixed myself to source tree from subversion repository. From calmasy at gmail.com Sat Aug 8 05:40:42 2009 From: calmasy at gmail.com (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Fri, 7 Aug 2009 21:40:42 -0600 Subject: [IronPython] ValueError: cannot assign to value types Message-ID: i'm really stuck trying to change values for an object of type 'Parcel', which comes from the openmetaverse library i'm using. how this library is implemented i don't have control over, but the given interface is to make local changes to these Parcel objects, then use its Update() method to commit the changes. but it seems in IronPython i can't change these objects. >>> type(props) >>> props.Name = "Yes" Traceback (most recent call last): File "", line 1, in ValueError: cannot assign to value types after hours of struggling, i found http://ironpython.codeplex.com/Wiki/View.aspx?title=Value%20Types which seems to explain why i'm being bit here. bit it also says "updates are still possible via instance methods on the value type itself." so isn't "__setattr__" an instance method? seems i'm not able to use that either: >>> props.__setattr__("Name", "Yes") Traceback (most recent call last): File "", line 1, in ValueError: Attempt to update field 'Name' on value type 'Parcel'; value type fields cannot be directly modified ok, so what are my options? how do i get around this? i *have* to be able to update objects of this type somehow. i can create a new object of that type, but the constructor doesn't allow me to pre-stock it with values ( since i guess it assumes i'll be able to change them later), and then of course once it's created i can't change anything. -- Cheers, L?szl? From curt at hagenlocher.org Sat Aug 8 07:04:55 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 7 Aug 2009 22:04:55 -0700 Subject: [IronPython] ValueError: cannot assign to value types In-Reply-To: References: Message-ID: __setattr__ it's not a *CLR*-level instance method of the type. IronPython just makes it look like it is. One possibility is to simply create an entirely new Parcel from scratch, assigning values as appropriate. For example, given the following C# classes: public struct Point { public int x, y; } public class Line { public Point to, from; } You can do this from Python: F:\tcwb\libs>ipy.exe IronPython 2.6 Beta 2 (2.6.0.20) on .NET 2.0.50727.4927 Type "help", "copyright", "credits" or "license" for more information. >>> import clr >>> clr.AddReference('x') >>> import Point, Line >>> l = Line() >>> l.to.x 0 >>> l.to.x = 1 Traceback (most recent call last): File "", line 1, in ValueError: cannot assign to value types >>> l.to = Point(x = 1, y = 2) >>> l.to.x 1 >>> On Fri, Aug 7, 2009 at 8:40 PM, Count L?szl? de Alm?sy wrote: > i'm really stuck trying to change values for an object of type > 'Parcel', which comes from the openmetaverse library i'm using. how > this library is implemented i don't have control over, but the given > interface is to make local changes to these Parcel objects, then use > its Update() method to commit the changes. but it seems in IronPython > i can't change these objects. > > >>> type(props) > > > >>> props.Name = "Yes" > Traceback (most recent call last): > File "", line 1, in > ValueError: cannot assign to value types > > after hours of struggling, i found > http://ironpython.codeplex.com/Wiki/View.aspx?title=Value%20Types > which seems to explain why i'm being bit here. bit it also says > "updates are still possible via instance methods on the value type > itself." so isn't "__setattr__" an instance method? seems i'm not able > to use that either: > > >>> props.__setattr__("Name", "Yes") > Traceback (most recent call last): > File "", line 1, in > ValueError: Attempt to update field 'Name' on value type 'Parcel'; > value type fields cannot be directly modified > > ok, so what are my options? how do i get around this? i *have* to be > able to update objects of this type somehow. > > i can create a new object of that type, but the constructor doesn't > allow me to pre-stock it with values ( since i guess it assumes i'll > be able to change them later), and then of course once it's created i > can't change anything. > > -- > Cheers, L?szl? > _______________________________________________ > 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 boris_aronshtam at vdptech.com Sat Aug 8 07:10:28 2009 From: boris_aronshtam at vdptech.com (boris_aronshtam at vdptech.com) Date: Fri, 07 Aug 2009 23:10:28 -0600 Subject: [IronPython] C# - IronPython Integration Message-ID: <20090807231028.a4gb3mtjc4k0wk48@vdptech.com> I am new to IronPython. I am trying to add IronPython scripting support to my C# program. I have a number of questions. Namespaces ---------- Looking at C# examples on WWW, I can see: using IronPython.Hosting; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; Where can I get documentation on these namespaces? From empirebuilder at gmail.com Sun Aug 9 09:37:12 2009 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Sun, 9 Aug 2009 10:37:12 +0300 Subject: [IronPython] C# - IronPython Integration In-Reply-To: <20090807231028.a4gb3mtjc4k0wk48@vdptech.com> References: <20090807231028.a4gb3mtjc4k0wk48@vdptech.com> Message-ID: <8cd017b80908090037u79c48b51tfeb83a076fe1e3c2@mail.gmail.com> http://dlr.codeplex.com/Wiki/View.aspx?title=Docs%20and%20specs Download the dlr-spec-hosting document. On Sat, Aug 8, 2009 at 8:10 AM, wrote: > I am new to IronPython. I am trying to add IronPython scripting support to > my C# program. I have a number of questions. > > Namespaces > ---------- > Looking at C# examples on WWW, I can see: > > using IronPython.Hosting; > using Microsoft.Scripting; > using Microsoft.Scripting.Hosting; > > Where can I get documentation on these namespaces? > > > > _______________________________________________ > 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 boris_aronshtam at vdptech.com Sun Aug 9 19:28:34 2009 From: boris_aronshtam at vdptech.com (Boris Aronshtam) Date: Sun, 9 Aug 2009 10:28:34 -0700 Subject: [IronPython] C# - IronPython Integration In-Reply-To: <8cd017b80908090037u79c48b51tfeb83a076fe1e3c2@mail.gmail.com> References: <20090807231028.a4gb3mtjc4k0wk48@vdptech.com> <8cd017b80908090037u79c48b51tfeb83a076fe1e3c2@mail.gmail.com> Message-ID: <014601ca1916$d4529fc0$7cf7df40$@com> Thanks a lot for your reply. I do see DLR description (Microsoft.Scripting namespace), but I fail to see IronPython.Hosting namespace. Do you know where can I find the spec on it? Thanks, Boris From: Dody Gunawinata [mailto:empirebuilder at gmail.com] Sent: Sunday, August 09, 2009 12:37 AM To: Discussion of IronPython Subject: Re: [IronPython] C# - IronPython Integration http://dlr.codeplex.com/Wiki/View.aspx?title=Docs%20and%20specs Download the dlr-spec-hosting document. On Sat, Aug 8, 2009 at 8:10 AM, wrote: I am new to IronPython. I am trying to add IronPython scripting support to my C# program. I have a number of questions. Namespaces ---------- Looking at C# examples on WWW, I can see: using IronPython.Hosting; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; Where can I get documentation on these namespaces? _______________________________________________ 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 curt at hagenlocher.org Sun Aug 9 20:20:33 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sun, 9 Aug 2009 11:20:33 -0700 Subject: [IronPython] C# - IronPython Integration In-Reply-To: <014601ca1916$d4529fc0$7cf7df40$@com> References: <20090807231028.a4gb3mtjc4k0wk48@vdptech.com> <8cd017b80908090037u79c48b51tfeb83a076fe1e3c2@mail.gmail.com> <014601ca1916$d4529fc0$7cf7df40$@com> Message-ID: There probably isn't one. But these are just helpers for functionality that's in the DLR hosting spec. The source ought to be pretty self-explanatory. On Sun, Aug 9, 2009 at 10:28 AM, Boris Aronshtam < boris_aronshtam at vdptech.com> wrote: > Thanks a lot for your reply. I do see DLR description > (Microsoft.Scripting namespace), but I fail to see IronPython.Hosting > namespace. Do you know where can I find the spec on it? > > > > Thanks, > > Boris > > > > *From:* Dody Gunawinata [mailto:empirebuilder at gmail.com] > *Sent:* Sunday, August 09, 2009 12:37 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] C# - IronPython Integration > > > > http://dlr.codeplex.com/Wiki/View.aspx?title=Docs%20and%20specs > > > > Download the dlr-spec-hosting document. > > On Sat, Aug 8, 2009 at 8:10 AM, wrote: > > I am new to IronPython. I am trying to add IronPython scripting support to > my C# program. I have a number of questions. > > Namespaces > ---------- > Looking at C# examples on WWW, I can see: > > using IronPython.Hosting; > using Microsoft.Scripting; > using Microsoft.Scripting.Hosting; > > Where can I get documentation on these namespaces? > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > nomadlife.org > > _______________________________________________ > 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 jwiles at webworks.com Mon Aug 10 07:17:12 2009 From: jwiles at webworks.com (Jesse Wiles) Date: Mon, 10 Aug 2009 00:17:12 -0500 Subject: [IronPython] Preloading An Engine Instance With References Message-ID: <6a6c05630908092217y21f63fd2u4811622535f4cf81@mail.gmail.com> Hi, I would like to preload an engine instance with references to .NET namespaces, such that using clr.AddReference in a script is unnecessary. To be simple, I've created an engine instance with all the scope variables that I want, but within a script executed by the instance, I am finding that clr.AddReference('System') is required to import System. Can I handle the adding of the reference in the construction of the engine instance and if so, how? Thanks, Jesse Wiles From Tomas.Matousek at microsoft.com Mon Aug 10 07:49:03 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Mon, 10 Aug 2009 05:49:03 +0000 Subject: [IronPython] Preloading An Engine Instance With References In-Reply-To: <6a6c05630908092217y21f63fd2u4811622535f4cf81@mail.gmail.com> References: <6a6c05630908092217y21f63fd2u4811622535f4cf81@mail.gmail.com> Message-ID: <4B342496A3EFEB48839E10BB4BF5964C02406101@TK5EX14MBXC129.redmond.corp.microsoft.com> You can load assemblies to the runtime via ScriptRuntime.LoadAssembly. Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jesse Wiles Sent: Sunday, August 09, 2009 10:17 PM To: users at lists.ironpython.com Subject: [IronPython] Preloading An Engine Instance With References Hi, I would like to preload an engine instance with references to .NET namespaces, such that using clr.AddReference in a script is unnecessary. To be simple, I've created an engine instance with all the scope variables that I want, but within a script executed by the instance, I am finding that clr.AddReference('System') is required to import System. Can I handle the adding of the reference in the construction of the engine instance and if so, how? Thanks, Jesse Wiles _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From railcar88 at gmail.com Mon Aug 10 17:59:42 2009 From: railcar88 at gmail.com (Scott Scites) Date: Mon, 10 Aug 2009 09:59:42 -0600 Subject: [IronPython] Omit SILVERLIGHT_3 from IronPython Build Message-ID: I've been unsuccessful at building IronPython 2.6 B2 for a Silverlight 2 environment. Are there any special requirements other than the Silverlight 2 developer tools for building IPy 2.6 B2 on a vista machine? I am using the Silverlight Release build and omitting the SILVERLIGHT_3 flag. Microsoft.Scripting.Core has numerous System library conflict errors related to the stubs.cs. The rest of the errors are related to the inability to find the IPy libraries in the referenced directory. Those may clear up if I can get past the errors related to stubs.cs. If needed, I can provide specific build error messages...they are unavailable to me at the moment. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Mon Aug 10 19:14:01 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 10 Aug 2009 17:14:01 +0000 Subject: [IronPython] Omit SILVERLIGHT_3 from IronPython Build In-Reply-To: References: Message-ID: <0B61564A-CC26-4307-B6B3-D5D8441FA067@microsoft.com> If you see errors in Stubs, then it's definitely not building in "Silverlight Debug" or "Silverlight Release" configurations. I'll get the codeplex sources and double check that things are working properly, but please make sure your building in the Silverlight configuration. ~Jimmy On Aug 10, 2009, at 9:00 AM, "Scott Scites" wrote: > I've been unsuccessful at building IronPython 2.6 B2 for a > Silverlight 2 environment. Are there any special requirements other > than the Silverlight 2 developer tools for building IPy 2.6 B2 on a > vista machine? I am using the Silverlight Release build and > omitting the SILVERLIGHT_3 flag. Microsoft.Scripting.Core has > numerous System library conflict errors related to the stubs.cs. > The rest of the errors are related to the inability to find the IPy > libraries in the referenced directory. Those may clear up if I can > get past the errors related to stubs.cs. > > If needed, I can provide specific build error messages...they are > unavailable to me at the moment. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Mon Aug 10 20:31:52 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 10 Aug 2009 18:31:52 +0000 Subject: [IronPython] Omit SILVERLIGHT_3 from IronPython Build In-Reply-To: <0B61564A-CC26-4307-B6B3-D5D8441FA067@microsoft.com> References: <0B61564A-CC26-4307-B6B3-D5D8441FA067@microsoft.com> Message-ID: Sorry for the confusion; the IronPython CODEPLEX sources are NOT buildable with Silverlight 2; the csproj files contain direct references to silverlight 3 assemblies. So you need to build with Silverlight 3 installed. However, if you want to ensure the assemblies still work on Silverlight 2, you'll have to remove the SILVERLIGHT_3 flag; then you install SL2 and test everything out. You are NOT required to have the silverlight tools installed to build the ironpython binaries; just the silverlight 3 runtime. How come you have a SL2 requirement though? You can't download SL2 from the web anymore, and everyones SL2 installs should be prompting them to update to SL3. SL3 should be entirely backward comaptible, so I'd like to know the reason your bound to SL2. ~Jimmy On Aug 10, 2009, at 10:15 AM, "Jimmy Schementi" wrote: > If you see errors in Stubs, then it's definitely not building in > "Silverlight Debug" or "Silverlight Release" configurations. I'll get > the codeplex sources and double check that things are working > properly, but please make sure your building in the Silverlight > configuration. > > ~Jimmy > > On Aug 10, 2009, at 9:00 AM, "Scott Scites" > wrote: > >> I've been unsuccessful at building IronPython 2.6 B2 for a >> Silverlight 2 environment. Are there any special requirements other >> than the Silverlight 2 developer tools for building IPy 2.6 B2 on a >> vista machine? I am using the Silverlight Release build and >> omitting the SILVERLIGHT_3 flag. Microsoft.Scripting.Core has >> numerous System library conflict errors related to the stubs.cs. >> The rest of the errors are related to the inability to find the IPy >> libraries in the referenced directory. Those may clear up if I can >> get past the errors related to stubs.cs. >> >> If needed, I can provide specific build error messages...they are >> unavailable to me at the moment. >> _______________________________________________ >> 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 microsoft.com Mon Aug 10 22:32:15 2009 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 10 Aug 2009 20:32:15 +0000 Subject: [IronPython] UTF-8 script every 1024 bytes are broken In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD0379AFA8@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD037D9FB7@TK5EX14MBXC116.redmond.corp.microsoft.com> We can port the fix back to 2.0.3 when we do that release. We're still not sure when the next 2.0 release will be - it'll probably depend on the reaction to 2.6 and how quickly people move to that. I'll add a comment to the bug. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of KATO Kanryu > Sent: Friday, August 07, 2009 6:43 PM > To: Discussion of IronPython > Subject: Re: [IronPython] UTF-8 script every 1024 bytes are broken > > 2009/8/8 Dino Viehland wrote: > > I believe this is the same as bug #18637 > > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=18637 > > That's right. > I think Mr. Koichi Yamamoto is yamakox. > > I see about fixed in 2.6 already, but it seems that there is no fix > about 2.0.2 ? > > I fixed myself to source tree from subversion repository. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From vernondcole at gmail.com Tue Aug 11 01:20:47 2009 From: vernondcole at gmail.com (Vernon Cole) Date: Mon, 10 Aug 2009 17:20:47 -0600 Subject: [IronPython] [ANN]: IronPython 2.6 Beta 2 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD036EF147@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <7CEEC335D70FFE4B957737DDE836F51B01EA01@TK5EX14MBXC123.redmond.corp.microsoft.com> <4A68E577.5060705@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD036EF147@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: Sorry to be slow getting back... I'm on vacation. In attempting to make a test case as you have requested, I suddenly run in to the following problem: C:\temp>ipy ipy_bug.py C:\temp>"c:\program files\Ironpython 2.0.2\ipy.exe" ipy_bug.py version= adodbapi v2.2.7a1 Executing the command: "select * from Products" result rowcount shows as= 6. (Note: -1 means "not known") result data description is: NAME TypeCd DispSize IntrnlSz Prec Scale Null? ItemNumber 3 4 4 10 255 1 ItemName 202 12 50 255 255 1 UnitsOnHand 4 4 4 7 255 1 CostPerUnit 131 19 19 14 4 1 LastOrdered 7 8 8 255 255 1 result first ten records are: (1, 'Widgit', 5.0, Decimal("15.1234"), datetime.datetime(2009, 1, 29, 13, 5, 30) ) (2, 'Thingamajig, Standard', 505.0, Decimal("0.1000"), datetime.datetime(2009, 1 , 29, 15, 5, 19)) (3, 'Left Handed Smoke Shifter', 1.0, Decimal("1000000.0000"), datetime.datetime (2008, 4, 1, 12, 0)) (4, 'Gravel (Bulk)', 100.25, Decimal("32.4567"), datetime.datetime(2009, 1, 29, 13, 5, 31)) (5, 'Tube, Drinking, Plastic, For cold liquids', 500000.0, Decimal("0.0013"), da tetime.datetime(2009, 1, 29, 13, 5, 32)) (6, 'Annoy-A-Tron', 1.0, Decimal("12.9500"), datetime.datetime(2009, 1, 29, 13, 5, 33)) C:\temp>ipy26 ipy_bug.py C:\temp>"c:\program files\Ironpython 2.6\ipy.exe" ipy_bug.py version= adodbapi v2.2.7a1 Traceback (most recent call last): File "ipy_bug.py", line 52, in ipy_bug.py AttributeError: 'module' object has no attribute 'adodbapi' The offending line is: adodbapi.adodbapi.defaultIsolationLevel = adodbapi.adXactBrowse I never have understood why it was necessary to use the adodbapi.adodbapi.(whatever) construct, but smarter people than me said that was necessary, and they are correct. If the redundant-looking entry is not used, the programs runs without an error message, but does not actually perform the intended function. If, for example, the line adodbapi.adodbapi.defaultCursorLocation = adodbapi.adUseClient is changed to adodbapi.defaultCursorLocation = adodbapi.adUseClient then the program will run, but the rowcount will return as -1, rather than 6, because the cursor is not actually changed to a local cursor. So, to make a long story short: some change in IPy 2.6 has broken a needed (if ugly looking) feature in adodbapi. I will file a bug in codeplex as soon as I can isolate a good example. -- Vernon On Mon, Aug 3, 2009 at 5:33 PM, Dino Viehland wrote: > Ok, I?ve finally got SQL server setup in a reasonable state where I can > try and repro this. This is what I?m trying to do. I have a database > called ?mydatabase? which contains a table ?Table_1? which contains 1 column > of type binary(4). I then attempt to do: > > > > import System > > conn = > System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection")) > > connstr = "driver={SQL Server};Server=localhost;Database=mydatabase;Initial > Catalog=mydatabase;Trusted_Connection=True;" > > conn.ConnectionString = connstr > > conn.Open() > > > > rs = > System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.RecordSet")) > > rs.Open("Table_2", conn, 1, 2, 2) # source, active connection, cursor type > (adOpenKeyset), lock type (adLockPessimistic), CommmandType (adCmdTable) > > rs.AddNew() > > b = System.Array[System.Byte]((2,3,4,5)) > > x = rs['Test1'] > > x.AppendChunk(b) > > > > which fails with: > > > > EnvironmentError: System.Runtime.InteropServices.COMException (0x800A0C93): > Operation is not allowed in this context. > > > > This is the same failure I get if I use Shri?s proposed work around. Do > you have any idea of what I?m doing wrong or any suggestions on how to tweak > this to get the correct simple repro? > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Vernon Cole > *Sent:* Thursday, July 23, 2009 10:11 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 > > > > Guys: > Good work on the new release, and the 215 bug fixes. As usual, as soon as > the new beta was announced I downloaded and tested it. > > Somehow I got the idea that the adodbapi test had been included in the > IronPython test suite. Did you only include the tests that already pass? > Issue 18222 is still unfixed -- so adodbapi still fails, and you still > cannot pass a read-only buffer as a COM parameter. > > I realize that no one has voted up this rather obscure bug. Perhaps if it > were titled "fully support DB API 2.0 compliant database access using ADO" > it would have gotten more votes. Nevertheless, this issue has been > outstanding for 11 months, and is the only remaining failure in adodbapi for > versions 2.3 thru 3.1 of python. Please try to get to it before 2.6 final. > > Please !!!??? > -- > Vernon Cole > > P.S. -- I plan to make a version of adodbapi which uses real ADO.NET, > rather than ADO via COM, but I want the current version to be solid before I > start mucking it up. > > _______________________________________________ > 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 microsoft.com Tue Aug 11 01:29:05 2009 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 10 Aug 2009 23:29:05 +0000 Subject: [IronPython] [ANN]: IronPython 2.6 Beta 2 In-Reply-To: References: <7CEEC335D70FFE4B957737DDE836F51B01EA01@TK5EX14MBXC123.redmond.corp.microsoft.com> <4A68E577.5060705@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD036EF147@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD037DC707@TK5EX14MBXC116.redmond.corp.microsoft.com> Does adodbapi publish something into sys.modules under the name adodbapi during import? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vernon Cole Sent: Monday, August 10, 2009 4:21 PM To: Discussion of IronPython Subject: Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 Sorry to be slow getting back... I'm on vacation. In attempting to make a test case as you have requested, I suddenly run in to the following problem: C:\temp>ipy ipy_bug.py C:\temp>"c:\program files\Ironpython 2.0.2\ipy.exe" ipy_bug.py version= adodbapi v2.2.7a1 Executing the command: "select * from Products" result rowcount shows as= 6. (Note: -1 means "not known") result data description is: NAME TypeCd DispSize IntrnlSz Prec Scale Null? ItemNumber 3 4 4 10 255 1 ItemName 202 12 50 255 255 1 UnitsOnHand 4 4 4 7 255 1 CostPerUnit 131 19 19 14 4 1 LastOrdered 7 8 8 255 255 1 result first ten records are: (1, 'Widgit', 5.0, Decimal("15.1234"), datetime.datetime(2009, 1, 29, 13, 5, 30) ) (2, 'Thingamajig, Standard', 505.0, Decimal("0.1000"), datetime.datetime(2009, 1 , 29, 15, 5, 19)) (3, 'Left Handed Smoke Shifter', 1.0, Decimal("1000000.0000"), datetime.datetime (2008, 4, 1, 12, 0)) (4, 'Gravel (Bulk)', 100.25, Decimal("32.4567"), datetime.datetime(2009, 1, 29, 13, 5, 31)) (5, 'Tube, Drinking, Plastic, For cold liquids', 500000.0, Decimal("0.0013"), da tetime.datetime(2009, 1, 29, 13, 5, 32)) (6, 'Annoy-A-Tron', 1.0, Decimal("12.9500"), datetime.datetime(2009, 1, 29, 13, 5, 33)) C:\temp>ipy26 ipy_bug.py C:\temp>"c:\program files\Ironpython 2.6\ipy.exe" ipy_bug.py version= adodbapi v2.2.7a1 Traceback (most recent call last): File "ipy_bug.py", line 52, in ipy_bug.py AttributeError: 'module' object has no attribute 'adodbapi' The offending line is: adodbapi.adodbapi.defaultIsolationLevel = adodbapi.adXactBrowse I never have understood why it was necessary to use the adodbapi.adodbapi.(whatever) construct, but smarter people than me said that was necessary, and they are correct. If the redundant-looking entry is not used, the programs runs without an error message, but does not actually perform the intended function. If, for example, the line adodbapi.adodbapi.defaultCursorLocation = adodbapi.adUseClient is changed to adodbapi.defaultCursorLocation = adodbapi.adUseClient then the program will run, but the rowcount will return as -1, rather than 6, because the cursor is not actually changed to a local cursor. So, to make a long story short: some change in IPy 2.6 has broken a needed (if ugly looking) feature in adodbapi. I will file a bug in codeplex as soon as I can isolate a good example. -- Vernon On Mon, Aug 3, 2009 at 5:33 PM, Dino Viehland > wrote: Ok, I've finally got SQL server setup in a reasonable state where I can try and repro this. This is what I'm trying to do. I have a database called "mydatabase" which contains a table "Table_1" which contains 1 column of type binary(4). I then attempt to do: import System conn = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection")) connstr = "driver={SQL Server};Server=localhost;Database=mydatabase;Initial Catalog=mydatabase;Trusted_Connection=True;" conn.ConnectionString = connstr conn.Open() rs = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.RecordSet")) rs.Open("Table_2", conn, 1, 2, 2) # source, active connection, cursor type (adOpenKeyset), lock type (adLockPessimistic), CommmandType (adCmdTable) rs.AddNew() b = System.Array[System.Byte]((2,3,4,5)) x = rs['Test1'] x.AppendChunk(b) which fails with: EnvironmentError: System.Runtime.InteropServices.COMException (0x800A0C93): Operation is not allowed in this context. This is the same failure I get if I use Shri's proposed work around. Do you have any idea of what I'm doing wrong or any suggestions on how to tweak this to get the correct simple repro? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vernon Cole Sent: Thursday, July 23, 2009 10:11 PM To: Discussion of IronPython Subject: Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 Guys: Good work on the new release, and the 215 bug fixes. As usual, as soon as the new beta was announced I downloaded and tested it. Somehow I got the idea that the adodbapi test had been included in the IronPython test suite. Did you only include the tests that already pass? Issue 18222 is still unfixed -- so adodbapi still fails, and you still cannot pass a read-only buffer as a COM parameter. I realize that no one has voted up this rather obscure bug. Perhaps if it were titled "fully support DB API 2.0 compliant database access using ADO" it would have gotten more votes. Nevertheless, this issue has been outstanding for 11 months, and is the only remaining failure in adodbapi for versions 2.3 thru 3.1 of python. Please try to get to it before 2.6 final. Please !!!??? -- Vernon Cole P.S. -- I plan to make a version of adodbapi which uses real ADO.NET, rather than ADO via COM, but I want the current version to be solid before I start mucking it up. _______________________________________________ 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 fuzzyman at voidspace.org.uk Tue Aug 11 01:35:18 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 11 Aug 2009 00:35:18 +0100 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text Message-ID: <4A80AEB6.2010504@voidspace.org.uk> Hello all, Just to let you know I've started a project to generate FlowDocument XAML from reStructuredText source. There is also a pygments formatter so that source code can be formatted. The project, rst2xaml is at: http://code.google.com/p/rst2xaml/ So far it can cope with rest documents consisting of bold, italics, blockquotes and the sourcecode directive! The pygments formatter looks quite nice though - here is the output shown in a FlowDocumentReader: http://twitpic.com/dfwu5 The goal is to be able to show highlighted Python examples / tutorials alongside an interactive interpreter in the browser with Silverlight / Moonlight. Currently rst2xaml.py itself runs under CPython, but the xaml it generates is intended to be used from IronPython with WPF. There is an example script, display_xaml.py, that will show generated xaml in a window. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From Harry.Pierson at microsoft.com Tue Aug 11 01:56:46 2009 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Mon, 10 Aug 2009 23:56:46 +0000 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <4A80AEB6.2010504@voidspace.org.uk> References: <4A80AEB6.2010504@voidspace.org.uk> Message-ID: <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> Very cool Michael. FYI, pygments runs in IronPython except for a but in their _automodule class in pygments/lexers/__init__.py (http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/__init__.py). If you comment out the last 6 lines of lexers/__init__.py, pygments will run under IronPython, but without the lexer module automodule support. That means you have to write from pygments.lexers.agile import PythonLexer instead of from pygments.lexers import PythonLexer Dino assures me this bug is fixed and will be available in source "soon" - definitely by RC. Harry -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, August 10, 2009 4:35 PM To: Discussion of IronPython Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text Hello all, Just to let you know I've started a project to generate FlowDocument XAML from reStructuredText source. There is also a pygments formatter so that source code can be formatted. The project, rst2xaml is at: http://code.google.com/p/rst2xaml/ So far it can cope with rest documents consisting of bold, italics, blockquotes and the sourcecode directive! The pygments formatter looks quite nice though - here is the output shown in a FlowDocumentReader: http://twitpic.com/dfwu5 The goal is to be able to show highlighted Python examples / tutorials alongside an interactive interpreter in the browser with Silverlight / Moonlight. Currently rst2xaml.py itself runs under CPython, but the xaml it generates is intended to be used from IronPython with WPF. There is an example script, display_xaml.py, that will show generated xaml in a window. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Tue Aug 11 01:59:48 2009 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 10 Aug 2009 23:59:48 +0000 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> FYI the fix is checked in and available on CodePlex as of last Friday. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Harry Pierson > Sent: Monday, August 10, 2009 4:57 PM > To: Discussion of IronPython > Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and > restructured text > > Very cool Michael. > > FYI, pygments runs in IronPython except for a but in their _automodule > class in pygments/lexers/__init__.py > (http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/__init_ > _.py). If you comment out the last 6 lines of lexers/__init__.py, > pygments will run under IronPython, but without the lexer module > automodule support. That means you have to write > > from pygments.lexers.agile import PythonLexer > > instead of > > from pygments.lexers import PythonLexer > > Dino assures me this bug is fixed and will be available in source > "soon" - definitely by RC. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, August 10, 2009 4:35 PM > To: Discussion of IronPython > Subject: [IronPython] FlowDocument XAML syntax highlighting and > restructured text > > Hello all, > > Just to let you know I've started a project to generate FlowDocument > XAML from reStructuredText source. There is also a pygments formatter > so that source code can be formatted. > > The project, rst2xaml is at: > > http://code.google.com/p/rst2xaml/ > > So far it can cope with rest documents consisting of bold, italics, > blockquotes and the sourcecode directive! > > The pygments formatter looks quite nice though - here is the output > shown in a FlowDocumentReader: > > http://twitpic.com/dfwu5 > > The goal is to be able to show highlighted Python examples / tutorials > alongside an interactive interpreter in the browser with Silverlight / > Moonlight. > > Currently rst2xaml.py itself runs under CPython, but the xaml it > generates is intended to be used from IronPython with WPF. There is an > example script, display_xaml.py, that will show generated xaml in a > window. > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > _______________________________________________ > 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 Tue Aug 11 02:02:36 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 11 Aug 2009 01:02:36 +0100 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> Any idea if docutils works? Michael -- http://www.ironpythoninaction.com On 11 Aug 2009, at 00:59, Dino Viehland wrote: > FYI the fix is checked in and available on CodePlex as of last Friday. > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Harry Pierson >> Sent: Monday, August 10, 2009 4:57 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and >> restructured text >> >> Very cool Michael. >> >> FYI, pygments runs in IronPython except for a but in their >> _automodule >> class in pygments/lexers/__init__.py >> (http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/__init_ >> _.py). If you comment out the last 6 lines of lexers/__init__.py, >> pygments will run under IronPython, but without the lexer module >> automodule support. That means you have to write >> >> from pygments.lexers.agile import PythonLexer >> >> instead of >> >> from pygments.lexers import PythonLexer >> >> Dino assures me this bug is fixed and will be available in source >> "soon" - definitely by RC. >> >> Harry >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Monday, August 10, 2009 4:35 PM >> To: Discussion of IronPython >> Subject: [IronPython] FlowDocument XAML syntax highlighting and >> restructured text >> >> Hello all, >> >> Just to let you know I've started a project to generate FlowDocument >> XAML from reStructuredText source. There is also a pygments formatter >> so that source code can be formatted. >> >> The project, rst2xaml is at: >> >> http://code.google.com/p/rst2xaml/ >> >> So far it can cope with rest documents consisting of bold, italics, >> blockquotes and the sourcecode directive! >> >> The pygments formatter looks quite nice though - here is the output >> shown in a FlowDocumentReader: >> >> http://twitpic.com/dfwu5 >> >> The goal is to be able to show highlighted Python examples / >> tutorials >> alongside an interactive interpreter in the browser with >> Silverlight / >> Moonlight. >> >> Currently rst2xaml.py itself runs under CPython, but the xaml it >> generates is intended to be used from IronPython with WPF. There is >> an >> example script, display_xaml.py, that will show generated xaml in a >> window. >> >> Michael >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/blog >> >> >> _______________________________________________ >> 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 microsoft.com Tue Aug 11 02:17:25 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 11 Aug 2009 00:17:25 +0000 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> I have no clue - any ideas what the issue was there? We only have 1 bug that references it and it was fixed a long time ago. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, August 10, 2009 5:03 PM > To: Discussion of IronPython > Cc: Discussion of IronPython > Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and > restructured text > > Any idea if docutils works? > > Michael > > > -- > http://www.ironpythoninaction.com > > On 11 Aug 2009, at 00:59, Dino Viehland wrote: > > > FYI the fix is checked in and available on CodePlex as of last Friday. > > > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > >> bounces at lists.ironpython.com] On Behalf Of Harry Pierson > >> Sent: Monday, August 10, 2009 4:57 PM > >> To: Discussion of IronPython > >> Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and > >> restructured text > >> > >> Very cool Michael. > >> > >> FYI, pygments runs in IronPython except for a but in their > >> _automodule > >> class in pygments/lexers/__init__.py > >> > (http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/__init_ > >> _.py). If you comment out the last 6 lines of lexers/__init__.py, > >> pygments will run under IronPython, but without the lexer module > >> automodule support. That means you have to write > >> > >> from pygments.lexers.agile import PythonLexer > >> > >> instead of > >> > >> from pygments.lexers import PythonLexer > >> > >> Dino assures me this bug is fixed and will be available in source > >> "soon" - definitely by RC. > >> > >> Harry > >> > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > >> bounces at lists.ironpython.com] On Behalf Of Michael Foord > >> Sent: Monday, August 10, 2009 4:35 PM > >> To: Discussion of IronPython > >> Subject: [IronPython] FlowDocument XAML syntax highlighting and > >> restructured text > >> > >> Hello all, > >> > >> Just to let you know I've started a project to generate FlowDocument > >> XAML from reStructuredText source. There is also a pygments > formatter > >> so that source code can be formatted. > >> > >> The project, rst2xaml is at: > >> > >> http://code.google.com/p/rst2xaml/ > >> > >> So far it can cope with rest documents consisting of bold, italics, > >> blockquotes and the sourcecode directive! > >> > >> The pygments formatter looks quite nice though - here is the output > >> shown in a FlowDocumentReader: > >> > >> http://twitpic.com/dfwu5 > >> > >> The goal is to be able to show highlighted Python examples / > >> tutorials > >> alongside an interactive interpreter in the browser with > >> Silverlight / > >> Moonlight. > >> > >> Currently rst2xaml.py itself runs under CPython, but the xaml it > >> generates is intended to be used from IronPython with WPF. There is > >> an > >> example script, display_xaml.py, that will show generated xaml in a > >> window. > >> > >> Michael > >> > >> -- > >> http://www.ironpythoninaction.com/ > >> http://www.voidspace.org.uk/blog > >> > >> > >> _______________________________________________ > >> 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 calmasy at gmail.com Tue Aug 11 02:20:17 2009 From: calmasy at gmail.com (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Mon, 10 Aug 2009 18:20:17 -0600 Subject: [IronPython] ValueError: cannot assign to value types In-Reply-To: References: Message-ID: i dunno. i think this behavior needs to be re-thought for Ipy 2.6. i understand the reasons behind the decision, but the bottom line is that i'm unable to work with a perfectly valid, legal .NET assembly. it's one thing to do this as the default behavior, but to not allow the programmer to override it if that is his choice is not correct in my opinion. On Fri, Aug 7, 2009 at 11:04 PM, Curt Hagenlocher wrote: > __setattr__ it's not a *CLR*-level instance method of the type. IronPython > just makes it look like it is. > One possibility is to simply create an entirely new Parcel from scratch, > assigning values as appropriate. For example, given the following C# > classes: > > public struct Point { > ??? public int x, y; > } > public class Line { > ??? public Point to, from; > } > > You can do this from Python: > > F:\tcwb\libs>ipy.exe > IronPython 2.6 Beta 2 (2.6.0.20) on .NET 2.0.50727.4927 > Type "help", "copyright", "credits" or "license" for more information. >>>> import clr >>>> clr.AddReference('x') >>>> import Point, Line >>>> l = Line() >>>> l.to.x > 0 >>>> l.to.x = 1 > Traceback (most recent call last): > ? File "", line 1, in > ValueError: cannot assign to value types >>>> l.to = Point(x = 1, y = 2) >>>> l.to.x > 1 >>>> > > On Fri, Aug 7, 2009 at 8:40 PM, Count L?szl? de Alm?sy > wrote: >> >> i'm really stuck trying to change values for an object of type >> 'Parcel', which comes from the openmetaverse library i'm using. how >> this library is implemented i don't have control over, but the given >> interface is to make local changes to these Parcel objects, then use >> its Update() method to commit the changes. but it seems in IronPython >> i can't change these objects. >> >> >>> type(props) >> >> >> >>> props.Name = "Yes" >> Traceback (most recent call last): >> ?File "", line 1, in >> ValueError: cannot assign to value types >> >> after hours of struggling, i found >> http://ironpython.codeplex.com/Wiki/View.aspx?title=Value%20Types >> which seems to explain why i'm being bit here. bit it also says >> "updates are still possible via instance methods on the value type >> itself." so isn't "__setattr__" an instance method? seems i'm not able >> to use that either: >> >> >>> props.__setattr__("Name", "Yes") >> Traceback (most recent call last): >> ?File "", line 1, in >> ValueError: Attempt to update field 'Name' on value type 'Parcel'; >> value type fields cannot be directly modified >> >> ok, so what are my options? how do i get around this? i *have* to be >> able to update objects of this type somehow. >> >> i can create a new object of that type, but the constructor doesn't >> allow me to pre-stock it with values ( since i guess it assumes i'll >> be able to change them later), and then of course once it's created i >> can't change anything. >> >> -- >> Cheers, L?szl? >> _______________________________________________ >> 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 > > -- Cheers, L?szl? From dinov at microsoft.com Tue Aug 11 02:27:27 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 11 Aug 2009 00:27:27 +0000 Subject: [IronPython] ValueError: cannot assign to value types In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD037DCCCE@TK5EX14MBXC116.redmond.corp.microsoft.com> Just out of curiosity - how would you feel if we enabled the behavior but issued a warning when it occurred? In v1.0 when we made this decision we had no warning support and it could serve as a mitigating factor in enabling it. But it could also be too noisy. It's funny, I just got had to fix a bug in IronPython where they allow this but it doesn't really work. Given: List x; X[0].Bar = 42; fails to update the list. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Count L?szl? de Alm?sy > Sent: Monday, August 10, 2009 5:20 PM > To: Discussion of IronPython > Subject: Re: [IronPython] ValueError: cannot assign to value types > > i dunno. i think this behavior needs to be re-thought for Ipy 2.6. i > understand the reasons behind the decision, but the bottom line is > that i'm unable to work with a perfectly valid, legal .NET assembly. > it's one thing to do this as the default behavior, but to not allow > the programmer to override it if that is his choice is not correct in > my opinion. > > On Fri, Aug 7, 2009 at 11:04 PM, Curt Hagenlocher > wrote: > > __setattr__ it's not a *CLR*-level instance method of the type. > IronPython > > just makes it look like it is. > > One possibility is to simply create an entirely new Parcel from > scratch, > > assigning values as appropriate. For example, given the following C# > > classes: > > > > public struct Point { > > public int x, y; > > } > > public class Line { > > public Point to, from; > > } > > > > You can do this from Python: > > > > F:\tcwb\libs>ipy.exe > > IronPython 2.6 Beta 2 (2.6.0.20) on .NET 2.0.50727.4927 > > Type "help", "copyright", "credits" or "license" for more information. > >>>> import clr > >>>> clr.AddReference('x') > >>>> import Point, Line > >>>> l = Line() > >>>> l.to.x > > 0 > >>>> l.to.x = 1 > > Traceback (most recent call last): > > File "", line 1, in > > ValueError: cannot assign to value types > >>>> l.to = Point(x = 1, y = 2) > >>>> l.to.x > > 1 > >>>> > > > > On Fri, Aug 7, 2009 at 8:40 PM, Count L?szl? de Alm?sy > > > wrote: > >> > >> i'm really stuck trying to change values for an object of type > >> 'Parcel', which comes from the openmetaverse library i'm using. how > >> this library is implemented i don't have control over, but the given > >> interface is to make local changes to these Parcel objects, then use > >> its Update() method to commit the changes. but it seems in > IronPython > >> i can't change these objects. > >> > >> >>> type(props) > >> > >> > >> >>> props.Name = "Yes" > >> Traceback (most recent call last): > >> File "", line 1, in > >> ValueError: cannot assign to value types > >> > >> after hours of struggling, i found > >> http://ironpython.codeplex.com/Wiki/View.aspx?title=Value%20Types > >> which seems to explain why i'm being bit here. bit it also says > >> "updates are still possible via instance methods on the value type > >> itself." so isn't "__setattr__" an instance method? seems i'm not > able > >> to use that either: > >> > >> >>> props.__setattr__("Name", "Yes") > >> Traceback (most recent call last): > >> File "", line 1, in > >> ValueError: Attempt to update field 'Name' on value type 'Parcel'; > >> value type fields cannot be directly modified > >> > >> ok, so what are my options? how do i get around this? i *have* to be > >> able to update objects of this type somehow. > >> > >> i can create a new object of that type, but the constructor doesn't > >> allow me to pre-stock it with values ( since i guess it assumes i'll > >> be able to change them later), and then of course once it's created > i > >> can't change anything. > >> > >> -- > >> Cheers, L?szl? > >> _______________________________________________ > >> 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 > > > > > > > > -- > Cheers, L?szl? > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From k.kanryu at gmail.com Tue Aug 11 02:54:56 2009 From: k.kanryu at gmail.com (KATO Kanryu) Date: Tue, 11 Aug 2009 09:54:56 +0900 Subject: [IronPython] UTF-8 script every 1024 bytes are broken In-Reply-To: <1A472770E042064698CB5ADC83A12ACD037D9FB7@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD0379AFA8@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037D9FB7@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: > We can port the fix back to 2.0.3 when we do that release. > ... > I'll add a comment to the bug. OK. Thank you. The fix is quite important for CJK(Chinese/Japanese/Korean) people. Because all scripts in UTF-8 are sure fail at parsing. > We're still not sure when the next 2.0 release will be > - it'll probably depend on the reaction to 2.6 > and how quickly people move to that. Yes, many people are looking forward to the release of 2.6, but it seems that the development gets behind a bit the plan. I think that the 2.0 will release 1 or 2 times more. Regards, KATO Kanryu From calmasy at gmail.com Tue Aug 11 03:07:27 2009 From: calmasy at gmail.com (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Mon, 10 Aug 2009 19:07:27 -0600 Subject: [IronPython] ValueError: cannot assign to value types In-Reply-To: <1A472770E042064698CB5ADC83A12ACD037DCCCE@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD037DCCCE@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: i'd feek ok about any method that at least allowed me to work around the current situaiton. a warning seems fine to me. even better, an explicit way for us to enable the behavior without a warning. On Mon, Aug 10, 2009 at 6:27 PM, Dino Viehland wrote: > Just out of curiosity - how would you feel if we enabled the behavior > but issued a warning when it occurred? ?In v1.0 when we made this > decision we had no warning support and it could serve as a mitigating > factor in enabling it. ?But it could also be too noisy. > > It's funny, I just got had to fix a bug in IronPython where they allow > this but it doesn't really work. > > Given: > > List x; > X[0].Bar = 42; > > fails to update the list. > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Count L?szl? de Alm?sy >> Sent: Monday, August 10, 2009 5:20 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] ValueError: cannot assign to value types >> >> i dunno. i think this behavior needs to be re-thought for Ipy 2.6. i >> understand the reasons behind the decision, but the bottom line is >> that i'm unable to work with a perfectly valid, legal .NET assembly. >> it's one thing to do this as the default behavior, but to not allow >> the programmer to override it if that is his choice is not correct in >> my opinion. >> >> On Fri, Aug 7, 2009 at 11:04 PM, Curt Hagenlocher >> wrote: >> > __setattr__ it's not a *CLR*-level instance method of the type. >> IronPython >> > just makes it look like it is. >> > One possibility is to simply create an entirely new Parcel from >> scratch, >> > assigning values as appropriate. For example, given the following C# >> > classes: >> > >> > public struct Point { >> > ? ? public int x, y; >> > } >> > public class Line { >> > ? ? public Point to, from; >> > } >> > >> > You can do this from Python: >> > >> > F:\tcwb\libs>ipy.exe >> > IronPython 2.6 Beta 2 (2.6.0.20) on .NET 2.0.50727.4927 >> > Type "help", "copyright", "credits" or "license" for more information. >> >>>> import clr >> >>>> clr.AddReference('x') >> >>>> import Point, Line >> >>>> l = Line() >> >>>> l.to.x >> > 0 >> >>>> l.to.x = 1 >> > Traceback (most recent call last): >> > ? File "", line 1, in >> > ValueError: cannot assign to value types >> >>>> l.to = Point(x = 1, y = 2) >> >>>> l.to.x >> > 1 >> >>>> >> > >> > On Fri, Aug 7, 2009 at 8:40 PM, Count L?szl? de Alm?sy >> >> > wrote: >> >> >> >> i'm really stuck trying to change values for an object of type >> >> 'Parcel', which comes from the openmetaverse library i'm using. how >> >> this library is implemented i don't have control over, but the given >> >> interface is to make local changes to these Parcel objects, then use >> >> its Update() method to commit the changes. but it seems in >> IronPython >> >> i can't change these objects. >> >> >> >> >>> type(props) >> >> >> >> >> >> >>> props.Name = "Yes" >> >> Traceback (most recent call last): >> >> ?File "", line 1, in >> >> ValueError: cannot assign to value types >> >> >> >> after hours of struggling, i found >> >> http://ironpython.codeplex.com/Wiki/View.aspx?title=Value%20Types >> >> which seems to explain why i'm being bit here. bit it also says >> >> "updates are still possible via instance methods on the value type >> >> itself." so isn't "__setattr__" an instance method? seems i'm not >> able >> >> to use that either: >> >> >> >> >>> props.__setattr__("Name", "Yes") >> >> Traceback (most recent call last): >> >> ?File "", line 1, in >> >> ValueError: Attempt to update field 'Name' on value type 'Parcel'; >> >> value type fields cannot be directly modified >> >> >> >> ok, so what are my options? how do i get around this? i *have* to be >> >> able to update objects of this type somehow. >> >> >> >> i can create a new object of that type, but the constructor doesn't >> >> allow me to pre-stock it with values ( since i guess it assumes i'll >> >> be able to change them later), and then of course once it's created >> i >> >> can't change anything. >> >> >> >> -- >> >> Cheers, L?szl? >> >> _______________________________________________ >> >> 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 >> > >> > >> >> >> >> -- >> Cheers, L?szl? >> _______________________________________________ >> 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 > -- Cheers, L?szl? From fuzzyman at voidspace.org.uk Tue Aug 11 03:11:36 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 11 Aug 2009 02:11:36 +0100 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A80C548.6020105@voidspace.org.uk> Dino Viehland wrote: > I have no clue - any ideas what the issue was there? We only have 1 bug > that references it and it was fixed a long time ago. > > First problem with 2.6B2: File "c:\IronPythonPackages\docutils\utils.py", line 16, in c:\IronPythonPackages\docutils\utils.py import unicodedata ImportError: No module named unicodedata Michael >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Monday, August 10, 2009 5:03 PM >> To: Discussion of IronPython >> Cc: Discussion of IronPython >> Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and >> restructured text >> >> Any idea if docutils works? >> >> Michael >> >> >> -- >> http://www.ironpythoninaction.com >> >> On 11 Aug 2009, at 00:59, Dino Viehland wrote: >> >> >>> FYI the fix is checked in and available on CodePlex as of last Friday. >>> >>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> bounces at lists.ironpython.com] On Behalf Of Harry Pierson >>>> Sent: Monday, August 10, 2009 4:57 PM >>>> To: Discussion of IronPython >>>> Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and >>>> restructured text >>>> >>>> Very cool Michael. >>>> >>>> FYI, pygments runs in IronPython except for a but in their >>>> _automodule >>>> class in pygments/lexers/__init__.py >>>> >>>> >> (http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/__init_ >> >>>> _.py). If you comment out the last 6 lines of lexers/__init__.py, >>>> pygments will run under IronPython, but without the lexer module >>>> automodule support. That means you have to write >>>> >>>> from pygments.lexers.agile import PythonLexer >>>> >>>> instead of >>>> >>>> from pygments.lexers import PythonLexer >>>> >>>> Dino assures me this bug is fixed and will be available in source >>>> "soon" - definitely by RC. >>>> >>>> Harry >>>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>>> Sent: Monday, August 10, 2009 4:35 PM >>>> To: Discussion of IronPython >>>> Subject: [IronPython] FlowDocument XAML syntax highlighting and >>>> restructured text >>>> >>>> Hello all, >>>> >>>> Just to let you know I've started a project to generate FlowDocument >>>> XAML from reStructuredText source. There is also a pygments >>>> >> formatter >> >>>> so that source code can be formatted. >>>> >>>> The project, rst2xaml is at: >>>> >>>> http://code.google.com/p/rst2xaml/ >>>> >>>> So far it can cope with rest documents consisting of bold, italics, >>>> blockquotes and the sourcecode directive! >>>> >>>> The pygments formatter looks quite nice though - here is the output >>>> shown in a FlowDocumentReader: >>>> >>>> http://twitpic.com/dfwu5 >>>> >>>> The goal is to be able to show highlighted Python examples / >>>> tutorials >>>> alongside an interactive interpreter in the browser with >>>> Silverlight / >>>> Moonlight. >>>> >>>> Currently rst2xaml.py itself runs under CPython, but the xaml it >>>> generates is intended to be used from IronPython with WPF. There is >>>> an >>>> example script, display_xaml.py, that will show generated xaml in a >>>> window. >>>> >>>> Michael >>>> >>>> -- >>>> http://www.ironpythoninaction.com/ >>>> http://www.voidspace.org.uk/blog >>>> >>>> >>>> _______________________________________________ >>>> 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From dinov at microsoft.com Tue Aug 11 03:13:03 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 11 Aug 2009 01:13:03 +0000 Subject: [IronPython] ValueError: cannot assign to value types In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD037DCCCE@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD037E00C6@TK5EX14MBXC116.redmond.corp.microsoft.com> If you want an immediate work around I think: type(props).Name.Info.SetValue(props, value) might work in 2.6. You'll need to do "import clr" for "Info" to be available on the reflected field object. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Count L?szl? de Alm?sy > Sent: Monday, August 10, 2009 6:07 PM > To: Discussion of IronPython > Subject: Re: [IronPython] ValueError: cannot assign to value types > > i'd feek ok about any method that at least allowed me to work around > the current situaiton. a warning seems fine to me. even better, an > explicit way for us to enable the behavior without a warning. > > On Mon, Aug 10, 2009 at 6:27 PM, Dino Viehland > wrote: > > Just out of curiosity - how would you feel if we enabled the behavior > > but issued a warning when it occurred? In v1.0 when we made this > > decision we had no warning support and it could serve as a mitigating > > factor in enabling it. But it could also be too noisy. > > > > It's funny, I just got had to fix a bug in IronPython where they > allow > > this but it doesn't really work. > > > > Given: > > > > List x; > > X[0].Bar = 42; > > > > fails to update the list. > > > > > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > >> bounces at lists.ironpython.com] On Behalf Of Count L?szl? de Alm?sy > >> Sent: Monday, August 10, 2009 5:20 PM > >> To: Discussion of IronPython > >> Subject: Re: [IronPython] ValueError: cannot assign to value types > >> > >> i dunno. i think this behavior needs to be re-thought for Ipy 2.6. i > >> understand the reasons behind the decision, but the bottom line is > >> that i'm unable to work with a perfectly valid, legal .NET assembly. > >> it's one thing to do this as the default behavior, but to not allow > >> the programmer to override it if that is his choice is not correct > in > >> my opinion. > >> > >> On Fri, Aug 7, 2009 at 11:04 PM, Curt > Hagenlocher > >> wrote: > >> > __setattr__ it's not a *CLR*-level instance method of the type. > >> IronPython > >> > just makes it look like it is. > >> > One possibility is to simply create an entirely new Parcel from > >> scratch, > >> > assigning values as appropriate. For example, given the following > C# > >> > classes: > >> > > >> > public struct Point { > >> > public int x, y; > >> > } > >> > public class Line { > >> > public Point to, from; > >> > } > >> > > >> > You can do this from Python: > >> > > >> > F:\tcwb\libs>ipy.exe > >> > IronPython 2.6 Beta 2 (2.6.0.20) on .NET 2.0.50727.4927 > >> > Type "help", "copyright", "credits" or "license" for more > information. > >> >>>> import clr > >> >>>> clr.AddReference('x') > >> >>>> import Point, Line > >> >>>> l = Line() > >> >>>> l.to.x > >> > 0 > >> >>>> l.to.x = 1 > >> > Traceback (most recent call last): > >> > File "", line 1, in > >> > ValueError: cannot assign to value types > >> >>>> l.to = Point(x = 1, y = 2) > >> >>>> l.to.x > >> > 1 > >> >>>> > >> > > >> > On Fri, Aug 7, 2009 at 8:40 PM, Count L?szl? de Alm?sy > >> > >> > wrote: > >> >> > >> >> i'm really stuck trying to change values for an object of type > >> >> 'Parcel', which comes from the openmetaverse library i'm using. > how > >> >> this library is implemented i don't have control over, but the > given > >> >> interface is to make local changes to these Parcel objects, then > use > >> >> its Update() method to commit the changes. but it seems in > >> IronPython > >> >> i can't change these objects. > >> >> > >> >> >>> type(props) > >> >> > >> >> > >> >> >>> props.Name = "Yes" > >> >> Traceback (most recent call last): > >> >> File "", line 1, in > >> >> ValueError: cannot assign to value types > >> >> > >> >> after hours of struggling, i found > >> >> http://ironpython.codeplex.com/Wiki/View.aspx?title=Value%20Types > >> >> which seems to explain why i'm being bit here. bit it also says > >> >> "updates are still possible via instance methods on the value > type > >> >> itself." so isn't "__setattr__" an instance method? seems i'm not > >> able > >> >> to use that either: > >> >> > >> >> >>> props.__setattr__("Name", "Yes") > >> >> Traceback (most recent call last): > >> >> File "", line 1, in > >> >> ValueError: Attempt to update field 'Name' on value type > 'Parcel'; > >> >> value type fields cannot be directly modified > >> >> > >> >> ok, so what are my options? how do i get around this? i *have* to > be > >> >> able to update objects of this type somehow. > >> >> > >> >> i can create a new object of that type, but the constructor > doesn't > >> >> allow me to pre-stock it with values ( since i guess it assumes > i'll > >> >> be able to change them later), and then of course once it's > created > >> i > >> >> can't change anything. > >> >> > >> >> -- > >> >> Cheers, L?szl? > >> >> _______________________________________________ > >> >> 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 > >> > > >> > > >> > >> > >> > >> -- > >> Cheers, L?szl? > >> _______________________________________________ > >> 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 > > > > > > -- > Cheers, L?szl? > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Tue Aug 11 03:24:50 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 11 Aug 2009 01:24:50 +0000 Subject: [IronPython] UTF-8 script every 1024 bytes are broken In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD0379AFA8@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037D9FB7@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD037E011F@TK5EX14MBXC116.redmond.corp.microsoft.com> KATO Kanryu wrote: > Yes, many people are looking forward to the release of 2.6, > but it seems that the development gets behind a bit the plan. > I think that the 2.0 will release 1 or 2 times more. I actually believe we've been tracking pretty close to the posted plan: http://ironpython.codeplex.com/Wiki/View.aspx?title=2.6%20Release%20Plan But that's only indirectly related to 2.0.3 anyway. From fuzzyman at voidspace.org.uk Tue Aug 11 03:24:58 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 11 Aug 2009 02:24:58 +0100 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <4A80C548.6020105@voidspace.org.uk> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A80C548.6020105@voidspace.org.uk> Message-ID: <4A80C86A.8060408@voidspace.org.uk> Michael Foord wrote: > Dino Viehland wrote: >> I have no clue - any ideas what the issue was there? We only have 1 bug >> that references it and it was fixed a long time ago. >> >> > > First problem with 2.6B2: > > File "c:\IronPythonPackages\docutils\utils.py", line 16, in > c:\IronPythonPackages\docutils\utils.py > import unicodedata > ImportError: No module named unicodedata If I use the unicodedata module from FePy then it *seems* to work. Although I do see a warning that I don't see under CPython: :1: DeprecationWarning: object.__new__() takes no parameters Not dug in to see where it comes from. Michael > > Michael > >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>> Sent: Monday, August 10, 2009 5:03 PM >>> To: Discussion of IronPython >>> Cc: Discussion of IronPython >>> Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and >>> restructured text >>> >>> Any idea if docutils works? >>> >>> Michael >>> >>> >>> -- >>> http://www.ironpythoninaction.com >>> >>> On 11 Aug 2009, at 00:59, Dino Viehland wrote: >>> >>> >>>> FYI the fix is checked in and available on CodePlex as of last Friday. >>>> >>>> >>>>> -----Original Message----- >>>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>>> bounces at lists.ironpython.com] On Behalf Of Harry Pierson >>>>> Sent: Monday, August 10, 2009 4:57 PM >>>>> To: Discussion of IronPython >>>>> Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and >>>>> restructured text >>>>> >>>>> Very cool Michael. >>>>> >>>>> FYI, pygments runs in IronPython except for a but in their >>>>> _automodule >>>>> class in pygments/lexers/__init__.py >>>>> >>>>> >>> (http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/__init_ >>> >>>>> _.py). If you comment out the last 6 lines of lexers/__init__.py, >>>>> pygments will run under IronPython, but without the lexer module >>>>> automodule support. That means you have to write >>>>> >>>>> from pygments.lexers.agile import PythonLexer >>>>> >>>>> instead of >>>>> >>>>> from pygments.lexers import PythonLexer >>>>> >>>>> Dino assures me this bug is fixed and will be available in source >>>>> "soon" - definitely by RC. >>>>> >>>>> Harry >>>>> >>>>> -----Original Message----- >>>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>>>> Sent: Monday, August 10, 2009 4:35 PM >>>>> To: Discussion of IronPython >>>>> Subject: [IronPython] FlowDocument XAML syntax highlighting and >>>>> restructured text >>>>> >>>>> Hello all, >>>>> >>>>> Just to let you know I've started a project to generate FlowDocument >>>>> XAML from reStructuredText source. There is also a pygments >>>>> >>> formatter >>> >>>>> so that source code can be formatted. >>>>> >>>>> The project, rst2xaml is at: >>>>> >>>>> http://code.google.com/p/rst2xaml/ >>>>> >>>>> So far it can cope with rest documents consisting of bold, italics, >>>>> blockquotes and the sourcecode directive! >>>>> >>>>> The pygments formatter looks quite nice though - here is the output >>>>> shown in a FlowDocumentReader: >>>>> >>>>> http://twitpic.com/dfwu5 >>>>> >>>>> The goal is to be able to show highlighted Python examples / >>>>> tutorials >>>>> alongside an interactive interpreter in the browser with >>>>> Silverlight / >>>>> Moonlight. >>>>> >>>>> Currently rst2xaml.py itself runs under CPython, but the xaml it >>>>> generates is intended to be used from IronPython with WPF. There is >>>>> an >>>>> example script, display_xaml.py, that will show generated xaml in a >>>>> window. >>>>> >>>>> Michael >>>>> >>>>> -- >>>>> http://www.ironpythoninaction.com/ >>>>> http://www.voidspace.org.uk/blog >>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 >> > > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From dinov at microsoft.com Tue Aug 11 03:32:28 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 11 Aug 2009 01:32:28 +0000 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <4A80C86A.8060408@voidspace.org.uk> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A80C548.6020105@voidspace.org.uk> <4A80C86A.8060408@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD037E03C9@TK5EX14MBXC116.redmond.corp.microsoft.com> Michael wrote: > If I use the unicodedata module from FePy then it *seems* to work. > Although I do see a warning that I don't see under CPython: > > :1: DeprecationWarning: object.__new__() takes no parameters > > Not dug in to see where it comes from. It's a new warning in 2.6 - it could be that FePy's unicodedata has something like: class x(object): def __new__(cls, *args): return object.__new__(cls, *args) # shouldn't pass args def __init__(self, *args): pass x(42) From fuzzyman at voidspace.org.uk Tue Aug 11 03:36:08 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 11 Aug 2009 02:36:08 +0100 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <1A472770E042064698CB5ADC83A12ACD037E03C9@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A80C548.6020105@voidspace.org.uk> <4A80C86A.8060408@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037E03C9@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A80CB08.8030900@voidspace.org.uk> Dino Viehland wrote: > Michael wrote: > >> If I use the unicodedata module from FePy then it *seems* to work. >> Although I do see a warning that I don't see under CPython: >> >> :1: DeprecationWarning: object.__new__() takes no parameters >> >> Not dug in to see where it comes from. >> > > It's a new warning in 2.6 - it could be that FePy's unicodedata has > something like: > > class x(object): > def __new__(cls, *args): > return object.__new__(cls, *args) # shouldn't pass args > def __init__(self, *args): > pass > > x(42) > > Nope, no class definitions - it just uses .NET functionality. It's a very short bit of code really - 77 lines of which 30 lines are a dictionary defining a category mapping. Michael > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From fuzzyman at voidspace.org.uk Tue Aug 11 03:57:24 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 11 Aug 2009 02:57:24 +0100 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <4A80C86A.8060408@voidspace.org.uk> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A80C548.6020105@voidspace.org.uk> <4A80C86A.8060408@voidspace.org.uk> Message-ID: <4A80D004.4010008@voidspace.org.uk> Michael Foord wrote: > Michael Foord wrote: >> Dino Viehland wrote: >>> I have no clue - any ideas what the issue was there? We only have 1 >>> bug >>> that references it and it was fixed a long time ago. >>> >>> >> >> First problem with 2.6B2: >> >> File "c:\IronPythonPackages\docutils\utils.py", line 16, in >> c:\IronPythonPackages\docutils\utils.py >> import unicodedata >> ImportError: No module named unicodedata > > If I use the unicodedata module from FePy then it *seems* to work. > Although I do see a warning that I don't see under CPython: > > :1: DeprecationWarning: object.__new__() takes no parameters > > Not dug in to see where it comes from. Another issue. If you use the programmatic API it blows up with an odd error. This is a function that uses a lot of keyword arguments (up to seventeen, mainly defaulting to None) and delegates to another function that also takes seventeen keyword arguments: >>> from docutils.core import publish_string >>> publish_string('foo') Traceback (most recent call last): File "", line 1, in TypeError: Value cannot be null. Parameter name: method This works fine with CPython. Michael > > Michael > >> >> Michael >> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>>> Sent: Monday, August 10, 2009 5:03 PM >>>> To: Discussion of IronPython >>>> Cc: Discussion of IronPython >>>> Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and >>>> restructured text >>>> >>>> Any idea if docutils works? >>>> >>>> Michael >>>> >>>> >>>> -- >>>> http://www.ironpythoninaction.com >>>> >>>> On 11 Aug 2009, at 00:59, Dino Viehland wrote: >>>> >>>> >>>>> FYI the fix is checked in and available on CodePlex as of last >>>>> Friday. >>>>> >>>>> >>>>>> -----Original Message----- >>>>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>>>> bounces at lists.ironpython.com] On Behalf Of Harry Pierson >>>>>> Sent: Monday, August 10, 2009 4:57 PM >>>>>> To: Discussion of IronPython >>>>>> Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and >>>>>> restructured text >>>>>> >>>>>> Very cool Michael. >>>>>> >>>>>> FYI, pygments runs in IronPython except for a but in their >>>>>> _automodule >>>>>> class in pygments/lexers/__init__.py >>>>>> >>>>>> >>>> (http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/__init_ >>>> >>>> >>>>>> _.py). If you comment out the last 6 lines of lexers/__init__.py, >>>>>> pygments will run under IronPython, but without the lexer module >>>>>> automodule support. That means you have to write >>>>>> >>>>>> from pygments.lexers.agile import PythonLexer >>>>>> >>>>>> instead of >>>>>> >>>>>> from pygments.lexers import PythonLexer >>>>>> >>>>>> Dino assures me this bug is fixed and will be available in source >>>>>> "soon" - definitely by RC. >>>>>> >>>>>> Harry >>>>>> >>>>>> -----Original Message----- >>>>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>>>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>>>>> Sent: Monday, August 10, 2009 4:35 PM >>>>>> To: Discussion of IronPython >>>>>> Subject: [IronPython] FlowDocument XAML syntax highlighting and >>>>>> restructured text >>>>>> >>>>>> Hello all, >>>>>> >>>>>> Just to let you know I've started a project to generate FlowDocument >>>>>> XAML from reStructuredText source. There is also a pygments >>>>>> >>>> formatter >>>> >>>>>> so that source code can be formatted. >>>>>> >>>>>> The project, rst2xaml is at: >>>>>> >>>>>> http://code.google.com/p/rst2xaml/ >>>>>> >>>>>> So far it can cope with rest documents consisting of bold, italics, >>>>>> blockquotes and the sourcecode directive! >>>>>> >>>>>> The pygments formatter looks quite nice though - here is the output >>>>>> shown in a FlowDocumentReader: >>>>>> >>>>>> http://twitpic.com/dfwu5 >>>>>> >>>>>> The goal is to be able to show highlighted Python examples / >>>>>> tutorials >>>>>> alongside an interactive interpreter in the browser with >>>>>> Silverlight / >>>>>> Moonlight. >>>>>> >>>>>> Currently rst2xaml.py itself runs under CPython, but the xaml it >>>>>> generates is intended to be used from IronPython with WPF. There is >>>>>> an >>>>>> example script, display_xaml.py, that will show generated xaml in a >>>>>> window. >>>>>> >>>>>> Michael >>>>>> >>>>>> -- >>>>>> http://www.ironpythoninaction.com/ >>>>>> http://www.voidspace.org.uk/blog >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>> >> >> > > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From fuzzyman at voidspace.org.uk Tue Aug 11 03:59:03 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 11 Aug 2009 02:59:03 +0100 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <4A80D004.4010008@voidspace.org.uk> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A80C548.6020105@voidspace.org.uk> <4A80C86A.8060408@voidspace.org.uk> <4A80D004.4010008@voidspace.org.uk> Message-ID: <4A80D067.7010700@voidspace.org.uk> Michael Foord wrote: > Michael Foord wrote: >> Michael Foord wrote: >>> Dino Viehland wrote: >>>> I have no clue - any ideas what the issue was there? We only have >>>> 1 bug >>>> that references it and it was fixed a long time ago. >>>> >>>> >>> >>> First problem with 2.6B2: >>> >>> File "c:\IronPythonPackages\docutils\utils.py", line 16, in >>> c:\IronPythonPackages\docutils\utils.py >>> import unicodedata >>> ImportError: No module named unicodedata >> >> If I use the unicodedata module from FePy then it *seems* to work. >> Although I do see a warning that I don't see under CPython: >> >> :1: DeprecationWarning: object.__new__() takes no parameters >> >> Not dug in to see where it comes from. > > Another issue. If you use the programmatic API it blows up with an odd > error. This is a function that uses a lot of keyword arguments (up to > seventeen, mainly defaulting to None) and delegates to another > function that also takes seventeen keyword arguments: > > >>> from docutils.core import publish_string > >>> publish_string('foo') > Traceback (most recent call last): > File "", line 1, in > TypeError: Value cannot be null. > Parameter name: method It looks like this might be the following issue, which is marked as fixed: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=24182 Cool. Michael > > > This works fine with CPython. > > Michael > >> >> Michael >> >>> >>> Michael >>> >>>>> -----Original Message----- >>>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>>>> Sent: Monday, August 10, 2009 5:03 PM >>>>> To: Discussion of IronPython >>>>> Cc: Discussion of IronPython >>>>> Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and >>>>> restructured text >>>>> >>>>> Any idea if docutils works? >>>>> >>>>> Michael >>>>> >>>>> >>>>> -- >>>>> http://www.ironpythoninaction.com >>>>> >>>>> On 11 Aug 2009, at 00:59, Dino Viehland wrote: >>>>> >>>>> >>>>>> FYI the fix is checked in and available on CodePlex as of last >>>>>> Friday. >>>>>> >>>>>> >>>>>>> -----Original Message----- >>>>>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>>>>> bounces at lists.ironpython.com] On Behalf Of Harry Pierson >>>>>>> Sent: Monday, August 10, 2009 4:57 PM >>>>>>> To: Discussion of IronPython >>>>>>> Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and >>>>>>> restructured text >>>>>>> >>>>>>> Very cool Michael. >>>>>>> >>>>>>> FYI, pygments runs in IronPython except for a but in their >>>>>>> _automodule >>>>>>> class in pygments/lexers/__init__.py >>>>>>> >>>>>>> >>>>> (http://dev.pocoo.org/projects/pygments/browser/pygments/lexers/__init_ >>>>> >>>>> >>>>>>> _.py). If you comment out the last 6 lines of lexers/__init__.py, >>>>>>> pygments will run under IronPython, but without the lexer module >>>>>>> automodule support. That means you have to write >>>>>>> >>>>>>> from pygments.lexers.agile import PythonLexer >>>>>>> >>>>>>> instead of >>>>>>> >>>>>>> from pygments.lexers import PythonLexer >>>>>>> >>>>>>> Dino assures me this bug is fixed and will be available in source >>>>>>> "soon" - definitely by RC. >>>>>>> >>>>>>> Harry >>>>>>> >>>>>>> -----Original Message----- >>>>>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>>>>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>>>>>> Sent: Monday, August 10, 2009 4:35 PM >>>>>>> To: Discussion of IronPython >>>>>>> Subject: [IronPython] FlowDocument XAML syntax highlighting and >>>>>>> restructured text >>>>>>> >>>>>>> Hello all, >>>>>>> >>>>>>> Just to let you know I've started a project to generate >>>>>>> FlowDocument >>>>>>> XAML from reStructuredText source. There is also a pygments >>>>>>> >>>>> formatter >>>>> >>>>>>> so that source code can be formatted. >>>>>>> >>>>>>> The project, rst2xaml is at: >>>>>>> >>>>>>> http://code.google.com/p/rst2xaml/ >>>>>>> >>>>>>> So far it can cope with rest documents consisting of bold, italics, >>>>>>> blockquotes and the sourcecode directive! >>>>>>> >>>>>>> The pygments formatter looks quite nice though - here is the output >>>>>>> shown in a FlowDocumentReader: >>>>>>> >>>>>>> http://twitpic.com/dfwu5 >>>>>>> >>>>>>> The goal is to be able to show highlighted Python examples / >>>>>>> tutorials >>>>>>> alongside an interactive interpreter in the browser with >>>>>>> Silverlight / >>>>>>> Moonlight. >>>>>>> >>>>>>> Currently rst2xaml.py itself runs under CPython, but the xaml it >>>>>>> generates is intended to be used from IronPython with WPF. There is >>>>>>> an >>>>>>> example script, display_xaml.py, that will show generated xaml in a >>>>>>> window. >>>>>>> >>>>>>> Michael >>>>>>> >>>>>>> -- >>>>>>> http://www.ironpythoninaction.com/ >>>>>>> http://www.voidspace.org.uk/blog >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> 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 >>>> >>> >>> >> >> > > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From boris_aronshtam at vdptech.com Tue Aug 11 07:49:24 2009 From: boris_aronshtam at vdptech.com (Boris Aronshtam) Date: Mon, 10 Aug 2009 22:49:24 -0700 Subject: [IronPython] C# - IronPython Integration In-Reply-To: References: <20090807231028.a4gb3mtjc4k0wk48@vdptech.com> <8cd017b80908090037u79c48b51tfeb83a076fe1e3c2@mail.gmail.com> <014601ca1916$d4529fc0$7cf7df40$@com> Message-ID: <01c801ca1a47$826ca980$8745fc80$@com> Thanks! From: Curt Hagenlocher [mailto:curt at hagenlocher.org] Sent: Sunday, August 09, 2009 11:21 AM To: Discussion of IronPython Subject: Re: [IronPython] C# - IronPython Integration There probably isn't one. But these are just helpers for functionality that's in the DLR hosting spec. The source ought to be pretty self-explanatory. On Sun, Aug 9, 2009 at 10:28 AM, Boris Aronshtam wrote: Thanks a lot for your reply. I do see DLR description (Microsoft.Scripting namespace), but I fail to see IronPython.Hosting namespace. Do you know where can I find the spec on it? Thanks, Boris From: Dody Gunawinata [mailto:empirebuilder at gmail.com] Sent: Sunday, August 09, 2009 12:37 AM To: Discussion of IronPython Subject: Re: [IronPython] C# - IronPython Integration http://dlr.codeplex.com/Wiki/View.aspx?title=Docs%20and%20specs Download the dlr-spec-hosting document. On Sat, Aug 8, 2009 at 8:10 AM, wrote: I am new to IronPython. I am trying to add IronPython scripting support to my C# program. I have a number of questions. Namespaces ---------- Looking at C# examples on WWW, I can see: using IronPython.Hosting; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; Where can I get documentation on these namespaces? _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org _______________________________________________ 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 vernondcole at gmail.com Tue Aug 11 10:54:16 2009 From: vernondcole at gmail.com (Vernon Cole) Date: Tue, 11 Aug 2009 02:54:16 -0600 Subject: [IronPython] [ANN]: IronPython 2.6 Beta 2 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD037DC707@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <7CEEC335D70FFE4B957737DDE836F51B01EA01@TK5EX14MBXC123.redmond.corp.microsoft.com> <4A68E577.5060705@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD036EF147@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DC707@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: No. The setup for the test script fiddles with os.path, but adodbapi itself makes no changes to sys.modules nor os.path. On Mon, Aug 10, 2009 at 5:29 PM, Dino Viehland wrote: > Does adodbapi publish something into sys.modules under the name adodbapi > during import? > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Vernon Cole > *Sent:* Monday, August 10, 2009 4:21 PM > > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 > > > > Sorry to be slow getting back... I'm on vacation. > In attempting to make a test case as you have requested, I suddenly run in > to the following problem: > > > C:\temp>ipy ipy_bug.py > > C:\temp>"c:\program files\Ironpython 2.0.2\ipy.exe" ipy_bug.py > version= adodbapi v2.2.7a1 > Executing the command: "select * from Products" > result rowcount shows as= 6. (Note: -1 means "not known") > > result data description is: > NAME TypeCd DispSize IntrnlSz Prec Scale Null? > ItemNumber 3 4 4 10 255 1 > ItemName 202 12 50 255 255 1 > UnitsOnHand 4 4 4 7 255 1 > CostPerUnit 131 19 19 14 4 1 > LastOrdered 7 8 8 255 255 1 > > result first ten records are: > (1, 'Widgit', 5.0, Decimal("15.1234"), datetime.datetime(2009, 1, 29, 13, > 5, 30) > ) > (2, 'Thingamajig, Standard', 505.0, Decimal("0.1000"), > datetime.datetime(2009, 1 > , 29, 15, 5, 19)) > (3, 'Left Handed Smoke Shifter', 1.0, Decimal("1000000.0000"), > datetime.datetime > (2008, 4, 1, 12, 0)) > (4, 'Gravel (Bulk)', 100.25, Decimal("32.4567"), datetime.datetime(2009, 1, > 29, > 13, 5, 31)) > (5, 'Tube, Drinking, Plastic, For cold liquids', 500000.0, > Decimal("0.0013"), da > tetime.datetime(2009, 1, 29, 13, 5, 32)) > (6, 'Annoy-A-Tron', 1.0, Decimal("12.9500"), datetime.datetime(2009, 1, 29, > 13, > 5, 33)) > > C:\temp>ipy26 ipy_bug.py > > C:\temp>"c:\program files\Ironpython 2.6\ipy.exe" ipy_bug.py > version= adodbapi v2.2.7a1 > Traceback (most recent call last): > File "ipy_bug.py", line 52, in ipy_bug.py > AttributeError: 'module' object has no attribute 'adodbapi' > > > The offending line is: > adodbapi.adodbapi.defaultIsolationLevel = adodbapi.adXactBrowse > > I never have understood why it was necessary to use the > adodbapi.adodbapi.(whatever) construct, but smarter people than me said that > was necessary, and they are correct. If the redundant-looking entry is not > used, the programs runs without an error message, but does not actually > perform the intended function. If, for example, the line > adodbapi.adodbapi.defaultCursorLocation = adodbapi.adUseClient > is changed to > adodbapi.defaultCursorLocation = adodbapi.adUseClient > then the program will run, but the rowcount will return as -1, rather than > 6, because the cursor is not actually changed to a local cursor. > > So, to make a long story short: some change in IPy 2.6 has broken a needed > (if ugly looking) feature in adodbapi. > I will file a bug in codeplex as soon as I can isolate a good example. > -- > Vernon > > > > On Mon, Aug 3, 2009 at 5:33 PM, Dino Viehland wrote: > > Ok, I?ve finally got SQL server setup in a reasonable state where I can try > and repro this. This is what I?m trying to do. I have a database called > ?mydatabase? which contains a table ?Table_1? which contains 1 column of > type binary(4). I then attempt to do: > > > > import System > > conn = > System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection")) > > connstr = "driver={SQL Server};Server=localhost;Database=mydatabase;Initial > Catalog=mydatabase;Trusted_Connection=True;" > > conn.ConnectionString = connstr > > conn.Open() > > > > rs = > System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.RecordSet")) > > rs.Open("Table_2", conn, 1, 2, 2) # source, active connection, cursor type > (adOpenKeyset), lock type (adLockPessimistic), CommmandType (adCmdTable) > > rs.AddNew() > > b = System.Array[System.Byte]((2,3,4,5)) > > x = rs['Test1'] > > x.AppendChunk(b) > > > > which fails with: > > > > EnvironmentError: System.Runtime.InteropServices.COMException (0x800A0C93): > Operation is not allowed in this context. > > > > This is the same failure I get if I use Shri?s proposed work around. Do > you have any idea of what I?m doing wrong or any suggestions on how to tweak > this to get the correct simple repro? > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Vernon Cole > *Sent:* Thursday, July 23, 2009 10:11 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 > > > > Guys: > Good work on the new release, and the 215 bug fixes. As usual, as soon as > the new beta was announced I downloaded and tested it. > > Somehow I got the idea that the adodbapi test had been included in the > IronPython test suite. Did you only include the tests that already pass? > Issue 18222 is still unfixed -- so adodbapi still fails, and you still > cannot pass a read-only buffer as a COM parameter. > > I realize that no one has voted up this rather obscure bug. Perhaps if it > were titled "fully support DB API 2.0 compliant database access using ADO" > it would have gotten more votes. Nevertheless, this issue has been > outstanding for 11 months, and is the only remaining failure in adodbapi for > versions 2.3 thru 3.1 of python. Please try to get to it before 2.6 final. > > Please !!!??? > -- > Vernon Cole > > P.S. -- I plan to make a version of adodbapi which uses real ADO.NET, > rather than ADO via COM, but I want the current version to be solid before I > start mucking it up. > > > _______________________________________________ > 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 railcar88 at gmail.com Tue Aug 11 12:06:32 2009 From: railcar88 at gmail.com (Scott Scites) Date: Tue, 11 Aug 2009 10:06:32 +0000 Subject: [IronPython] Users Digest, Vol 61, Issue 16 In-Reply-To: References: Message-ID: Jimmy, Please see this tweet: http://is.gd/22y9D I'm running the vmware image of the latest opensuse 11.1 with Mono 2.4.2.3. The Moonlight/Ipy application I was developing acts like it is loading but nothing displays. It works fine using Ipy 2.6 B1 and Moonlight 1.9.5. The Clock and Repl python samples (IronRuby 0.9.0 samples) are also broken using Ipy 2.6 B2 and Moonlight 1.9.6 (the latest). The background for the clock displays but not the control. The Repl simply does not display. Additionally, tested against the agdlr 0.5.0 samples: http://twitter.com/railcar88/status/2692911187 My thought is that perhaps building against Silverlight 3 might have broken compatibility with Moonlight 1.9.6. It could just as well be something else on the Mono or Moonlight side too (hopefully not user error :-) ). I'd like to use the latest of Ipy and the Moonlight Preview of Moonlight 2 to develop against. Thanks, Scott > Message: 5 > Date: Mon, 10 Aug 2009 18:31:52 +0000 > From: Jimmy Schementi > Subject: Re: [IronPython] Omit SILVERLIGHT_3 from IronPython Build > To: Discussion of IronPython > Cc: Discussion of IronPython , > "users at lists.ironpython.com" > Message-ID: > Content-Type: text/plain; charset="us-ascii" > > Sorry for the confusion; the IronPython CODEPLEX sources are NOT > buildable with Silverlight 2; the csproj files contain direct > references to silverlight 3 assemblies. So you need to build with > Silverlight 3 installed. However, if you want to ensure the assemblies > still work on Silverlight 2, you'll have to remove the SILVERLIGHT_3 > flag; then you install SL2 and test everything out. > > You are NOT required to have the silverlight tools installed to build > the ironpython binaries; just the silverlight 3 runtime. > > How come you have a SL2 requirement though? You can't download SL2 > from the web anymore, and everyones SL2 installs should be prompting > them to update to SL3. SL3 should be entirely backward comaptible, so > I'd like to know the reason your bound to SL2. > > ~Jimmy > > On Aug 10, 2009, at 10:15 AM, "Jimmy Schementi" < > Jimmy.Schementi at microsoft.com > > wrote: > > > If you see errors in Stubs, then it's definitely not building in > > "Silverlight Debug" or "Silverlight Release" configurations. I'll get > > the codeplex sources and double check that things are working > > properly, but please make sure your building in the Silverlight > > configuration. > > > > ~Jimmy > > > > On Aug 10, 2009, at 9:00 AM, "Scott Scites" > > wrote: > > > >> I've been unsuccessful at building IronPython 2.6 B2 for a > >> Silverlight 2 environment. Are there any special requirements other > >> than the Silverlight 2 developer tools for building IPy 2.6 B2 on a > >> vista machine? I am using the Silverlight Release build and > >> omitting the SILVERLIGHT_3 flag. Microsoft.Scripting.Core has > >> numerous System library conflict errors related to the stubs.cs. > >> The rest of the errors are related to the inability to find the IPy > >> libraries in the referenced directory. Those may clear up if I can > >> get past the errors related to stubs.cs. > >> > >> If needed, I can provide specific build error messages...they are > >> unavailable to me at the moment. > >> _______________________________________________ > >> 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 > > > End of Users Digest, Vol 61, Issue 16 > ************************************* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jregele23 at gmail.com Tue Aug 11 13:21:27 2009 From: jregele23 at gmail.com (Justin Regele) Date: Tue, 11 Aug 2009 04:21:27 -0700 Subject: [IronPython] C# - IronPython Integration In-Reply-To: <01c801ca1a47$826ca980$8745fc80$@com> References: <20090807231028.a4gb3mtjc4k0wk48@vdptech.com> <8cd017b80908090037u79c48b51tfeb83a076fe1e3c2@mail.gmail.com> <014601ca1916$d4529fc0$7cf7df40$@com> <01c801ca1a47$826ca980$8745fc80$@com> Message-ID: <8429660908110421j30bf0042n4608e6baf5b9be91@mail.gmail.com> Hi, Also get Michael's book. The web is pretty lacking in helping you get going, but the book is invaluable. On Mon, Aug 10, 2009 at 10:49 PM, Boris Aronshtam < boris_aronshtam at vdptech.com> wrote: > Thanks! > > > > *From:* Curt Hagenlocher [mailto:curt at hagenlocher.org] > *Sent:* Sunday, August 09, 2009 11:21 AM > > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] C# - IronPython Integration > > > > There probably isn't one. But these are just helpers for functionality > that's in the DLR hosting spec. The source ought to be pretty > self-explanatory. > > On Sun, Aug 9, 2009 at 10:28 AM, Boris Aronshtam < > boris_aronshtam at vdptech.com> wrote: > > Thanks a lot for your reply. I do see DLR description (Microsoft.Scripting > namespace), but I fail to see IronPython.Hosting namespace. Do you know > where can I find the spec on it? > > > > Thanks, > > Boris > > > > *From:* Dody Gunawinata [mailto:empirebuilder at gmail.com] > *Sent:* Sunday, August 09, 2009 12:37 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] C# - IronPython Integration > > > > http://dlr.codeplex.com/Wiki/View.aspx?title=Docs%20and%20specs > > > > Download the dlr-spec-hosting document. > > On Sat, Aug 8, 2009 at 8:10 AM, wrote: > > I am new to IronPython. I am trying to add IronPython scripting support to > my C# program. I have a number of questions. > > Namespaces > ---------- > Looking at C# examples on WWW, I can see: > > using IronPython.Hosting; > using Microsoft.Scripting; > using Microsoft.Scripting.Hosting; > > Where can I get documentation on these namespaces? > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > nomadlife.org > > > _______________________________________________ > 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 boris_aronshtam at vdptech.com Tue Aug 11 16:48:20 2009 From: boris_aronshtam at vdptech.com (Boris Aronshtam) Date: Tue, 11 Aug 2009 07:48:20 -0700 Subject: [IronPython] C# - IronPython Integration In-Reply-To: <8429660908110421j30bf0042n4608e6baf5b9be91@mail.gmail.com> References: <20090807231028.a4gb3mtjc4k0wk48@vdptech.com> <8cd017b80908090037u79c48b51tfeb83a076fe1e3c2@mail.gmail.com> <014601ca1916$d4529fc0$7cf7df40$@com> <01c801ca1a47$826ca980$8745fc80$@com> <8429660908110421j30bf0042n4608e6baf5b9be91@mail.gmail.com> Message-ID: <01f201ca1a92$c53a7350$4faf59f0$@com> Thanks Justin. I have obtained the book yesterday. Indeed, the book is invaluable. Especially in C# - IronPython integration. I will post a favorite review on Amazon regarding the book. Here is another question. How do I debug IronPython from C#. 1. Using Debug flag in options I can put break-points in IronPython code and single-step through it. But I cannot view the variables. 2. It would be great if somehow I can invoke IronPython shell from a break-point, so I can interactively examine the code and play with it. Is it possible? 3. For some reason Dir() output does not go to Console. Where does it go? Thanks, Boris From: Justin Regele [mailto:jregele23 at gmail.com] Sent: Tuesday, August 11, 2009 4:21 AM To: Discussion of IronPython Subject: Re: [IronPython] C# - IronPython Integration Hi, Also get Michael's book. The web is pretty lacking in helping you get going, but the book is invaluable. On Mon, Aug 10, 2009 at 10:49 PM, Boris Aronshtam wrote: Thanks! From: Curt Hagenlocher [mailto:curt at hagenlocher.org] Sent: Sunday, August 09, 2009 11:21 AM To: Discussion of IronPython Subject: Re: [IronPython] C# - IronPython Integration There probably isn't one. But these are just helpers for functionality that's in the DLR hosting spec. The source ought to be pretty self-explanatory. On Sun, Aug 9, 2009 at 10:28 AM, Boris Aronshtam wrote: Thanks a lot for your reply. I do see DLR description (Microsoft.Scripting namespace), but I fail to see IronPython.Hosting namespace. Do you know where can I find the spec on it? Thanks, Boris From: Dody Gunawinata [mailto:empirebuilder at gmail.com] Sent: Sunday, August 09, 2009 12:37 AM To: Discussion of IronPython Subject: Re: [IronPython] C# - IronPython Integration http://dlr.codeplex.com/Wiki/View.aspx?title=Docs%20and%20specs Download the dlr-spec-hosting document. On Sat, Aug 8, 2009 at 8:10 AM, wrote: I am new to IronPython. I am trying to add IronPython scripting support to my C# program. I have a number of questions. Namespaces ---------- Looking at C# examples on WWW, I can see: using IronPython.Hosting; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; Where can I get documentation on these namespaces? _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org _______________________________________________ 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 merllab at microsoft.com Tue Aug 11 17:52:56 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 11 Aug 2009 08:52:56 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <60776ca2-d4d0-4920-8413-d692b24e35e8@tk5-exsmh-c101.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/57959. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Tests/Tools/baselines/types_only.log $/IronPython/IronPython_Main/Src/IronPython/Runtime/ModuleGlobalCache.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/Shell/OptionsParser.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/BindingWarnings.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonProtocol.Operations.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/SlotOrFunction.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/FunctionCode.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonFunction.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/BuiltinFunction.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/PythonType.cs CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1051057 Date: 8/10/2009 3:14:52 PM (ddicato) 19589 2.6: warn when comparing objects which don't implement comparisons improve MakeComparisonOperation to detect Python3WarningAttribute 23971 Ipy.exe should list the command line options when invoked with '/?' trivial - added to OptionsParser (Shelveset: 26features4;REDMOND\ddicato | SNAP CheckinId: 9110) -------------------------------------------------------------------------------- Changeset Id: 1050494 Date: 8/10/2009 10:14:47 AM (dfugate) IronPython\Runtime\ModuleGlobalCache.cs was reopening the MS.Scripting.Runtime namespace. Changed this to IronPython.Runtime. (Shelveset: MODULEGLOBALCACHE;REDMOND\dfugate | SNAP CheckinId: 9108) From Jimmy.Schementi at microsoft.com Tue Aug 11 20:29:19 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 11 Aug 2009 18:29:19 +0000 Subject: [IronPython] Users Digest, Vol 61, Issue 16 In-Reply-To: References: , Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC19BD1BAF@tk5ex14mbxc106.redmond.corp.microsoft.com> In my most recent blogpost about IronRuby and Moonlight (http://blog.jimmy.schementi.com/2009/07/ironruby-at-oscon-2009-mono-moonlight.html) I say this: Note: the latest Moonlight stable release will not work for IronRuby, you must install the latest Moonlight build from their build bot:http://sublimeintervention.com:8123/GetFile.aspx?id=11487919 There were some bugs in Moonlight that they had to work out to get Ruby working. I believe Python worked as well, but these were "Silverlight Debug" builds from the IronRuby github source (which includes IronPython) without the "SILVERLIGHT_3" flag; you're right that building against SL3 broke the SL2/Moonlight2 compatibility because we now depend on System.Windows.Deployment.ExtensionPart. I think it makes sence to figure out a way to have the same binaries work in Silverlight 3 and Moonlight 2 without rebuilding, so I'll make sure to get that in to IronPython 2.6. ~js ________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] on behalf of Scott Scites [railcar88 at gmail.com] Sent: Tuesday, August 11, 2009 3:06 AM To: users at lists.ironpython.com Subject: Re: [IronPython] Users Digest, Vol 61, Issue 16 Jimmy, Please see this tweet: http://is.gd/22y9D I'm running the vmware image of the latest opensuse 11.1 with Mono 2.4.2.3. The Moonlight/Ipy application I was developing acts like it is loading but nothing displays. It works fine using Ipy 2.6 B1 and Moonlight 1.9.5. The Clock and Repl python samples (IronRuby 0.9.0 samples) are also broken using Ipy 2.6 B2 and Moonlight 1.9.6 (the latest). The background for the clock displays but not the control. The Repl simply does not display. Additionally, tested against the agdlr 0.5.0 samples: http://twitter.com/railcar88/status/2692911187 My thought is that perhaps building against Silverlight 3 might have broken compatibility with Moonlight 1.9.6. It could just as well be something else on the Mono or Moonlight side too (hopefully not user error :-) ). I'd like to use the latest of Ipy and the Moonlight Preview of Moonlight 2 to develop against. Thanks, Scott Message: 5 Date: Mon, 10 Aug 2009 18:31:52 +0000 From: Jimmy Schementi > Subject: Re: [IronPython] Omit SILVERLIGHT_3 from IronPython Build To: Discussion of IronPython > Cc: Discussion of IronPython >, "users at lists.ironpython.com" > Message-ID: > Content-Type: text/plain; charset="us-ascii" Sorry for the confusion; the IronPython CODEPLEX sources are NOT buildable with Silverlight 2; the csproj files contain direct references to silverlight 3 assemblies. So you need to build with Silverlight 3 installed. However, if you want to ensure the assemblies still work on Silverlight 2, you'll have to remove the SILVERLIGHT_3 flag; then you install SL2 and test everything out. You are NOT required to have the silverlight tools installed to build the ironpython binaries; just the silverlight 3 runtime. How come you have a SL2 requirement though? You can't download SL2 from the web anymore, and everyones SL2 installs should be prompting them to update to SL3. SL3 should be entirely backward comaptible, so I'd like to know the reason your bound to SL2. ~Jimmy On Aug 10, 2009, at 10:15 AM, "Jimmy Schementi" > wrote: > If you see errors in Stubs, then it's definitely not building in > "Silverlight Debug" or "Silverlight Release" configurations. I'll get > the codeplex sources and double check that things are working > properly, but please make sure your building in the Silverlight > configuration. > > ~Jimmy > > On Aug 10, 2009, at 9:00 AM, "Scott Scites" > > wrote: > >> I've been unsuccessful at building IronPython 2.6 B2 for a >> Silverlight 2 environment. Are there any special requirements other >> than the Silverlight 2 developer tools for building IPy 2.6 B2 on a >> vista machine? I am using the Silverlight Release build and >> omitting the SILVERLIGHT_3 flag. Microsoft.Scripting.Core has >> numerous System library conflict errors related to the stubs.cs. >> The rest of the errors are related to the inability to find the IPy >> libraries in the referenced directory. Those may clear up if I can >> get past the errors related to stubs.cs. >> >> If needed, I can provide specific build error messages...they are >> unavailable to me at the moment. >> _______________________________________________ >> 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 End of Users Digest, Vol 61, Issue 16 ************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Tue Aug 11 21:04:45 2009 From: vernondcole at gmail.com (Vernon Cole) Date: Tue, 11 Aug 2009 13:04:45 -0600 Subject: [IronPython] [ANN]: IronPython 2.6 Beta 2 In-Reply-To: References: <7CEEC335D70FFE4B957737DDE836F51B01EA01@TK5EX14MBXC123.redmond.corp.microsoft.com> <4A68E577.5060705@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD036EF147@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DC707@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: I have filed Codeplex Item # 24272 on this issue. I hope it makes sense -- I had been up way too many hours when I pushed the "send" button. -- Vernon On Tue, Aug 11, 2009 at 2:54 AM, Vernon Cole wrote: > No. The setup for the test script fiddles with os.path, but adodbapi itself > makes no changes to sys.modules nor os.path. > > > > On Mon, Aug 10, 2009 at 5:29 PM, Dino Viehland wrote: > >> Does adodbapi publish something into sys.modules under the name adodbapi >> during import? >> >> >> >> *From:* users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Vernon Cole >> *Sent:* Monday, August 10, 2009 4:21 PM >> >> *To:* Discussion of IronPython >> *Subject:* Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 >> >> >> >> Sorry to be slow getting back... I'm on vacation. >> In attempting to make a test case as you have requested, I suddenly run in >> to the following problem: >> >> >> C:\temp>ipy ipy_bug.py >> >> C:\temp>"c:\program files\Ironpython 2.0.2\ipy.exe" ipy_bug.py >> version= adodbapi v2.2.7a1 >> Executing the command: "select * from Products" >> result rowcount shows as= 6. (Note: -1 means "not known") >> >> result data description is: >> NAME TypeCd DispSize IntrnlSz Prec Scale Null? >> ItemNumber 3 4 4 10 255 1 >> ItemName 202 12 50 255 255 1 >> UnitsOnHand 4 4 4 7 255 1 >> CostPerUnit 131 19 19 14 4 1 >> LastOrdered 7 8 8 255 255 1 >> >> result first ten records are: >> (1, 'Widgit', 5.0, Decimal("15.1234"), datetime.datetime(2009, 1, 29, 13, >> 5, 30) >> ) >> (2, 'Thingamajig, Standard', 505.0, Decimal("0.1000"), >> datetime.datetime(2009, 1 >> , 29, 15, 5, 19)) >> (3, 'Left Handed Smoke Shifter', 1.0, Decimal("1000000.0000"), >> datetime.datetime >> (2008, 4, 1, 12, 0)) >> (4, 'Gravel (Bulk)', 100.25, Decimal("32.4567"), datetime.datetime(2009, >> 1, 29, >> 13, 5, 31)) >> (5, 'Tube, Drinking, Plastic, For cold liquids', 500000.0, >> Decimal("0.0013"), da >> tetime.datetime(2009, 1, 29, 13, 5, 32)) >> (6, 'Annoy-A-Tron', 1.0, Decimal("12.9500"), datetime.datetime(2009, 1, >> 29, 13, >> 5, 33)) >> >> C:\temp>ipy26 ipy_bug.py >> >> C:\temp>"c:\program files\Ironpython 2.6\ipy.exe" ipy_bug.py >> version= adodbapi v2.2.7a1 >> Traceback (most recent call last): >> File "ipy_bug.py", line 52, in ipy_bug.py >> AttributeError: 'module' object has no attribute 'adodbapi' >> >> >> The offending line is: >> adodbapi.adodbapi.defaultIsolationLevel = adodbapi.adXactBrowse >> >> I never have understood why it was necessary to use the >> adodbapi.adodbapi.(whatever) construct, but smarter people than me said that >> was necessary, and they are correct. If the redundant-looking entry is not >> used, the programs runs without an error message, but does not actually >> perform the intended function. If, for example, the line >> adodbapi.adodbapi.defaultCursorLocation = adodbapi.adUseClient >> is changed to >> adodbapi.defaultCursorLocation = adodbapi.adUseClient >> then the program will run, but the rowcount will return as -1, rather than >> 6, because the cursor is not actually changed to a local cursor. >> >> So, to make a long story short: some change in IPy 2.6 has broken a needed >> (if ugly looking) feature in adodbapi. >> I will file a bug in codeplex as soon as I can isolate a good example. >> -- >> Vernon >> >> >> >> On Mon, Aug 3, 2009 at 5:33 PM, Dino Viehland >> wrote: >> >> Ok, I?ve finally got SQL server setup in a reasonable state where I can >> try and repro this. This is what I?m trying to do. I have a database >> called ?mydatabase? which contains a table ?Table_1? which contains 1 column >> of type binary(4). I then attempt to do: >> >> >> >> import System >> >> conn = >> System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection")) >> >> connstr = "driver={SQL >> Server};Server=localhost;Database=mydatabase;Initial >> Catalog=mydatabase;Trusted_Connection=True;" >> >> conn.ConnectionString = connstr >> >> conn.Open() >> >> >> >> rs = >> System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.RecordSet")) >> >> rs.Open("Table_2", conn, 1, 2, 2) # source, active connection, cursor >> type (adOpenKeyset), lock type (adLockPessimistic), CommmandType >> (adCmdTable) >> >> rs.AddNew() >> >> b = System.Array[System.Byte]((2,3,4,5)) >> >> x = rs['Test1'] >> >> x.AppendChunk(b) >> >> >> >> which fails with: >> >> >> >> EnvironmentError: System.Runtime.InteropServices.COMException >> (0x800A0C93): Operation is not allowed in this context. >> >> >> >> This is the same failure I get if I use Shri?s proposed work around. Do >> you have any idea of what I?m doing wrong or any suggestions on how to tweak >> this to get the correct simple repro? >> >> >> >> *From:* users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Vernon Cole >> *Sent:* Thursday, July 23, 2009 10:11 PM >> *To:* Discussion of IronPython >> *Subject:* Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 >> >> >> >> Guys: >> Good work on the new release, and the 215 bug fixes. As usual, as soon >> as the new beta was announced I downloaded and tested it. >> >> Somehow I got the idea that the adodbapi test had been included in the >> IronPython test suite. Did you only include the tests that already pass? >> Issue 18222 is still unfixed -- so adodbapi still fails, and you still >> cannot pass a read-only buffer as a COM parameter. >> >> I realize that no one has voted up this rather obscure bug. Perhaps if it >> were titled "fully support DB API 2.0 compliant database access using ADO" >> it would have gotten more votes. Nevertheless, this issue has been >> outstanding for 11 months, and is the only remaining failure in adodbapi for >> versions 2.3 thru 3.1 of python. Please try to get to it before 2.6 final. >> >> Please !!!??? >> -- >> Vernon Cole >> >> P.S. -- I plan to make a version of adodbapi which uses real ADO.NET, >> rather than ADO via COM, but I want the current version to be solid before I >> start mucking it up. >> >> >> _______________________________________________ >> 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 microsoft.com Tue Aug 11 21:16:26 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 11 Aug 2009 19:16:26 +0000 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <4A80CB08.8030900@voidspace.org.uk> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A80C548.6020105@voidspace.org.uk> <4A80C86A.8060408@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037E03C9@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A80CB08.8030900@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD037E822E@TK5EX14MBXC116.redmond.corp.microsoft.com> Michael wrote: > Nope, no class definitions - it just uses .NET functionality. It's a > very short bit of code really - 77 lines of which 30 lines are a > dictionary defining a category mapping. I looked at this closer looking at all combinations of __new__/__init__ being defined and calling the super class w/ and w/o arguments. Our behavior on warnings seems to be correct - we're a little less strict on when we report errors though which I'll fix. Did you get no warnings from CPython 2.6? The one other difference I've noticed is that CPython seems to only warn once - even when I replace all of the functions in warnings to get past it's report-once caching - where we warn multiple times. I'm inclined to not replicate the behavior that specifically right now. try: import warnings except ImportError: import _warnings as warnings def warn_explicit(*args): print 'my warn', args import sys x = sys._getframe(0) while x: print x.f_code x = x.f_back warnings.warn_explicit = warn_explicit warnings.warn = warn_explicit warnings._show_warning = warn_explicit warnings.showwarning = warn_explicit import _warnings _warnings.warn_explicit = warn_explicit _warnings.warn = warn_explicit _warnings._show_warning = warn_explicit _warnings.showwarning = warn_explicit print 'I warn:' class x(object): def __init__(self, *args): object.__init__(self, *args) def __new__(cls, *args): return object.__new__(cls, *args) x(42) print 'I warn once in cpy:' for i in xrange(2): class x(object): def __init__(self, *args): object.__init__(self, *args) def __new__(cls, *args): return object.__new__(cls, *args) x(42) From dinov at microsoft.com Tue Aug 11 22:08:10 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 11 Aug 2009 20:08:10 +0000 Subject: [IronPython] [ANN]: IronPython 2.6 Beta 2 In-Reply-To: References: <7CEEC335D70FFE4B957737DDE836F51B01EA01@TK5EX14MBXC123.redmond.corp.microsoft.com> <4A68E577.5060705@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD036EF147@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DC707@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD037E8747@TK5EX14MBXC116.redmond.corp.microsoft.com> The report makes perfect sense. Thanks for tracking this down, I'm looking at it now. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vernon Cole Sent: Tuesday, August 11, 2009 12:05 PM To: Discussion of IronPython Subject: Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 I have filed Codeplex Item # 24272 on this issue. I hope it makes sense -- I had been up way too many hours when I pushed the "send" button. -- Vernon On Tue, Aug 11, 2009 at 2:54 AM, Vernon Cole > wrote: No. The setup for the test script fiddles with os.path, but adodbapi itself makes no changes to sys.modules nor os.path. On Mon, Aug 10, 2009 at 5:29 PM, Dino Viehland > wrote: Does adodbapi publish something into sys.modules under the name adodbapi during import? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vernon Cole Sent: Monday, August 10, 2009 4:21 PM To: Discussion of IronPython Subject: Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 Sorry to be slow getting back... I'm on vacation. In attempting to make a test case as you have requested, I suddenly run in to the following problem: C:\temp>ipy ipy_bug.py C:\temp>"c:\program files\Ironpython 2.0.2\ipy.exe" ipy_bug.py version= adodbapi v2.2.7a1 Executing the command: "select * from Products" result rowcount shows as= 6. (Note: -1 means "not known") result data description is: NAME TypeCd DispSize IntrnlSz Prec Scale Null? ItemNumber 3 4 4 10 255 1 ItemName 202 12 50 255 255 1 UnitsOnHand 4 4 4 7 255 1 CostPerUnit 131 19 19 14 4 1 LastOrdered 7 8 8 255 255 1 result first ten records are: (1, 'Widgit', 5.0, Decimal("15.1234"), datetime.datetime(2009, 1, 29, 13, 5, 30) ) (2, 'Thingamajig, Standard', 505.0, Decimal("0.1000"), datetime.datetime(2009, 1 , 29, 15, 5, 19)) (3, 'Left Handed Smoke Shifter', 1.0, Decimal("1000000.0000"), datetime.datetime (2008, 4, 1, 12, 0)) (4, 'Gravel (Bulk)', 100.25, Decimal("32.4567"), datetime.datetime(2009, 1, 29, 13, 5, 31)) (5, 'Tube, Drinking, Plastic, For cold liquids', 500000.0, Decimal("0.0013"), da tetime.datetime(2009, 1, 29, 13, 5, 32)) (6, 'Annoy-A-Tron', 1.0, Decimal("12.9500"), datetime.datetime(2009, 1, 29, 13, 5, 33)) C:\temp>ipy26 ipy_bug.py C:\temp>"c:\program files\Ironpython 2.6\ipy.exe" ipy_bug.py version= adodbapi v2.2.7a1 Traceback (most recent call last): File "ipy_bug.py", line 52, in ipy_bug.py AttributeError: 'module' object has no attribute 'adodbapi' The offending line is: adodbapi.adodbapi.defaultIsolationLevel = adodbapi.adXactBrowse I never have understood why it was necessary to use the adodbapi.adodbapi.(whatever) construct, but smarter people than me said that was necessary, and they are correct. If the redundant-looking entry is not used, the programs runs without an error message, but does not actually perform the intended function. If, for example, the line adodbapi.adodbapi.defaultCursorLocation = adodbapi.adUseClient is changed to adodbapi.defaultCursorLocation = adodbapi.adUseClient then the program will run, but the rowcount will return as -1, rather than 6, because the cursor is not actually changed to a local cursor. So, to make a long story short: some change in IPy 2.6 has broken a needed (if ugly looking) feature in adodbapi. I will file a bug in codeplex as soon as I can isolate a good example. -- Vernon On Mon, Aug 3, 2009 at 5:33 PM, Dino Viehland > wrote: Ok, I've finally got SQL server setup in a reasonable state where I can try and repro this. This is what I'm trying to do. I have a database called "mydatabase" which contains a table "Table_1" which contains 1 column of type binary(4). I then attempt to do: import System conn = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection")) connstr = "driver={SQL Server};Server=localhost;Database=mydatabase;Initial Catalog=mydatabase;Trusted_Connection=True;" conn.ConnectionString = connstr conn.Open() rs = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.RecordSet")) rs.Open("Table_2", conn, 1, 2, 2) # source, active connection, cursor type (adOpenKeyset), lock type (adLockPessimistic), CommmandType (adCmdTable) rs.AddNew() b = System.Array[System.Byte]((2,3,4,5)) x = rs['Test1'] x.AppendChunk(b) which fails with: EnvironmentError: System.Runtime.InteropServices.COMException (0x800A0C93): Operation is not allowed in this context. This is the same failure I get if I use Shri's proposed work around. Do you have any idea of what I'm doing wrong or any suggestions on how to tweak this to get the correct simple repro? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vernon Cole Sent: Thursday, July 23, 2009 10:11 PM To: Discussion of IronPython Subject: Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 Guys: Good work on the new release, and the 215 bug fixes. As usual, as soon as the new beta was announced I downloaded and tested it. Somehow I got the idea that the adodbapi test had been included in the IronPython test suite. Did you only include the tests that already pass? Issue 18222 is still unfixed -- so adodbapi still fails, and you still cannot pass a read-only buffer as a COM parameter. I realize that no one has voted up this rather obscure bug. Perhaps if it were titled "fully support DB API 2.0 compliant database access using ADO" it would have gotten more votes. Nevertheless, this issue has been outstanding for 11 months, and is the only remaining failure in adodbapi for versions 2.3 thru 3.1 of python. Please try to get to it before 2.6 final. Please !!!??? -- Vernon Cole P.S. -- I plan to make a version of adodbapi which uses real ADO.NET, rather than ADO via COM, but I want the current version to be solid before I start mucking it up. _______________________________________________ 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 vernondcole at gmail.com Tue Aug 11 23:53:02 2009 From: vernondcole at gmail.com (Vernon Cole) Date: Tue, 11 Aug 2009 15:53:02 -0600 Subject: [IronPython] [ANN]: IronPython 2.6 Beta 2 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD036EF147@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <7CEEC335D70FFE4B957737DDE836F51B01EA01@TK5EX14MBXC123.redmond.corp.microsoft.com> <4A68E577.5060705@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD036EF147@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: Dino: Here is the repo. You were using ADODB.RecordSet. This is ADODB.Command. """exercise BINARY field bug""" _computername=".\SQLexpress" #or name of computer with SQL Server _databasename="Northwind" #or something else constr = r"Initial Catalog=%s; Data Source=%s; Provider=SQLOLEDB.1; Integrated Security=SSPI" \ %(_databasename, _computername) import System conn = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection")) connstr = constr #"driver={SQL Server};Server=localhost;Database=mydatabase;Initial Catalog=mydatabase;Trusted_Connection=True;" conn.ConnectionString = connstr conn.Open() operation = "INSERT INTO Table_1 (Test1) VALUES (?)" b = buffer('\x02\x03\x04\x05') print 'b=',repr(b) cmd = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Command")) cmd.ActiveConnection=conn cmd.CommandText=operation cmd.CommandType=1 #adCmdText cmd.Parameters.Refresh() p = cmd.Parameters.Item[0] p.AppendChunk(b) # this is the error line ra = System.Reference[int]() rs = cmd.Execute(ra) count = ra.Value print 'Returned rowcount=',count -- Vernon On Mon, Aug 3, 2009 at 5:33 PM, Dino Viehland wrote: > Ok, I?ve finally got SQL server setup in a reasonable state where I can > try and repro this. This is what I?m trying to do. I have a database > called ?mydatabase? which contains a table ?Table_1? which contains 1 column > of type binary(4). I then attempt to do: > > > > import System > > conn = > System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection")) > > connstr = "driver={SQL Server};Server=localhost;Database=mydatabase;Initial > Catalog=mydatabase;Trusted_Connection=True;" > > conn.ConnectionString = connstr > > conn.Open() > > > > rs = > System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.RecordSet")) > > rs.Open("Table_2", conn, 1, 2, 2) # source, active connection, cursor type > (adOpenKeyset), lock type (adLockPessimistic), CommmandType (adCmdTable) > > rs.AddNew() > > b = System.Array[System.Byte]((2,3,4,5)) > > x = rs['Test1'] > > x.AppendChunk(b) > > > > which fails with: > > > > EnvironmentError: System.Runtime.InteropServices.COMException (0x800A0C93): > Operation is not allowed in this context. > > > > This is the same failure I get if I use Shri?s proposed work around. Do > you have any idea of what I?m doing wrong or any suggestions on how to tweak > this to get the correct simple repro? > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Vernon Cole > *Sent:* Thursday, July 23, 2009 10:11 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 > > > > Guys: > Good work on the new release, and the 215 bug fixes. As usual, as soon as > the new beta was announced I downloaded and tested it. > > Somehow I got the idea that the adodbapi test had been included in the > IronPython test suite. Did you only include the tests that already pass? > Issue 18222 is still unfixed -- so adodbapi still fails, and you still > cannot pass a read-only buffer as a COM parameter. > > I realize that no one has voted up this rather obscure bug. Perhaps if it > were titled "fully support DB API 2.0 compliant database access using ADO" > it would have gotten more votes. Nevertheless, this issue has been > outstanding for 11 months, and is the only remaining failure in adodbapi for > versions 2.3 thru 3.1 of python. Please try to get to it before 2.6 final. > > Please !!!??? > -- > Vernon Cole > > P.S. -- I plan to make a version of adodbapi which uses real ADO.NET, > rather than ADO via COM, but I want the current version to be solid before I > start mucking it up. > > _______________________________________________ > 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 microsoft.com Wed Aug 12 00:11:50 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 11 Aug 2009 22:11:50 +0000 Subject: [IronPython] [ANN]: IronPython 2.6 Beta 2 In-Reply-To: References: <7CEEC335D70FFE4B957737DDE836F51B01EA01@TK5EX14MBXC123.redmond.corp.microsoft.com> <4A68E577.5060705@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD036EF147@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD037E90C1@TK5EX14MBXC116.redmond.corp.microsoft.com> Awesome, thanks! I've found and I believe I have a fix for the import issue - it was a regression from fixing bug 20174. Now I'll take a look at this :) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vernon Cole Sent: Tuesday, August 11, 2009 2:53 PM To: Discussion of IronPython Subject: Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 Dino: Here is the repo. You were using ADODB.RecordSet. This is ADODB.Command. """exercise BINARY field bug""" _computername=".\SQLexpress" #or name of computer with SQL Server _databasename="Northwind" #or something else constr = r"Initial Catalog=%s; Data Source=%s; Provider=SQLOLEDB.1; Integrated Security=SSPI" \ %(_databasename, _computername) import System conn = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection")) connstr = constr #"driver={SQL Server};Server=localhost;Database=mydatabase;Initial Catalog=mydatabase;Trusted_Connection=True;" conn.ConnectionString = connstr conn.Open() operation = "INSERT INTO Table_1 (Test1) VALUES (?)" b = buffer('\x02\x03\x04\x05') print 'b=',repr(b) cmd = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Command")) cmd.ActiveConnection=conn cmd.CommandText=operation cmd.CommandType=1 #adCmdText cmd.Parameters.Refresh() p = cmd.Parameters.Item[0] p.AppendChunk(b) # this is the error line ra = System.Reference[int]() rs = cmd.Execute(ra) count = ra.Value print 'Returned rowcount=',count -- Vernon On Mon, Aug 3, 2009 at 5:33 PM, Dino Viehland > wrote: Ok, I've finally got SQL server setup in a reasonable state where I can try and repro this. This is what I'm trying to do. I have a database called "mydatabase" which contains a table "Table_1" which contains 1 column of type binary(4). I then attempt to do: import System conn = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection")) connstr = "driver={SQL Server};Server=localhost;Database=mydatabase;Initial Catalog=mydatabase;Trusted_Connection=True;" conn.ConnectionString = connstr conn.Open() rs = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.RecordSet")) rs.Open("Table_2", conn, 1, 2, 2) # source, active connection, cursor type (adOpenKeyset), lock type (adLockPessimistic), CommmandType (adCmdTable) rs.AddNew() b = System.Array[System.Byte]((2,3,4,5)) x = rs['Test1'] x.AppendChunk(b) which fails with: EnvironmentError: System.Runtime.InteropServices.COMException (0x800A0C93): Operation is not allowed in this context. This is the same failure I get if I use Shri's proposed work around. Do you have any idea of what I'm doing wrong or any suggestions on how to tweak this to get the correct simple repro? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vernon Cole Sent: Thursday, July 23, 2009 10:11 PM To: Discussion of IronPython Subject: Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 Guys: Good work on the new release, and the 215 bug fixes. As usual, as soon as the new beta was announced I downloaded and tested it. Somehow I got the idea that the adodbapi test had been included in the IronPython test suite. Did you only include the tests that already pass? Issue 18222 is still unfixed -- so adodbapi still fails, and you still cannot pass a read-only buffer as a COM parameter. I realize that no one has voted up this rather obscure bug. Perhaps if it were titled "fully support DB API 2.0 compliant database access using ADO" it would have gotten more votes. Nevertheless, this issue has been outstanding for 11 months, and is the only remaining failure in adodbapi for versions 2.3 thru 3.1 of python. Please try to get to it before 2.6 final. Please !!!??? -- Vernon Cole P.S. -- I plan to make a version of adodbapi which uses real ADO.NET, rather than ADO via COM, but I want the current version to be solid before I start mucking it up. _______________________________________________ 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 fuzzyman at voidspace.org.uk Wed Aug 12 00:20:06 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 11 Aug 2009 23:20:06 +0100 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <1A472770E042064698CB5ADC83A12ACD037E822E@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A80C548.6020105@voidspace.org.uk> <4A80C86A.8060408@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037E03C9@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A80CB08.8030900@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037E822E@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A81EE96.3020009@voidspace.org.uk> Dino Viehland wrote: > Michael wrote: > >> Nope, no class definitions - it just uses .NET functionality. It's a >> very short bit of code really - 77 lines of which 30 lines are a >> dictionary defining a category mapping. >> > > I looked at this closer looking at all combinations of __new__/__init__ > being defined and calling the super class w/ and w/o arguments. Our > behavior on warnings seems to be correct - we're a little less strict > on when we report errors though which I'll fix. > I definitely get a warning with IronPython 2.6 and *no* warning with Python 2.6. I tried digging a bit further in, but it's late and I'm hampered by the programmatic API not working with 2.6B2. Michael > Did you get no warnings from CPython 2.6? The one other difference > I've noticed is that CPython seems to only warn once - even when I > replace all of the functions in warnings to get past it's report-once > caching - where we warn multiple times. I'm inclined to not replicate > the behavior that specifically right now. > > try: > import warnings > except ImportError: > import _warnings as warnings > > def warn_explicit(*args): > print 'my warn', args > import sys > x = sys._getframe(0) > while x: > print x.f_code > x = x.f_back > > warnings.warn_explicit = warn_explicit > warnings.warn = warn_explicit > warnings._show_warning = warn_explicit > warnings.showwarning = warn_explicit > import _warnings > _warnings.warn_explicit = warn_explicit > _warnings.warn = warn_explicit > _warnings._show_warning = warn_explicit > _warnings.showwarning = warn_explicit > > print 'I warn:' > class x(object): > def __init__(self, *args): > object.__init__(self, *args) > def __new__(cls, *args): > return object.__new__(cls, *args) > > x(42) > > > print 'I warn once in cpy:' > for i in xrange(2): > class x(object): > def __init__(self, *args): > object.__init__(self, *args) > def __new__(cls, *args): > return object.__new__(cls, *args) > > x(42) > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From dinov at microsoft.com Wed Aug 12 00:33:46 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 11 Aug 2009 22:33:46 +0000 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <4A81EE96.3020009@voidspace.org.uk> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A80C548.6020105@voidspace.org.uk> <4A80C86A.8060408@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037E03C9@TK5EX14MBXC116.redmond.corp.microsoft <1A472770E042064698CB5ADC83A12ACD037E822E@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A81EE96.3020009@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD037E91A0@TK5EX14MBXC116.redmond.corp.microsoft.com> programmatic API? > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, August 11, 2009 3:20 PM > To: Discussion of IronPython > Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and > restructured text > > Dino Viehland wrote: > > Michael wrote: > > > >> Nope, no class definitions - it just uses .NET functionality. It's a > >> very short bit of code really - 77 lines of which 30 lines are a > >> dictionary defining a category mapping. > >> > > > > I looked at this closer looking at all combinations of > __new__/__init__ > > being defined and calling the super class w/ and w/o arguments. Our > > behavior on warnings seems to be correct - we're a little less strict > > on when we report errors though which I'll fix. > > > I definitely get a warning with IronPython 2.6 and *no* warning with > Python 2.6. > > I tried digging a bit further in, but it's late and I'm hampered by the > programmatic API not working with 2.6B2. > > Michael > > > > Did you get no warnings from CPython 2.6? The one other difference > > I've noticed is that CPython seems to only warn once - even when I > > replace all of the functions in warnings to get past it's report-once > > caching - where we warn multiple times. I'm inclined to not > replicate > > the behavior that specifically right now. > > > > try: > > import warnings > > except ImportError: > > import _warnings as warnings > > > > def warn_explicit(*args): > > print 'my warn', args > > import sys > > x = sys._getframe(0) > > while x: > > print x.f_code > > x = x.f_back > > > > warnings.warn_explicit = warn_explicit > > warnings.warn = warn_explicit > > warnings._show_warning = warn_explicit > > warnings.showwarning = warn_explicit > > import _warnings > > _warnings.warn_explicit = warn_explicit > > _warnings.warn = warn_explicit > > _warnings._show_warning = warn_explicit > > _warnings.showwarning = warn_explicit > > > > print 'I warn:' > > class x(object): > > def __init__(self, *args): > > object.__init__(self, *args) > > def __new__(cls, *args): > > return object.__new__(cls, *args) > > > > x(42) > > > > > > print 'I warn once in cpy:' > > for i in xrange(2): > > class x(object): > > def __init__(self, *args): > > object.__init__(self, *args) > > def __new__(cls, *args): > > return object.__new__(cls, *args) > > > > x(42) > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Wed Aug 12 00:35:47 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 11 Aug 2009 23:35:47 +0100 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <1A472770E042064698CB5ADC83A12ACD037E91A0@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A80C548.6020105@voidspace.org.uk> <4A80C86A.8060408@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037E03C9@TK5EX14MBXC116.redmond.corp.microsoft <1A472770E042064698CB5ADC83A12ACD037E822E@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A81EE96.3020009@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037E91A0@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A81F243.2070301@voidspace.org.uk> Dino Viehland wrote: > programmatic API? > The functions with 17 arguments that don't work... This is how you call docutils programatically. I can trigger the bug with the rst2html.py scripts but to dig into what is calling it I really want to call the APIs directly. Michael > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Tuesday, August 11, 2009 3:20 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] FlowDocument XAML syntax highlighting and >> restructured text >> >> Dino Viehland wrote: >> >>> Michael wrote: >>> >>> >>>> Nope, no class definitions - it just uses .NET functionality. It's a >>>> very short bit of code really - 77 lines of which 30 lines are a >>>> dictionary defining a category mapping. >>>> >>>> >>> I looked at this closer looking at all combinations of >>> >> __new__/__init__ >> >>> being defined and calling the super class w/ and w/o arguments. Our >>> behavior on warnings seems to be correct - we're a little less strict >>> on when we report errors though which I'll fix. >>> >>> >> I definitely get a warning with IronPython 2.6 and *no* warning with >> Python 2.6. >> >> I tried digging a bit further in, but it's late and I'm hampered by the >> programmatic API not working with 2.6B2. >> >> Michael >> >> >> >>> Did you get no warnings from CPython 2.6? The one other difference >>> I've noticed is that CPython seems to only warn once - even when I >>> replace all of the functions in warnings to get past it's report-once >>> caching - where we warn multiple times. I'm inclined to not >>> >> replicate >> >>> the behavior that specifically right now. >>> >>> try: >>> import warnings >>> except ImportError: >>> import _warnings as warnings >>> >>> def warn_explicit(*args): >>> print 'my warn', args >>> import sys >>> x = sys._getframe(0) >>> while x: >>> print x.f_code >>> x = x.f_back >>> >>> warnings.warn_explicit = warn_explicit >>> warnings.warn = warn_explicit >>> warnings._show_warning = warn_explicit >>> warnings.showwarning = warn_explicit >>> import _warnings >>> _warnings.warn_explicit = warn_explicit >>> _warnings.warn = warn_explicit >>> _warnings._show_warning = warn_explicit >>> _warnings.showwarning = warn_explicit >>> >>> print 'I warn:' >>> class x(object): >>> def __init__(self, *args): >>> object.__init__(self, *args) >>> def __new__(cls, *args): >>> return object.__new__(cls, *args) >>> >>> x(42) >>> >>> >>> print 'I warn once in cpy:' >>> for i in xrange(2): >>> class x(object): >>> def __init__(self, *args): >>> object.__init__(self, *args) >>> def __new__(cls, *args): >>> return object.__new__(cls, *args) >>> >>> x(42) >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/blog >> >> >> _______________________________________________ >> 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From dinov at microsoft.com Wed Aug 12 00:43:13 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 11 Aug 2009 22:43:13 +0000 Subject: [IronPython] FlowDocument XAML syntax highlighting and restructured text In-Reply-To: <4A81F243.2070301@voidspace.org.uk> References: <4A80AEB6.2010504@voidspace.org.uk> <6B5AE3B08809CC47A81ACBF99E2690F514ABFBA9@TK5EX14MBXC104.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD037DCB97@TK5EX14MBXC116.redmond.corp.microsoft.com> <041ED255-EDA9-4B7E-B37B-81508E37AB85@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037DCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A80C548.6020105@voidspace.org.uk> <4A80C86A.8060408@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037E03C9@TK5EX14MBXC116.redmond.corp.microsoft <1A472770E042064698CB5ADC83A12ACD037E822E@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A81EE96.3020009@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD037E91A0@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A81F243.2070301@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD037E9352@TK5EX14MBXC116.redmond.corp.microsoft.com> Michael wrote: > The functions with 17 arguments that don't work... This is how you call > docutils programatically. I can trigger the bug with the rst2html.py > scripts but to dig into what is calling it I really want to call the > APIs directly. Ahh, yes, an easy work around would be to pass one of the args w/ defaults as a keyword argument w/ it's default value. From railcar88 at gmail.com Wed Aug 12 12:31:07 2009 From: railcar88 at gmail.com (Scott Scites) Date: Wed, 12 Aug 2009 06:31:07 -0400 Subject: [IronPython] Moonlight 2/IPy 2.6 B2 Message-ID: Jimmy, That's great news that IPy 2.6 will be compatible with Moonlight 2 and Silverlight 3! The Moonlight build bot link is broken. My search for an alternative link is coming up short. Thanks, Scott Date: Tue, 11 Aug 2009 18:29:19 +0000 From: Jimmy Schementi Subject: Re: [IronPython] Users Digest, Vol 61, Issue 16 To: Discussion of IronPython Message-ID: < 0047ECBFA2E0DF4A834AA369282A5AFC19BD1BAF at tk5ex14mbxc106.redmond.corp.microsoft.com > Content-Type: text/plain; charset="iso-8859-1" In my most recent blogpost about IronRuby and Moonlight ( http://blog.jimmy.schementi.com/2009/07/ironruby-at-oscon-2009-mono-moonlight.html) I say this: Note: the latest Moonlight stable release will not work for IronRuby, you must install the latest Moonlight build from their build bot: http://sublimeintervention.com:8123/GetFile.aspx?id=11487919 There were some bugs in Moonlight that they had to work out to get Ruby working. I believe Python worked as well, but these were "Silverlight Debug" builds from the IronRuby github source (which includes IronPython) without the "SILVERLIGHT_3" flag; you're right that building against SL3 broke the SL2/Moonlight2 compatibility because we now depend on System.Windows.Deployment.ExtensionPart. I think it makes sence to figure out a way to have the same binaries work in Silverlight 3 and Moonlight 2 without rebuilding, so I'll make sure to get that in to IronPython 2.6. ~js -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexander2006 at gmail.com Wed Aug 12 16:44:27 2009 From: alexander2006 at gmail.com (Alexander Mail) Date: Wed, 12 Aug 2009 16:44:27 +0200 Subject: [IronPython] Python Modules Message-ID: <45D912A1-41C4-4AB1-9F3F-B54F2D387D90@gmail.com> Hi, I'm developing an application for MacOsX build with python and cocoa. Now I want to convert my project to a Windows .Net project. But I have this problem: in one of my classes i use pysqlite module. How i can use this module on IronPython? Thanks Marco From brian.curtin at gmail.com Wed Aug 12 17:06:10 2009 From: brian.curtin at gmail.com (Brian Curtin) Date: Wed, 12 Aug 2009 10:06:10 -0500 Subject: [IronPython] Python Modules In-Reply-To: <45D912A1-41C4-4AB1-9F3F-B54F2D387D90@gmail.com> References: <45D912A1-41C4-4AB1-9F3F-B54F2D387D90@gmail.com> Message-ID: On Wed, Aug 12, 2009 at 09:44, Alexander Mail wrote: > Hi, > I'm developing an application for MacOsX build with python and cocoa. Now I > want to convert my project to a Windows .Net project. > But I have this problem: in one of my classes i use pysqlite module. > How i can use this module on IronPython? > Thanks > > Marco Right now you can't use it because the pysqlite/sqlite3 module involves C code, and last I checked it does not work with ironclad. You could look into System.Data.SQLite from http://sqlite.phxsoftware.com/, but it won't be a drop-in replacement for your current sqlite code. -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibaut.barrere at gmail.com Wed Aug 12 17:10:04 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Wed, 12 Aug 2009 17:10:04 +0200 Subject: [IronPython] Python Modules In-Reply-To: References: <45D912A1-41C4-4AB1-9F3F-B54F2D387D90@gmail.com> Message-ID: <4a68b8cf0908120810t617518e3w7267308ead0286a@mail.gmail.com> Another link that could be useful: http://code.google.com/p/csharp-sqlite/ maybe some rewrapping of this is possible ? hth, Thibaut -- http://www.learnivore.com From merllab at microsoft.com Wed Aug 12 17:52:47 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 12 Aug 2009 08:52:47 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/57985. ADDED SOURCES $/IronPython/IronPython_Main/Src/Tests/modules/_ssl_test.py DELETED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Math/MathResources.resx $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Math/MathResources.Designer.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Tests/modules/_ssl_test.py $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Microsoft.Scripting.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Math/BigInteger.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Math/Complex64.cs CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1053128 Date: 8/11/2009 4:01:13 PM (dfugate) Added a test for the _ssl module. Still a few TODOs in this test module, particularly around the key/certificate params of sslojbects and also members IP hasn't implemented yet. (Shelveset: SSL_TEST;REDMOND\dfugate | SNAP CheckinId: 9121) From k.kanryu at gmail.com Wed Aug 12 19:22:01 2009 From: k.kanryu at gmail.com (KATO Kanryu) Date: Thu, 13 Aug 2009 02:22:01 +0900 Subject: [IronPython] Python Modules In-Reply-To: <45D912A1-41C4-4AB1-9F3F-B54F2D387D90@gmail.com> References: <45D912A1-41C4-4AB1-9F3F-B54F2D387D90@gmail.com> Message-ID: > But I have this problem: in one of my classes i use pysqlite module. fepy has one! This is compatible with db-api 2.0 :) This uses System.Data.SQLite.dll http://fepy.svn.sourceforge.net/viewvc/fepy/trunk/dbapi/sqlite3/dbapi2.py?revision=592&view=markup Regards, KATO Kanryu From jdhardy at gmail.com Wed Aug 12 20:25:27 2009 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 12 Aug 2009 12:25:27 -0600 Subject: [IronPython] Python Modules In-Reply-To: References: <45D912A1-41C4-4AB1-9F3F-B54F2D387D90@gmail.com> Message-ID: On Wed, Aug 12, 2009 at 11:22 AM, KATO Kanryu wrote: >> But I have this problem: in one of my classes i use pysqlite module. > > fepy has one! > This is compatible with db-api 2.0 :) > This uses System.Data.SQLite.dll > > http://fepy.svn.sourceforge.net/viewvc/fepy/trunk/dbapi/sqlite3/dbapi2.py?revision=592&view=markup If you just want the database modules without all of FePy, you can get them from http://bitbucket.org/jdhardy/adonet-dbapi/ (click on "Get Source"). It's the same code in a smaller package. - Jeff From fuzzyman at voidspace.org.uk Wed Aug 12 20:59:43 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 12 Aug 2009 19:59:43 +0100 Subject: [IronPython] Python Modules In-Reply-To: <4a68b8cf0908120810t617518e3w7267308ead0286a@mail.gmail.com> References: <45D912A1-41C4-4AB1-9F3F-B54F2D387D90@gmail.com> <4a68b8cf0908120810t617518e3w7267308ead0286a@mail.gmail.com> Message-ID: <4A83111F.9030403@voidspace.org.uk> Thibaut Barr?re wrote: > Another link that could be useful: > > http://code.google.com/p/csharp-sqlite/ > > maybe some rewrapping of this is possible ? > That's highly experimental and currently 3-5x slower than SQLite. Really not ready to use yet (and still not compatible with pysqlite anyway). Michael > hth, > > Thibaut > -- > http://www.learnivore.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From pratikpj at hotmail.com Wed Aug 12 22:24:36 2009 From: pratikpj at hotmail.com (Pratik Joshi) Date: Thu, 13 Aug 2009 01:54:36 +0530 Subject: [IronPython] Career in IronPython Message-ID: Hi All, I'm a newbie in IronPython. I've got an interest to learn and work in IronPython. Can anyone suggest me about the scope in IronPython and developing career in it? I'm a software engineer and have 3 years of professional experience in .NET. So how would it be for me to put my shoes in IronPython? Thanks Pratik. _________________________________________________________________ Sports, news, fashion and entertainment. Pick it all up in a package called MSN India http://in.msn.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cenovsky at bakalari.cz Wed Aug 12 22:32:32 2009 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Wed, 12 Aug 2009 22:32:32 +0200 Subject: [IronPython] Career in IronPython In-Reply-To: References: Message-ID: <4A8326E0.1060008@bakalari.cz> An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Thu Aug 13 01:12:42 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 13 Aug 2009 00:12:42 +0100 Subject: [IronPython] rst2xaml progress Message-ID: <4A834C6A.3070403@voidspace.org.uk> Hello all, Just to let you know about the progress of my rst2xaml project: http://code.google.com/p/rst2xaml/ It now supports the following docutils markup features: * title and headings * paragraphs * bold * italics * superscript * literal blocks * inline literals * line blocks * bullet lists * enumerated lists * the pygments code-block directive Almost enough to be useful. :-) I've attached a screenshot of a simple rest document rendered to xaml and displayed with WPF. Unfortunately the subset of text formatting supported by Silverlight is frankly pathetic, so it means lots more hoops to jump through. The pygments xaml formatter already works, and can output xaml that can be used in a Silverlight / Moonlight TextBlock. For the other docutils features I will have to be a bit more imaginative and stack separately formatted TextBlocks inside other components, which is a bit more tricky... All the best, Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog -------------- next part -------------- A non-text attachment was scrubbed... Name: rst2xaml.jpg Type: image/jpeg Size: 119344 bytes Desc: not available URL: From calmasy at gmail.com Thu Aug 13 05:19:58 2009 From: calmasy at gmail.com (=?ISO-8859-1?Q?Count_L=E1szl=F3_de_Alm=E1sy?=) Date: Wed, 12 Aug 2009 21:19:58 -0600 Subject: [IronPython] help with an IPy traceback Message-ID: i'm still getting used to the tracebacks that IPy / .NET produces. I'm used to CPython always telling me which line of code to look for the problem at. Is there a way to find where in my .py program the source of this problem lies? It looks like gobbledegook to me: 2009-08-12 20:11:51,782 [XML-RPC Login] ERROR - System.MissingMemberException: Parcel instance has no attribute 'client' at (wrapper dynamic-method) object._stub_$231##142 (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Scripting.Actions.CallSite,object,Microsoft.Scripting.Runtime.CodeContex t) <0x0017b> at Microsoft.Scripting.Actions.MatchCaller.Call2 (Microsoft.Func`4,Microsoft.Scripting.Actions.CallSite,object[]) <0x00093> at (wrapper static-rgctx-invoke) Microsoft.Scripting.Actions.MatchCaller.static_rgctx_invoke_object_Func`4_CallSite_object[] (Microsoft.Fu nc`4,Microsoft.Scripting.Actions.CallSite,object[]) <0x0002b> at Microsoft.Scripting.Actions.CallSite`1>.UpdateAndExecute (obje ct[]) <0x005ea> at Microsoft.Scripting.Actions.UpdateDelegates.Update2, object, M icrosoft.Scripting.Runtime.CodeContext, object> (Microsoft.Scripting.Actions.CallSite,object,Microsoft.Scripting.Runtime.CodeContext) <0x0008b> at (wrapper static-rgctx-invoke) Microsoft.Scripting.Actions.UpdateDelegates.static_rgctx_invoke_object_CallSite_object_CodeContext (Microsoft.Scripting.Actions.CallSite,object, Microsoft.Scripting.Runtime.CodeContext) <0x0002b> at S$3._Network_OnConnected$23 (Microsoft.Runtime.CompilerServices.Closure,object,object) <0x0010b> at (wrapper dynamic-method) object._stub_$230##141 (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Scripting.Actions.CallSite,Microsoft.Scripting.Runtime.CodeContext,objec t,object,object) <0x0018e> at (wrapper dynamic-method) object._stub_$229##140 (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Scripting.Actions.CallSite,object,object) <0x00170> at Microsoft.Scripting.Actions.MatchCaller.Call2 (Microsoft.Func`4,Microsoft.Scripting.Acti ons.CallSite,object[]) <0x00093> at (wrapper static-rgctx-invoke) Microsoft.Scripting.Actions.MatchCaller.static_rgctx_invoke_object_Func`4_CallSite_object[] (Microsoft.Func`4< Microsoft.Scripting.Actions.CallSite, object, object, object>,Microsoft.Scripting.Actions.CallSite,object[]) <0x0002b> at Microsoft.Scripting.Actions.CallSite`1>.UpdateAndExecute (object[]) <0x00444> at Microsoft.Scripting.Actions.UpdateDelegates.Update2, object, object, object> (Microsoft.Scripti ng.Actions.CallSite,object,object) <0x0008b> at (wrapper static-rgctx-invoke) Microsoft.Scripting.Actions.UpdateDelegates.static_rgctx_invoke_object_CallSite_object_object (Microsoft.Scripting.Actions.CallSite,object,objec t) <0x0002b> at (wrapper dynamic-method) object.System.Void(Object) (object[],object) <0x00062> at (wrapper delegate-invoke) OpenMetaverse.NetworkManager/ConnectedCallback.invoke_void__this___object (object) <0x0004f> at OpenMetaverse.NetworkManager.LoginReplyXmlRpcHandler (Nwc.XmlRpc.XmlRpcResponse,OpenMetaverse.LoginParams) <0x00954> -- Cheers, L?szl? From dinov at microsoft.com Thu Aug 13 05:43:42 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 13 Aug 2009 03:43:42 +0000 Subject: [IronPython] help with an IPy traceback In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD038074A5@TK5EX14MBXC116.redmond.corp.microsoft.com> It looks like this code is hosted somewhere. So who is catching the exception in this case? If it's you then you can do: pythonEngine.GetService().FormatException(exception); to get a standard Python version of the stack trace. W/o doing that the .NET stack trace is basically useless. Sometimes code is interpreted which gives you no info and even when it's compiled it's usually as DynamicMethod's which don't have debugging info associated with them. If you enable debug mode though (-X:Debug from the command line or setting DebugMode on a ScriptRuntimeSetup) then you'll at least get some .py file line numbers in all the noise. But there's also lots of other frames which show up from the DLR and IronPython infrastructure which makes it confusing. If the code isn't hosted and you're getting this exception from pure Python code then it'd be a bug. One thing to watch out for is if you've done from System import * then "except Exception, e:" will give you the .NET exception object. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Count L?szl? de Alm?sy > Sent: Wednesday, August 12, 2009 8:20 PM > To: Discussion of IronPython > Subject: [IronPython] help with an IPy traceback > > i'm still getting used to the tracebacks that IPy / .NET produces. I'm > used to CPython always telling me which line of code to look for the > problem at. Is there a way to find where in my .py program the source > of this problem lies? It looks like gobbledegook to me: > > 2009-08-12 20:11:51,782 [XML-RPC Login] ERROR - > System.MissingMemberException: Parcel instance has no attribute > 'client' > at (wrapper dynamic-method) object._stub_$231##142 > (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Scripting.Actions > .CallSite,object,Microsoft.Scripting.Runtime.CodeContex > t) <0x0017b> > at Microsoft.Scripting.Actions.MatchCaller.Call2 Microsoft.Scripting.Runtime.CodeContext, object> > (Microsoft.Func`4 Microso > ft.Scripting.Runtime.CodeContext, > object>,Microsoft.Scripting.Actions.CallSite,object[]) <0x00093> > at (wrapper static-rgctx-invoke) > Microsoft.Scripting.Actions.MatchCaller.static_rgctx_invoke_object_Func > `4 object, CodeContext, object>_CallSite_object[] (Microsoft.Fu > nc`4 Microsoft.Scripting.Runtime.CodeContext, > object>,Microsoft.Scripting.Actions.CallSite,object[]) <0x0002b> > at > Microsoft.Scripting.Actions.CallSite`1 ting.Actions.CallSite, > object, Microsoft.Scripting.Runtime.CodeContext, > object>>.UpdateAndExecute (obje > ct[]) <0x005ea> > at > Microsoft.Scripting.Actions.UpdateDelegates.Update2 crosoft.Scripting.Actions.CallSite, > object, Microsoft.Scripting.Runtime.CodeContext, object>, object, M > icrosoft.Scripting.Runtime.CodeContext, object> > (Microsoft.Scripting.Actions.CallSite,object,Microsoft.Scripting.Runtim > e.CodeContext) > <0x0008b> > at (wrapper static-rgctx-invoke) > Microsoft.Scripting.Actions.UpdateDelegates.static_rgctx_invoke_object_ > CallSite_object_CodeContext > (Microsoft.Scripting.Actions.CallSite,object, > Microsoft.Scripting.Runtime.CodeContext) <0x0002b> > at S$3._Network_OnConnected$23 > (Microsoft.Runtime.CompilerServices.Closure,object,object) <0x0010b> > at (wrapper dynamic-method) object._stub_$230##141 > (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Scripting.Actions > .CallSite,Microsoft.Scripting.Runtime.CodeContext,objec > t,object,object) <0x0018e> > at (wrapper dynamic-method) object._stub_$229##140 > (Microsoft.Runtime.CompilerServices.Closure,Microsoft.Scripting.Actions > .CallSite,object,object) > <0x00170> > at Microsoft.Scripting.Actions.MatchCaller.Call2 object> (Microsoft.Func`4 object, object, object>,Microsoft.Scripting.Acti > ons.CallSite,object[]) <0x00093> > at (wrapper static-rgctx-invoke) > Microsoft.Scripting.Actions.MatchCaller.static_rgctx_invoke_object_Func > `4 object, object, object>_CallSite_object[] (Microsoft.Func`4< > Microsoft.Scripting.Actions.CallSite, object, object, > object>,Microsoft.Scripting.Actions.CallSite,object[]) <0x0002b> > at > Microsoft.Scripting.Actions.CallSite`1 ting.Actions.CallSite, > object, object, object>>.UpdateAndExecute (object[]) <0x00444> > at > Microsoft.Scripting.Actions.UpdateDelegates.Update2 crosoft.Scripting.Actions.CallSite, > object, object, object>, object, object, object> (Microsoft.Scripti > ng.Actions.CallSite,object,object) <0x0008b> > at (wrapper static-rgctx-invoke) > Microsoft.Scripting.Actions.UpdateDelegates.static_rgctx_invoke_object_ > CallSite_object_object > (Microsoft.Scripting.Actions.CallSite,object,objec > t) <0x0002b> > at (wrapper dynamic-method) object.System.Void(Object) > (object[],object) <0x00062> > at (wrapper delegate-invoke) > OpenMetaverse.NetworkManager/ConnectedCallback.invoke_void__this___obje > ct > (object) <0x0004f> > at OpenMetaverse.NetworkManager.LoginReplyXmlRpcHandler > (Nwc.XmlRpc.XmlRpcResponse,OpenMetaverse.LoginParams) <0x00954> > > -- > Cheers, L?szl? > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From alexander2006 at gmail.com Thu Aug 13 15:20:18 2009 From: alexander2006 at gmail.com (Alexander Mail) Date: Thu, 13 Aug 2009 15:20:18 +0200 Subject: [IronPython] IronPython and DataRow Message-ID: <789ECD73-4A4F-4470-924C-2283C5E182E1@gmail.com> Hi, I'm new in IronPython programming. I try to build a simple project that use DataSet/DataTable/DataRow. But when I add a DataRow with this code: mydatar = DataRow() my program crash. Any ideas? Thanks Marco From fuzzyman at voidspace.org.uk Thu Aug 13 15:28:26 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 13 Aug 2009 14:28:26 +0100 Subject: [IronPython] IronPython and DataRow In-Reply-To: <789ECD73-4A4F-4470-924C-2283C5E182E1@gmail.com> References: <789ECD73-4A4F-4470-924C-2283C5E182E1@gmail.com> Message-ID: <4A8414FA.3000009@voidspace.org.uk> This class has no public constructors - you aren't intended to construct it directly. See the documentation for details: http://msdn.microsoft.com/en-us/library/system.data.datarow.aspx To create a new DataRow, use the NewRow method of the DataTable object. After creating a new DataRow, use the Add method to add the new DataRow to the DataRowCollection. Michael Alexander Mail wrote: > Hi, > I'm new in IronPython programming. I try to build a simple project > that use DataSet/DataTable/DataRow. > But when I add a DataRow with this code: > > mydatar = DataRow() > > my program crash. > > Any ideas? > > Thanks > > Marco > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From merllab at microsoft.com Thu Aug 13 17:52:37 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Thu, 13 Aug 2009 08:52:37 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <7d11c5ba-5dd1-4998-ab09-3c864a1158d9@tk5-exsmh-c102.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/58019. ADDED SOURCES $/IronPython/IronPython_Main/Src/Tests/modules/_bytesio_test.py $/IronPython/IronPython_Main/Src/Tests/modules/_warnings_test.py $/IronPython/IronPython_Main/Src/IronPython/Compiler/RunnableScriptCode.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Tests/modules/_bytesio_test.py $/IronPython/IronPython_Main/Src/Tests/modules/_warnings_test.py $/IronPython/IronPython_Main/Src/IronPython/Compiler/RunnableScriptCode.cs $/IronPython/IronPython_Main/Src/IronPython/Modules/Builtin.cs $/IronPython/IronPython_Main/Src/IronPython/Modules/sys.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Runtime/DynamicOperations.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/DynamicSiteHelper.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Generation/DelegateHelpers.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/DefaultBinder.SetMember.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Generation/Snippets.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Utils/ReflectionUtils.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/PythonScriptCode.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/SavableGlobalAllocator.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/SavableScriptCode.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/RuntimeScriptCode.cs $/IronPython/IronPython_Main/Src/Tests/versions/python26.py $/IronPython/IronPython_Main/Src/IronPython/Lib/iptest/assert_util.py $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonGetMemberBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonSetMemberBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/OnDiskScriptCode.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/MetaPythonFunction.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/FunctionCode.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonFunction.cs $/IronPython/IronPython_Main/Src/Tests/test_nt.py $/IronPython/IronPython_Main/Src/Tests/test_sys.py $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/FloatOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_Main/Src/IronPythonTest/EngineTest.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/nt.cs $/IronPython/IronPython_Main/Src/Tests/test_builtinfunc.py $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/WithStatement.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/PythonAst.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/FunctionDefinition.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/ClassDefinition.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/AstGenerator.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Tokenizer.cs $/IronPython/IronPython_Main/Src/IronPython/IronPython.csproj CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1055274 Date: 8/12/2009 5:58:57 PM (dfugate) Added test file for _bytesio, and filed on http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=24303. (Shelveset: COV03;REDMOND\dfugate | SNAP CheckinId: 9132) -------------------------------------------------------------------------------- Changeset Id: 1055146 Date: 8/12/2009 4:44:35 PM (dfugate) Moved _warnings tests from python26.py to _warnings_test.py after a moderate refactoring. Filed one bug. Added more test cases for nt.stat_result (our code coverage run detected most operators were not being hit). Filed a handful of bugs. (Shelveset: COV02;REDMOND\dfugate | SNAP CheckinId: 9129) From dinov at microsoft.com Thu Aug 13 19:11:28 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 13 Aug 2009 17:11:28 +0000 Subject: [IronPython] IronPython 2.6 RC1 must fix bugs Message-ID: <1A472770E042064698CB5ADC83A12ACD0380BA27@TK5EX14MBXC116.redmond.corp.microsoft.com> As we're winding down towards RC1 and I wanted to do one last check to see if there's a must-fix bug that we've somehow missed. Based upon our own triage, the number of votes, etc... it's entirely possible that we've de-prioritized an important bug that might enable a new scenario, make an existing scenario work better or easier, or just generally make IronPython more enjoyable for your day to day use. So please let us know if you have a bug that you think we should go back and take a second look at fixing now rather than later. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From loocas at duber.cz Thu Aug 13 19:14:58 2009 From: loocas at duber.cz (Lukas Dubeda) Date: Thu, 13 Aug 2009 19:14:58 +0200 Subject: [IronPython] Using IronPython as an assembly in dotNET Message-ID: <4A844A12.5020408@duber.cz> Hi there everyone, I have a problem I can't seem to figure out. I want to use IronPython as an assembly via dotNET, I managed to load it as an assembly and access various constructors, classes etc... However, I have a problem with executing Python code from the host application. I'm using 3ds Max to load up the assembly via dotNET. The code looks like this: Assembly = dotNetClass "System.Reflection.Assembly" -- loading the assembly class Assembly.LoadFrom "C:\IronPython-2.0.1\IronPython.dll" -- loading IronPython ironPythonHosting = dotNetClass "IronPython.Hosting.Python" -- loading the hosting class pythonEngine = ironPythonHosting.CreateEngine() -- creating an engine Now, when I execute: pythonEngine.ExecuteFile("C:\\tst.py") it runs smoothly and executes the tst.py and whatever Python code that's inside. Now, I want to execute the code directly, not via a saved file. I tried this: pythonEngine.Execute("print 'TEST'") but it throws me an error: -- Error occurred in anonymous codeblock; filename: ; position: 344 -- Runtime error: dotNet runtime exception: Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true. Also, if I execute the Python code inside a file, is there a way to get the result/feedback from the code back to the host application? Via dotNET or IronPython? Or anyhow? So that I can write more complex tools that'd communicate with Pyhon code from within 3ds Max. Thanks a lot in advance, cheers, - Lukas Dubeda From dinov at microsoft.com Thu Aug 13 19:34:56 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 13 Aug 2009 17:34:56 +0000 Subject: [IronPython] Using IronPython as an assembly in dotNET In-Reply-To: <4A844A12.5020408@duber.cz> References: <4A844A12.5020408@duber.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD0380BC68@TK5EX14MBXC116.redmond.corp.microsoft.com> What language are you doing this from? ScriptEngine.Execute has an overload which is generic and an overload which is not generic. The generic version will get the result and convert it to the provided generic type. It looks like for some reason you end up trying to call the generic version here. Does the language have support for generics? If so you could do: engine.Execute(...) (C# syntax) which would be the same as the non-generic version. For communication I'd suggest injecting a class into the ScriptScope You execute the code in. Then the Python code can call back on it or subscribe to events on it. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Lukas Dubeda > Sent: Thursday, August 13, 2009 10:15 AM > To: users at lists.ironpython.com > Subject: [IronPython] Using IronPython as an assembly in dotNET > > Hi there everyone, > > I have a problem I can't seem to figure out. > > I want to use IronPython as an assembly via dotNET, I managed to load > it > as an assembly and access various constructors, classes etc... > > However, I have a problem with executing Python code from the host > application. I'm using 3ds Max to load up the assembly via dotNET. The > code looks like this: > > Assembly = dotNetClass "System.Reflection.Assembly" -- loading the > assembly class > Assembly.LoadFrom "C:\IronPython-2.0.1\IronPython.dll" -- loading > IronPython > > ironPythonHosting = dotNetClass "IronPython.Hosting.Python" -- loading > the hosting class > pythonEngine = ironPythonHosting.CreateEngine() -- creating an engine > > Now, when I execute: > > pythonEngine.ExecuteFile("C:\\tst.py") > > it runs smoothly and executes the tst.py and whatever Python code > that's > inside. > > Now, I want to execute the code directly, not via a saved file. I tried > this: > > pythonEngine.Execute("print 'TEST'") > > but it throws me an error: > > -- Error occurred in anonymous codeblock; filename: ; position: 344 > -- Runtime error: dotNet runtime exception: Late bound operations > cannot > be performed on types or methods for which ContainsGenericParameters is > true. > > Also, if I execute the Python code inside a file, is there a way to get > the result/feedback from the code back to the host application? Via > dotNET or IronPython? Or anyhow? So that I can write more complex tools > that'd communicate with Pyhon code from within 3ds Max. > > Thanks a lot in advance, cheers, > > - Lukas Dubeda > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From loocas at duber.cz Thu Aug 13 19:42:23 2009 From: loocas at duber.cz (Lukas Dubeda) Date: Thu, 13 Aug 2009 19:42:23 +0200 Subject: [IronPython] Using IronPython as an assembly in dotNET In-Reply-To: <1A472770E042064698CB5ADC83A12ACD0380BC68@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A844A12.5020408@duber.cz> <1A472770E042064698CB5ADC83A12ACD0380BC68@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A84507F.7080904@duber.cz> Hey, thanks Dino, some interesting points. However, I'm not a programmer, I'm more of a "scripter" so all I'm familiar with is Python and MAXScript (native 3ds Max scripting language). I have no idea how to access the generic/non-generic engine, further more, I have no idea what the difference is. As for scope, I can do that, the problem is, I have no idea how exactly to do that. Is there a documentation on this subject somewhere? Thanks a lot for the tips, I appretiate it. - Lukas Dino Viehland wrote: > What language are you doing this from? > > ScriptEngine.Execute has an overload which is generic and an overload > which is not generic. The generic version will get the result and > convert it to the provided generic type. It looks like for some reason > you end up trying to call the generic version here. Does the language > have support for generics? If so you could do: > > engine.Execute(...) (C# syntax) > > which would be the same as the non-generic version. > > For communication I'd suggest injecting a class into the ScriptScope > You execute the code in. Then the Python code can call back on it or > subscribe to events on it. > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Lukas Dubeda >> Sent: Thursday, August 13, 2009 10:15 AM >> To: users at lists.ironpython.com >> Subject: [IronPython] Using IronPython as an assembly in dotNET >> >> Hi there everyone, >> >> I have a problem I can't seem to figure out. >> >> I want to use IronPython as an assembly via dotNET, I managed to load >> it >> as an assembly and access various constructors, classes etc... >> >> However, I have a problem with executing Python code from the host >> application. I'm using 3ds Max to load up the assembly via dotNET. The >> code looks like this: >> >> Assembly = dotNetClass "System.Reflection.Assembly" -- loading the >> assembly class >> Assembly.LoadFrom "C:\IronPython-2.0.1\IronPython.dll" -- loading >> IronPython >> >> ironPythonHosting = dotNetClass "IronPython.Hosting.Python" -- loading >> the hosting class >> pythonEngine = ironPythonHosting.CreateEngine() -- creating an engine >> >> Now, when I execute: >> >> pythonEngine.ExecuteFile("C:\\tst.py") >> >> it runs smoothly and executes the tst.py and whatever Python code >> that's >> inside. >> >> Now, I want to execute the code directly, not via a saved file. I tried >> this: >> >> pythonEngine.Execute("print 'TEST'") >> >> but it throws me an error: >> >> -- Error occurred in anonymous codeblock; filename: ; position: 344 >> -- Runtime error: dotNet runtime exception: Late bound operations >> cannot >> be performed on types or methods for which ContainsGenericParameters is >> true. >> >> Also, if I execute the Python code inside a file, is there a way to get >> the result/feedback from the code back to the host application? Via >> dotNET or IronPython? Or anyhow? So that I can write more complex tools >> that'd communicate with Pyhon code from within 3ds Max. >> >> Thanks a lot in advance, cheers, >> >> - Lukas Dubeda >> _______________________________________________ >> 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 > > __________ Information from ESET NOD32 Antivirus, version of virus signature database 4332 (20090813) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com > > > > From dinov at microsoft.com Thu Aug 13 19:58:32 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 13 Aug 2009 17:58:32 +0000 Subject: [IronPython] Using IronPython as an assembly in dotNET In-Reply-To: <4A84507F.7080904@duber.cz> References: <4A844A12.5020408@duber.cz> <1A472770E042064698CB5ADC83A12ACD0380BC68@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A84507F.7080904@duber.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD0380BE64@TK5EX14MBXC116.redmond.corp.microsoft.com> There's documentation on the hosting APIs over here: http://dlr.codeplex.com/Wiki/View.aspx?title=Docs%20and%20specs But basically you want to do: scope = engine.CreateScope() scope.SetVariable("my_object_model", new MyObjectModel()) engine.Execute("print my_object_model.SomeCall()", scope) As a workaround for Execute you can call ExecuteAndWrap which doesn't have a generic overload. You'll just need to call .Unwrap() on the resulting value to get the real object back. A quick search seems to indicate that MaxScript 9 doesn't support generics. I have no clue what the latest version is though so I'm not sure how relevant that was (it was from 2006). > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Lukas Dubeda > Sent: Thursday, August 13, 2009 10:42 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Using IronPython as an assembly in dotNET > > Hey, thanks Dino, > > some interesting points. However, I'm not a programmer, I'm more of a > "scripter" so all I'm familiar with is Python and MAXScript (native 3ds > Max scripting language). > > I have no idea how to access the generic/non-generic engine, further > more, I have no idea what the difference is. > > As for scope, I can do that, the problem is, I have no idea how exactly > to do that. Is there a documentation on this subject somewhere? > > Thanks a lot for the tips, I appretiate it. > > - Lukas > > Dino Viehland wrote: > > What language are you doing this from? > > > > ScriptEngine.Execute has an overload which is generic and an overload > > which is not generic. The generic version will get the result and > > convert it to the provided generic type. It looks like for some > reason > > you end up trying to call the generic version here. Does the > language > > have support for generics? If so you could do: > > > > engine.Execute(...) (C# syntax) > > > > which would be the same as the non-generic version. > > > > For communication I'd suggest injecting a class into the ScriptScope > > You execute the code in. Then the Python code can call back on it or > > subscribe to events on it. > > > > > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > >> bounces at lists.ironpython.com] On Behalf Of Lukas Dubeda > >> Sent: Thursday, August 13, 2009 10:15 AM > >> To: users at lists.ironpython.com > >> Subject: [IronPython] Using IronPython as an assembly in dotNET > >> > >> Hi there everyone, > >> > >> I have a problem I can't seem to figure out. > >> > >> I want to use IronPython as an assembly via dotNET, I managed to > load > >> it > >> as an assembly and access various constructors, classes etc... > >> > >> However, I have a problem with executing Python code from the host > >> application. I'm using 3ds Max to load up the assembly via dotNET. > The > >> code looks like this: > >> > >> Assembly = dotNetClass "System.Reflection.Assembly" -- loading the > >> assembly class > >> Assembly.LoadFrom "C:\IronPython-2.0.1\IronPython.dll" -- loading > >> IronPython > >> > >> ironPythonHosting = dotNetClass "IronPython.Hosting.Python" -- > loading > >> the hosting class > >> pythonEngine = ironPythonHosting.CreateEngine() -- creating an > engine > >> > >> Now, when I execute: > >> > >> pythonEngine.ExecuteFile("C:\\tst.py") > >> > >> it runs smoothly and executes the tst.py and whatever Python code > >> that's > >> inside. > >> > >> Now, I want to execute the code directly, not via a saved file. I > tried > >> this: > >> > >> pythonEngine.Execute("print 'TEST'") > >> > >> but it throws me an error: > >> > >> -- Error occurred in anonymous codeblock; filename: ; position: 344 > >> -- Runtime error: dotNet runtime exception: Late bound operations > >> cannot > >> be performed on types or methods for which ContainsGenericParameters > is > >> true. > >> > >> Also, if I execute the Python code inside a file, is there a way to > get > >> the result/feedback from the code back to the host application? Via > >> dotNET or IronPython? Or anyhow? So that I can write more complex > tools > >> that'd communicate with Pyhon code from within 3ds Max. > >> > >> Thanks a lot in advance, cheers, > >> > >> - Lukas Dubeda > >> _______________________________________________ > >> 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 > > > > __________ Information from ESET NOD32 Antivirus, version of virus > signature database 4332 (20090813) __________ > > > > The message was checked by ESET NOD32 Antivirus. > > > > http://www.eset.com > > > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From loocas at duber.cz Thu Aug 13 20:48:38 2009 From: loocas at duber.cz (Lukas Dubeda) Date: Thu, 13 Aug 2009 20:48:38 +0200 Subject: [IronPython] Using IronPython as an assembly in dotNET In-Reply-To: <1A472770E042064698CB5ADC83A12ACD0380BE64@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A844A12.5020408@duber.cz> <1A472770E042064698CB5ADC83A12ACD0380BC68@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A84507F.7080904@duber.cz> <1A472770E042064698CB5ADC83A12ACD0380BE64@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A846006.8070305@duber.cz> Thanks again, I'll dig into the documentation and see if I can come up with a solution. As for "generics", since I have no idea what these are and I know MAXScript quite well, I assume they really don't exist in this language. MXS is a very simple, focused, language that only works within 3ds Max. It wasn't intented for such broad use as Python for example. Cheers, - Lukas Dino Viehland wrote: > There's documentation on the hosting APIs over here: > > http://dlr.codeplex.com/Wiki/View.aspx?title=Docs%20and%20specs > > But basically you want to do: > > scope = engine.CreateScope() > scope.SetVariable("my_object_model", new MyObjectModel()) > engine.Execute("print my_object_model.SomeCall()", scope) > > As a workaround for Execute you can call ExecuteAndWrap which > doesn't have a generic overload. You'll just need to call > .Unwrap() on the resulting value to get the real object back. > > A quick search seems to indicate that MaxScript 9 doesn't > support generics. I have no clue what the latest version is > though so I'm not sure how relevant that was (it was from 2006). > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Lukas Dubeda >> Sent: Thursday, August 13, 2009 10:42 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Using IronPython as an assembly in dotNET >> >> Hey, thanks Dino, >> >> some interesting points. However, I'm not a programmer, I'm more of a >> "scripter" so all I'm familiar with is Python and MAXScript (native 3ds >> Max scripting language). >> >> I have no idea how to access the generic/non-generic engine, further >> more, I have no idea what the difference is. >> >> As for scope, I can do that, the problem is, I have no idea how exactly >> to do that. Is there a documentation on this subject somewhere? >> >> Thanks a lot for the tips, I appretiate it. >> >> - Lukas >> >> Dino Viehland wrote: >>> What language are you doing this from? >>> >>> ScriptEngine.Execute has an overload which is generic and an overload >>> which is not generic. The generic version will get the result and >>> convert it to the provided generic type. It looks like for some >> reason >>> you end up trying to call the generic version here. Does the >> language >>> have support for generics? If so you could do: >>> >>> engine.Execute(...) (C# syntax) >>> >>> which would be the same as the non-generic version. >>> >>> For communication I'd suggest injecting a class into the ScriptScope >>> You execute the code in. Then the Python code can call back on it or >>> subscribe to events on it. >>> >>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> bounces at lists.ironpython.com] On Behalf Of Lukas Dubeda >>>> Sent: Thursday, August 13, 2009 10:15 AM >>>> To: users at lists.ironpython.com >>>> Subject: [IronPython] Using IronPython as an assembly in dotNET >>>> >>>> Hi there everyone, >>>> >>>> I have a problem I can't seem to figure out. >>>> >>>> I want to use IronPython as an assembly via dotNET, I managed to >> load >>>> it >>>> as an assembly and access various constructors, classes etc... >>>> >>>> However, I have a problem with executing Python code from the host >>>> application. I'm using 3ds Max to load up the assembly via dotNET. >> The >>>> code looks like this: >>>> >>>> Assembly = dotNetClass "System.Reflection.Assembly" -- loading the >>>> assembly class >>>> Assembly.LoadFrom "C:\IronPython-2.0.1\IronPython.dll" -- loading >>>> IronPython >>>> >>>> ironPythonHosting = dotNetClass "IronPython.Hosting.Python" -- >> loading >>>> the hosting class >>>> pythonEngine = ironPythonHosting.CreateEngine() -- creating an >> engine >>>> Now, when I execute: >>>> >>>> pythonEngine.ExecuteFile("C:\\tst.py") >>>> >>>> it runs smoothly and executes the tst.py and whatever Python code >>>> that's >>>> inside. >>>> >>>> Now, I want to execute the code directly, not via a saved file. I >> tried >>>> this: >>>> >>>> pythonEngine.Execute("print 'TEST'") >>>> >>>> but it throws me an error: >>>> >>>> -- Error occurred in anonymous codeblock; filename: ; position: 344 >>>> -- Runtime error: dotNet runtime exception: Late bound operations >>>> cannot >>>> be performed on types or methods for which ContainsGenericParameters >> is >>>> true. >>>> >>>> Also, if I execute the Python code inside a file, is there a way to >> get >>>> the result/feedback from the code back to the host application? Via >>>> dotNET or IronPython? Or anyhow? So that I can write more complex >> tools >>>> that'd communicate with Pyhon code from within 3ds Max. >>>> >>>> Thanks a lot in advance, cheers, >>>> >>>> - Lukas Dubeda >>>> _______________________________________________ >>>> 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 >>> >>> __________ Information from ESET NOD32 Antivirus, version of virus >> signature database 4332 (20090813) __________ >>> The message was checked by ESET NOD32 Antivirus. >>> >>> http://www.eset.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 > > __________ Information from ESET NOD32 Antivirus, version of virus signature database 4332 (20090813) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com > > > > From merllab at microsoft.com Fri Aug 14 17:53:15 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Fri, 14 Aug 2009 08:53:15 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <2477b2f5-8f50-4bd5-ae9a-ed12722093cf@tk5-exsmh-c101.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/58073. ADDED SOURCES $/IronPython/IronPython_Main/Src/Tests/modules/_fileio_test.py $/IronPython/IronPython_Main/Src/Tests/modules/array_test.py MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Tests/modules/_fileio_test.py $/IronPython/IronPython_Main/Src/Tests/modules/array_test.py $/IronPython/IronPython_Main/Src/Tests/test_array.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1057438 Date: 8/13/2009 4:18:50 PM (dfugate) - test_array.py is now a pure System.Array test. All array.array test cases have been moved to modules.array_test - added some test cases for _fileio and filed a handful of bugs (Shelveset: COV04;REDMOND\dfugate | SNAP CheckinId: 9143) From ctrachte at gmail.com Sat Aug 15 07:24:12 2009 From: ctrachte at gmail.com (Carl Trachte) Date: Fri, 14 Aug 2009 23:24:12 -0600 Subject: [IronPython] Career in IronPython In-Reply-To: References: Message-ID: <426ada670908142224l4e4bc538xd8af9be9f893ad9d@mail.gmail.com> On Wed, Aug 12, 2009 at 2:24 PM, Pratik Joshi wrote: > Hi All, > > I'm a newbie in IronPython. I've got an interest to learn and work in > IronPython. > > Can anyone suggest me about the scope in IronPython and developing career in > it? > > I'm a software engineer and have 3 years of professional experience in .NET. > So how would it be for me to put my shoes in IronPython? > > Thanks > Pratik. > > ________________________________ > Are you an untamed, bizarre or daring explorer? Find out now! Drag n' drop > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > Python isn't that hard to learn, at least not the basics. The tutorial on the python.org website is a good place to start. The IronPython downloads are free. It's reall a matter of installing the interpreter and starting to test things. I you're a dot Net developer, you can prototype things more quickly and easily and interactively with IronPython. Most of the common dot Net libraries work with the IronPython implementation. Now, for your real question - jobs/career. I surf the job boards pretty frequently just to see what's going on and how people are using Python. I've seen at least one job posted a number of months back in New York City in the financial sector. It referred to a third party app with a Python API. I assumed (perhaps falsely) that the app was the Resolver spreadsheet, because the company that makes it does target the stock market sector. I believe you can still download the base Resolver product for free for non-commercial use (basically to learn it). The short on learning IronPython or IronRuby or any other dynamic language is that you're really learning the language, not just the dot Net implementation of it. IronPython gets more and more consistent with the main Python implementation (CPython) with each release. Even now, Python programmers are still hard to come by. My one boss referred to them as being "so darn hard to find." So, IronPython or jython or PyPy or just plain Python - it's not a bad skill to have. My two cents. Hope this helps. Carl T. From fuzzyman at voidspace.org.uk Sun Aug 16 16:04:42 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 16 Aug 2009 15:04:42 +0100 Subject: [IronPython] Career in IronPython In-Reply-To: References: Message-ID: <4A8811FA.4050402@voidspace.org.uk> Pratik Joshi wrote: > Hi All, > > I'm a newbie in IronPython. I've got an interest to learn and work in > IronPython. > > Can anyone suggest me about the scope in IronPython and developing > career in it? > > I'm a software engineer and have 3 years of professional experience in > .NET. So how would it be for me to put my shoes in IronPython? Jobs in Python are growing steadily. IronPython is also growing in adoption, especially in companies that were already using a mix of C# and Python - IronPython is an obvious fit. Despite this I've not seen many jobs specifically asking for IronPython developers. My guess is that they know that developers with *either* Python experience or .NET experience will find IronPython easy. All the best, Michael Foord > > Thanks > Pratik. > > ------------------------------------------------------------------------ > Are you an untamed, bizarre or daring explorer? Find out now! Drag n' > drop > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From Harry.Pierson at microsoft.com Sun Aug 16 17:21:52 2009 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Sun, 16 Aug 2009 15:21:52 +0000 Subject: [IronPython] Wiki Editor Role Message-ID: <6B5AE3B08809CC47A81ACBF99E2690F514ACC3C4@TK5EX14MBXC104.redmond.corp.microsoft.com> FYI, the CodePlex team pushed out a new release last week [1] that includes Wiki Editor permissions. As I blogged [2], we're going to give out wiki editor permissions to anyone who asks for them. Note, however, that being a wiki editor means you can't rate releases. If you're interested, please drop me a line (harry.pierson at microsoft.com). Harry [1] http://blogs.msdn.com/codeplex/archive/2009/08/14/donate-ad-revenue-to-charity-and-new-editor-role.aspx [2] http://devhawk.net/2009/08/16/CodePlex+Editor+Role.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From boris_aronshtam at vdptech.com Mon Aug 17 00:30:30 2009 From: boris_aronshtam at vdptech.com (Boris Aronshtam) Date: Sun, 16 Aug 2009 15:30:30 -0700 Subject: [IronPython] Controling DLR/IronPython Memory Size In-Reply-To: <426ada670908142224l4e4bc538xd8af9be9f893ad9d@mail.gmail.com> References: <426ada670908142224l4e4bc538xd8af9be9f893ad9d@mail.gmail.com> Message-ID: <004d01ca1ec1$2a0a25f0$7e1e71d0$@com> I am developing a C# app and considering to embed IronPython scripting. Using TaskManager, I have noticed that - the minimal C# ConsoleApp that includes DLR and IronPython is 8.7MB in RAM - while the minimal C# ConsoleApp that does not include DLR and IronPython is only 1.5MB in RAM Unfortunately extra 7MB in RAM is too much to justify scripting. Is there any idea what this 7MB is used for? And more importantly, does anyone know how to reduce the RAM size? Thanks! From pavel.suhotjuk at gmail.com Mon Aug 17 10:19:03 2009 From: pavel.suhotjuk at gmail.com (Pavel Suhotyuk) Date: Mon, 17 Aug 2009 11:19:03 +0300 Subject: [IronPython] InvokeMember with three or more parameters. Message-ID: <4A891277.4060007@gmail.com> Hello. I have Python code: class Broker ( object ) : def validation( self, info, provider_manager ): pass def check( self, payment, payment_manager, provider_manager ): pass and try to call methods by this c# code: operations = scriptEngine.CreateOperations(); var scriptSource = scriptEngine.CreateScriptSourceFromString(script,SourceCodeKind.Statements); scriptCode = scriptSource.Compile(); scriptCode.Execute(); scriptScope = scriptCode.DefaultScope; broker = scriptEngine.Execute(string.Format("{0}()","Broker"),scriptScope); bool validationResult = operations.InvokeMember(broker, "validation", paymentInfo, providerManager); operations.InvokeMember(broker, "check", payment, paymentManager, providerManager); Invoke validation method is success, but invoke check method throws NotImplementedException with stack trace: System.NotImplementedException: Method or operation not implemented. ? Microsoft.Scripting.Runtime.DynamicOperations.InvokeMember(Object obj, String memberName, Boolean ignoreCase, Object[] parameters) ? Microsoft.Scripting.Hosting.ObjectOperations.InvokeMember(Object obj, String memberName, Object[] parameters) Looks like 2 paramters called correct, but more than 2 throws exception in all cases. Why it happens? -- Best regards, Suhotjuk Pavel Sergeevich From merllab at microsoft.com Mon Aug 17 17:53:12 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 17 Aug 2009 08:53:12 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/58205. ADDED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/IComConvertible.cs $/IronPython/IronPython_Main/Src/Tests/debugging $/IronPython/IronPython_Main/Src/Tests/debugging/__init__.py $/IronPython/IronPython_Main/Src/Tests/debugging/mdbg_tool $/IronPython/IronPython_Main/Src/Tests/debugging/mdbg_tool/__init__.py $/IronPython/IronPython_Main/Src/Tests/debugging/pdb_mod $/IronPython/IronPython_Main/Src/Tests/debugging/pdb_mod/__init__.py $/IronPython/IronPython_Main/Src/Tests/debugging/vs $/IronPython/IronPython_Main/Src/Tests/debugging/vs/__init__.py $/IronPython/IronPython_Main/Src/Tests/plans/debugging.html $/IronPython/IronPython_Main/Src/Tests/plans/debugging.mdbg_tool.html $/IronPython/IronPython_Main/Src/Tests/plans/debugging.pdb_mod.html $/IronPython/IronPython_Main/Src/Tests/plans/debugging.vs.html MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Compiler/RunnableScriptCode.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/BindingHelpers.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/re.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/marshal.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/ScopeStatement.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/Parameter.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/FunctionDefinition.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/ClassDefinition.cs $/IronPython/IronPython_Main/Src/IronPython/IronPython.csproj $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/IComConvertible.cs $/IronPython/IronPython_Main/Src/Tests/debugging/__init__.py $/IronPython/IronPython_Main/Src/IronPython/Runtime/DontMapGetMemberNamesToDirAttribute.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonGetIndexBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonSetIndexBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonOperationBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonInvokeBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonSetMemberBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/CompatibilityInvokeBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/FunctionCode.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/InstanceOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/StringFormatter.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonBuffer.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Importer.cs $/IronPython/IronPython_Main/Src/Tests/debugging/mdbg_tool/__init__.py $/IronPython/IronPython_Main/Src/Tests/debugging/pdb_mod/__init__.py $/IronPython/IronPython_Main/Src/Tests/debugging/vs/__init__.py $/IronPython/IronPython_Main/Src/Tests/plans/debugging.html $/IronPython/IronPython_Main/Src/Tests/plans/debugging.mdbg_tool.html $/IronPython/IronPython_Main/Src/Tests/plans/debugging.pdb_mod.html $/IronPython/IronPython_Main/Src/Tests/plans/debugging.vs.html $/IronPython/IronPython_Main/Src/Tests/test_function.py $/IronPython/IronPython_Main/Src/Tests/test_class.py $/IronPython/IronPython_Main/Src/Tests/test_importpkg.py $/IronPython/IronPython_Main/Src/Tests/test_set.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1061106 Date: 8/14/2009 11:35:37 AM (dfugate) Complete revamp of the IronPython debugging test plan which is now entirely in pydoc format. This will be used as a model for all future IronPython test plans on major features. Not very pretty to look at, but I will be investigating the use of Sphinx (http://sphinx.pocoo.org) in the near future. (Shelveset: DEBUG_PLAN;REDMOND\dfugate | SNAP CheckinId: 9150) -------------------------------------------------------------------------------- Changeset Id: 1060857 Date: 8/14/2009 9:33:53 AM (dinov) 18222 ADO parameter method .AppendChunk will not accept a python buffer Add IComConvertible interface. Whenever IronPython calls into the COM binder we attempt to apply our own COM conversions. PythonBuffer is the only supported COM conversion currently and it converts to a byte array. 14022 Floating point values incorrect on German Windows XP We are incorrectly using ?en-US? in the string formatter because it usually formats the same as Python does. But a user can modify the en-US locale and change the formatting which breaks IronPython?s formatting. So instead we should use the invariant culture. 15398 Most co_* attributes raise NotImplementedError Implements co_names, co_nlocals, and co_cellvars. Makes co_code return an empty string. Fixes co_varnames so it includes arguments & local variables. Adds a lot of doc comments to code objects. There?s some plumbing in ClassDefinition/FunctionDefinition/ScopeStatement so that we track the extra info and pass it to the creation of FunctionCode objects. 6277 Implement re.purge() Add a limited cache on RE_Pattern objects and implement re.purge which flushes the cache 21979 marshal.dumps works on subtypes of tuple, list, dict, set, frozenset Moving to an exact type test, and enabling the CPython test 20162 Error message misreports required number of args This is currently passing as expected, adding a test Fixes a regression caused by 20174. When importing from a package we still need to publish the child module into the parent package. Also tightens up the errors reporting when calling object.__new__/__init__. We were more lex than CPython before. (Shelveset: RC1BugsContinuedFinal;REDMOND\dinov | SNAP CheckinId: 9148) From dinov at microsoft.com Mon Aug 17 18:26:35 2009 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 17 Aug 2009 16:26:35 +0000 Subject: [IronPython] InvokeMember with three or more parameters. In-Reply-To: <4A891277.4060007@gmail.com> References: <4A891277.4060007@gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD03842A70@TK5EX14MBXC116.redmond.corp.microsoft.com> We haven't implemented support for more than 3 parameters :) In 2.6 I just fixed > 3 params for the Invoke case (not InvokeMember) and I can fix > 3 for InvokeMember/CreateInstance as well before 2.6 ships. The preferred way to do this though is to do a GetMember where T is a delegate type with > 3 paraemters. Then you can just invoke the delegate. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Pavel Suhotyuk > Sent: Monday, August 17, 2009 1:19 AM > To: Discussion of IronPython > Subject: [IronPython] InvokeMember with three or more parameters. > > Hello. > > I have Python code: > > class Broker ( object ) : > > def validation( self, info, provider_manager ): > pass > > def check( self, payment, payment_manager, provider_manager ): > pass > > and try to call methods by this c# code: > > operations = scriptEngine.CreateOperations(); > var scriptSource = > scriptEngine.CreateScriptSourceFromString(script,SourceCodeKind.Stateme > nts); > scriptCode = scriptSource.Compile(); > scriptCode.Execute(); > scriptScope = scriptCode.DefaultScope; > broker = > scriptEngine.Execute(string.Format("{0}()","Broker"),scriptScope); > > bool validationResult = operations.InvokeMember(broker, "validation", > paymentInfo, providerManager); > > operations.InvokeMember(broker, "check", payment, paymentManager, > providerManager); > > > Invoke validation method is success, but invoke check method throws > NotImplementedException with stack trace: > > System.NotImplementedException: Method or operation not implemented. > ? Microsoft.Scripting.Runtime.DynamicOperations.InvokeMember(Object > obj, String memberName, Boolean ignoreCase, Object[] parameters) > ? Microsoft.Scripting.Hosting.ObjectOperations.InvokeMember(Object > obj, String memberName, Object[] parameters) > > Looks like 2 paramters called correct, but more than 2 throws exception > in all cases. > > Why it happens? > > -- > Best regards, > Suhotjuk Pavel Sergeevich > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Mon Aug 17 18:41:10 2009 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 17 Aug 2009 16:41:10 +0000 Subject: [IronPython] Controling DLR/IronPython Memory Size In-Reply-To: <004d01ca1ec1$2a0a25f0$7e1e71d0$@com> References: <426ada670908142224l4e4bc538xd8af9be9f893ad9d@mail.gmail.com> <004d01ca1ec1$2a0a25f0$7e1e71d0$@com> Message-ID: <1A472770E042064698CB5ADC83A12ACD03842C26@TK5EX14MBXC116.redmond.corp.microsoft.com> What version of IronPython are you using? Have you ngen'd the binaries? Ngen will significantly reduce the amount of private working set IronPython uses. I assume you don't have a "site.py" or the standard library present or I think it'd probably be more. On my machine (some post-RC1 Windows 7 build) I see: C# Hello World: 1.5MB Private working set "ipy.exe -S" (IronPython 2.6B2, ngen'd binaries): 4.7MB private working set Giving us about 3.2MB to start up IronPython including its REPL. 2.6 certainly is better from a working set perspective than 2.0 is but the gains there are mainly for large applications. 2.6 should also see better WS on non-Vista platforms. This is because we've fixed the base addresses up to make sure that ngen'd binaries don't require being re-based when they get loaded. We haven't really focused on memory usage of hello world at all. But we'd welcome a bug on CodePlex to draw our attention to the problem. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Boris Aronshtam > Sent: Sunday, August 16, 2009 3:31 PM > To: 'Discussion of IronPython' > Subject: [IronPython] Controling DLR/IronPython Memory Size > > I am developing a C# app and considering to embed IronPython scripting. > Using TaskManager, I have noticed that > > - the minimal C# ConsoleApp that includes DLR and IronPython is 8.7MB > in RAM > - while the minimal C# ConsoleApp that does not include DLR and > IronPython > is only 1.5MB in RAM > > Unfortunately extra 7MB in RAM is too much to justify scripting. Is > there > any idea what this 7MB is used for? And more importantly, does anyone > know > how to reduce the RAM size? > > Thanks! > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From davidescobar1976 at gmail.com Mon Aug 17 21:05:37 2009 From: davidescobar1976 at gmail.com (David Escobar) Date: Mon, 17 Aug 2009 12:05:37 -0700 Subject: [IronPython] IronPython DLLs distributing Message-ID: <38ef96bd0908171205r6670a337la26f5a9ba1559544@mail.gmail.com> Hello everyone. What is the best way to distribute IronPython applications? I've seen that all the IronPython .dll files need to be in the same folder as the application .exe and the application .dll in order to run. Is it possible to install the IronPython .dll files in one common location for all applications to use? Or do they need to be distributed with every IronPython application? That would seem to be inefficient, especially since the .dlls increase the total size of the application. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Aug 17 21:48:21 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 17 Aug 2009 20:48:21 +0100 Subject: [IronPython] IronPython DLLs distributing In-Reply-To: <38ef96bd0908171205r6670a337la26f5a9ba1559544@mail.gmail.com> References: <38ef96bd0908171205r6670a337la26f5a9ba1559544@mail.gmail.com> Message-ID: <4A89B405.3040505@voidspace.org.uk> David Escobar wrote: > Hello everyone. What is the best way to distribute IronPython > applications? I've seen that all the IronPython .dll files need to be > in the same folder as the application .exe and the application .dll in > order to run. Is it possible to install the IronPython .dll files in > one common location for all applications to use? Or do they need to be > distributed with every IronPython application? That would seem to be > inefficient, especially since the .dlls increase the total size of the > application. > This is only the same problem as any .NET application distributing DLLs it depends on. The 'standard' solution is to install assemblies into the GAC. You could do this in your installer. Michael > Thanks. > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From davidescobar1976 at gmail.com Mon Aug 17 22:38:04 2009 From: davidescobar1976 at gmail.com (David Escobar) Date: Mon, 17 Aug 2009 13:38:04 -0700 Subject: [IronPython] IronPython DLLs distributing In-Reply-To: <4A89B405.3040505@voidspace.org.uk> References: <38ef96bd0908171205r6670a337la26f5a9ba1559544@mail.gmail.com> <4A89B405.3040505@voidspace.org.uk> Message-ID: <38ef96bd0908171338n59275a84x66a7be89cdf7be80@mail.gmail.com> Ah ok, I will do that. Thanks. On Mon, Aug 17, 2009 at 12:48 PM, Michael Foord wrote: > David Escobar wrote: > >> Hello everyone. What is the best way to distribute IronPython >> applications? I've seen that all the IronPython .dll files need to be in the >> same folder as the application .exe and the application .dll in order to >> run. Is it possible to install the IronPython .dll files in one common >> location for all applications to use? Or do they need to be distributed with >> every IronPython application? That would seem to be inefficient, especially >> since the .dlls increase the total size of the application. >> >> This is only the same problem as any .NET application distributing DLLs > it depends on. The 'standard' solution is to install assemblies into the > GAC. You could do this in your installer. > > Michael > > Thanks. >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > _______________________________________________ > 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 microsoft.com Tue Aug 18 00:10:07 2009 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 17 Aug 2009 22:10:07 +0000 Subject: [IronPython] [ANN]: IronPython 2.6 Beta 2 In-Reply-To: References: <7CEEC335D70FFE4B957737DDE836F51B01EA01@TK5EX14MBXC123.redmond.corp.microsoft.com> <4A68E577.5060705@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD036EF147@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD03844216@TK5EX14MBXC116.redmond.corp.microsoft.com> The fix for this is now checked in and pushed out to CodePlex. Thanks for pushing on this and providing the repro! From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vernon Cole Sent: Tuesday, August 11, 2009 2:53 PM To: Discussion of IronPython Subject: Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 Dino: Here is the repo. You were using ADODB.RecordSet. This is ADODB.Command. """exercise BINARY field bug""" _computername=".\SQLexpress" #or name of computer with SQL Server _databasename="Northwind" #or something else constr = r"Initial Catalog=%s; Data Source=%s; Provider=SQLOLEDB.1; Integrated Security=SSPI" \ %(_databasename, _computername) import System conn = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection")) connstr = constr #"driver={SQL Server};Server=localhost;Database=mydatabase;Initial Catalog=mydatabase;Trusted_Connection=True;" conn.ConnectionString = connstr conn.Open() operation = "INSERT INTO Table_1 (Test1) VALUES (?)" b = buffer('\x02\x03\x04\x05') print 'b=',repr(b) cmd = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Command")) cmd.ActiveConnection=conn cmd.CommandText=operation cmd.CommandType=1 #adCmdText cmd.Parameters.Refresh() p = cmd.Parameters.Item[0] p.AppendChunk(b) # this is the error line ra = System.Reference[int]() rs = cmd.Execute(ra) count = ra.Value print 'Returned rowcount=',count -- Vernon On Mon, Aug 3, 2009 at 5:33 PM, Dino Viehland > wrote: Ok, I've finally got SQL server setup in a reasonable state where I can try and repro this. This is what I'm trying to do. I have a database called "mydatabase" which contains a table "Table_1" which contains 1 column of type binary(4). I then attempt to do: import System conn = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.Connection")) connstr = "driver={SQL Server};Server=localhost;Database=mydatabase;Initial Catalog=mydatabase;Trusted_Connection=True;" conn.ConnectionString = connstr conn.Open() rs = System.Activator.CreateInstance(System.Type.GetTypeFromProgID("ADODB.RecordSet")) rs.Open("Table_2", conn, 1, 2, 2) # source, active connection, cursor type (adOpenKeyset), lock type (adLockPessimistic), CommmandType (adCmdTable) rs.AddNew() b = System.Array[System.Byte]((2,3,4,5)) x = rs['Test1'] x.AppendChunk(b) which fails with: EnvironmentError: System.Runtime.InteropServices.COMException (0x800A0C93): Operation is not allowed in this context. This is the same failure I get if I use Shri's proposed work around. Do you have any idea of what I'm doing wrong or any suggestions on how to tweak this to get the correct simple repro? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vernon Cole Sent: Thursday, July 23, 2009 10:11 PM To: Discussion of IronPython Subject: Re: [IronPython] [ANN]: IronPython 2.6 Beta 2 Guys: Good work on the new release, and the 215 bug fixes. As usual, as soon as the new beta was announced I downloaded and tested it. Somehow I got the idea that the adodbapi test had been included in the IronPython test suite. Did you only include the tests that already pass? Issue 18222 is still unfixed -- so adodbapi still fails, and you still cannot pass a read-only buffer as a COM parameter. I realize that no one has voted up this rather obscure bug. Perhaps if it were titled "fully support DB API 2.0 compliant database access using ADO" it would have gotten more votes. Nevertheless, this issue has been outstanding for 11 months, and is the only remaining failure in adodbapi for versions 2.3 thru 3.1 of python. Please try to get to it before 2.6 final. Please !!!??? -- Vernon Cole P.S. -- I plan to make a version of adodbapi which uses real ADO.NET, rather than ADO via COM, but I want the current version to be solid before I start mucking it up. _______________________________________________ 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 k.kanryu at gmail.com Tue Aug 18 04:48:50 2009 From: k.kanryu at gmail.com (KATO Kanryu) Date: Tue, 18 Aug 2009 11:48:50 +0900 Subject: [IronPython] How do you run compiled scripts(dll) by C# host? Message-ID: How do you run compiled scripts(dll) by C# host? Hitherto, I run IronPython scripts by my C# host with the following. - Microsoft.Scripting.Hosting.ScriptEngine - Microsoft.Scripting.Hosting.ScriptScope I think we can use the implementation IronPython.Runtime.Operations.PythonOps.InitializeModule() . The code doesn't use Microsoft.Scripting.Hosting.[ScriptScope] but Microsoft.Scripting.Runtime.[Scope] . We can make instances of [Scope], but we cannot make ones of [ScopeScope] directly. Because both ScriptScope.ScriptScope() and ScriptScope.Scope are defined 'internal'. Comments? From curt at hagenlocher.org Tue Aug 18 05:37:30 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 17 Aug 2009 20:37:30 -0700 Subject: [IronPython] How do you run compiled scripts(dll) by C# host? In-Reply-To: References: Message-ID: You can convert between Scope and ScriptScope by using Microsoft.Scripting.Hosting.Providers.HostingHelpers. On Mon, Aug 17, 2009 at 7:48 PM, KATO Kanryu wrote: > How do you run compiled scripts(dll) by C# host? > > Hitherto, I run IronPython scripts by my C# host with the following. > - Microsoft.Scripting.Hosting.ScriptEngine > - Microsoft.Scripting.Hosting.ScriptScope > > I think we can use the implementation > IronPython.Runtime.Operations.PythonOps.InitializeModule() . > The code doesn't use Microsoft.Scripting.Hosting.[ScriptScope] but > Microsoft.Scripting.Runtime.[Scope] . > We can make instances of [Scope], but we cannot make ones of > [ScopeScope] directly. > Because both ScriptScope.ScriptScope() and ScriptScope.Scope are > defined 'internal'. > > Comments? > _______________________________________________ > 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 microsoft.com Tue Aug 18 06:17:10 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 18 Aug 2009 04:17:10 +0000 Subject: [IronPython] How do you run compiled scripts(dll) by C# host? In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD038488C9@TK5EX14MBXC116.redmond.corp.microsoft.com> What Curt says is true but I would suggest doing scriptRuntime.LoadAssembly instead. Once you do that you can do engine.ImportModule (an extension method defined in the Python class) do get a ScriptSource for any of your compiled modules. InitializeModule may change from major version to major version of IronPython - but engine.ImportModule is a fixed public API. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Monday, August 17, 2009 8:38 PM To: Discussion of IronPython Subject: Re: [IronPython] How do you run compiled scripts(dll) by C# host? You can convert between Scope and ScriptScope by using Microsoft.Scripting.Hosting.Providers.HostingHelpers. On Mon, Aug 17, 2009 at 7:48 PM, KATO Kanryu > wrote: How do you run compiled scripts(dll) by C# host? Hitherto, I run IronPython scripts by my C# host with the following. - Microsoft.Scripting.Hosting.ScriptEngine - Microsoft.Scripting.Hosting.ScriptScope I think we can use the implementation IronPython.Runtime.Operations.PythonOps.InitializeModule() . The code doesn't use Microsoft.Scripting.Hosting.[ScriptScope] but Microsoft.Scripting.Runtime.[Scope] . We can make instances of [Scope], but we cannot make ones of [ScopeScope] directly. Because both ScriptScope.ScriptScope() and ScriptScope.Scope are defined 'internal'. Comments? _______________________________________________ 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 k.kanryu at gmail.com Tue Aug 18 07:10:59 2009 From: k.kanryu at gmail.com (KATO Kanryu) Date: Tue, 18 Aug 2009 14:10:59 +0900 Subject: [IronPython] How do you run compiled scripts(dll) by C# host? In-Reply-To: <1A472770E042064698CB5ADC83A12ACD038488C9@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD038488C9@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: 2009/8/18 Curt Hagenlocher > using Microsoft.Scripting.Hosting.Providers.HostingHelpers. OK. but after imported not set data to the scope or the scriptscope. | var scope = HostingHelpers.GetScope(scriptScope); | var codeContext = new CodeContext(scope, pythonContext); | Importer.Import(codeContext, main, new PythonTuple(), 0); | |: scope.Dict is empty 2009/8/18 Dino Viehland : > What Curt says is true but I would suggest doing scriptRuntime.LoadAssembly > instead. > Once you do that you can do engine.ImportModule (an extension method defined > in the Python class) do get a ScriptSource for any of your compiled > modules.? InitializeModule may change from major version to major version of > IronPython ? but engine.ImportModule is a fixed public API. Thanks! I made it the following. | public static void InitializeModule(string ModulePath, string/*!*/ main) | { | var pythonEngine = Python.CreateEngine(); | var path = Path.GetFullPath(ModulePath); | var precompiled = Assembly.LoadFile(path); | | pythonEngine.Runtime.LoadAssembly(typeof(string).Assembly); | pythonEngine.Runtime.LoadAssembly(typeof(System.Diagnostics.Debug).Assembly); | pythonEngine.Runtime.LoadAssembly(precompiled); | | var pythonContext = HostingHelpers.GetLanguageContext(pythonEngine) as PythonContext; | | try | { | scriptScope = pythonEngine.ImportModule(main); | } | catch (SystemExitException ex) | { | Console.WriteLine(ex.ToString()); | } | } But the problem dated ahead about UTF-8 parsing again :( To be fixed myself... From marco.parenzan at libero.it Tue Aug 18 11:44:24 2009 From: marco.parenzan at libero.it (Marco Parenzan) Date: Tue, 18 Aug 2009 11:44:24 +0200 Subject: [IronPython] Microsoft.Scripting, Python and Ruby Message-ID: <000001ca1fe8$7869e500$693daf00$@parenzan@libero.it> Dear All, what about coexistent IronPython and IronRuby in the same application (not passing objects between IronPython to IronRuby and viceversa)? In detail, I'd like to script my application with either IronPython or IronRuby: the DLR is here for this! Where I store locally my scripts (an Xml file) I can save the type of script, so I can decide on a script base the language. But with all subsequent releases of IPY and IRB, have always different Microsoft.Scripting dlls: at the moment, IPY 2.6beta2 has 2.6.907.0, while IRB has 1.0. If I statically link Microsoft Scripting dll is a problem: the only solution I have is to bring IPY and IRB dlls in different folders and dynamically load the assemblies. How can be solved this? Thanks in advance. Marco [dot] Parenzan [at] libero [dot] it -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Tue Aug 18 12:30:34 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 18 Aug 2009 11:30:34 +0100 Subject: [IronPython] IronPython 2.6 Bugs Message-ID: <4A8A82CA.7030806@voidspace.org.uk> Hello Dino, Sorry - I lost the original email so am sending a fresh one. :-) You asked what bugs in particular we would like to see fixed in 2.6 final. I am *very* keen to see pdb work with IronPython 2.6, and in particular set_trace and post_mortem which don't work in Beta 2. There is an open codeplex issue for this somewhere... Michael -- http://www.ironpythoninaction.com/ From ivan at flanders.co.nz Tue Aug 18 13:02:30 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Tue, 18 Aug 2009 13:02:30 +0200 Subject: [IronPython] Microsoft.Scripting, Python and Ruby In-Reply-To: <-7103774759857286882@unknownmsgid> References: <-7103774759857286882@unknownmsgid> Message-ID: from memory: You create different language setups and from these setups you can create different scriptscopes to execute you code. --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) ---------- Forwarded message ---------- From: Marco Parenzan Date: Tue, Aug 18, 2009 at 11:44 AM Subject: [IronPython] Microsoft.Scripting, Python and Ruby To: users at lists.ironpython.com Dear All, what about coexistent IronPython and IronRuby in the same application (not passing objects between IronPython to IronRuby and viceversa)? In detail, I?d like to script my application with either IronPython or IronRuby: the DLR is here for this! Where I store locally my scripts (an Xml file) I can save the type of script, so I can decide on a script base the language. But with all subsequent releases of IPY and IRB, have always different Microsoft.Scripting dlls: at the moment, IPY 2.6beta2 has 2.6.907.0, while IRB has 1.0. If I statically link Microsoft Scripting dll is a problem: the only solution I have is to bring IPY and IRB dlls in different folders and dynamically load the assemblies. How can be solved this? Thanks in advance. Marco [dot] Parenzan [at] libero [dot] it _______________________________________________ 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 fuzzyman at voidspace.org.uk Tue Aug 18 13:15:26 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 18 Aug 2009 12:15:26 +0100 Subject: [IronPython] Microsoft.Scripting, Python and Ruby In-Reply-To: References: <-7103774759857286882@unknownmsgid> Message-ID: <4A8A8D4E.1070803@voidspace.org.uk> Ivan Porto Carrero wrote: > from memory: > You create different language setups and from these setups you can > create different scriptscopes to execute you code. His issue (as I understand it) is not having a common build of IronPython and IronRuby that use the same version of the DLR. Michael > > --- > Met vriendelijke groeten - Best regards - Salutations > Ivan Porto Carrero > Blog: http://flanders.co.nz > Twitter: http://twitter.com/casualjim > Author of IronRuby in Action (http://manning.com/carrero) > > > > ---------- Forwarded message ---------- > From: *Marco Parenzan* > > Date: Tue, Aug 18, 2009 at 11:44 AM > Subject: [IronPython] Microsoft.Scripting, Python and Ruby > To: users at lists.ironpython.com > > > Dear All, > > > > what about coexistent IronPython and IronRuby in the same application > (not passing objects between IronPython to IronRuby and viceversa)? > > In detail, I?d like to script my application with either IronPython or > IronRuby: the DLR is here for this! > > Where I store locally my scripts (an Xml file) I can save the type of > script, so I can decide on a script base the language. > > But with all subsequent releases of IPY and IRB, have always different > Microsoft.Scripting dlls: at the moment, IPY 2.6beta2 has 2.6.907.0, > while IRB has 1.0. > > If I statically link Microsoft Scripting dll is a problem: the only > solution I have is to bring IPY and IRB dlls in different folders and > dynamically load the assemblies. > > How can be solved this? > > > > Thanks in advance. > > > > Marco [dot] Parenzan [at] libero [dot] it > > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ From ivan at flanders.co.nz Tue Aug 18 13:19:02 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Tue, 18 Aug 2009 13:19:02 +0200 Subject: [IronPython] Microsoft.Scripting, Python and Ruby In-Reply-To: <4A8A8D4E.1070803@voidspace.org.uk> References: <-7103774759857286882@unknownmsgid> <4A8A8D4E.1070803@voidspace.org.uk> Message-ID: The ironruby release includes the binaries of ironpython too http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30914#DownloadId=77408 --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero GSM: +32.486.787.582 Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Tue, Aug 18, 2009 at 1:15 PM, Michael Foord wrote: > Ivan Porto Carrero wrote: > >> from memory: >> You create different language setups and from these setups you can create >> different scriptscopes to execute you code. >> > > His issue (as I understand it) is not having a common build of IronPython > and IronRuby that use the same version of the DLR. > > Michael > >> >> --- >> Met vriendelijke groeten - Best regards - Salutations >> Ivan Porto Carrero >> Blog: http://flanders.co.nz >> Twitter: http://twitter.com/casualjim >> Author of IronRuby in Action (http://manning.com/carrero) >> >> >> >> ---------- Forwarded message ---------- >> From: *Marco Parenzan* > marco.parenzan at libero.it>> >> Date: Tue, Aug 18, 2009 at 11:44 AM >> Subject: [IronPython] Microsoft.Scripting, Python and Ruby >> To: users at lists.ironpython.com >> >> >> Dear All, >> >> >> what about coexistent IronPython and IronRuby in the same application (not >> passing objects between IronPython to IronRuby and viceversa)? >> >> In detail, I?d like to script my application with either IronPython or >> IronRuby: the DLR is here for this! >> >> Where I store locally my scripts (an Xml file) I can save the type of >> script, so I can decide on a script base the language. >> >> But with all subsequent releases of IPY and IRB, have always different >> Microsoft.Scripting dlls: at the moment, IPY 2.6beta2 has 2.6.907.0, while >> IRB has 1.0. >> >> If I statically link Microsoft Scripting dll is a problem: the only >> solution I have is to bring IPY and IRB dlls in different folders and >> dynamically load the assemblies. >> >> How can be solved this? >> >> >> Thanks in advance. >> >> >> Marco [dot] Parenzan [at] libero [dot] it >> >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.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 marco.parenzan at libero.it Tue Aug 18 14:26:03 2009 From: marco.parenzan at libero.it (Marco Parenzan) Date: Tue, 18 Aug 2009 14:26:03 +0200 Subject: [IronPython] Microsoft.Scripting, Python and Ruby Message-ID: <000501ca1fff$0dd19140$2974b3c0$@parenzan@libero.it> Ivan and Michael, sorry if I have written bad. I try to rewrite. Microsoft.Scripting is statically referenced by IPY and IRB. Each IPY and PRB distribution come with his own Microsoft.Scripting: at the moment, IPY 2.6beta2 has 2.6.907.0, while IRB has 1.0. Now, I need to host DLR, not specific DLR language, in my application: I?d like allow my script choosing which language to use for scripting (the script is contained in an XML file the has an attribute for language selection). So I?d like to reference in my application the Microsoft .Scripting assembly, configure app.config with all DLR languages available (not only IPY and IRB), and implement logic that calls the hosting api selecting the language. The question is: which Microsoft.Scripting assembly I have to reference? How about IPY and IRB updates? I use this mail to congratulate with you for your books! Marco [dot] Parenzan [at] libero [dot] it From: Marco Parenzan [mailto:marco.parenzan at libero.it] Sent: marted? 18 agosto 2009 11.44 To: 'users at lists.ironpython.com' Subject: Microsoft.Scripting, Python and Ruby Dear All, what about coexistent IronPython and IronRuby in the same application (not passing objects between IronPython to IronRuby and viceversa)? In detail, I?d like to script my application with either IronPython or IronRuby: the DLR is here for this! Where I store locally my scripts (an Xml file) I can save the type of script, so I can decide on a script base the language. But with all subsequent releases of IPY and IRB, have always different Microsoft.Scripting dlls: at the moment, IPY 2.6beta2 has 2.6.907.0, while IRB has 1.0. If I statically link Microsoft Scripting dll is a problem: the only solution I have is to bring IPY and IRB dlls in different folders and dynamically load the assemblies. How can be solved this? Thanks in advance. Marco [dot] Parenzan [at] libero [dot] it -------------- next part -------------- An HTML attachment was scrubbed... URL: From glenn.k.jones+ipy at gmail.com Tue Aug 18 14:30:35 2009 From: glenn.k.jones+ipy at gmail.com (Glenn Jones) Date: Tue, 18 Aug 2009 13:30:35 +0100 Subject: [IronPython] Pyc in IronPython 2.6 Message-ID: <2679f6510908180530i3610ca0dm5269c3c04d8c2116@mail.gmail.com> Hi guys, I have just created a ticket http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=24362, but I was wondering if there was anything obvious that I could do to get this working. Thanks Glenn From marco.parenzan at libero.it Tue Aug 18 17:09:22 2009 From: marco.parenzan at libero.it (Marco Parenzan) Date: Tue, 18 Aug 2009 17:09:22 +0200 Subject: [IronPython] UNICODEDATA.PY Message-ID: <001201ca2015$dfabf0f0$9f03d2d0$@parenzan@libero.it> Hi All, does anyone has an implementation of unicodedata.py for IronPython? Thanks Marco [dot] Parenzan [at] libero [dot] it -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Tue Aug 18 17:42:20 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 18 Aug 2009 15:42:20 +0000 Subject: [IronPython] IronPython 2.6 Bugs In-Reply-To: <4A8A82CA.7030806@voidspace.org.uk> References: <4A8A82CA.7030806@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD0384B5C8@TK5EX14MBXC116.redmond.corp.microsoft.com> That's convenient because I've been working on fixing that one along w/ another related bug for getting PyDev debugging to work. This one will require that you provide a -X:Tracing command line flag so that we always have the tracing code gen. But it works on my machine as of a couple of days ago (there's just other things which are still failing). So expect this to be in 2.6RC1. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, August 18, 2009 3:31 AM > To: Discussion of IronPython > Subject: [IronPython] IronPython 2.6 Bugs > > Hello Dino, > > Sorry - I lost the original email so am sending a fresh one. :-) > > You asked what bugs in particular we would like to see fixed in 2.6 > final. I am *very* keen to see pdb work with IronPython 2.6, and in > particular set_trace and post_mortem which don't work in Beta 2. There > is an open codeplex issue for this somewhere... > > Michael > > -- > http://www.ironpythoninaction.com/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From merllab at microsoft.com Tue Aug 18 17:53:09 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 18 Aug 2009 08:53:09 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <5193fa94-4771-482f-a2b8-ca7324cda9c0@tk5-exsmh-c101.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/58217. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Tests/modules/system_namespaces.py $/IronPython/IronPython_Main/Src/Tests/regressions.py $/IronPython/IronPython_Main/Src/Tests/test_stdmodules.py $/IronPython/IronPython_Main/Src/Tests/test_codecs.py $/IronPython/IronPython_Main/Src/Tests/test_class.py $/IronPython/IronPython_Main/Src/Tests/test_sys.py $/IronPython/IronPython_Main/Src/Tests/Tools/cmodule.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1063533 Date: 8/17/2009 10:02:06 AM (dfugate) - test_math.py: part of 21116 fixed - test_sys.py: part of 17460 fixed - regressions.py: improved test_reraise_backtrace_cp20051 a bit. Still needs more verfication - cmodule.py: ignore some integer/float attributes that popped up in CPython 2.6 - test_sys.py: added a couple of minimal sanity checks for getsizeof and gettrace. Both broken in some fashion (Shelveset: CP70;REDMOND\dfugate | SNAP CheckinId: 9160) From marco.parenzan at libero.it Tue Aug 18 18:25:04 2009 From: marco.parenzan at libero.it (Marco Parenzan) Date: Tue, 18 Aug 2009 18:25:04 +0200 Subject: [IronPython] Users Digest, Vol 61, Issue 38 In-Reply-To: References: Message-ID: <001d01ca2020$7151a9a0$53f4fce0$@parenzan@libero.it> Ivan, I have downloaded IRB 0.9.0 this morning and I have not found IPY binaries in it. Marco [dot] Parenzan [at] libero [dot] it -----Original Message----- Date: Tue, 18 Aug 2009 13:19:02 +0200 From: Ivan Porto Carrero To: Discussion of IronPython Subject: Re: [IronPython] Microsoft.Scripting, Python and Ruby Message-ID: Content-Type: text/plain; charset="utf-8" The ironruby release includes the binaries of ironpython too http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30914#Do wnloadId=77408 From Harry.Pierson at microsoft.com Tue Aug 18 18:37:44 2009 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Tue, 18 Aug 2009 16:37:44 +0000 Subject: [IronPython] Users Digest, Vol 61, Issue 38 In-Reply-To: <001d01ca2020$7151a9a0$53f4fce0$@parenzan@libero.it> References: <001d01ca2020$7151a9a0$53f4fce0$@parenzan@libero.it> Message-ID: <6B5AE3B08809CC47A81ACBF99E2690F514ACF265@TK5EX14MBXC104.redmond.corp.microsoft.com> There are two downloads: ironruby-0.9.0 (http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30914#DownloadId=77408) and IronPython binaries for ironruby-0.9.0 interop (http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30914#DownloadId=77409). You need both. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Marco Parenzan Sent: Tuesday, August 18, 2009 9:25 AM To: users at lists.ironpython.com Subject: Re: [IronPython] Users Digest, Vol 61, Issue 38 Ivan, I have downloaded IRB 0.9.0 this morning and I have not found IPY binaries in it. Marco [dot] Parenzan [at] libero [dot] it -----Original Message----- Date: Tue, 18 Aug 2009 13:19:02 +0200 From: Ivan Porto Carrero To: Discussion of IronPython Subject: Re: [IronPython] Microsoft.Scripting, Python and Ruby Message-ID: Content-Type: text/plain; charset="utf-8" The ironruby release includes the binaries of ironpython too http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30914#Do wnloadId=77408 _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dfugate at microsoft.com Tue Aug 18 18:39:45 2009 From: dfugate at microsoft.com (Dave Fugate) Date: Tue, 18 Aug 2009 16:39:45 +0000 Subject: [IronPython] Users Digest, Vol 61, Issue 38 In-Reply-To: <001d01ca2020$7151a9a0$53f4fce0$@parenzan@libero.it> References: <001d01ca2020$7151a9a0$53f4fce0$@parenzan@libero.it> Message-ID: <7CEEC335D70FFE4B957737DDE836F51B8FB40E@TK5EX14MBXC125.redmond.corp.microsoft.com> Please note that IronPython sources found on IronRuby's GIT repository are NOT actually an exact match or completely compatible with IronPython sources on CodePlex. You see for IronPython we transform some uses of the "System" C# namespaces into "Microsoft". IronRuby doesn't do this last time I checked. E.g., compare what's in http://github.com/ironruby/ironruby/blob/adb33b18780e5f2a7e050fd38ebc58750ec1cf5b/ndp/fx/src/Core/Microsoft/Scripting/Compiler/BoundConstants.cs to http://ironpython.codeplex.com/sourcecontrol/changeset/view/57668?projectName=IronPython#760473. The best way in my opinion to get compatible versions of IronPython+IronRuby is to use the DLR CodePlex site - http://dlr.codeplex.com/SourceControl/ListDownloadableCommits.aspx#DownloadLatest. Cross-language interop between Iron* languages was one of the primary motivations for creating the DLR site:) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Marco Parenzan Sent: Tuesday, August 18, 2009 9:25 AM To: users at lists.ironpython.com Subject: Re: [IronPython] Users Digest, Vol 61, Issue 38 Ivan, I have downloaded IRB 0.9.0 this morning and I have not found IPY binaries in it. Marco [dot] Parenzan [at] libero [dot] it -----Original Message----- Date: Tue, 18 Aug 2009 13:19:02 +0200 From: Ivan Porto Carrero To: Discussion of IronPython Subject: Re: [IronPython] Microsoft.Scripting, Python and Ruby Message-ID: Content-Type: text/plain; charset="utf-8" The ironruby release includes the binaries of ironpython too http://ironruby.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30914#Do wnloadId=77408 _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Tue Aug 18 19:25:18 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 18 Aug 2009 18:25:18 +0100 Subject: [IronPython] UNICODEDATA.PY In-Reply-To: <001201ca2015$dfabf0f0$9f03d2d0$@parenzan@libero.it> References: <001201ca2015$dfabf0f0$9f03d2d0$@parenzan@libero.it> Message-ID: <4A8AE3FE.3000007@voidspace.org.uk> Yes, there is one as part of the FePy project ( http://fepy.sf.net ). Michael Marco Parenzan wrote: > > Hi All, > > > > does anyone has an implementation of unicodedata.py for IronPython? > > > > Thanks > > > > Marco [dot] Parenzan [at] libero [dot] it > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From dinov at microsoft.com Tue Aug 18 19:33:57 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 18 Aug 2009 17:33:57 +0000 Subject: [IronPython] Pyc in IronPython 2.6 In-Reply-To: <2679f6510908180530i3610ca0dm5269c3c04d8c2116@mail.gmail.com> References: <2679f6510908180530i3610ca0dm5269c3c04d8c2116@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD0384BD47@TK5EX14MBXC116.redmond.corp.microsoft.com> Compile on 64-bit? :) I have a guess of what the problem is here but I haven't run a test to Confirm. I recently ran into a similar issue when I increased the number of constants we were generating - except for I was just trying to pre-compile a single file. If you want to build from source you can modify ToDiskRewriter.cs to add a new member variable: private Dictionary _constantCache; And then in VisitConstant replace: Expression serialized = exprSerializable.CreateExpression(); _constants.Add(serialized); return AstUtils.Convert( Expression.ArrayAccess(_constantPool, AstUtils.Constant(_constants.Count - 1)), serialized.Type ); With: Expression res; if (!_constantCache.TryGetValue(node, out res)) { Expression serialized = exprSerializable.CreateExpression(); _constants.Add(serialized); _constantCache[node] = res = AstUtils.Convert( Expression.ArrayAccess(_constantPool, AstUtils.Constant(_constants.Count - 1)), serialized.Type ); } return res; and then add: _constantCache = new Dictionary(); To EnsureConstantPool() If that doesn't work, or you don't want to build from source, I'll attempt to repro it and see what's going on. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Glenn Jones > Sent: Tuesday, August 18, 2009 5:31 AM > To: users at lists.ironpython.com > Subject: [IronPython] Pyc in IronPython 2.6 > > Hi guys, > > I have just created a ticket > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=24362, > but I was wondering if there was anything obvious that I could do to > get this working. > > Thanks > Glenn > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Kyle.Howland-Rose at aar.com.au Wed Aug 19 08:23:30 2009 From: Kyle.Howland-Rose at aar.com.au (Howland-Rose, Kyle) Date: Wed, 19 Aug 2009 16:23:30 +1000 Subject: [IronPython] sys.argv empty in compiled scripts Message-ID: Hi all, I just http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=24373 to report this but I would appreciate a work-around if anyone has one. The text of the issue is below. Thanks for any help! Regards, Kyle Description This is like http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=12283 but seems to refer to a different exe. I downloaded the pyc in the samples today this problem is still an issue - or is an issue again. In this case sys.argv is empty in compiled scripts. See below for an example. bash-3.2$ ipy IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053 Type "help", "copyright", "credits" or "license" for more information. >>> ^Z bash-3.2$ cat broken.py import sys print str(sys.argv) bash-3.2$ ipy broken.py foo bar ['broken.py', 'foo', 'bar'] bash-3.2$ ipy.exe pyc.py /main:broken.py Input Files: Output: broken Target: ConsoleApplication Platform: ILOnly Machine: I386 Compiling... Saved to broken bash-3.2$ ./broken.exe foo bar [''] bash-3.2$ ************************************************************************ Allens Arthur Robinson online: http://www.aar.com.au This email is confidential and may be subject to legal or other professional privilege. It is also subject to copyright. If you have received it in error, confidentiality and privilege are not waived and you must not disclose or use the information in it. Please notify the sender by return email and delete it from your system. Any personal information in this email must be handled in accordance with the Privacy Act 1988 (Cth). ************************************************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From pavel.suhotjuk at gmail.com Wed Aug 19 09:19:47 2009 From: pavel.suhotjuk at gmail.com (Pavel Suhotyuk) Date: Wed, 19 Aug 2009 10:19:47 +0300 Subject: [IronPython] InvokeMember with three or more parameters. In-Reply-To: <1A472770E042064698CB5ADC83A12ACD03842A70@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A891277.4060007@gmail.com> <1A472770E042064698CB5ADC83A12ACD03842A70@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A8BA793.8090709@gmail.com> Hello. Thank you for answer. How can I create script object without code generation same like: scriptEngine.Execute(string.Format("{0}()","Broker"),scriptScope); ? Dino Viehland wrote: > We haven't implemented support for more than 3 parameters :) > > In 2.6 I just fixed > 3 params for the Invoke case (not InvokeMember) > and I can fix > 3 for InvokeMember/CreateInstance as well before > 2.6 ships. > > The preferred way to do this though is to do a GetMember where > T is a delegate type with > 3 paraemters. Then you can just invoke > the delegate. > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Pavel Suhotyuk >> Sent: Monday, August 17, 2009 1:19 AM >> To: Discussion of IronPython >> Subject: [IronPython] InvokeMember with three or more parameters. >> >> Hello. >> >> I have Python code: >> >> class Broker ( object ) : >> >> def validation( self, info, provider_manager ): >> pass >> >> def check( self, payment, payment_manager, provider_manager ): >> pass >> >> and try to call methods by this c# code: >> >> operations = scriptEngine.CreateOperations(); >> var scriptSource = >> scriptEngine.CreateScriptSourceFromString(script,SourceCodeKind.Stateme >> nts); >> scriptCode = scriptSource.Compile(); >> scriptCode.Execute(); >> scriptScope = scriptCode.DefaultScope; >> broker = >> scriptEngine.Execute(string.Format("{0}()","Broker"),scriptScope); >> >> bool validationResult = operations.InvokeMember(broker, "validation", >> paymentInfo, providerManager); >> >> operations.InvokeMember(broker, "check", payment, paymentManager, >> providerManager); >> >> >> Invoke validation method is success, but invoke check method throws >> NotImplementedException with stack trace: >> >> System.NotImplementedException: Method or operation not implemented. >> ? Microsoft.Scripting.Runtime.DynamicOperations.InvokeMember(Object >> obj, String memberName, Boolean ignoreCase, Object[] parameters) >> ? Microsoft.Scripting.Hosting.ObjectOperations.InvokeMember(Object >> obj, String memberName, Object[] parameters) >> >> Looks like 2 paramters called correct, but more than 2 throws exception >> in all cases. >> >> Why it happens? >> >> -- >> Best regards, >> Suhotjuk Pavel Sergeevich >> _______________________________________________ >> 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 microsoft.com Wed Aug 19 09:28:51 2009 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 19 Aug 2009 07:28:51 +0000 Subject: [IronPython] InvokeMember with three or more parameters. In-Reply-To: <4A8BA793.8090709@gmail.com> References: <4A891277.4060007@gmail.com> <1A472770E042064698CB5ADC83A12ACD03842A70@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A8BA793.8090709@gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD03851D47@TK5EX14MBXC116.redmond.corp.microsoft.com> This should do it: scriptScope.GetVariable>("Broker")(); -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pavel Suhotyuk Sent: Wednesday, August 19, 2009 12:20 AM To: Discussion of IronPython Subject: Re: [IronPython] InvokeMember with three or more parameters. Hello. Thank you for answer. How can I create script object without code generation same like: scriptEngine.Execute(string.Format("{0}()","Broker"),scriptScope); ? Dino Viehland wrote: > We haven't implemented support for more than 3 parameters :) > > In 2.6 I just fixed > 3 params for the Invoke case (not InvokeMember) > and I can fix > 3 for InvokeMember/CreateInstance as well before > 2.6 ships. > > The preferred way to do this though is to do a GetMember where > T is a delegate type with > 3 paraemters. Then you can just invoke > the delegate. > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Pavel Suhotyuk >> Sent: Monday, August 17, 2009 1:19 AM >> To: Discussion of IronPython >> Subject: [IronPython] InvokeMember with three or more parameters. >> >> Hello. >> >> I have Python code: >> >> class Broker ( object ) : >> >> def validation( self, info, provider_manager ): >> pass >> >> def check( self, payment, payment_manager, provider_manager ): >> pass >> >> and try to call methods by this c# code: >> >> operations = scriptEngine.CreateOperations(); >> var scriptSource = >> scriptEngine.CreateScriptSourceFromString(script,SourceCodeKind.Stateme >> nts); >> scriptCode = scriptSource.Compile(); >> scriptCode.Execute(); >> scriptScope = scriptCode.DefaultScope; >> broker = >> scriptEngine.Execute(string.Format("{0}()","Broker"),scriptScope); >> >> bool validationResult = operations.InvokeMember(broker, "validation", >> paymentInfo, providerManager); >> >> operations.InvokeMember(broker, "check", payment, paymentManager, >> providerManager); >> >> >> Invoke validation method is success, but invoke check method throws >> NotImplementedException with stack trace: >> >> System.NotImplementedException: Method or operation not implemented. >> ? Microsoft.Scripting.Runtime.DynamicOperations.InvokeMember(Object >> obj, String memberName, Boolean ignoreCase, Object[] parameters) >> ? Microsoft.Scripting.Hosting.ObjectOperations.InvokeMember(Object >> obj, String memberName, Object[] parameters) >> >> Looks like 2 paramters called correct, but more than 2 throws exception >> in all cases. >> >> Why it happens? >> >> -- >> Best regards, >> Suhotjuk Pavel Sergeevich >> _______________________________________________ >> 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 Aug 19 12:44:16 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 19 Aug 2009 11:44:16 +0100 Subject: [IronPython] sys.argv empty in compiled scripts In-Reply-To: References: Message-ID: <4A8BD780.8030005@voidspace.org.uk> Hello, This is a known bug - and if it isn't fixed in 2.6 it really needs to be. :-) You can access the command line arguments through System.Environment. from System import Environment args = Environment.GetCommandLineArgs() HTH Michael Howland-Rose, Kyle wrote: > Hi all, > > I just > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=24373 to > report this but I would appreciate a work-around if anyone has one. > The text of the issue is below. > > Thanks for any help! > > Regards, > Kyle > > *Description* > This is like > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=12283 but > seems to refer to a different exe. > > I downloaded the pyc in the samples today this problem is still an > issue - or is an issue again. > > In this case sys.argv is empty in compiled scripts. See below for an > example. > > bash-3.2$ ipy > IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053 > Type "help", "copyright", "credits" or "license" for more information. > >>> ^Z > bash-3.2$ cat broken.py > import sys > print str(sys.argv) > bash-3.2$ ipy broken.py foo bar > ['broken.py', 'foo', 'bar'] > bash-3.2$ ipy.exe pyc.py /main:broken.py > Input Files: > Output: > broken > Target: > ConsoleApplication > Platform: > ILOnly > Machine: > I386 > Compiling... > Saved to broken > bash-3.2$ ./broken.exe foo bar > [''] > bash-3.2$ > > > > ************************************************************************ > > Allens Arthur Robinson online: http://www.aar.com.au > > This email is confidential and may be subject to legal or other > professional privilege. It is also subject to copyright. If you have > received it in error, confidentiality and privilege are not waived and > you must not disclose or use the information in it. Please notify the > sender by return email and delete it from your system. Any personal > information in this email must be handled in accordance with the > Privacy Act 1988 (Cth). > > ************************************************************************* > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From merllab at microsoft.com Wed Aug 19 17:52:51 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 19 Aug 2009 08:52:51 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/58233. ADDED SOURCES $/IronPython/IronPython_Main/Src/Tests/functions $/IronPython/IronPython_Main/Src/Tests/functions/__init__.py $/IronPython/IronPython_Main/Src/Tests/functions/signatures.py MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Tests/functions/__init__.py $/IronPython/IronPython_Main/Src/Tests/functions/signatures.py $/IronPython/IronPython_Main/Src/Tests/interop/net/type/test_clrtype.py $/IronPython/IronPython_Main/Src/Tests/Modes/ConsoleFlags.ps1 $/IronPython/IronPython_Main/Src/Tests/test_class.py $/IronPython/IronPython_Main/Src/Tests/test_superconsole.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1065794 Date: 8/18/2009 12:22:34 PM (dfugate) - test_superconsole.py: CP 15428 is not quite fixed. Also trying to fix sporadic failures seen in test_areraise - test_StringIO.py: we now pass more of this test WRT CP 23702 - test_grammar.py: CP14964 is fixed - test_class.py: extended regression for CP19585. Still broken - ConsoleFlags.ps1: added a regression for a -D/-O related bug. Fixed - test_clrtype.py: extended regression for CP23252. Fixed - functions.signatures: new test module for CP24182. Fixed (Shelveset: CP71;REDMOND\dfugate | SNAP CheckinId: 9170) From davidescobar at ieee.org Wed Aug 19 20:02:51 2009 From: davidescobar at ieee.org (David Escobar) Date: Wed, 19 Aug 2009 11:02:51 -0700 Subject: [IronPython] FolderBrowserDialog does not show folders Message-ID: <38ef96bd0908191102x97f4f48h356463d8402c90cf@mail.gmail.com> I've noticed an issue with the FolderBrowserDialog window from IronPython. When I display it with the ShowDialog method in a compiled script (through pyc.py), it does not show the TreeView of folders. It will display the Description title and the buttons, however. If I run the script straight through the interpreter, it will display the folders just fine. For reference, I also tried the OpenFileDialog and SaveFileDialog, and those show up correctly in both methods. Is this a bug, or am I doing something wrong? Sample code below: *import clr clr.AddReference("System.Windows.Forms") from System import * from System.Windows.Forms import * dlg = FolderBrowserDialog( ) dlg.Description = "Testing..." dlg.ShowDialog( ) * -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Aug 19 20:27:38 2009 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 19 Aug 2009 18:27:38 +0000 Subject: [IronPython] FolderBrowserDialog does not show folders In-Reply-To: <38ef96bd0908191102x97f4f48h356463d8402c90cf@mail.gmail.com> References: <38ef96bd0908191102x97f4f48h356463d8402c90cf@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD03854A6C@TK5EX14MBXC116.redmond.corp.microsoft.com> Are you compiling w/ the "/target:winexe" option? You'll need to provide that for doing WinForms development. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of David Escobar Sent: Wednesday, August 19, 2009 11:03 AM To: Discussion of IronPython Subject: [IronPython] FolderBrowserDialog does not show folders I've noticed an issue with the FolderBrowserDialog window from IronPython. When I display it with the ShowDialog method in a compiled script (through pyc.py), it does not show the TreeView of folders. It will display the Description title and the buttons, however. If I run the script straight through the interpreter, it will display the folders just fine. For reference, I also tried the OpenFileDialog and SaveFileDialog, and those show up correctly in both methods. Is this a bug, or am I doing something wrong? Sample code below: import clr clr.AddReference("System.Windows.Forms") from System import * from System.Windows.Forms import * dlg = FolderBrowserDialog( ) dlg.Description = "Testing..." dlg.ShowDialog( ) -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidescobar at ieee.org Wed Aug 19 20:41:31 2009 From: davidescobar at ieee.org (David Escobar) Date: Wed, 19 Aug 2009 11:41:31 -0700 Subject: [IronPython] FolderBrowserDialog does not show folders In-Reply-To: <1A472770E042064698CB5ADC83A12ACD03854A6C@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <38ef96bd0908191102x97f4f48h356463d8402c90cf@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD03854A6C@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <38ef96bd0908191141m68a4b767y72df816524ae2eaa@mail.gmail.com> Yes, I am. The full command line I'm using is: *"C:\Program Files\IronPython 2.0.2\ipy.exe" pyc.py /out:FolderBrowserDialogTest /main:FolderBrowserDialogTest.py /target:winexe FolderBrowserDialogTest.py*. The dialog window does come up with every control except the tree view of folders. On Wed, Aug 19, 2009 at 11:27 AM, Dino Viehland wrote: > Are you compiling w/ the ?/target:winexe? option? You?ll need to provide > that for doing WinForms development. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *David Escobar > *Sent:* Wednesday, August 19, 2009 11:03 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] FolderBrowserDialog does not show folders > > > > I've noticed an issue with the FolderBrowserDialog window from IronPython. > When I display it with the ShowDialog method in a compiled script (through > pyc.py), it does not show the TreeView of folders. It will display the > Description title and the buttons, however. If I run the script straight > through the interpreter, it will display the folders just fine. For > reference, I also tried the OpenFileDialog and SaveFileDialog, and those > show up correctly in both methods. Is this a bug, or am I doing something > wrong? > > Sample code below: > > *import clr > clr.AddReference("System.Windows.Forms") > from System import * > from System.Windows.Forms import * > > dlg = FolderBrowserDialog( ) > dlg.Description = "Testing..." > dlg.ShowDialog( )* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Aug 19 22:07:50 2009 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 19 Aug 2009 20:07:50 +0000 Subject: [IronPython] sys.argv empty in compiled scripts In-Reply-To: <4A8BD780.8030005@voidspace.org.uk> References: <4A8BD780.8030005@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD03855287@TK5EX14MBXC116.redmond.corp.microsoft.com> It is fixed in 2.6. I don't see another bug on this anywhere else so the new bug will be good to keep around for 2.0.3. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, August 19, 2009 3:44 AM To: Discussion of IronPython Subject: Re: [IronPython] sys.argv empty in compiled scripts Hello, This is a known bug - and if it isn't fixed in 2.6 it really needs to be. :-) You can access the command line arguments through System.Environment. from System import Environment args = Environment.GetCommandLineArgs() HTH Michael Howland-Rose, Kyle wrote: > Hi all, > > I just > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=24373 to > report this but I would appreciate a work-around if anyone has one. > The text of the issue is below. > > Thanks for any help! > > Regards, > Kyle > > *Description* > This is like > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=12283 but > seems to refer to a different exe. > > I downloaded the pyc in the samples today this problem is still an > issue - or is an issue again. > > In this case sys.argv is empty in compiled scripts. See below for an > example. > > bash-3.2$ ipy > IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053 > Type "help", "copyright", "credits" or "license" for more information. > >>> ^Z > bash-3.2$ cat broken.py > import sys > print str(sys.argv) > bash-3.2$ ipy broken.py foo bar > ['broken.py', 'foo', 'bar'] > bash-3.2$ ipy.exe pyc.py /main:broken.py > Input Files: > Output: > broken > Target: > ConsoleApplication > Platform: > ILOnly > Machine: > I386 > Compiling... > Saved to broken > bash-3.2$ ./broken.exe foo bar > [''] > bash-3.2$ > > > > ************************************************************************ > > Allens Arthur Robinson online: http://www.aar.com.au > > This email is confidential and may be subject to legal or other > professional privilege. It is also subject to copyright. If you have > received it in error, confidentiality and privilege are not waived and > you must not disclose or use the information in it. Please notify the > sender by return email and delete it from your system. Any personal > information in this email must be handled in accordance with the > Privacy Act 1988 (Cth). > > ************************************************************************* > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Thu Aug 20 00:09:00 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 19 Aug 2009 15:09:00 -0700 Subject: [IronPython] FolderBrowserDialog does not show folders In-Reply-To: <38ef96bd0908191141m68a4b767y72df816524ae2eaa@mail.gmail.com> References: <38ef96bd0908191102x97f4f48h356463d8402c90cf@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD03854A6C@TK5EX14MBXC116.redmond.corp.microsoft.com> <38ef96bd0908191141m68a4b767y72df816524ae2eaa@mail.gmail.com> Message-ID: It's a COM issue. The emitted Main needs to be tagged with the [STAThread] attribute. On Wed, Aug 19, 2009 at 11:41 AM, David Escobar wrote: > Yes, I am. The full command line I'm using is: > *"C:\Program Files\IronPython 2.0.2\ipy.exe" pyc.py > /out:FolderBrowserDialogTest /main:FolderBrowserDialogTest.py /target:winexe > FolderBrowserDialogTest.py*. > > The dialog window does come up with every control except the tree view of > folders. > > > > On Wed, Aug 19, 2009 at 11:27 AM, Dino Viehland wrote: > >> Are you compiling w/ the ?/target:winexe? option? You?ll need to >> provide that for doing WinForms development. >> >> >> >> *From:* users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *David Escobar >> *Sent:* Wednesday, August 19, 2009 11:03 AM >> *To:* Discussion of IronPython >> *Subject:* [IronPython] FolderBrowserDialog does not show folders >> >> >> >> I've noticed an issue with the FolderBrowserDialog window from IronPython. >> When I display it with the ShowDialog method in a compiled script (through >> pyc.py), it does not show the TreeView of folders. It will display the >> Description title and the buttons, however. If I run the script straight >> through the interpreter, it will display the folders just fine. For >> reference, I also tried the OpenFileDialog and SaveFileDialog, and those >> show up correctly in both methods. Is this a bug, or am I doing something >> wrong? >> >> Sample code below: >> >> *import clr >> clr.AddReference("System.Windows.Forms") >> from System import * >> from System.Windows.Forms import * >> >> dlg = FolderBrowserDialog( ) >> dlg.Description = "Testing..." >> dlg.ShowDialog( )* >> > > > _______________________________________________ > 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 curt at hagenlocher.org Thu Aug 20 00:11:30 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 19 Aug 2009 15:11:30 -0700 Subject: [IronPython] FolderBrowserDialog does not show folders In-Reply-To: References: <38ef96bd0908191102x97f4f48h356463d8402c90cf@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD03854A6C@TK5EX14MBXC116.redmond.corp.microsoft.com> <38ef96bd0908191141m68a4b767y72df816524ae2eaa@mail.gmail.com> Message-ID: ...which has been fixed for IronPython 2.6. You might be able to use the 2.6 pyc.py script against 2.0. On Wed, Aug 19, 2009 at 3:09 PM, Curt Hagenlocher wrote: > It's a COM issue. The emitted Main needs to be tagged with the [STAThread] > attribute. > > On Wed, Aug 19, 2009 at 11:41 AM, David Escobar wrote: > >> Yes, I am. The full command line I'm using is: >> *"C:\Program Files\IronPython 2.0.2\ipy.exe" pyc.py >> /out:FolderBrowserDialogTest /main:FolderBrowserDialogTest.py /target:winexe >> FolderBrowserDialogTest.py*. >> >> The dialog window does come up with every control except the tree view of >> folders. >> >> >> >> On Wed, Aug 19, 2009 at 11:27 AM, Dino Viehland wrote: >> >>> Are you compiling w/ the ?/target:winexe? option? You?ll need to >>> provide that for doing WinForms development. >>> >>> >>> >>> *From:* users-bounces at lists.ironpython.com [mailto: >>> users-bounces at lists.ironpython.com] *On Behalf Of *David Escobar >>> *Sent:* Wednesday, August 19, 2009 11:03 AM >>> *To:* Discussion of IronPython >>> *Subject:* [IronPython] FolderBrowserDialog does not show folders >>> >>> >>> >>> I've noticed an issue with the FolderBrowserDialog window from >>> IronPython. When I display it with the ShowDialog method in a compiled >>> script (through pyc.py), it does not show the TreeView of folders. It will >>> display the Description title and the buttons, however. If I run the script >>> straight through the interpreter, it will display the folders just fine. For >>> reference, I also tried the OpenFileDialog and SaveFileDialog, and those >>> show up correctly in both methods. Is this a bug, or am I doing something >>> wrong? >>> >>> Sample code below: >>> >>> *import clr >>> clr.AddReference("System.Windows.Forms") >>> from System import * >>> from System.Windows.Forms import * >>> >>> dlg = FolderBrowserDialog( ) >>> dlg.Description = "Testing..." >>> dlg.ShowDialog( )* >>> >> >> >> _______________________________________________ >> 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 Kyle.Howland-Rose at aar.com.au Thu Aug 20 00:14:03 2009 From: Kyle.Howland-Rose at aar.com.au (Howland-Rose, Kyle) Date: Thu, 20 Aug 2009 08:14:03 +1000 Subject: [IronPython] sys.argv empty in compiled scripts In-Reply-To: <4A8BD780.8030005@voidspace.org.uk> References: <4A8BD780.8030005@voidspace.org.uk> Message-ID: Awesome, thanks Michael :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, 19 August 2009 8:44 PM To: Discussion of IronPython Subject: Re: [IronPython] sys.argv empty in compiled scripts Hello, This is a known bug - and if it isn't fixed in 2.6 it really needs to be. :-) You can access the command line arguments through System.Environment. from System import Environment args = Environment.GetCommandLineArgs() HTH Michael Howland-Rose, Kyle wrote: > Hi all, > > I just > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=24373 to > report this but I would appreciate a work-around if anyone has one. > The text of the issue is below. > > Thanks for any help! > > Regards, > Kyle > > *Description* > This is like > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=12283 but > seems to refer to a different exe. > > I downloaded the pyc in the samples today this problem is still an > issue - or is an issue again. > > In this case sys.argv is empty in compiled scripts. See below for an > example. > > bash-3.2$ ipy > IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053 > Type "help", "copyright", "credits" or "license" for more information. > >>> ^Z > bash-3.2$ cat broken.py > import sys > print str(sys.argv) > bash-3.2$ ipy broken.py foo bar > ['broken.py', 'foo', 'bar'] > bash-3.2$ ipy.exe pyc.py /main:broken.py > Input Files: > Output: > broken > Target: > ConsoleApplication > Platform: > ILOnly > Machine: > I386 > Compiling... > Saved to broken > bash-3.2$ ./broken.exe foo bar > [''] > bash-3.2$ > > > > ************************************************************************ > > Allens Arthur Robinson online: http://www.aar.com.au > > This email is confidential and may be subject to legal or other > professional privilege. It is also subject to copyright. If you have > received it in error, confidentiality and privilege are not waived and > you must not disclose or use the information in it. Please notify the > sender by return email and delete it from your system. Any personal > information in this email must be handled in accordance with the > Privacy Act 1988 (Cth). > > ************************************************************************ * > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ************************************************************************ Allens Arthur Robinson online: http://www.aar.com.au This email is confidential and may be subject to legal or other professional privilege. It is also subject to copyright. If you have received it in error, confidentiality and privilege are not waived and you must not disclose or use the information in it. Please notify the sender by return email and delete it from your system. Any personal information in this email must be handled in accordance with the Privacy Act 1988 (Cth). ************************************************************************* From davidescobar at ieee.org Thu Aug 20 00:42:52 2009 From: davidescobar at ieee.org (David Escobar) Date: Wed, 19 Aug 2009 15:42:52 -0700 Subject: [IronPython] FolderBrowserDialog does not show folders In-Reply-To: References: <38ef96bd0908191102x97f4f48h356463d8402c90cf@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD03854A6C@TK5EX14MBXC116.redmond.corp.microsoft.com> <38ef96bd0908191141m68a4b767y72df816524ae2eaa@mail.gmail.com> Message-ID: <38ef96bd0908191542n597248x67ddf5f19016a372@mail.gmail.com> How would I tag Main with the [STAThread] attribute in IronPython? I thought IP didn't yet have the ability to use attributes... On Wed, Aug 19, 2009 at 3:11 PM, Curt Hagenlocher wrote: > ...which has been fixed for IronPython 2.6. You might be able to use the > 2.6 pyc.py script against 2.0. > > > On Wed, Aug 19, 2009 at 3:09 PM, Curt Hagenlocher wrote: > >> It's a COM issue. The emitted Main needs to be tagged with the [STAThread] >> attribute. >> >> On Wed, Aug 19, 2009 at 11:41 AM, David Escobar wrote: >> >>> Yes, I am. The full command line I'm using is: >>> *"C:\Program Files\IronPython 2.0.2\ipy.exe" pyc.py >>> /out:FolderBrowserDialogTest /main:FolderBrowserDialogTest.py /target:winexe >>> FolderBrowserDialogTest.py*. >>> >>> The dialog window does come up with every control except the tree view of >>> folders. >>> >>> >>> >>> On Wed, Aug 19, 2009 at 11:27 AM, Dino Viehland wrote: >>> >>>> Are you compiling w/ the ?/target:winexe? option? You?ll need to >>>> provide that for doing WinForms development. >>>> >>>> >>>> >>>> *From:* users-bounces at lists.ironpython.com [mailto: >>>> users-bounces at lists.ironpython.com] *On Behalf Of *David Escobar >>>> *Sent:* Wednesday, August 19, 2009 11:03 AM >>>> *To:* Discussion of IronPython >>>> *Subject:* [IronPython] FolderBrowserDialog does not show folders >>>> >>>> >>>> >>>> I've noticed an issue with the FolderBrowserDialog window from >>>> IronPython. When I display it with the ShowDialog method in a compiled >>>> script (through pyc.py), it does not show the TreeView of folders. It will >>>> display the Description title and the buttons, however. If I run the script >>>> straight through the interpreter, it will display the folders just fine. For >>>> reference, I also tried the OpenFileDialog and SaveFileDialog, and those >>>> show up correctly in both methods. Is this a bug, or am I doing something >>>> wrong? >>>> >>>> Sample code below: >>>> >>>> *import clr >>>> clr.AddReference("System.Windows.Forms") >>>> from System import * >>>> from System.Windows.Forms import * >>>> >>>> dlg = FolderBrowserDialog( ) >>>> dlg.Description = "Testing..." >>>> dlg.ShowDialog( )* >>>> >>> >>> >>> _______________________________________________ >>> 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 fuzzyman at voidspace.org.uk Thu Aug 20 00:44:53 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 19 Aug 2009 23:44:53 +0100 Subject: [IronPython] FolderBrowserDialog does not show folders In-Reply-To: <38ef96bd0908191542n597248x67ddf5f19016a372@mail.gmail.com> References: <38ef96bd0908191102x97f4f48h356463d8402c90cf@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD03854A6C@TK5EX14MBXC116.redmond.corp.microsoft.com> <38ef96bd0908191141m68a4b767y72df816524ae2eaa@mail.gmail.com> <38ef96bd0908191542n597248x67ddf5f19016a372@mail.gmail.com> Message-ID: <4A8C8065.4050203@voidspace.org.uk> David Escobar wrote: > How would I tag Main with the [STAThread] attribute in IronPython? I > thought IP didn't yet have the ability to use attributes... Unfortunately that is something that needs to be done in the Pyc compiler. Did you try Curt's suggestion of using the 2.6 Pyc.py? Michael > > On Wed, Aug 19, 2009 at 3:11 PM, Curt Hagenlocher > > wrote: > > ...which has been fixed for IronPython 2.6. You might be able to > use the 2.6 pyc.py script against 2.0. > > > On Wed, Aug 19, 2009 at 3:09 PM, Curt Hagenlocher > > wrote: > > It's a COM issue. The emitted Main needs to be tagged with the > [STAThread] attribute. > > On Wed, Aug 19, 2009 at 11:41 AM, David Escobar > > wrote: > > Yes, I am. The full command line I'm using is: > *"C:\Program Files\IronPython 2.0.2\ipy.exe" pyc.py > /out:FolderBrowserDialogTest > /main:FolderBrowserDialogTest.py /target:winexe > FolderBrowserDialogTest.py*. > > The dialog window does come up with every control except > the tree view of folders. > > > > On Wed, Aug 19, 2009 at 11:27 AM, Dino Viehland > > wrote: > > Are you compiling w/ the ?/target:winexe? option? > You?ll need to provide that for doing WinForms > development. > > > > *From:* users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] *On > Behalf Of *David Escobar > *Sent:* Wednesday, August 19, 2009 11:03 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] FolderBrowserDialog does not > show folders > > > > I've noticed an issue with the FolderBrowserDialog > window from IronPython. When I display it with the > ShowDialog method in a compiled script (through > pyc.py), it does not show the TreeView of folders. It > will display the Description title and the buttons, > however. If I run the script straight through the > interpreter, it will display the folders just fine. > For reference, I also tried the OpenFileDialog and > SaveFileDialog, and those show up correctly in both > methods. Is this a bug, or am I doing something wrong? > > Sample code below: > > *import clr > clr.AddReference("System.Windows.Forms") > from System import * > from System.Windows.Forms import * > > dlg = FolderBrowserDialog( ) > dlg.Description = "Testing..." > dlg.ShowDialog( )* > > > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From dinov at microsoft.com Thu Aug 20 00:47:44 2009 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 19 Aug 2009 22:47:44 +0000 Subject: [IronPython] FolderBrowserDialog does not show folders In-Reply-To: <4A8C8065.4050203@voidspace.org.uk> References: <38ef96bd0908191102x97f4f48h356463d8402c90cf@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD03854A6C@TK5EX14MBXC116.redmond.corp.microsoft.com> <38ef96bd0908191141m68a4b767y72df816524ae2eaa@mail.gmail.com> <38ef96bd0908191542n597248x67ddf5f19016a372@mail.gmail.com> <4A8C8065.4050203@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD03856156@TK5EX14MBXC116.redmond.corp.microsoft.com> If 2.6 doesn't work unmodified there's also adding the 2 needed lines to 2.0's pyc: mainMethod = tb.DefineMethod('Main', MethodAttributes.Public | MethodAttributes.Static, int, ()) + if targetKind == System.Reflection.Emit.PEFileKinds.WindowApplication: + mainMethod.SetCustomAttribute(clr.GetClrType(System.STAThreadAttribute).GetConstructor(()), System.Array[System.Byte](())) gen = mainMethod.GetILGenerator() -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, August 19, 2009 3:45 PM To: davidescobar at ieee.org; Discussion of IronPython Subject: Re: [IronPython] FolderBrowserDialog does not show folders David Escobar wrote: > How would I tag Main with the [STAThread] attribute in IronPython? I > thought IP didn't yet have the ability to use attributes... Unfortunately that is something that needs to be done in the Pyc compiler. Did you try Curt's suggestion of using the 2.6 Pyc.py? Michael > > On Wed, Aug 19, 2009 at 3:11 PM, Curt Hagenlocher > > wrote: > > ...which has been fixed for IronPython 2.6. You might be able to > use the 2.6 pyc.py script against 2.0. > > > On Wed, Aug 19, 2009 at 3:09 PM, Curt Hagenlocher > > wrote: > > It's a COM issue. The emitted Main needs to be tagged with the > [STAThread] attribute. > > On Wed, Aug 19, 2009 at 11:41 AM, David Escobar > > wrote: > > Yes, I am. The full command line I'm using is: > *"C:\Program Files\IronPython 2.0.2\ipy.exe" pyc.py > /out:FolderBrowserDialogTest > /main:FolderBrowserDialogTest.py /target:winexe > FolderBrowserDialogTest.py*. > > The dialog window does come up with every control except > the tree view of folders. > > > > On Wed, Aug 19, 2009 at 11:27 AM, Dino Viehland > > wrote: > > Are you compiling w/ the "/target:winexe" option? > You'll need to provide that for doing WinForms > development. > > > > *From:* users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] *On > Behalf Of *David Escobar > *Sent:* Wednesday, August 19, 2009 11:03 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] FolderBrowserDialog does not > show folders > > > > I've noticed an issue with the FolderBrowserDialog > window from IronPython. When I display it with the > ShowDialog method in a compiled script (through > pyc.py), it does not show the TreeView of folders. It > will display the Description title and the buttons, > however. If I run the script straight through the > interpreter, it will display the folders just fine. > For reference, I also tried the OpenFileDialog and > SaveFileDialog, and those show up correctly in both > methods. Is this a bug, or am I doing something wrong? > > Sample code below: > > *import clr > clr.AddReference("System.Windows.Forms") > from System import * > from System.Windows.Forms import * > > dlg = FolderBrowserDialog( ) > dlg.Description = "Testing..." > dlg.ShowDialog( )* > > > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From davidescobar at ieee.org Thu Aug 20 01:13:14 2009 From: davidescobar at ieee.org (David Escobar) Date: Wed, 19 Aug 2009 16:13:14 -0700 Subject: [IronPython] FolderBrowserDialog does not show folders In-Reply-To: <4A8C8065.4050203@voidspace.org.uk> References: <38ef96bd0908191102x97f4f48h356463d8402c90cf@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD03854A6C@TK5EX14MBXC116.redmond.corp.microsoft.com> <38ef96bd0908191141m68a4b767y72df816524ae2eaa@mail.gmail.com> <38ef96bd0908191542n597248x67ddf5f19016a372@mail.gmail.com> <4A8C8065.4050203@voidspace.org.uk> Message-ID: <38ef96bd0908191613k1c9523c3g7c86533aafa4a9c4@mail.gmail.com> Yes, I did. The 2.6 pyc.py did not work when run against 2.0.2, but I downloaded IP 2.6 Beta 2 and now the FolderBrowserDialog comes up correctly. So I guess I'll just use 2.6 from now on. Thanks! On Wed, Aug 19, 2009 at 3:44 PM, Michael Foord wrote: > David Escobar wrote: > >> How would I tag Main with the [STAThread] attribute in IronPython? I >> thought IP didn't yet have the ability to use attributes... >> > Unfortunately that is something that needs to be done in the Pyc compiler. > Did you try Curt's suggestion of using the 2.6 Pyc.py? > > Michael > > >> On Wed, Aug 19, 2009 at 3:11 PM, Curt Hagenlocher > curt at hagenlocher.org>> wrote: >> >> ...which has been fixed for IronPython 2.6. You might be able to >> use the 2.6 pyc.py script against 2.0. >> >> >> On Wed, Aug 19, 2009 at 3:09 PM, Curt Hagenlocher >> > wrote: >> >> It's a COM issue. The emitted Main needs to be tagged with the >> [STAThread] attribute. >> >> On Wed, Aug 19, 2009 at 11:41 AM, David Escobar >> > wrote: >> >> Yes, I am. The full command line I'm using is: >> *"C:\Program Files\IronPython 2.0.2\ipy.exe" pyc.py >> /out:FolderBrowserDialogTest >> /main:FolderBrowserDialogTest.py /target:winexe >> FolderBrowserDialogTest.py*. >> >> The dialog window does come up with every control except >> the tree view of folders. >> >> >> >> On Wed, Aug 19, 2009 at 11:27 AM, Dino Viehland >> > wrote: >> >> Are you compiling w/ the ?/target:winexe? option? >> You?ll need to provide that for doing WinForms >> development. >> >> >> *From:* users-bounces at lists.ironpython.com >> >> [mailto:users-bounces at lists.ironpython.com >> ] *On >> Behalf Of *David Escobar >> *Sent:* Wednesday, August 19, 2009 11:03 AM >> *To:* Discussion of IronPython >> *Subject:* [IronPython] FolderBrowserDialog does not >> show folders >> >> >> I've noticed an issue with the FolderBrowserDialog >> window from IronPython. When I display it with the >> ShowDialog method in a compiled script (through >> pyc.py), it does not show the TreeView of folders. It >> will display the Description title and the buttons, >> however. If I run the script straight through the >> interpreter, it will display the folders just fine. >> For reference, I also tried the OpenFileDialog and >> SaveFileDialog, and those show up correctly in both >> methods. Is this a bug, or am I doing something wrong? >> >> Sample code below: >> >> *import clr >> clr.AddReference("System.Windows.Forms") >> from System import * >> from System.Windows.Forms import * >> >> dlg = FolderBrowserDialog( ) >> dlg.Description = "Testing..." >> dlg.ShowDialog( )* >> >> >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidescobar at ieee.org Thu Aug 20 01:40:07 2009 From: davidescobar at ieee.org (David Escobar) Date: Wed, 19 Aug 2009 16:40:07 -0700 Subject: [IronPython] FolderBrowserDialog does not show folders In-Reply-To: <1A472770E042064698CB5ADC83A12ACD03856156@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <38ef96bd0908191102x97f4f48h356463d8402c90cf@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD03854A6C@TK5EX14MBXC116.redmond.corp.microsoft.com> <38ef96bd0908191141m68a4b767y72df816524ae2eaa@mail.gmail.com> <38ef96bd0908191542n597248x67ddf5f19016a372@mail.gmail.com> <4A8C8065.4050203@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD03856156@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <38ef96bd0908191640x15ce3156k97b8d6b94563187b@mail.gmail.com> I will try that as well. Thanks! On Wed, Aug 19, 2009 at 3:47 PM, Dino Viehland wrote: > If 2.6 doesn't work unmodified there's also adding the 2 needed lines > to 2.0's pyc: > > mainMethod = tb.DefineMethod('Main', MethodAttributes.Public | > MethodAttributes.Static, int, ()) > + if targetKind == System.Reflection.Emit.PEFileKinds.WindowApplication: > + > mainMethod.SetCustomAttribute(clr.GetClrType(System.STAThreadAttribute).GetConstructor(()), > System.Array[System.Byte](())) > gen = mainMethod.GetILGenerator() > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Wednesday, August 19, 2009 3:45 PM > To: davidescobar at ieee.org; Discussion of IronPython > Subject: Re: [IronPython] FolderBrowserDialog does not show folders > > David Escobar wrote: > > How would I tag Main with the [STAThread] attribute in IronPython? I > > thought IP didn't yet have the ability to use attributes... > Unfortunately that is something that needs to be done in the Pyc > compiler. Did you try Curt's suggestion of using the 2.6 Pyc.py? > > Michael > > > > > On Wed, Aug 19, 2009 at 3:11 PM, Curt Hagenlocher > > > wrote: > > > > ...which has been fixed for IronPython 2.6. You might be able to > > use the 2.6 pyc.py script against 2.0. > > > > > > On Wed, Aug 19, 2009 at 3:09 PM, Curt Hagenlocher > > > wrote: > > > > It's a COM issue. The emitted Main needs to be tagged with the > > [STAThread] attribute. > > > > On Wed, Aug 19, 2009 at 11:41 AM, David Escobar > > > wrote: > > > > Yes, I am. The full command line I'm using is: > > *"C:\Program Files\IronPython 2.0.2\ipy.exe" pyc.py > > /out:FolderBrowserDialogTest > > /main:FolderBrowserDialogTest.py /target:winexe > > FolderBrowserDialogTest.py*. > > > > The dialog window does come up with every control except > > the tree view of folders. > > > > > > > > On Wed, Aug 19, 2009 at 11:27 AM, Dino Viehland > > > wrote: > > > > Are you compiling w/ the "/target:winexe" option? > > You'll need to provide that for doing WinForms > > development. > > > > > > > > *From:* users-bounces at lists.ironpython.com > > > > [mailto:users-bounces at lists.ironpython.com > > ] *On > > Behalf Of *David Escobar > > *Sent:* Wednesday, August 19, 2009 11:03 AM > > *To:* Discussion of IronPython > > *Subject:* [IronPython] FolderBrowserDialog does not > > show folders > > > > > > > > I've noticed an issue with the FolderBrowserDialog > > window from IronPython. When I display it with the > > ShowDialog method in a compiled script (through > > pyc.py), it does not show the TreeView of folders. It > > will display the Description title and the buttons, > > however. If I run the script straight through the > > interpreter, it will display the folders just fine. > > For reference, I also tried the OpenFileDialog and > > SaveFileDialog, and those show up correctly in both > > methods. Is this a bug, or am I doing something wrong? > > > > Sample code below: > > > > *import clr > > clr.AddReference("System.Windows.Forms") > > from System import * > > from System.Windows.Forms import * > > > > dlg = FolderBrowserDialog( ) > > dlg.Description = "Testing..." > > dlg.ShowDialog( )* > > > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > _______________________________________________ > 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 marco.parenzan at libero.it Thu Aug 20 09:56:37 2009 From: marco.parenzan at libero.it (Marco Parenzan) Date: Thu, 20 Aug 2009 09:56:37 +0200 Subject: [IronPython] IronPython and ReportLab Message-ID: <007301ca216b$be7bc480$3b734d80$@parenzan@libero.it> Dear All, I'm trying to use IronPython 2.0.2 with ReportLab PDF. I have downloaded it (version 2.3) with FePy for unicodedata.py. I used this code for testing (from Magnus Lie Hetland "Beginning Python"): from reportlab.graphics.shapes import Drawing, String from reportlab.graphics import renderPDF d = Drawing(100, 100) s = String(50, 50, "Hello World", textAlign='middle') d.add(s) renderPDF.drawToFile(d, "HelloWorld.pdf", "HW") The execution fails: Traceback (most recent call last): File "renderPDF01.py", line 9, in renderPDF01.py File "C:\marco.parenzan\Python\reportlab\graphics\renderPDF.py", line 268, in drawToFile File "C:\marco.parenzan\Python\reportlab\pdfgen\canvas.py", line 947, in save File "C:\marco.parenzan\Python\reportlab\pdfbase\pdfdoc.py", line 223, in SaveToFile File "C:\marco.parenzan\Python\reportlab\pdfbase\pdfdoc.py", line 245, in GetPDFData File "C:\marco.parenzan\Python\reportlab\pdfbase\pdfdoc.py", line 422, in format File "C:\marco.parenzan\Python\reportlab\pdfbase\pdfdoc.py", line 883, in format File "mscorlib", line unknown, in GetString File "mscorlib", line unknown, in GetChars File "mscorlib", line unknown, in Fallback File "mscorlib", line unknown, in Throw UnicodeDecodeError: ('unknown', u'\x93', 11, 12, '') The failed row shows: 882: def format(self, document): 883: strings = map(str, self.strings) # final conversion, in case of lazy objects 884: return string.join(strings, "") I have discovered that the problem is in this string, that is the header for the PDF file: # Following Ken Lunde's advice and the PDF spec, this includes # some high-order bytes. I chose the characters for Tokyo # in Shift-JIS encoding, as these cannot be mistaken for # any other encoding, and we'll be able to tell if something # has run our PDF files through a dodgy Unicode conversion. PDFHeader = ( "%PDF-1.3"+LINEEND+ "%\223\214\213\236 ReportLab Generated PDF document http://www.reportlab.com "+LINEEND) Which is appended at the beginning of str variable. The problem is in the four characters: \223\214\213\236, which are badly converted into Unicode. Accordingly to the comment (and to PDF documentation) the four bytes are not fixed, but can be any number, better if >128 because of automatic detection as binary, not text. If I convert them into full-code Unicode characters \x00DF\x00D6\x00D5\x00EC, all is ok. "%\x00DF\x00D6\x00D5\x00EC ReportLab Generated PDF document http://www.reportlab.com"+LINEEND)" Do you know why? Uuhh, reportLab is very long to execute (Vista32, CoreDuo 2.5GHz, 4GbRAM):about 20 seconds. Marco [dot] Parenzan [at] libero [dot] it -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.parenzan at libero.it Thu Aug 20 11:26:14 2009 From: marco.parenzan at libero.it (Marco Parenzan) Date: Thu, 20 Aug 2009 11:26:14 +0200 Subject: [IronPython] Performances and Profiling of ReportLab under IronPython Message-ID: <008301ca2178$43716ee0$ca544ca0$@parenzan@libero.it> Dear All, I downloaded IPY2.6beta2 to test this script: from reportlab.graphics.shapes import Drawing, String from reportlab.graphics import renderPDF d = Drawing(100, 100) s = String(50, 50, "Hello World", textAlign='middle') d.add(s) renderPDF.drawToFile(d, "HelloWorld.pdf", "HW") IPY 2.0.2 takes 20 seconds; IPY 2.6beta2 about 8! But it takes long....CPython takes less that a second. I have executed profiling from Curt post . This is the result (first 15 rows, sorted by calls DESC): Name Inclusive Exclusive Calls type Builtin: method: chr(Int32) 46543 46543 1453 type Builtin: method: ord(Object) 17910 17910 888 type List: method: append(Object) 11752 11752 468 type Builtin: method: __import__(CodeContext, String, Object, Object, Object, Int32) 209641377 209641377 380 type Builtin: method: hasattr(CodeContext, Object, String) 771507 771507 317 type Builtin: method: divmod(CodeContext, Object, Object) 99164 99164 262 type PythonDictionary: method: has_key(Object) 48355 48355 218 type Builtin: method: len(Object) 42922 42922 189 type StringOps: method: join(String, List) 19591 19591 182 module colors: class Color: def __init__(self, red, green, blue) 17359 8780 150 module colors: def HexColor(val, htmlOnly) 145565 6839 150 type Builtin: method: isinstance(CodeContext, Object, Object) 6342 6342 146 module pdfdoc: def format(element, document, toplevel, InstanceType) 5712898 6437 114 module pdfutils: def _escape(s): def (c, d) 4710 2922 108 type StringOps: method: lower(String) 3266 3266 100 Sorted by Inclusive: Name Inclusive Exclusive Calls type Builtin: method: __import__(CodeContext, String, Object, Object, Object, Int32) 209641377 209641377 380 module renderPDF01 61950185 256 1 module shapes 45433217 1455217 1 module __init__ 40333697 53011 8 module site 18405008 1141596 1 module renderPDF: def drawToFile(d, fn, msg, showBoundary, autoSize) 13208473 210 1 module flowables 13108755 64681 1 module os 10374697 101300 1 module paragraph 9988916 104182 1 module colors 9227303 9866 1 module utils 7020300 220690 1 module canvas: class Canvas: def save(self) 6521990 49 1 module pdfdoc: class PDFDocument: def SaveToFile(self, filename, canvas) 6493142 169 1 module pdfdoc: class PDFDocument: def GetPDFData(self, canvas) 6215312 142 1 module pdfdoc: def format(element, document, toplevel, InstanceType) 5712898 6437 114 I have not experience: any idea on improving performances? Thanks Marco [dot] Parenzan [at] libero [dot] it -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.parenzan at libero.it Thu Aug 20 12:00:06 2009 From: marco.parenzan at libero.it (Marco Parenzan) Date: Thu, 20 Aug 2009 12:00:06 +0200 Subject: [IronPython] Answer from ReportLab about unicode chars Message-ID: <009301ca217c$fee17450$fca45cf0$@parenzan@libero.it> I have posted my question about unicode chars also to reportlab. I have some answers. Any comment? Marco [dot] Parenzan [at] libero [dot] it ------------------------------ Message: 4 Date: Thu, 20 Aug 2009 10:10:49 +0100 From: Robin Becker Subject: Re: [reportlab-users] IronPython and ReportLab To: Support list for users of Reportlab software Message-ID: <4A8D1319.8020205 at chamonix.reportlab.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Marco, in CPython reportlab we expect all strings to be either bytes in utf8 encoding or unicode. I suspect that the default string encoding in ironpython is something other than that so a lot of reportlab string handling may be broken. Does ironpython support unicode directly ie u'Hello World'? I would not expect reportlab to work out of the box with ironpython. PDF doesn't use unicode (normally) and most of the output is in Adobe specific encodings. I don't think the real problem lies in our use of strange bytes (although that may not help). If the string in question is the special sequence we use at the beginning of the document then the issue is deeper since that string doesn't normally require any special manipulation (ie we expect it to appear literally in the output as a sequence of bytes). If we are unable to write bytes directly to a file then many other problems will also need to be found and fixed. This problem also arises in Python 3.x so may eventually be solved for you. As to why reportlab takes so long to execute I cannot say. -- Robin Becker ------------------------------ Message: 5 Date: Thu, 20 Aug 2009 21:20:25 +1200 From: Tony Meyer Subject: Re: [reportlab-users] IronPython and ReportLab To: Support list for users of Reportlab software Message-ID: Content-Type: text/plain; charset=ISO-8859-1 (For context, I've only ever used ReportLab with CPython. I do use IronPython for other things, though). > Does ironpython support unicode directly ie u'Hello World'? Yes. IronPython is like Python 3.x in that there are only unicode strings (`str is unicode` evaluates to True). > As to why reportlab takes so long to execute I cannot say. IronPython is faster than CPython with some things, but CPython is much, much faster at starting up than IronPython. I suspect that Marco is just seeing the regular slow startup of IronPython. Cheers, Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From k.kanryu at gmail.com Thu Aug 20 13:09:00 2009 From: k.kanryu at gmail.com (KATO Kanryu) Date: Thu, 20 Aug 2009 20:09:00 +0900 Subject: [IronPython] How to get stack traces from runtime exception with using generators. Message-ID: I use generators in IronPython. if a exception occars in the one, I cannot get correct stack traces. How to get the trace? The following, my codes. /// /// Run a python method, and if exception occars, to trap it. /// static object CallFunctionImp(callee func) { try { var python_function = Scope.GetVariable(funcName); var result = PythonEngine.Runtime.Operations.Call(python_function); return result; } catch (Microsoft.Scripting.SyntaxErrorException ex) { var Language = HostingHelpers.GetLanguageContext(PythonEngine); Console.WriteError(Language.FormatException(ex)); Console.WriteError(FrameToString(new StackFrame(2, true))); } catch (Exception ex) { string type = ex.GetType().ToString(); Console.Error("{0}: {1}\n", ex.GetType(), ex.Message); // write out call stacks Console.Info(FrameToString(new StackFrame(2, true))); // write out call stacks upper the function string result = ""; foreach (DynamicStackFrame frame in ExceptionHelpers.GetStackFrames(ex, true)) { MethodBase method = frame.GetMethod(); if (method.DeclaringType != null && method.DeclaringType.FullName.StartsWith("IronPython.")) { continue; } result += FrameToString(frame) + Environment.NewLine; } Console.Info(result); } throw new MyScriptingExeption(); } static string FrameToString(DynamicStackFrame frame) { string methodName = frame.GetMethodName(); int lineNumber = frame.GetFileLineNumber(); return String.Format(" File \"{0}\", line {1}, in {2}", frame.GetFileName(), lineNumber == 0 ? "unknown" : lineNumber.ToString(), methodName); } static string FrameToString(StackFrame frame) { string stacks = string.Format(@" File ""{0}"", line {1}, in {2}", frame.GetFileName(), frame.GetFileLineNumber(), frame.GetMethod().ToString()); return stacks; } From marco.parenzan at libero.it Thu Aug 20 13:46:15 2009 From: marco.parenzan at libero.it (Marco Parenzan) Date: Thu, 20 Aug 2009 13:46:15 +0200 Subject: [IronPython] Performances and Profiling of ReportLab under IronPython Message-ID: <00a001ca218b$d3569cc0$7a03d640$@parenzan@libero.it> Boys I have a news. Executing code interactive, I have an important result: - Launching IPY: 3seconds - from reportlab.graphics.shapes import Drawing, String: ? seconds - renderPDF.drawToFile(d, "C:\users\marco.parenzan\desktop\uuu.pdf", "HellO"): 1 second!!!!!!!!!!! (all timings are my counting in my mind!) I have not taken in count this! Sorry, but these are my first seriour experiments with IPY. So I can: - preload IPY engine (not a bad idea) - preload reportlab (also not bad). I can execute statement from engine(?from reportlab.graphics.shapes import Drawing, String?), but, is there an API that allow making this via hosting (scriptscope.import?)? Where can I read about long startup time? What about import? Why long time? Which are the differences with CPython? Thanks in advance Marco [dot] Parenzan [at] libero [dot] it From: Marco Parenzan [mailto:marco.parenzan at libero.it] Sent: gioved? 20 agosto 2009 11.26 To: 'users at lists.ironpython.com' Subject: Performances and Profiling of ReportLab under IronPython Dear All, I downloaded IPY2.6beta2 to test this script: from reportlab.graphics.shapes import Drawing, String from reportlab.graphics import renderPDF d = Drawing(100, 100) s = String(50, 50, "Hello World", textAlign='middle') d.add(s) renderPDF.drawToFile(d, "HelloWorld.pdf", "HW") IPY 2.0.2 takes 20 seconds; IPY 2.6beta2 about 8! But it takes long....CPython takes less that a second. I have executed profiling from Curt post . This is the result (first 15 rows, sorted by calls DESC): Name Inclusive Exclusive Calls type Builtin: method: chr(Int32) 46543 46543 1453 type Builtin: method: ord(Object) 17910 17910 888 type List: method: append(Object) 11752 11752 468 type Builtin: method: __import__(CodeContext, String, Object, Object, Object, Int32) 209641377 209641377 380 type Builtin: method: hasattr(CodeContext, Object, String) 771507 771507 317 type Builtin: method: divmod(CodeContext, Object, Object) 99164 99164 262 type PythonDictionary: method: has_key(Object) 48355 48355 218 type Builtin: method: len(Object) 42922 42922 189 type StringOps: method: join(String, List) 19591 19591 182 module colors: class Color: def __init__(self, red, green, blue) 17359 8780 150 module colors: def HexColor(val, htmlOnly) 145565 6839 150 type Builtin: method: isinstance(CodeContext, Object, Object) 6342 6342 146 module pdfdoc: def format(element, document, toplevel, InstanceType) 5712898 6437 114 module pdfutils: def _escape(s): def (c, d) 4710 2922 108 type StringOps: method: lower(String) 3266 3266 100 Sorted by Inclusive: Name Inclusive Exclusive Calls type Builtin: method: __import__(CodeContext, String, Object, Object, Object, Int32) 209641377 209641377 380 module renderPDF01 61950185 256 1 module shapes 45433217 1455217 1 module __init__ 40333697 53011 8 module site 18405008 1141596 1 module renderPDF: def drawToFile(d, fn, msg, showBoundary, autoSize) 13208473 210 1 module flowables 13108755 64681 1 module os 10374697 101300 1 module paragraph 9988916 104182 1 module colors 9227303 9866 1 module utils 7020300 220690 1 module canvas: class Canvas: def save(self) 6521990 49 1 module pdfdoc: class PDFDocument: def SaveToFile(self, filename, canvas) 6493142 169 1 module pdfdoc: class PDFDocument: def GetPDFData(self, canvas) 6215312 142 1 module pdfdoc: def format(element, document, toplevel, InstanceType) 5712898 6437 114 I have not experience: any idea on improving performances? Thanks Marco [dot] Parenzan [at] libero [dot] it -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.parenzan at libero.it Thu Aug 20 16:21:47 2009 From: marco.parenzan at libero.it (Marco Parenzan) Date: Thu, 20 Aug 2009 16:21:47 +0200 Subject: [IronPython] Performances and Profiling of ReportLab under IronPython Message-ID: <00a801ca21a1$8d7cfb70$a876f250$@parenzan@libero.it> Other results. I have hosted IPY in a test C# application in which I separate ScriptScope creation from execution: specifically, I create scope one time, import modules, and then execute, 100 times. Timings are ok: Python Startup Elapsed time: 10595 Execution 0 Elapsed time: 1454ms Execution 1 Elapsed time: 55ms Execution 2 Elapsed time: 38ms Execution 3 Elapsed time: 32ms Execution 4 Elapsed time: 32ms Execution 5 Elapsed time: 35ms Execution 6 Elapsed time: 27ms Execution 7 Elapsed time: 27ms Execution 8 Elapsed time: 27ms Execution 9 Elapsed time: 25ms Execution 10 Elapsed time: 39ms Execution 99 Elapsed time: 22ms At the moment for me is ok (waiting for a solutions, or, at least, to understand the 10 seconds!). Another question:. This is the code I use to create the scope: __pyEngine = Python.CreateEngine(); __pyEngine.SetSearchPaths(__pySearchPaths); __pyScope = __pyEngine.CreateScope(); __pyEngine.Execute("from reportlab.graphics.shapes import Drawing, String", __pyScope); __pyEngine.Execute("from reportlab.graphics import renderPDF", __pyScope); and I use the scope to execute the subsequent code d = Drawing(100, 100) s = String(50, 50, "Hello World", textAlign='middle') d.add(s) renderPDF.drawToFile(d, "HelloWorld.pdf", "HW") The thing I dislike is sharing the single scope among the multiple execution of scripts during process life: I?d like to recreate scope every time, but at the moment I have the discussed module load cost. Is there any way to load the module at engine level (a sort of global) that all scopes can view, without importing every time? Thanks in advance Marco [dot] Parenzan [at] libero [dot] it From: Marco Parenzan [mailto:marco.parenzan at libero.it] Sent: gioved? 20 agosto 2009 11.26 To: 'users at lists.ironpython.com' Subject: Performances and Profiling of ReportLab under IronPython Dear All, I downloaded IPY2.6beta2 to test this script: from reportlab.graphics.shapes import Drawing, String from reportlab.graphics import renderPDF d = Drawing(100, 100) s = String(50, 50, "Hello World", textAlign='middle') d.add(s) renderPDF.drawToFile(d, "HelloWorld.pdf", "HW") IPY 2.0.2 takes 20 seconds; IPY 2.6beta2 about 8! But it takes long....CPython takes less that a second. I have executed profiling from Curt post . This is the result (first 15 rows, sorted by calls DESC): Name Inclusive Exclusive Calls type Builtin: method: chr(Int32) 46543 46543 1453 type Builtin: method: ord(Object) 17910 17910 888 type List: method: append(Object) 11752 11752 468 type Builtin: method: __import__(CodeContext, String, Object, Object, Object, Int32) 209641377 209641377 380 type Builtin: method: hasattr(CodeContext, Object, String) 771507 771507 317 type Builtin: method: divmod(CodeContext, Object, Object) 99164 99164 262 type PythonDictionary: method: has_key(Object) 48355 48355 218 type Builtin: method: len(Object) 42922 42922 189 type StringOps: method: join(String, List) 19591 19591 182 module colors: class Color: def __init__(self, red, green, blue) 17359 8780 150 module colors: def HexColor(val, htmlOnly) 145565 6839 150 type Builtin: method: isinstance(CodeContext, Object, Object) 6342 6342 146 module pdfdoc: def format(element, document, toplevel, InstanceType) 5712898 6437 114 module pdfutils: def _escape(s): def (c, d) 4710 2922 108 type StringOps: method: lower(String) 3266 3266 100 Sorted by Inclusive: Name Inclusive Exclusive Calls type Builtin: method: __import__(CodeContext, String, Object, Object, Object, Int32) 209641377 209641377 380 module renderPDF01 61950185 256 1 module shapes 45433217 1455217 1 module __init__ 40333697 53011 8 module site 18405008 1141596 1 module renderPDF: def drawToFile(d, fn, msg, showBoundary, autoSize) 13208473 210 1 module flowables 13108755 64681 1 module os 10374697 101300 1 module paragraph 9988916 104182 1 module colors 9227303 9866 1 module utils 7020300 220690 1 module canvas: class Canvas: def save(self) 6521990 49 1 module pdfdoc: class PDFDocument: def SaveToFile(self, filename, canvas) 6493142 169 1 module pdfdoc: class PDFDocument: def GetPDFData(self, canvas) 6215312 142 1 module pdfdoc: def format(element, document, toplevel, InstanceType) 5712898 6437 114 I have not experience: any idea on improving performances? Thanks Marco [dot] Parenzan [at] libero [dot] it -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Thu Aug 20 16:43:08 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 20 Aug 2009 07:43:08 -0700 Subject: [IronPython] Performances and Profiling of ReportLab under IronPython In-Reply-To: <-7960212116417447806@unknownmsgid> References: <-7960212116417447806@unknownmsgid> Message-ID: Imports are specific to a ScriptEngine. When you create a new ScriptScope through the hosting interface and run "import foo" inside of it, the standard Python behavior applies -- if "foo" is already in sys.modules, it won't be imported again. Instead, the name will just be added to the current scope. When you say "startup time" in this context -- that includes the time it takes to import the modules? On Thu, Aug 20, 2009 at 7:21 AM, Marco Parenzan wrote: > Other results. > > > > I have hosted IPY in a test C# application in which I separate ScriptScope > creation from execution: specifically, I create scope one time, import > modules, and then execute, 100 times. > > Timings are ok: > > > > Python Startup Elapsed time: 10595 > > Execution 0 Elapsed time: 1454ms > > Execution 1 Elapsed time: 55ms > > Execution 2 Elapsed time: 38ms > > Execution 3 Elapsed time: 32ms > > Execution 4 Elapsed time: 32ms > > Execution 5 Elapsed time: 35ms > > Execution 6 Elapsed time: 27ms > > Execution 7 Elapsed time: 27ms > > Execution 8 Elapsed time: 27ms > > Execution 9 Elapsed time: 25ms > > Execution 10 Elapsed time: 39ms > > ? > > Execution 99 Elapsed time: 22ms > > > > At the moment for me is ok (waiting for a solutions, or, at least, to > understand the 10 seconds!). > > > > Another question:. This is the code I use to create the scope: > > > > __pyEngine = Python.CreateEngine(); > > __pyEngine.SetSearchPaths(__pySearchPaths); > > > > __pyScope = __pyEngine.CreateScope(); > > __pyEngine.Execute("from reportlab.graphics.shapes import Drawing, > String", __pyScope); > > __pyEngine.Execute("from reportlab.graphics import renderPDF", > __pyScope); > > > > > > ?and I use the scope to execute the subsequent code > > > > d = Drawing(100, 100) > > s = String(50, 50, "Hello World", textAlign='middle') > > > > d.add(s) > > > > renderPDF.drawToFile(d, "HelloWorld.pdf", "HW") > > > > The thing I dislike is sharing the single scope among the multiple > execution of scripts during process life: I?d like to recreate scope every > time, but at the moment I have the discussed module load cost. Is there any > way to load the module at engine level (a sort of global) that all scopes > can view, without importing every time? > > > > Thanks in advance > > > > Marco [dot] Parenzan [at] libero [dot] it > > > > *From:* Marco Parenzan [mailto:marco.parenzan at libero.it] > *Sent:* gioved? 20 agosto 2009 11.26 > *To:* 'users at lists.ironpython.com' > *Subject:* Performances and Profiling of ReportLab under IronPython > > > > Dear All, > > > > I downloaded IPY2.6beta2 to test this script: > > > > from reportlab.graphics.shapes import Drawing, String > > from reportlab.graphics import renderPDF > > > > d = Drawing(100, 100) > > s = String(50, 50, "Hello World", textAlign='middle') > > > > d.add(s) > > > > renderPDF.drawToFile(d, "HelloWorld.pdf", "HW") > > > > IPY 2.0.2 takes 20 seconds; IPY 2.6beta2 about 8! But it takes > long....CPython takes less that a second. > > > > I have executed profiling from Curt post. > This is the result (first 15 rows, sorted by calls DESC): > > > > Name > > Inclusive > > Exclusive > > Calls > > type Builtin: method: chr(Int32) > > 46543 > > 46543 > > 1453 > > type Builtin: method: ord(Object) > > 17910 > > 17910 > > 888 > > type List: method: append(Object) > > 11752 > > 11752 > > 468 > > type Builtin: method: __import__(CodeContext, String, Object, Object, > Object, Int32) > > 209641377 > > 209641377 > > 380 > > type Builtin: method: hasattr(CodeContext, Object, String) > > 771507 > > 771507 > > 317 > > type Builtin: method: divmod(CodeContext, Object, Object) > > 99164 > > 99164 > > 262 > > type PythonDictionary: method: has_key(Object) > > 48355 > > 48355 > > 218 > > type Builtin: method: len(Object) > > 42922 > > 42922 > > 189 > > type StringOps: method: join(String, List) > > 19591 > > 19591 > > 182 > > module colors: class Color: def __init__(self, red, green, blue) > > 17359 > > 8780 > > 150 > > module colors: def HexColor(val, htmlOnly) > > 145565 > > 6839 > > 150 > > type Builtin: method: isinstance(CodeContext, Object, Object) > > 6342 > > 6342 > > 146 > > module pdfdoc: def format(element, document, toplevel, InstanceType) > > 5712898 > > 6437 > > 114 > > module pdfutils: def _escape(s): def (c, d) > > 4710 > > 2922 > > 108 > > type StringOps: method: lower(String) > > 3266 > > 3266 > > 100 > > > > Sorted by Inclusive: > > > > Name > > Inclusive > > Exclusive > > Calls > > type Builtin: method: __import__(CodeContext, String, Object, Object, > Object, Int32) > > 209641377 > > 209641377 > > 380 > > module renderPDF01 > > 61950185 > > 256 > > 1 > > module shapes > > 45433217 > > 1455217 > > 1 > > module __init__ > > 40333697 > > 53011 > > 8 > > module site > > 18405008 > > 1141596 > > 1 > > module renderPDF: def drawToFile(d, fn, msg, showBoundary, autoSize) > > 13208473 > > 210 > > 1 > > module flowables > > 13108755 > > 64681 > > 1 > > module os > > 10374697 > > 101300 > > 1 > > module paragraph > > 9988916 > > 104182 > > 1 > > module colors > > 9227303 > > 9866 > > 1 > > module utils > > 7020300 > > 220690 > > 1 > > module canvas: class Canvas: def save(self) > > 6521990 > > 49 > > 1 > > module pdfdoc: class PDFDocument: def SaveToFile(self, filename, canvas) > > 6493142 > > 169 > > 1 > > module pdfdoc: class PDFDocument: def GetPDFData(self, canvas) > > 6215312 > > 142 > > 1 > > module pdfdoc: def format(element, document, toplevel, InstanceType) > > 5712898 > > 6437 > > 114 > > > > I have not experience: any idea on improving performances? Thanks > > > > Marco [dot] Parenzan [at] libero [dot] it > > _______________________________________________ > 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 marco.parenzan at libero.it Thu Aug 20 17:18:27 2009 From: marco.parenzan at libero.it (Marco Parenzan) Date: Thu, 20 Aug 2009 17:18:27 +0200 Subject: [IronPython] Performances and Profiling of ReportLab under IronPython In-Reply-To: References: Message-ID: <00ad01ca21a9$7816a4e0$6843eea0$@parenzan@libero.it> Curt, thanks for tip: it's ok. That's the code: __pySearchPaths = new List(Properties.Settings.Default.PySearchPaths.Split(';')); __pyEngine = Python.CreateEngine(); __pyEngine.SetSearchPaths(__pySearchPaths); __pyEngine.ImportModule("reportlab.graphics"); __pyEngine.ImportModule("reportlab.graphics.shapes"); ScriptScope scope = __pyEngine.CreateScope(); ScriptWriter writer = new ScriptWriter(); // an helper class I use to write python code in C# code writer.Clear(); writer.Write("from reportlab.graphics.shapes import Drawing, String"); writer.Write("from reportlab.graphics import renderPDF"); writer.Write("d = Drawing(100, 100)"); writer.Write("s = String(50, 50, 'Hello world', textAlign='middle')"); writer.Write("d.add(s)"); writer.Write(@"renderPDF.drawToFile(d, 'HW.pdf', 'Hello World {0}')"); __pyEngine.Execute(writer.Script(false), scope); About startup time: yes, the first five lines takes 10/11 seconds! With your tip I have solved my problem, but I don't understand the difference between IPY and CPython (1 seconds from start to end). Marco -----Original Message----- Date: Thu, 20 Aug 2009 07:43:08 -0700 From: Curt Hagenlocher To: Discussion of IronPython Subject: Re: [IronPython] Performances and Profiling of ReportLab under IronPython Message-ID: Content-Type: text/plain; charset="windows-1252" Imports are specific to a ScriptEngine. When you create a new ScriptScope through the hosting interface and run "import foo" inside of it, the standard Python behavior applies -- if "foo" is already in sys.modules, it won't be imported again. Instead, the name will just be added to the current scope. When you say "startup time" in this context -- that includes the time it takes to import the modules? From dinov at microsoft.com Thu Aug 20 17:47:38 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 20 Aug 2009 15:47:38 +0000 Subject: [IronPython] How to get stack traces from runtime exception with using generators. In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD0385C1E5@TK5EX14MBXC116.redmond.corp.microsoft.com> Is there a reason you can't just call FormatException for both cases? Depending on how the exception is propagated there may be more data in the exception Data property which we need to pick out and format to accurately display it. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of KATO Kanryu Sent: Thursday, August 20, 2009 4:09 AM To: Discussion of IronPython Subject: [IronPython] How to get stack traces from runtime exception with using generators. I use generators in IronPython. if a exception occars in the one, I cannot get correct stack traces. How to get the trace? The following, my codes. /// /// Run a python method, and if exception occars, to trap it. /// static object CallFunctionImp(callee func) { try { var python_function = Scope.GetVariable(funcName); var result = PythonEngine.Runtime.Operations.Call(python_function); return result; } catch (Microsoft.Scripting.SyntaxErrorException ex) { var Language = HostingHelpers.GetLanguageContext(PythonEngine); Console.WriteError(Language.FormatException(ex)); Console.WriteError(FrameToString(new StackFrame(2, true))); } catch (Exception ex) { string type = ex.GetType().ToString(); Console.Error("{0}: {1}\n", ex.GetType(), ex.Message); // write out call stacks Console.Info(FrameToString(new StackFrame(2, true))); // write out call stacks upper the function string result = ""; foreach (DynamicStackFrame frame in ExceptionHelpers.GetStackFrames(ex, true)) { MethodBase method = frame.GetMethod(); if (method.DeclaringType != null && method.DeclaringType.FullName.StartsWith("IronPython.")) { continue; } result += FrameToString(frame) + Environment.NewLine; } Console.Info(result); } throw new MyScriptingExeption(); } static string FrameToString(DynamicStackFrame frame) { string methodName = frame.GetMethodName(); int lineNumber = frame.GetFileLineNumber(); return String.Format(" File \"{0}\", line {1}, in {2}", frame.GetFileName(), lineNumber == 0 ? "unknown" : lineNumber.ToString(), methodName); } static string FrameToString(StackFrame frame) { string stacks = string.Format(@" File ""{0}"", line {1}, in {2}", frame.GetFileName(), frame.GetFileLineNumber(), frame.GetMethod().ToString()); return stacks; } _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Thu Aug 20 17:51:38 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 20 Aug 2009 15:51:38 +0000 Subject: [IronPython] Performances and Profiling of ReportLab under IronPython In-Reply-To: <00ad01ca21a9$7816a4e0$6843eea0$@parenzan@libero.it> References: <00ad01ca21a9$7816a4e0$6843eea0$@parenzan@libero.it> Message-ID: <1A472770E042064698CB5ADC83A12ACD0385C28C@TK5EX14MBXC116.redmond.corp.microsoft.com> IronPython import time remains much slower than CPython. I think you've seen from the differences between 2.0 and 2.6 that we've already made significant progress in improving this - and we certainly plan to continue pushing on it with each release. One way to improve startup time today is to use the pyc tool (in Tools\Scripts in the IronPython install) to pre-compile your .py files. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Marco Parenzan Sent: Thursday, August 20, 2009 8:18 AM To: users at lists.ironpython.com Subject: Re: [IronPython] Performances and Profiling of ReportLab under IronPython Curt, thanks for tip: it's ok. That's the code: __pySearchPaths = new List(Properties.Settings.Default.PySearchPaths.Split(';')); __pyEngine = Python.CreateEngine(); __pyEngine.SetSearchPaths(__pySearchPaths); __pyEngine.ImportModule("reportlab.graphics"); __pyEngine.ImportModule("reportlab.graphics.shapes"); ScriptScope scope = __pyEngine.CreateScope(); ScriptWriter writer = new ScriptWriter(); // an helper class I use to write python code in C# code writer.Clear(); writer.Write("from reportlab.graphics.shapes import Drawing, String"); writer.Write("from reportlab.graphics import renderPDF"); writer.Write("d = Drawing(100, 100)"); writer.Write("s = String(50, 50, 'Hello world', textAlign='middle')"); writer.Write("d.add(s)"); writer.Write(@"renderPDF.drawToFile(d, 'HW.pdf', 'Hello World {0}')"); __pyEngine.Execute(writer.Script(false), scope); About startup time: yes, the first five lines takes 10/11 seconds! With your tip I have solved my problem, but I don't understand the difference between IPY and CPython (1 seconds from start to end). Marco -----Original Message----- Date: Thu, 20 Aug 2009 07:43:08 -0700 From: Curt Hagenlocher To: Discussion of IronPython Subject: Re: [IronPython] Performances and Profiling of ReportLab under IronPython Message-ID: Content-Type: text/plain; charset="windows-1252" Imports are specific to a ScriptEngine. When you create a new ScriptScope through the hosting interface and run "import foo" inside of it, the standard Python behavior applies -- if "foo" is already in sys.modules, it won't be imported again. Instead, the name will just be added to the current scope. When you say "startup time" in this context -- that includes the time it takes to import the modules? _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From merllab at microsoft.com Thu Aug 20 17:54:15 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Thu, 20 Aug 2009 08:54:15 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/58263. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Lib/iptest/assert_util.py $/IronPython/IronPython_Main/Src/IronPython.Modules/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Generation/AssemblyGen.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ScriptScope.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ScriptRuntime.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/CompiledCode.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ObjectOperations.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ScriptEngine.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ScriptSource.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonUnaryOperationBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonOperationBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/ConversionBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Generator.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/List.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_Main/Src/IronPython/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Tests/modules/_warnings_test.py $/IronPython/IronPython_Main/Src/Tests/Modes/ConsoleFlags.ps1 $/IronPython/IronPython_Main/Src/Tests/interop/com/apps/excel.py $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Utils/TypeUtils.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/Shell/ConsoleHost.cs $/IronPython/IronPython_Main/Src/Tests/test_file.py $/IronPython/IronPython_Main/Src/Tests/test_builtinfunc.py $/IronPython/IronPython_Main/Src/Tests/test_nt.py $/IronPython/IronPython_Main/Src/Tests/test_re.py $/IronPython/IronPython_Main/Src/Tests/test_imp.py $/IronPython/IronPython_Main/Src/Tests/test_function.py $/IronPython/IronPython_Main/Src/Tests/test_syntax.py $/IronPython/IronPython_Main/Src/Tests/test_thread.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1068595 Date: 8/19/2009 8:41:00 PM (dfugate) - test_gc.py: 314470 was closed as Won't Fix ages ago, but the test cases were never updated. Modified them to reflect that this is considered an incompatibility, not a bug - test_descr.py: 314130 - test_scope.py: 149066 is fixed - iptest.assert_util: improved stderr_trapper and stdout_trapper. Propagated these changes down to test_syntax and _warnings_test.py - test_builtinfunc.py: CP24249 not really fixed - test_file.py: extended a regression on file's 'buffering' param - test_nt.py: added a regression for CP1217. Fixed - test_re.py: added a regression for re.search(..., buffer(...)) - test_thread.py: CP22746 is fixed - excel.py: 372472 might be fixed. CP18614 is fixed (Shelveset: CP73;REDMOND\dfugate | SNAP CheckinId: 9190) -------------------------------------------------------------------------------- Changeset Id: 1068510 Date: 8/19/2009 7:35:22 PM (dinov) A few changes to improve perf of some of the shootout tests: Generators ? ensure CheckSetActive() can be inlined Lists slice assign ? if we are assigning from an immutable/non-list RHS then lock the LHS and only once rather than on each assignment Conversion to bool call sites ? a common pattern is checking for None & a single type (List, tuple, str, int, etc?). Update the pre-generated sites to include checks for null which return the appropriate value. This prevents us from bouncing around updating call sites and switch back and forth between the (type) & None sites. Sequence unpacking ? if we have a tuple just return it?s data array instead of copying it in the slowest possible way. (Shelveset: ShootoutPerfTweaksFinal;REDMOND\dinov | SNAP CheckinId: 9189) -------------------------------------------------------------------------------- Changeset Id: 1067396 Date: 8/19/2009 9:26:35 AM (dfugate) - test_re.py: enabled more of test_pickling - test_function.py: extended test_splat_none. CP20250 not entirely fixed - ConsoleFlags.ps1: "ipy /?" now works (CP2397) (Shelveset: CP72;REDMOND\dfugate | SNAP CheckinId: 9180) From k.kanryu at gmail.com Fri Aug 21 05:09:15 2009 From: k.kanryu at gmail.com (KATO Kanryu) Date: Fri, 21 Aug 2009 12:09:15 +0900 Subject: [IronPython] How to get stack traces from runtime exception with using generators. In-Reply-To: <1A472770E042064698CB5ADC83A12ACD0385C1E5@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD0385C1E5@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: 2009/8/21 Dino Viehland : > Is there a reason you can't just call FormatException for both cases? OK. I rewrote to the following: | catch(Exception ex) | { | var pythonContext = HostingHelpers.GetLanguageContext(pythonEngine) as PythonContext; | Igs.Trace.Error(pythonContext.FormatException(ex)); | } But I havn't get stack traces upper the generator yet :( From merllab at microsoft.com Fri Aug 21 17:53:44 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Fri, 21 Aug 2009 08:53:44 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/58283. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Compiler/RunnableScriptCode.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/DictionaryGlobalAllocator.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/PythonScriptCode.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/ArrayGlobalAllocator.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/SavableGlobalAllocator.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/RuntimeScriptCode.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/OnDiskScriptCode.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/array.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/cStringIO.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/FunctionDefinition.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/ClassDefinition.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/AstGenerator.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonDynamicStackFrame.cs $/IronPython/IronPython_Main/Src/IronPython/Modules/Builtin.cs $/IronPython/IronPython_Main/Src/IronPython/Modules/sys.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonTracebackListener.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Runtime/LanguageContext.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/SourceUnit.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Generation/ToDiskRewriter.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/SavableScriptCode.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/StaticGlobalAllocator.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonOptions.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/FunctionCode.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Exceptions/TraceBack.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_Main/Src/IronPythonTest/EngineTest.cs $/IronPython/IronPython_Main/Src/IronPython/Hosting/PythonOptionsParser.cs $/IronPython/IronPython_Main/Src/Tests/Modes/ConsoleHelp.Debug.out $/IronPython/IronPython_Main/Src/Tests/Modes/ConsoleHelp.Release.out $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Utils/WeakDictionary.cs $/IronPython/IronPython_Main/Src/Tests/interop/net/derivation/test_property_override.py $/IronPython/IronPython_Main/Src/Tests/test_function.py $/IronPython/IronPython_Main/Src/Tests/test_cStringIO.py $/IronPython/IronPython_Main/Src/Tests/test_cliclass.py $/IronPython/IronPython_Main/Src/Tests/test_class.py $/IronPython/IronPython_Main/Src/Tests/test_metaclass.py $/IronPython/IronPython_Main/Src/Tests/test_generator_throw.py $/IronPython/IronPython_Main/Src/Tests/test_nt.py $/IronPython/IronPython_Main/Src/Tests/test_namebinding.py $/IronPython/IronPython_Main/Src/Tests/test_slots.py $/IronPython/IronPython_Main/Src/Tests/test_sys.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1072305 Date: 8/20/2009 3:26:06 PM (dfugate) - test_array.py: 315192 is fixed - test_descr.py: 316449 is fixed which enabled finding many more bugs (all under CP21116 for now) - test_float.py: float(unicode(huge number)) is a bug (24383), not an incompat - test_gettext.py: a tearDown method wasn't broken due to 315224 - test_cStringIO.py: 151029 is fixed - test_metclass.py: 364860 is fixed - test_namebinding.py: 233393 is fixed - test_nt.py: CP24235 is fixed - test_property_override.py: 372528 appears to be fixed (Shelveset: CP74;REDMOND\dfugate | SNAP CheckinId: m9995) -------------------------------------------------------------------------------- Changeset Id: 1071937 Date: 8/20/2009 12:01:56 PM (dinov) Fixes for two tracing related bugs: 24313 The frame received from sys.settrace is not the actual frame This is the bulk of the change. This includes: We no longer create fake FunctionCode objects when building up traceback frames. Instead our code gen, stack trace updates, and PythonDynamicStackFrame objects have been updated to have the FunctionCode object for the actual function. For modules this means we need to flow the function code object into the generated module function. We also get a new DelayedFunctionCode expression which allows us to create the function code object after the code generation for module/class/function definitions is complete. This lets us create the function code which can hold onto the generated lambda and the generated lambda can refere back to the function code object. It also has a cleanup to function code to remove support for ScriptCode?s over there. This ends a circular dependency between our code objects and ScriptCode objects. Our trace back listener is updated to only use 1 thread static for storing all frames. Previously we had a stack of traceback listeners (which still needs to exist) and inside each traceback listener we had our own list of frames. This unifies all lists of frames. Because of this there?s some additional coordination needed when a traceback function throws an exception. But when the user calls sys._getframe now we can go and look at this unified static list of traceback frames and pull the frame object from there. And now all the frames have consistent identities. 23650 Pdb set_trace and post_mortem Adding a new ?X:Tracing option which enables these to work. The problem here is that tracing needs to be enabled all the time, not just when sys.settrace() has been called. This option makes that possible. Also fixing a bug reported by Mike Stall that del frame.f_trace doesn?t work. (Shelveset: TracingFrameIdentityFinal;REDMOND\dinov | SNAP CheckinId: 9194) -------------------------------------------------------------------------------- Changeset Id: 1070492 Date: 8/20/2009 9:59:49 AM (dinov) 23703 Trivial: missing cStringIO.isatty Adding check to see if cStringIO is closed, enabling test in test_stringIO 23704 iter(x) == x when x is cStringIO.StringIO instance Already passing, Enabling test in test_StringIO 23741 re.match(re.escape(chr(92),chr(92)) throws value error Enabling test in test_re 23772 NotImplemented returned when calling builtinfunciton.__call__ with keyword args Adding test to test_cliclass 23791 the itemsize return different result when typecode is 'u' for Ironpython and Cpython Fixing site in array, adding new check for Unicode in verifying size for fromunicode, enabling test in test_array 23792 binascii.a2b_base64("\n") throw a TypeError Enabling test in test_gettext 23795 AttributeError: 'type' object has no attribute '__getformat__' Enabling test in test_float except for the test which is clearly marked as an implementation detail 23722 locals() fails in nested functions if locals() is also used in an outer function Enabling test in test_namebinding 23822 locals() in nested member function can't view locals in outer function Adding test case to test_namebinding (1st new test case) 23823 nested function's locals() affected by sibling nested function's locals(). Adding test case to test_namebinding (2nd new test case) 23908 calling OldClass with list can fail. Adding test to test_class 23903 negative scenario: new-style class can't have only classic bases when using "type" to create it Enabling test case in test_metaclass 23901 valid scenario: deriving a class from multiple new styles with __slots__ Adding test case to test_slots 23899 subtype's __slots__ not working Enabling test case in test_slots (bug 364438) 23852 Trivial: lack of 'digest_size', 'digestsize', 'name' attribute for md5 module compare to ... (Shelveset: Enable261tESTS;REDMOND\dinov | SNAP CheckinId: 9192) From dinov at microsoft.com Fri Aug 21 20:41:25 2009 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 21 Aug 2009 18:41:25 +0000 Subject: [IronPython] How to get stack traces from runtime exception with using generators. In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD0385C1E5@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD03864EC2@TK5EX14MBXC116.redmond.corp.microsoft.com> Can you include the generator code? If I do: using System; using Microsoft.Scripting.Hosting; using IronPython.Hosting; public class Test { public static void Main(string[] args) { var engine = Python.CreateEngine(); try { engine.Execute(@" def f(): raise Exception('hello generator') yield 42 def g(): f().next() g() "); } catch(Exception e) { Console.WriteLine(engine.GetService().FormatException(e)); } } } Then this outputs: Traceback (most recent call last): File "", line 7, in g File "", line 3, in f Exception: hello generator I did use the preferred way to format the exception but they should be equivalent. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of KATO Kanryu > Sent: Thursday, August 20, 2009 8:09 PM > To: Discussion of IronPython > Subject: Re: [IronPython] How to get stack traces from runtime > exception with using generators. > > 2009/8/21 Dino Viehland : > > Is there a reason you can't just call FormatException for both cases? > > OK. I rewrote to the following: > > | catch(Exception ex) > | { > | var pythonContext = > HostingHelpers.GetLanguageContext(pythonEngine) as PythonContext; > | Igs.Trace.Error(pythonContext.FormatException(ex)); > | } > > But I havn't get stack traces upper the generator yet :( > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Sat Aug 22 00:40:15 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 21 Aug 2009 23:40:15 +0100 Subject: [IronPython] Spurious warning when executing modules with -m Message-ID: <4A8F224F.7090909@voidspace.org.uk> Create a Python file called foo.py containing nothing but "import os". Execute it with "python -m foo" and "ipy.exe -m foo" (Python 2.6 and IronPython 2.6 B2). C:\compile\testing>python -m foo C:\compile\testing>ipy.exe -m foo :1: RuntimeWarning: Parent module '' not found while handling absolute import Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From dinov at microsoft.com Sat Aug 22 01:14:30 2009 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 21 Aug 2009 23:14:30 +0000 Subject: [IronPython] Spurious warning when executing modules with -m In-Reply-To: <4A8F224F.7090909@voidspace.org.uk> References: <4A8F224F.7090909@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD03866206@TK5EX14MBXC116.redmond.corp.microsoft.com> runpy is setting __package__ to an empty string. Looks like CPython doesn't warn when the string is empty because if I do: import runpy x = runpy.run_module('foo', run_name = '__main__', alter_sys=True) CPython doesn't warn. So the fix is easy enough. But it's interesting CPython no longer calls runpy.run_module anymore. I guess it's calling runpy._run_module_as_main as there's a big comment saying should we make this public. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, August 21, 2009 3:40 PM > To: Discussion of IronPython > Subject: [IronPython] Spurious warning when executing modules with -m > > Create a Python file called foo.py containing nothing but "import os". > Execute it with "python -m foo" and "ipy.exe -m foo" (Python 2.6 and > IronPython 2.6 B2). > > C:\compile\testing>python -m foo > > C:\compile\testing>ipy.exe -m foo > :1: RuntimeWarning: Parent module '' not found while handling > absolute import > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Sat Aug 22 01:16:56 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Aug 2009 00:16:56 +0100 Subject: [IronPython] Spurious warning when executing modules with -m In-Reply-To: <1A472770E042064698CB5ADC83A12ACD03866206@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A8F224F.7090909@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD03866206@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A8F2AE8.3050208@voidspace.org.uk> As quick as ever Dino. :-) Thanks Michael Dino Viehland wrote: > runpy is setting __package__ to an empty string. Looks like CPython doesn't > warn when the string is empty because if I do: > > import runpy > x = runpy.run_module('foo', run_name = '__main__', alter_sys=True) > > CPython doesn't warn. So the fix is easy enough. > > But it's interesting CPython no longer calls runpy.run_module anymore. I > guess it's calling runpy._run_module_as_main as there's a big comment saying > should we make this public. > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Friday, August 21, 2009 3:40 PM >> To: Discussion of IronPython >> Subject: [IronPython] Spurious warning when executing modules with -m >> >> Create a Python file called foo.py containing nothing but "import os". >> Execute it with "python -m foo" and "ipy.exe -m foo" (Python 2.6 and >> IronPython 2.6 B2). >> >> C:\compile\testing>python -m foo >> >> C:\compile\testing>ipy.exe -m foo >> :1: RuntimeWarning: Parent module '' not found while handling >> absolute import >> >> Michael >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/blog >> >> >> _______________________________________________ >> 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From zachc at microsoft.com Sat Aug 22 01:38:37 2009 From: zachc at microsoft.com (Zach Crowell) Date: Fri, 21 Aug 2009 23:38:37 +0000 Subject: [IronPython] Constructors & inheriting from standard .NET classes Message-ID: I am unable to inherit from .NET classes which do not define a parameterless constructor. Is this expected behavior? Is there another way to make this inheritance work? Here's a simple case. using System; namespace Test { public class Base { public Base(int i) { } } } import clr clr.AddReference('Test') import Test class Derived(Test.Base): def __init__(self): pass d = Derived() Traceback (most recent call last): File "d:\tmp\class.py", line 9, in d:\tmp\class.py TypeError: Derived() takes exactly 2 arguments (1 given) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Sat Aug 22 01:41:12 2009 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 21 Aug 2009 23:41:12 +0000 Subject: [IronPython] Constructors & inheriting from standard .NET classes In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD03866483@TK5EX14MBXC116.redmond.corp.microsoft.com> You need to override and call the base __new__ instead of __init__. .NET has a simpler construction model than Python does and __new__ is what best corresponds to .NET constructors. class Derived(Test.Base): def __new__(cls, i): return Test.Base.__new__(cls, i) d = Derived() From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Zach Crowell Sent: Friday, August 21, 2009 4:39 PM To: users at lists.ironpython.com Subject: [IronPython] Constructors & inheriting from standard .NET classes I am unable to inherit from .NET classes which do not define a parameterless constructor. Is this expected behavior? Is there another way to make this inheritance work? Here's a simple case. using System; namespace Test { public class Base { public Base(int i) { } } } import clr clr.AddReference('Test') import Test class Derived(Test.Base): def __init__(self): pass d = Derived() Traceback (most recent call last): File "d:\tmp\class.py", line 9, in d:\tmp\class.py TypeError: Derived() takes exactly 2 arguments (1 given) From fuzzyman at voidspace.org.uk Sat Aug 22 01:42:57 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Aug 2009 00:42:57 +0100 Subject: [IronPython] Constructors & inheriting from standard .NET classes In-Reply-To: References: Message-ID: <4A8F3101.2060600@voidspace.org.uk> Zach Crowell wrote: > > I am unable to inherit from .NET classes which do not define a > parameterless constructor. Is this expected behavior? Is there > another way to make this inheritance work? > > > > Here's a simple case. > > > > using System; > > > > namespace Test > > { > > public class Base > > { > > public Base(int i) > > { > > } > > } > > } > > > > *import *clr > > clr.*AddReference*('Test') > > *import *Test > > > > *class **Derived*(Test.Base): > > *def **__init__*(self): > > pass > > > > d = *Derived*() > > > > Traceback (most recent call last): > > File "d:\tmp\class.py", line 9, in d:\tmp\class.py > > TypeError: Derived() takes exactly 2 arguments (1 given) > When you inherit from a .NET type and wish to provide an alternate constructor you need to override __new__ instead of or as well as __init__. *class **Derived*(Test.Base): def __new__(cls): return Test.Base.__new__(cls, 2) *def **__init__*(self): pass Michael > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sat Aug 22 01:44:36 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Aug 2009 00:44:36 +0100 Subject: [IronPython] Constructors & inheriting from standard .NET classes In-Reply-To: <1A472770E042064698CB5ADC83A12ACD03866483@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD03866483@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A8F3164.6060208@voidspace.org.uk> Dino Viehland wrote: > You need to override and call the base __new__ instead of __init__. .NET has a simpler construction model than Python does and __new__ is what best corresponds to .NET constructors. > > class Derived(Test.Base): > def __new__(cls, i): > return Test.Base.__new__(cls, i) > > d = Derived() > Won't that still blow up? What will .NET use for i in the constructor if you don't provide an argument? Michael > > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Zach Crowell > Sent: Friday, August 21, 2009 4:39 PM > To: users at lists.ironpython.com > Subject: [IronPython] Constructors & inheriting from standard .NET classes > > I am unable to inherit from .NET classes which do not define a parameterless constructor. Is this expected behavior? Is there another way to make this inheritance work? > > Here's a simple case. > > using System; > > namespace Test > { > public class Base > { > public Base(int i) > { > } > } > } > > import clr > clr.AddReference('Test') > import Test > > class Derived(Test.Base): > def __init__(self): > pass > > d = Derived() > > Traceback (most recent call last): > File "d:\tmp\class.py", line 9, in d:\tmp\class.py > TypeError: Derived() takes exactly 2 arguments (1 given) > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From dinov at microsoft.com Sat Aug 22 01:52:11 2009 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 21 Aug 2009 23:52:11 +0000 Subject: [IronPython] Constructors & inheriting from standard .NET classes In-Reply-To: <4A8F3164.6060208@voidspace.org.uk> References: <1A472770E042064698CB5ADC83A12ACD03866483@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A8F3164.6060208@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD038664F9@TK5EX14MBXC116.redmond.corp.microsoft.com> Yes, you're right, too much copying and pasting :) > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, August 21, 2009 4:45 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Constructors & inheriting from standard .NET > classes > > Dino Viehland wrote: > > You need to override and call the base __new__ instead of __init__. > .NET has a simpler construction model than Python does and __new__ is > what best corresponds to .NET constructors. > > > > class Derived(Test.Base): > > def __new__(cls, i): > > return Test.Base.__new__(cls, i) > > > > d = Derived() > > > > Won't that still blow up? What will .NET use for i in the constructor > if > you don't provide an argument? > > Michael > > > > > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Zach Crowell > > Sent: Friday, August 21, 2009 4:39 PM > > To: users at lists.ironpython.com > > Subject: [IronPython] Constructors & inheriting from standard .NET > classes > > > > I am unable to inherit from .NET classes which do not define a > parameterless constructor. Is this expected behavior? Is there another > way to make this inheritance work? > > > > Here's a simple case. > > > > using System; > > > > namespace Test > > { > > public class Base > > { > > public Base(int i) > > { > > } > > } > > } > > > > import clr > > clr.AddReference('Test') > > import Test > > > > class Derived(Test.Base): > > def __init__(self): > > pass > > > > d = Derived() > > > > Traceback (most recent call last): > > File "d:\tmp\class.py", line 9, in d:\tmp\class.py > > TypeError: Derived() takes exactly 2 arguments (1 given) > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From zachc at microsoft.com Sat Aug 22 02:02:20 2009 From: zachc at microsoft.com (Zach Crowell) Date: Sat, 22 Aug 2009 00:02:20 +0000 Subject: [IronPython] Constructors & inheriting from standard .NET classes In-Reply-To: <1A472770E042064698CB5ADC83A12ACD038664F9@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD03866483@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A8F3164.6060208@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD038664F9@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: Thanks. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Friday, August 21, 2009 16:52 To: Discussion of IronPython Subject: Re: [IronPython] Constructors & inheriting from standard .NET classes Yes, you're right, too much copying and pasting :) > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, August 21, 2009 4:45 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Constructors & inheriting from standard .NET > classes > > Dino Viehland wrote: > > You need to override and call the base __new__ instead of __init__. > .NET has a simpler construction model than Python does and __new__ is > what best corresponds to .NET constructors. > > > > class Derived(Test.Base): > > def __new__(cls, i): > > return Test.Base.__new__(cls, i) > > > > d = Derived() > > > > Won't that still blow up? What will .NET use for i in the constructor > if > you don't provide an argument? > > Michael > > > > > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Zach Crowell > > Sent: Friday, August 21, 2009 4:39 PM > > To: users at lists.ironpython.com > > Subject: [IronPython] Constructors & inheriting from standard .NET > classes > > > > I am unable to inherit from .NET classes which do not define a > parameterless constructor. Is this expected behavior? Is there another > way to make this inheritance work? > > > > Here's a simple case. > > > > using System; > > > > namespace Test > > { > > public class Base > > { > > public Base(int i) > > { > > } > > } > > } > > > > import clr > > clr.AddReference('Test') > > import Test > > > > class Derived(Test.Base): > > def __init__(self): > > pass > > > > d = Derived() > > > > Traceback (most recent call last): > > File "d:\tmp\class.py", line 9, in d:\tmp\class.py > > TypeError: Derived() takes exactly 2 arguments (1 given) > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > _______________________________________________ > 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 Aug 22 17:29:01 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Aug 2009 16:29:01 +0100 Subject: [IronPython] IronPython and IronRuby interop with IronRuby 0.9 Message-ID: <4A900EBD.7050408@voidspace.org.uk> Hello all, I've played a little bit with IronPython and IronRuby interop with the IronRuby 0.9 binaries. A very basic example works as expected: IronPython 2.6 Beta 2 (2.6.0.20) on .NET 2.0.50727.4927 Type "help", "copyright", "credits" or "license" for more information. >>> import clr >>> clr.AddReference('IronRuby') >>> from IronRuby import Ruby >>> >>> engine = Ruby.CreateEngine() >>> source = engine.CreateScriptSourceFromString("puts 'Hello from Ruby'") >>> scope = engine.CreateScope() >>> >>> source.Execute(scope) Hello from Ruby >>> However my attempts to use a Ruby library fails. The same code works when executed from ir.exe: >>> import clr >>> clr.AddReference('IronRuby') >>> clr.AddReference('Microsoft.Scripting') >>> >>> from Microsoft.Scripting import SourceCodeKind >>> from IronRuby import Ruby >>> engine = Ruby.CreateEngine() >>> source = engine.CreateScriptSourceFromString("require 'date'", SourceCodeKin d.Statements) >>> scope = engine.CreateScope() >>> source.Execute(scope) Traceback (most recent call last): File "", line 1, in Exception: no such file to load -- date >>> I tried adding a reference to IronRuby.Libraries to the runtime associated with the Ruby engine (using runtime.LoadAssembly) but this didn't help. Requiring Ruby modules I've written myself doesn't blow-up but doesn't populate the scriptscope they are executed in with anything. Likewise calling engine.ExecuteFile('foo.rb') returns an empty ScriptScope. Any ideas? All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From fuzzyman at voidspace.org.uk Sat Aug 22 17:40:35 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Aug 2009 16:40:35 +0100 Subject: [IronPython] IronPython and IronRuby interop with IronRuby 0.9 In-Reply-To: <4A900EBD.7050408@voidspace.org.uk> References: <4A900EBD.7050408@voidspace.org.uk> Message-ID: <6f4025010908220840x4d3f6518jc8605aa30e4395f6@mail.gmail.com> Ok, so setting the engine search paths solves the failure to find the library, but the ScriptScope is still coming back empty. In the example below I would have expected to see 'd' in the ScriptScope. c:\Binaries\IronRuby\bin>ipy.exe interop.py [] >From this code: import clr clr.AddReference('IronRuby') clr.AddReference('Microsoft.Scripting') from System import Array paths = [r'C:\Binaries\IronRuby\lib\IronRuby', r'C:\Binaries\IronRuby\lib\ruby\1.8'] array = Array[str](paths) source_code = "require 'date'\nd = Date::civil(2003, 4, 8)\n" from Microsoft.Scripting import SourceCodeKind from IronRuby import Ruby engine = Ruby.CreateEngine() engine.SetSearchPaths(array) source = engine.CreateScriptSourceFromString(source_code, SourceCodeKind.Statements) scope = engine.CreateScope() source.Execute(scope) print dir(scope) Michael 2009/8/22 Michael Foord > Hello all, > > I've played a little bit with IronPython and IronRuby interop with the > IronRuby 0.9 binaries. > > A very basic example works as expected: > > IronPython 2.6 Beta 2 (2.6.0.20) on .NET 2.0.50727.4927 > Type "help", "copyright", "credits" or "license" for more information. > >>> import clr > >>> clr.AddReference('IronRuby') > >>> from IronRuby import Ruby > >>> > >>> engine = Ruby.CreateEngine() > >>> source = engine.CreateScriptSourceFromString("puts 'Hello from Ruby'") > >>> scope = engine.CreateScope() > >>> > >>> source.Execute(scope) > Hello from Ruby > >>> > > > However my attempts to use a Ruby library fails. The same code works when > executed from ir.exe: > > >>> import clr > >>> clr.AddReference('IronRuby') > >>> clr.AddReference('Microsoft.Scripting') > >>> > >>> from Microsoft.Scripting import SourceCodeKind > >>> from IronRuby import Ruby > >>> engine = Ruby.CreateEngine() > >>> source = engine.CreateScriptSourceFromString("require 'date'", > SourceCodeKin > d.Statements) > >>> scope = engine.CreateScope() > >>> source.Execute(scope) > Traceback (most recent call last): > File "", line 1, in > Exception: no such file to load -- date > >>> > > I tried adding a reference to IronRuby.Libraries to the runtime associated > with the Ruby engine (using runtime.LoadAssembly) but this didn't help. > > Requiring Ruby modules I've written myself doesn't blow-up but doesn't > populate the scriptscope they are executed in with anything. Likewise > calling engine.ExecuteFile('foo.rb') returns an empty ScriptScope. > > Any ideas? > > All the best, > > Michael Foord > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > -- http://www.ironpythoninaction.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sat Aug 22 17:45:59 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Aug 2009 16:45:59 +0100 Subject: [IronPython] IronPython and IronRuby interop with IronRuby 0.9 In-Reply-To: <6f4025010908220840x4d3f6518jc8605aa30e4395f6@mail.gmail.com> References: <4A900EBD.7050408@voidspace.org.uk> <6f4025010908220840x4d3f6518jc8605aa30e4395f6@mail.gmail.com> Message-ID: <4A9012B7.1050805@voidspace.org.uk> Hehe - well I can fish the contents of the library I required from engine.Runtime.Globals, which seems right as I'm requiring it in the global namespace. I'm still surprised the ScriptScope is empty. Michael Michael Foord wrote: > Ok, so setting the engine search paths solves the failure to find the > library, but the ScriptScope is still coming back empty. In the > example below I would have expected to see 'd' in the ScriptScope. > > c:\Binaries\IronRuby\bin>ipy.exe interop.py > [] > > From this code: > > import clr > clr.AddReference('IronRuby') > clr.AddReference('Microsoft.Scripting') > > from System import Array > > paths = [r'C:\Binaries\IronRuby\lib\IronRuby', > r'C:\Binaries\IronRuby\lib\ruby\1.8'] > array = Array[str](paths) > > source_code = "require 'date'\nd = Date::civil(2003, 4, 8)\n" > > from Microsoft.Scripting import SourceCodeKind > from IronRuby import Ruby > engine = Ruby.CreateEngine() > engine.SetSearchPaths(array) > source = engine.CreateScriptSourceFromString(source_code, > SourceCodeKind.Statements) > scope = engine.CreateScope() > source.Execute(scope) > > print dir(scope) > > Michael > > 2009/8/22 Michael Foord > > > Hello all, > > I've played a little bit with IronPython and IronRuby interop with > the IronRuby 0.9 binaries. > > A very basic example works as expected: > > IronPython 2.6 Beta 2 (2.6.0.20) on .NET 2.0.50727.4927 > Type "help", "copyright", "credits" or "license" for more information. > >>> import clr > >>> clr.AddReference('IronRuby') > >>> from IronRuby import Ruby > >>> > >>> engine = Ruby.CreateEngine() > >>> source = engine.CreateScriptSourceFromString("puts 'Hello from > Ruby'") > >>> scope = engine.CreateScope() > >>> > >>> source.Execute(scope) > Hello from Ruby > >>> > > > However my attempts to use a Ruby library fails. The same code > works when executed from ir.exe: > > >>> import clr > >>> clr.AddReference('IronRuby') > >>> clr.AddReference('Microsoft.Scripting') > >>> > >>> from Microsoft.Scripting import SourceCodeKind > >>> from IronRuby import Ruby > >>> engine = Ruby.CreateEngine() > >>> source = engine.CreateScriptSourceFromString("require 'date'", > SourceCodeKin > d.Statements) > >>> scope = engine.CreateScope() > >>> source.Execute(scope) > Traceback (most recent call last): > File "", line 1, in > Exception: no such file to load -- date > >>> > > I tried adding a reference to IronRuby.Libraries to the runtime > associated with the Ruby engine (using runtime.LoadAssembly) but > this didn't help. > > Requiring Ruby modules I've written myself doesn't blow-up but > doesn't populate the scriptscope they are executed in with > anything. Likewise calling engine.ExecuteFile('foo.rb') returns an > empty ScriptScope. > > Any ideas? > > All the best, > > Michael Foord > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > > > > -- > http://www.ironpythoninaction.com/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From Tomas.Matousek at microsoft.com Sat Aug 22 18:04:05 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Sat, 22 Aug 2009 16:04:05 +0000 Subject: [IronPython] IronPython and IronRuby interop with IronRuby 0.9 In-Reply-To: <4A9012B7.1050805@voidspace.org.uk> References: <4A900EBD.7050408@voidspace.org.uk> <6f4025010908220840x4d3f6518jc8605aa30e4395f6@mail.gmail.com> <4A9012B7.1050805@voidspace.org.uk> Message-ID: <4B342496A3EFEB48839E10BB4BF5964C02482625@TK5EX14MBXC131.redmond.corp.microsoft.com> This works: import clr clr.AddReference('IronRuby') from IronRuby import Ruby from System import Array paths = [r'C:\Binaries\IronRuby\lib\IronRuby', r'C:\Binaries\IronRuby\lib\ruby\1.8'] array = Array[str](paths) engine = Ruby.CreateEngine() engine.SetSearchPaths(array) scope = engine.CreateScope() source = engine.Execute(''' require 'date' def d Date::civil(2003, 4, 8) end ''', scope) print scope.d() print engine.Runtime.Globals.Date --- Top-level methods, not local variables, are published in the scope. Classes and modules are published in Runtime.Globals scope. And this works too (the value of the last expression is returned): print engine.Execute(''' require 'date' Date::civil(2003, 4, 8) ''') Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, August 22, 2009 8:46 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython and IronRuby interop with IronRuby 0.9 Hehe - well I can fish the contents of the library I required from engine.Runtime.Globals, which seems right as I'm requiring it in the global namespace. I'm still surprised the ScriptScope is empty. Michael Michael Foord wrote: > Ok, so setting the engine search paths solves the failure to find the > library, but the ScriptScope is still coming back empty. In the > example below I would have expected to see 'd' in the ScriptScope. > > c:\Binaries\IronRuby\bin>ipy.exe interop.py [] > > From this code: > > import clr > clr.AddReference('IronRuby') > clr.AddReference('Microsoft.Scripting') > > from System import Array > > paths = [r'C:\Binaries\IronRuby\lib\IronRuby', > r'C:\Binaries\IronRuby\lib\ruby\1.8'] > array = Array[str](paths) > > source_code = "require 'date'\nd = Date::civil(2003, 4, 8)\n" > > from Microsoft.Scripting import SourceCodeKind from IronRuby import > Ruby engine = Ruby.CreateEngine() > engine.SetSearchPaths(array) > source = engine.CreateScriptSourceFromString(source_code, > SourceCodeKind.Statements) > scope = engine.CreateScope() > source.Execute(scope) > > print dir(scope) > > Michael > > 2009/8/22 Michael Foord > > > Hello all, > > I've played a little bit with IronPython and IronRuby interop with > the IronRuby 0.9 binaries. > > A very basic example works as expected: > > IronPython 2.6 Beta 2 (2.6.0.20) on .NET 2.0.50727.4927 > Type "help", "copyright", "credits" or "license" for more information. > >>> import clr > >>> clr.AddReference('IronRuby') > >>> from IronRuby import Ruby > >>> > >>> engine = Ruby.CreateEngine() > >>> source = engine.CreateScriptSourceFromString("puts 'Hello from > Ruby'") > >>> scope = engine.CreateScope() > >>> > >>> source.Execute(scope) > Hello from Ruby > >>> > > > However my attempts to use a Ruby library fails. The same code > works when executed from ir.exe: > > >>> import clr > >>> clr.AddReference('IronRuby') > >>> clr.AddReference('Microsoft.Scripting') > >>> > >>> from Microsoft.Scripting import SourceCodeKind > >>> from IronRuby import Ruby > >>> engine = Ruby.CreateEngine() > >>> source = engine.CreateScriptSourceFromString("require 'date'", > SourceCodeKin > d.Statements) > >>> scope = engine.CreateScope() > >>> source.Execute(scope) > Traceback (most recent call last): > File "", line 1, in > Exception: no such file to load -- date > >>> > > I tried adding a reference to IronRuby.Libraries to the runtime > associated with the Ruby engine (using runtime.LoadAssembly) but > this didn't help. > > Requiring Ruby modules I've written myself doesn't blow-up but > doesn't populate the scriptscope they are executed in with > anything. Likewise calling engine.ExecuteFile('foo.rb') returns an > empty ScriptScope. > > Any ideas? > > All the best, > > Michael Foord > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > > > > -- > http://www.ironpythoninaction.com/ > > > ---------------------------------------------------------------------- > -- > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Sat Aug 22 18:05:26 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Aug 2009 17:05:26 +0100 Subject: [IronPython] IronPython and IronRuby interop with IronRuby 0.9 In-Reply-To: <4B342496A3EFEB48839E10BB4BF5964C02482625@TK5EX14MBXC131.redmond.corp.microsoft.com> References: <4A900EBD.7050408@voidspace.org.uk> <6f4025010908220840x4d3f6518jc8605aa30e4395f6@mail.gmail.com> <4A9012B7.1050805@voidspace.org.uk> <4B342496A3EFEB48839E10BB4BF5964C02482625@TK5EX14MBXC131.redmond.corp.microsoft.com> Message-ID: <4A901746.8030601@voidspace.org.uk> Thanks Tomas. Michael Tomas Matousek wrote: > This works: > > import clr > clr.AddReference('IronRuby') > > from IronRuby import Ruby > from System import Array > > paths = [r'C:\Binaries\IronRuby\lib\IronRuby', r'C:\Binaries\IronRuby\lib\ruby\1.8'] > array = Array[str](paths) > > engine = Ruby.CreateEngine() > engine.SetSearchPaths(array) > > scope = engine.CreateScope() > source = engine.Execute(''' > require 'date' > > def d > Date::civil(2003, 4, 8) > end > ''', scope) > > print scope.d() > print engine.Runtime.Globals.Date > > --- > > Top-level methods, not local variables, are published in the scope. > Classes and modules are published in Runtime.Globals scope. > > And this works too (the value of the last expression is returned): > print engine.Execute(''' > require 'date' > Date::civil(2003, 4, 8) > ''') > > Tomas > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, August 22, 2009 8:46 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython and IronRuby interop with IronRuby 0.9 > > Hehe - well I can fish the contents of the library I required from engine.Runtime.Globals, which seems right as I'm requiring it in the global namespace. I'm still surprised the ScriptScope is empty. > > Michael > > > Michael Foord wrote: > >> Ok, so setting the engine search paths solves the failure to find the >> library, but the ScriptScope is still coming back empty. In the >> example below I would have expected to see 'd' in the ScriptScope. >> >> c:\Binaries\IronRuby\bin>ipy.exe interop.py [] >> >> From this code: >> >> import clr >> clr.AddReference('IronRuby') >> clr.AddReference('Microsoft.Scripting') >> >> from System import Array >> >> paths = [r'C:\Binaries\IronRuby\lib\IronRuby', >> r'C:\Binaries\IronRuby\lib\ruby\1.8'] >> array = Array[str](paths) >> >> source_code = "require 'date'\nd = Date::civil(2003, 4, 8)\n" >> >> from Microsoft.Scripting import SourceCodeKind from IronRuby import >> Ruby engine = Ruby.CreateEngine() >> engine.SetSearchPaths(array) >> source = engine.CreateScriptSourceFromString(source_code, >> SourceCodeKind.Statements) >> scope = engine.CreateScope() >> source.Execute(scope) >> >> print dir(scope) >> >> Michael >> >> 2009/8/22 Michael Foord > > >> >> Hello all, >> >> I've played a little bit with IronPython and IronRuby interop with >> the IronRuby 0.9 binaries. >> >> A very basic example works as expected: >> >> IronPython 2.6 Beta 2 (2.6.0.20) on .NET 2.0.50727.4927 >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import clr >> >>> clr.AddReference('IronRuby') >> >>> from IronRuby import Ruby >> >>> >> >>> engine = Ruby.CreateEngine() >> >>> source = engine.CreateScriptSourceFromString("puts 'Hello from >> Ruby'") >> >>> scope = engine.CreateScope() >> >>> >> >>> source.Execute(scope) >> Hello from Ruby >> >>> >> >> >> However my attempts to use a Ruby library fails. The same code >> works when executed from ir.exe: >> >> >>> import clr >> >>> clr.AddReference('IronRuby') >> >>> clr.AddReference('Microsoft.Scripting') >> >>> >> >>> from Microsoft.Scripting import SourceCodeKind >> >>> from IronRuby import Ruby >> >>> engine = Ruby.CreateEngine() >> >>> source = engine.CreateScriptSourceFromString("require 'date'", >> SourceCodeKin >> d.Statements) >> >>> scope = engine.CreateScope() >> >>> source.Execute(scope) >> Traceback (most recent call last): >> File "", line 1, in >> Exception: no such file to load -- date >> >>> >> >> I tried adding a reference to IronRuby.Libraries to the runtime >> associated with the Ruby engine (using runtime.LoadAssembly) but >> this didn't help. >> >> Requiring Ruby modules I've written myself doesn't blow-up but >> doesn't populate the scriptscope they are executed in with >> anything. Likewise calling engine.ExecuteFile('foo.rb') returns an >> empty ScriptScope. >> >> Any ideas? >> >> All the best, >> >> Michael Foord >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/blog >> >> >> >> >> >> -- >> http://www.ironpythoninaction.com/ >> >> >> ---------------------------------------------------------------------- >> -- >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From steve at mcneel.com Sat Aug 22 19:46:53 2009 From: steve at mcneel.com (Steve Baer) Date: Sat, 22 Aug 2009 10:46:53 -0700 Subject: [IronPython] Current line of script Message-ID: I am hosting IronPython in my application and have python scripts calling some of my C# functions. I was wondering if there was a way to figure out which line of the script I am at from inside my C# function. Thanks, -Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From merllab at microsoft.com Tue Aug 25 17:53:18 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 25 Aug 2009 08:53:18 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <98dd7002-1677-43d5-96ea-88bd586b7880@tk5-exsmh-c102.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/58400. ADDED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Compiler/SharedGlobalAllocator.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/SharedGlobalAllocator.Generated.cs $/IronPython/IronPython_Main/Src/Scripts/generate_SharedGlobalAllocator.py DELETED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Compiler/StaticGlobalAllocator.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Compiler/SharedGlobalAllocator.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/SharedGlobalAllocator.Generated.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/GlobalAllocator.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/RuntimeScriptCode.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/AstGenerator.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/ModuleGlobalCache.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Interpreter/LightCompiler.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_Main/Src/IronPython/IronPython.csproj $/IronPython/IronPython_Main/Src/Scripts/generate_SharedGlobalAllocator.py $/IronPython/IronPython_Main/Src/Tests/test_superconsole.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1086147 Date: 8/24/2009 8:00:43 PM (ddicato) Changes the allocation scheme of global variables, cached constants, and CallSites for increased access speed and throughput, most notably in function calls. Increased performance comes at the price of ~100ms startup time, which we consider to be an acceptable tradeoff. (Shelveset: allocator;REDMOND\ddicato | SNAP CheckinId: 9236) -------------------------------------------------------------------------------- Changeset Id: 1085820 Date: 8/24/2009 4:54:49 PM (dfugate) Trying to fix another spurious failure in test_superconsole.py. This time around the COM member completion test case seems to randomly take longer than 10 seconds to execute on some of our SNAP machines. I've modified the test to capture all of stdout, emit more meaningful output when it fails, and reorganized the calls to time.sleep (we need to sleep before taking over stdout/stderr again). (Shelveset: SUPERCONSOLE;REDMOND\dfugate | SNAP CheckinId: 9233) From Georg.Eichhorn at philips.com Wed Aug 26 07:59:31 2009 From: Georg.Eichhorn at philips.com (Eichhorn, Georg) Date: Wed, 26 Aug 2009 07:59:31 +0200 Subject: [IronPython] Call methods from Python-Script Message-ID: <14B852A5C6341946B80C2B53B8BF51151DF058BBB4@NLCLUEXM11.connect1.local> Hi, I have implemented some piece of code that should execute a python-script. In this script I want to call a c#-function. First, I Generate a module (context to work in): _scriptRuntime.Start(true); _scriptRuntime.ScriptScope.SetVariable("class", this); ('this' is CClassName') Then I get the class: PythonType pType = _scriptRuntime.ScriptScope.GetVariable("CClassName") as PythonType; Create an instance of the object _Class = _scriptRuntime.ScriptScope.Engine.Operations.CreateInstance(pType, new object[] { }); [...] (do some other tings) >From the python script, I want to call the function: return class.doSomething(parameter) The code throws an exception: 'CClassName' object has no attribute 'doSomething'. What am I making wrong? CClassName has a public method doSomething() Thanks for U're help. Greetings Georg Eichhorn ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian2.schmidt at gmx.de Wed Aug 26 14:21:00 2009 From: christian2.schmidt at gmx.de (Christian Schmidt) Date: Wed, 26 Aug 2009 14:21:00 +0200 Subject: [IronPython] Documentation/Example for Python expressions Message-ID: <4A9528AC.7020804@gmx.de> Hi, we're using IronPython 2.6 within our C#-application to evaluate user defined expressions. Where can I find "end user" examples and documentation I can link to for python expressions? I looked at http://docs.python.org/reference/expressions.html but this is too programmer oriented. http://www.devshed.com/c/a/Python/Python-Expressions-and-Operators/ looks better but is not "official". Any other links or ideas? Thanks, Christian From dinov at microsoft.com Wed Aug 26 18:46:21 2009 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 26 Aug 2009 16:46:21 +0000 Subject: [IronPython] Call methods from Python-Script In-Reply-To: <14B852A5C6341946B80C2B53B8BF51151DF058BBB4@NLCLUEXM11.connect1.local> References: <14B852A5C6341946B80C2B53B8BF51151DF058BBB4@NLCLUEXM11.connect1.local> Message-ID: <1A472770E042064698CB5ADC83A12ACD045185E5@TK5EX14MBXC120.redmond.corp.microsoft.com> Is CClassName a public type? It'll need to both have public members and also be public its self. If that's not the problem I'm having trouble understanding exactly what's going on. Is "return class.doSomething(parameter)" supposedly Python code? Or are you doing this from C#? "class" is a keyword in Python so I don't see how it's Python code. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Eichhorn, Georg Sent: Tuesday, August 25, 2009 11:00 PM To: users at lists.ironpython.com Subject: [IronPython] Call methods from Python-Script Hi, I have implemented some piece of code that should execute a python-script. In this script I want to call a c#-function. First, I Generate a module (context to work in): _scriptRuntime.Start(true); _scriptRuntime.ScriptScope.SetVariable("class", this); ('this' is CClassName') Then I get the class: PythonType pType = _scriptRuntime.ScriptScope.GetVariable("CClassName") as PythonType; Create an instance of the object _Class = _scriptRuntime.ScriptScope.Engine.Operations.CreateInstance(pType, new object[] { }); [...] (do some other tings) >From the python script, I want to call the function: return class.doSomething(parameter) The code throws an exception: 'CClassName' object has no attribute 'doSomething'. What am I making wrong? CClassName has a public method doSomething() Thanks for U're help. Greetings Georg Eichhorn ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce.bromberek at gmail.com Wed Aug 26 20:45:58 2009 From: bruce.bromberek at gmail.com (Bruce Bromberek) Date: Wed, 26 Aug 2009 13:45:58 -0500 Subject: [IronPython] Documentation/Example for Python expressions In-Reply-To: <4A9528AC.7020804@gmx.de> References: <4A9528AC.7020804@gmx.de> Message-ID: <58ad4a110908261145j6b6457a6rac8fd1bd1f1531f5@mail.gmail.com> How much python will you let your users execute? Are they just typing in formulas or are they accessing data structure? The Python Tutorial http://docs.python.org/tutorial/index.html or http://www.diveintopython.org might be a good place to start, but if they will not be allowed to forms loops, etc both might be too much. Can you post an example if what someone would be entering with your program? On Wed, Aug 26, 2009 at 7:21 AM, Christian Schmidt < christian2.schmidt at gmx.de> wrote: > Hi, > > we're using IronPython 2.6 within our C#-application to evaluate user > defined expressions. > > Where can I find "end user" examples and documentation I can link to for > python expressions? > > I looked at http://docs.python.org/reference/expressions.html but this is > too programmer oriented. > http://www.devshed.com/c/a/Python/Python-Expressions-and-Operators/ looks > better but is not "official". > > Any other links or ideas? > > Thanks, > Christian > _______________________________________________ > 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 christian2.schmidt at gmx.de Wed Aug 26 21:33:05 2009 From: christian2.schmidt at gmx.de (Christian Schmidt) Date: Wed, 26 Aug 2009 21:33:05 +0200 Subject: [IronPython] Documentation/Example for Python expressions In-Reply-To: <58ad4a110908261145j6b6457a6rac8fd1bd1f1531f5@mail.gmail.com> References: <4A9528AC.7020804@gmx.de> <58ad4a110908261145j6b6457a6rac8fd1bd1f1531f5@mail.gmail.com> Message-ID: <4A958DF1.602@gmx.de> Hi Bruce, thanks for your answer. > How much python will you let your users execute? Potentially everything that can be put into ScriptEngine.CreateScriptSourceFromString( Expression, _SourceCodeKind.Expression_).Execute(ScriptScope) > Are they just typing in formulas or are they accessing data structure? Normally they type in simple formulas. But they are also allowed to type in formulas that access functions, properties of classes/objects/data structures and generators. > The Python Tutorial http://docs.python.org/tutorial/index.html or > http://www.diveintopython.org might be a good place to start, but if > they will not be allowed to forms loops, etc both might be too much. These are all nicely written introductions to python "programming". But that's too much: As Expression one can only enter "one-liners" - no structured programs, no function or class definitions, no control flow, no import statements ... simply no statements at all. > Can you post an example if what someone would be entering with your program? "Distance * AvgSpeed" "Distance**0.9 if Distance > 0 else 5" "sum([pos.time for pos in positions where pos.type = 7])" "complicated_function1(a,b) + complicated_function2({ param1: c, param2: 42 })" where Distance, AvgSpeed, positions, a, b, c, ... are variables from the ScriptScope. From fuzzyman at voidspace.org.uk Wed Aug 26 21:36:37 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 26 Aug 2009 20:36:37 +0100 Subject: [IronPython] Documentation/Example for Python expressions In-Reply-To: <4A958DF1.602@gmx.de> References: <4A9528AC.7020804@gmx.de> <58ad4a110908261145j6b6457a6rac8fd1bd1f1531f5@mail.gmail.com> <4A958DF1.602@gmx.de> Message-ID: <4A958EC5.6010708@voidspace.org.uk> Christian Schmidt wrote: > Hi Bruce, > > thanks for your answer. > >> How much python will you let your users execute? > > Potentially everything that can be put into > > ScriptEngine.CreateScriptSourceFromString( > Expression, _SourceCodeKind.Expression_).Execute(ScriptScope) > >> Are they just typing in formulas or are they accessing data structure? > > Normally they type in simple formulas. But they are also allowed to > type in formulas that access functions, properties of > classes/objects/data structures and generators. > >> The Python Tutorial http://docs.python.org/tutorial/index.html or >> http://www.diveintopython.org might be a good place to start, but if >> they will not be allowed to forms loops, etc both might be too much. > > These are all nicely written introductions to python "programming". > But that's too much: As Expression one can only enter "one-liners" - > no structured programs, no function or class definitions, no control > flow, no import statements ... simply no statements at all. > >> Can you post an example if what someone would be entering with your >> program? > > "Distance * AvgSpeed" > > "Distance**0.9 if Distance > 0 else 5" > > "sum([pos.time for pos in positions where pos.type = 7])" > > "complicated_function1(a,b) + complicated_function2({ param1: c, > param2: 42 })" > > where Distance, AvgSpeed, positions, a, b, c, ... are variables from > the ScriptScope. Unfortunately I don't think such a documentation exists (not that I'm aware of but the internets is a big place). I wish it did - and if you write one then please make it public. The Python grammar is a good place to get the definitive syntax allowed in expressions, at least if you can read BNF. Michael > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From bruce.bromberek at gmail.com Wed Aug 26 23:32:11 2009 From: bruce.bromberek at gmail.com (Bruce Bromberek) Date: Wed, 26 Aug 2009 16:32:11 -0500 Subject: [IronPython] Documentation/Example for Python expressions In-Reply-To: <4A958EC5.6010708@voidspace.org.uk> References: <4A9528AC.7020804@gmx.de> <58ad4a110908261145j6b6457a6rac8fd1bd1f1531f5@mail.gmail.com> <4A958DF1.602@gmx.de> <4A958EC5.6010708@voidspace.org.uk> Message-ID: <58ad4a110908261432s2cffba04p3693684e1329ef7b@mail.gmail.com> So you are looking for something more along the lines of this https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Expressions or this https://www.cs.drexel.edu/~rweaver/COURSES/ISTC-2/TOPICS/expr.html But for python. This http://www.greenteapress.com/thinkpython/html/book003.html comes close, but again it is too programming oriented. I'll keep an eye out, but If you need something right away I'd modify the Javascript Pages. The info is available under a Creative Commons License, and it would not take too much time to make it 'pythonic'. I think the problem you are going to find is most python intro information is geared towards learning via the interactive interpreter (out of your scope) or too technical like the BNF grammer from the language reference. -Bruce On Wed, Aug 26, 2009 at 2:36 PM, Michael Foord wrote: > Christian Schmidt wrote: > >> Hi Bruce, >> >> thanks for your answer. >> >> How much python will you let your users execute? >>> >> >> Potentially everything that can be put into >> >> ScriptEngine.CreateScriptSourceFromString( >> Expression, _SourceCodeKind.Expression_).Execute(ScriptScope) >> >> Are they just typing in formulas or are they accessing data structure? >>> >> >> Normally they type in simple formulas. But they are also allowed to type >> in formulas that access functions, properties of classes/objects/data >> structures and generators. >> >> The Python Tutorial http://docs.python.org/tutorial/index.html or >>> http://www.diveintopython.org might be a good place to start, but if >>> they will not be allowed to forms loops, etc both might be too much. >>> >> >> These are all nicely written introductions to python "programming". But >> that's too much: As Expression one can only enter "one-liners" - no >> structured programs, no function or class definitions, no control flow, no >> import statements ... simply no statements at all. >> >> Can you post an example if what someone would be entering with your >>> program? >>> >> >> "Distance * AvgSpeed" >> >> "Distance**0.9 if Distance > 0 else 5" >> >> "sum([pos.time for pos in positions where pos.type = 7])" >> >> "complicated_function1(a,b) + complicated_function2({ param1: c, param2: >> 42 })" >> >> where Distance, AvgSpeed, positions, a, b, c, ... are variables from the >> ScriptScope. >> > > Unfortunately I don't think such a documentation exists (not that I'm aware > of but the internets is a big place). I wish it did - and if you write one > then please make it public. > > The Python grammar is a good place to get the definitive syntax allowed in > expressions, at least if you can read BNF. > > Michael > > >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > > _______________________________________________ > 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 Georg.Eichhorn at philips.com Thu Aug 27 10:32:59 2009 From: Georg.Eichhorn at philips.com (Eichhorn, Georg) Date: Thu, 27 Aug 2009 10:32:59 +0200 Subject: [IronPython] Call methods from Python-Script In-Reply-To: <1A472770E042064698CB5ADC83A12ACD045185E5@TK5EX14MBXC120.redmond.corp.microsoft.com> References: <14B852A5C6341946B80C2B53B8BF51151DF058BBB4@NLCLUEXM11.connect1.local> <1A472770E042064698CB5ADC83A12ACD045185E5@TK5EX14MBXC120.redmond.corp.microsoft.com> Message-ID: <14B852A5C6341946B80C2B53B8BF51151DF058C0DE@NLCLUEXM11.connect1.local> Hi, I found my problem - thanks for the help Dino. CClassName was not public. Now it works fine. Greetings, Georg From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Mittwoch, 26. August 2009 18:46 To: Discussion of IronPython Subject: Re: [IronPython] Call methods from Python-Script Is CClassName a public type? It'll need to both have public members and also be public its self. If that's not the problem I'm having trouble understanding exactly what's going on. Is "return class.doSomething(parameter)" supposedly Python code? Or are you doing this from C#? "class" is a keyword in Python so I don't see how it's Python code. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Eichhorn, Georg Sent: Tuesday, August 25, 2009 11:00 PM To: users at lists.ironpython.com Subject: [IronPython] Call methods from Python-Script Hi, I have implemented some piece of code that should execute a python-script. In this script I want to call a c#-function. First, I Generate a module (context to work in): _scriptRuntime.Start(true); _scriptRuntime.ScriptScope.SetVariable("class", this); ('this' is CClassName') Then I get the class: PythonType pType = _scriptRuntime.ScriptScope.GetVariable("CClassName") as PythonType; Create an instance of the object _Class = _scriptRuntime.ScriptScope.Engine.Operations.CreateInstance(pType, new object[] { }); [...] (do some other tings) >From the python script, I want to call the function: return class.doSomething(parameter) The code throws an exception: 'CClassName' object has no attribute 'doSomething'. What am I making wrong? CClassName has a public method doSomething() Thanks for U're help. Greetings Georg Eichhorn ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. ________________________________ The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdraghi at gmail.com Thu Aug 27 15:21:25 2009 From: mdraghi at gmail.com (Mariano Draghi) Date: Thu, 27 Aug 2009 10:21:25 -0300 Subject: [IronPython] IPy 2.x and ASP.NET 3.5 Message-ID: Hi there, After many hours running different experiments, I still can't find a way to embed IronPython 2.x in a ASP.NET 3.5 web site. I have read this: http://ironpython-urls.blogspot.com/2008/10/ironpython-2-and-fifth-assembly.html and this: http://devhawk.net/2008/10/21/The+Fifth+Assembly.aspx and tried the solution on this CodePlex workitem: http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=19126 ... but nothing works. If I use the "shipped" Microsoft.Scripting.ExtensionAttribute.dll, I get the "ambiguous..." compilation error that originated the workitem 19126 If I use the "modified" Microsoft.Scripting.ExtensionAttribute.dll attached to the workitem, it refuses to be loaded. When I try to instantiate the engine, I get an error telling me that the Microsoft.Scripting.ExtensionAtribute cannot be loaded. It seems that IronPython 2.0.2 expects versions 0.9.0.0, and the patched DLL is 1.0.0.0 I tried to solve the last issue using a "dependentAssembly" node in the web.config, like this: ... but it doesn't work either. The DLL cannot be loaded. I tried to compile my own Microsoft.Scripting.ExtensionAttribute.dll using the "type forwarding" trick mentioned in Michaeld's post, but then I run into signing issues, and my DLL can't be loaded. I even tried a suggestion discused here some time ago, about recompiling IronPython taking away the Microsoft.Scripting.ExtensionAttribute project, and using 3.5 as a target (adding references to System.Core), but it seems it is not as simple as that: As soon as I start changing targets, I start getting more and more "collitions" with System.Core and IronPython's own implementations. So, in a nuthshell, I downgraded to IPy 1.1 (and I *hate* having to do that!), which is old, but works like a charm. But I *really, really* would like to find a proper solution to this, or at least a workarround that... *works*, without having to mess around with IronPython's source code. I'm very sad because this problem is also reproducible with the last beta of IPy 2.6, so it seems we're going to get another major release that cannot play well with ASP.NET 3. Is there anything I can do yo embed IronPython 2 in a ASP.NET 3.5 application? Thank you very much, -- Mariano From dinov at microsoft.com Thu Aug 27 16:19:41 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 27 Aug 2009 14:19:41 +0000 Subject: [IronPython] IPy 2.x and ASP.NET 3.5 In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD0452C39E@TK5EX14MBXC120.redmond.corp.microsoft.com> To get around the signing issues you can run "sn -Vr Microsoft.Scripting.ExtensionAttribute.dll" on your built version if you build it w/ our public key. The public key is in our source distributions as "MSSharedLibKey.snk". I had intended for 2.6 to be lined up w/ the previously shipped extension DLL but it looks like it's not. We should also put out an updated DLL for 2.0.3 - I'll look into doing that. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Mariano Draghi > Sent: Thursday, August 27, 2009 6:21 AM > To: users at lists.ironpython.com > Subject: [IronPython] IPy 2.x and ASP.NET 3.5 > > Hi there, > > After many hours running different experiments, I still can't find a > way to embed IronPython 2.x in a ASP.NET 3.5 web site. > > I have read this: > http://ironpython-urls.blogspot.com/2008/10/ironpython-2-and-fifth- > assembly.html > > and this: > http://devhawk.net/2008/10/21/The+Fifth+Assembly.aspx > > and tried the solution on this CodePlex workitem: > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=19126 > > ... but nothing works. > > If I use the "shipped" Microsoft.Scripting.ExtensionAttribute.dll, I > get the "ambiguous..." compilation error that originated the workitem > 19126 > > If I use the "modified" Microsoft.Scripting.ExtensionAttribute.dll > attached to the workitem, it refuses to be loaded. When I try to > instantiate the engine, I get an error telling me that the > Microsoft.Scripting.ExtensionAtribute cannot be loaded. It seems that > IronPython 2.0.2 expects versions 0.9.0.0, and the patched DLL is > 1.0.0.0 > > I tried to solve the last issue using a "dependentAssembly" node in > the web.config, like this: > > name="Miscrosoft.Scripting.ExtensionAttribute" > publicKeyToken="31bf3856ad364e35" culture="neutral" /> > > > > ... but it doesn't work either. The DLL cannot be loaded. > > I tried to compile my own Microsoft.Scripting.ExtensionAttribute.dll > using the "type forwarding" trick mentioned in Michaeld's post, but > then I run into signing issues, and my DLL can't be loaded. > > I even tried a suggestion discused here some time ago, about > recompiling IronPython taking away the > Microsoft.Scripting.ExtensionAttribute project, and using 3.5 as a > target (adding references to System.Core), but it seems it is not as > simple as that: As soon as I start changing targets, I start getting > more and more "collitions" with System.Core and IronPython's own > implementations. > > So, in a nuthshell, I downgraded to IPy 1.1 (and I *hate* having to do > that!), which is old, but works like a charm. > > But I *really, really* would like to find a proper solution to this, > or at least a workarround that... *works*, without having to mess > around with IronPython's source code. > > I'm very sad because this problem is also reproducible with the last > beta of IPy 2.6, so it seems we're going to get another major release > that cannot play well with ASP.NET 3. > > Is there anything I can do yo embed IronPython 2 in a ASP.NET 3.5 > application? > > Thank you very much, > > > -- > Mariano > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Thu Aug 27 17:26:19 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 27 Aug 2009 15:26:19 +0000 Subject: [IronPython] IPy 2.x and ASP.NET 3.5 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD0452C39E@TK5EX14MBXC120.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD0452C39E@TK5EX14MBXC120.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD0452C78B@TK5EX14MBXC120.redmond.corp.microsoft.com> I've generated the 0.9 and 2.0 versions for 2.0 and 2.6 and attached them: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=19126 > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Thursday, August 27, 2009 7:20 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IPy 2.x and ASP.NET 3.5 > Importance: Low > > To get around the signing issues you can run "sn -Vr > Microsoft.Scripting.ExtensionAttribute.dll" on > your built version if you build it w/ our public key. The public key > is in our source distributions > as "MSSharedLibKey.snk". > > I had intended for 2.6 to be lined up w/ the previously shipped > extension DLL but it looks like > it's not. We should also put out an updated DLL for 2.0.3 - I'll look > into doing that. > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of Mariano Draghi > > Sent: Thursday, August 27, 2009 6:21 AM > > To: users at lists.ironpython.com > > Subject: [IronPython] IPy 2.x and ASP.NET 3.5 > > > > Hi there, > > > > After many hours running different experiments, I still can't find a > > way to embed IronPython 2.x in a ASP.NET 3.5 web site. > > > > I have read this: > > http://ironpython-urls.blogspot.com/2008/10/ironpython-2-and-fifth- > > assembly.html > > > > and this: > > http://devhawk.net/2008/10/21/The+Fifth+Assembly.aspx > > > > and tried the solution on this CodePlex workitem: > > > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=19126 > > > > ... but nothing works. > > > > If I use the "shipped" Microsoft.Scripting.ExtensionAttribute.dll, I > > get the "ambiguous..." compilation error that originated the workitem > > 19126 > > > > If I use the "modified" Microsoft.Scripting.ExtensionAttribute.dll > > attached to the workitem, it refuses to be loaded. When I try to > > instantiate the engine, I get an error telling me that the > > Microsoft.Scripting.ExtensionAtribute cannot be loaded. It seems that > > IronPython 2.0.2 expects versions 0.9.0.0, and the patched DLL is > > 1.0.0.0 > > > > I tried to solve the last issue using a "dependentAssembly" node in > > the web.config, like this: > > > > > name="Miscrosoft.Scripting.ExtensionAttribute" > > publicKeyToken="31bf3856ad364e35" culture="neutral" /> > > > > > > > > ... but it doesn't work either. The DLL cannot be loaded. > > > > I tried to compile my own Microsoft.Scripting.ExtensionAttribute.dll > > using the "type forwarding" trick mentioned in Michaeld's post, but > > then I run into signing issues, and my DLL can't be loaded. > > > > I even tried a suggestion discused here some time ago, about > > recompiling IronPython taking away the > > Microsoft.Scripting.ExtensionAttribute project, and using 3.5 as a > > target (adding references to System.Core), but it seems it is not as > > simple as that: As soon as I start changing targets, I start getting > > more and more "collitions" with System.Core and IronPython's own > > implementations. > > > > So, in a nuthshell, I downgraded to IPy 1.1 (and I *hate* having to > do > > that!), which is old, but works like a charm. > > > > But I *really, really* would like to find a proper solution to this, > > or at least a workarround that... *works*, without having to mess > > around with IronPython's source code. > > > > I'm very sad because this problem is also reproducible with the last > > beta of IPy 2.6, so it seems we're going to get another major release > > that cannot play well with ASP.NET 3. > > > > Is there anything I can do yo embed IronPython 2 in a ASP.NET 3.5 > > application? > > > > Thank you very much, > > > > > > -- > > Mariano > > _______________________________________________ > > 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 mdraghi at gmail.com Thu Aug 27 18:02:06 2009 From: mdraghi at gmail.com (Mariano Draghi) Date: Thu, 27 Aug 2009 13:02:06 -0300 Subject: [IronPython] IPy 2.x and ASP.NET 3.5 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD0452C78B@TK5EX14MBXC120.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD0452C39E@TK5EX14MBXC120.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD0452C78B@TK5EX14MBXC120.redmond.corp.microsoft.com> Message-ID: On Thu, Aug 27, 2009 at 12:26 PM, Dino Viehland wrote: > I've generated the 0.9 and 2.0 versions for 2.0 and 2.6 and attached them: > > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=19126 > Thank you *VERY* much!!! I'll try them as soon as I can, and report back -- Mariano From mdraghi at gmail.com Thu Aug 27 21:04:18 2009 From: mdraghi at gmail.com (Mariano Draghi) Date: Thu, 27 Aug 2009 16:04:18 -0300 Subject: [IronPython] [SOLVED] Re: IPy 2.x and ASP.NET 3.5 In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD0452C39E@TK5EX14MBXC120.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD0452C78B@TK5EX14MBXC120.redmond.corp.microsoft.com> Message-ID: Success! I can confirm that the generated 0.9.0.0 version works perfect with IPy 2.0.2 final release. Once again, thank you very much for your quick response! Regards, -- Mariano On Thu, Aug 27, 2009 at 1:02 PM, Mariano Draghi wrote: > On Thu, Aug 27, 2009 at 12:26 PM, Dino Viehland wrote: >> I've generated the 0.9 and 2.0 versions for 2.0 and 2.6 and attached them: >> >> http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=19126 >> > > Thank you *VERY* much!!! > > I'll try them as soon as I can, and report back > From prabupsgit at gmail.com Fri Aug 28 15:39:22 2009 From: prabupsgit at gmail.com (Prabhu Mohan) Date: Fri, 28 Aug 2009 19:09:22 +0530 Subject: [IronPython] Generating executables out of IronPython script Message-ID: <76b190ae0908280639k718ef575o6766cbc0d42ecfb8@mail.gmail.com> Hi, I have been using IronPython 2.0.2 to develop a Microsoft SharePoint application. I use IronPython studio (Integrated with Visual Studio 2008). When I build the project, I get an executable along with IronPython.dll and IronMath.dll which I need to redistribute with the executable. But when I try to create an executable using PYC I get an executable along with a dll (say Main.dll with Main.exe). In this case, I need to redistribute Main.dll, IronPython.dll, IronMath.dll, IronPython.Modules.dll, Microsoft.Scripting.Core.dll, Microsoft.Scripting.dll etc., So I need to know if it is possible to get the same way as IronPython studio provides without using the studio (using command line or any other tool) -- Kind Regards, Prabhu -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Aug 28 19:58:50 2009 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 28 Aug 2009 17:58:50 +0000 Subject: [IronPython] Generating executables out of IronPython script In-Reply-To: <76b190ae0908280639k718ef575o6766cbc0d42ecfb8@mail.gmail.com> References: <76b190ae0908280639k718ef575o6766cbc0d42ecfb8@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD04574035@TK5EX14MBXC116.redmond.corp.microsoft.com> You might be able to use al.exe to link them together - but otherwise no. Is the problem having both Main.dll + Main.exe (which we could presumably fix)? Or is it just the large number of assemblies overall? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Prabhu Mohan Sent: Friday, August 28, 2009 6:39 AM To: users at lists.ironpython.com Subject: [IronPython] Generating executables out of IronPython script Hi, I have been using IronPython 2.0.2 to develop a Microsoft SharePoint application. I use IronPython studio (Integrated with Visual Studio 2008). When I build the project, I get an executable along with IronPython.dll and IronMath.dll which I need to redistribute with the executable. But when I try to create an executable using PYC I get an executable along with a dll (say Main.dll with Main.exe). In this case, I need to redistribute Main.dll, IronPython.dll, IronMath.dll, IronPython.Modules.dll, Microsoft.Scripting.Core.dll, Microsoft.Scripting.dll etc., So I need to know if it is possible to get the same way as IronPython studio provides without using the studio (using command line or any other tool) -- Kind Regards, Prabhu -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce.bromberek at gmail.com Sat Aug 29 04:16:59 2009 From: bruce.bromberek at gmail.com (Bruce Bromberek) Date: Fri, 28 Aug 2009 21:16:59 -0500 Subject: [IronPython] Generating executables out of IronPython script In-Reply-To: <1A472770E042064698CB5ADC83A12ACD04574035@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <76b190ae0908280639k718ef575o6766cbc0d42ecfb8@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD04574035@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <58ad4a110908281916n74f333d2w85dbd74bad80d749@mail.gmail.com> I used to think that would be great back when I used py2exe, but once I built a script to build an MSI, the need went away. For me having real install/uninstall, shortcut and registry setting capabilities trumps a single exe file. Bruce On Fri, Aug 28, 2009 at 12:58 PM, Dino Viehland wrote: > You might be able to use al.exe to link them together ? but otherwise > no. Is the problem having both Main.dll + Main.exe (which we could > presumably fix)? Or is it just the large number of assemblies overall? > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Prabhu Mohan > *Sent:* Friday, August 28, 2009 6:39 AM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] Generating executables out of IronPython script > > > > Hi, > > I have been using IronPython 2.0.2 to develop a Microsoft SharePoint > application. I use IronPython studio (Integrated with Visual Studio 2008). > When I build the project, I get an executable along with IronPython.dll and > IronMath.dll which I need to redistribute with the executable. But when I > try to create an executable using PYC I get an executable along with a dll > (say Main.dll with Main.exe). In this case, I need to redistribute Main.dll, > IronPython.dll, IronMath.dll, IronPython.Modules.dll, > Microsoft.Scripting.Core.dll, Microsoft.Scripting.dll etc., So I need to > know if it is possible to get the same way as IronPython studio provides > without using the studio (using command line or any other tool) > > -- > Kind Regards, > Prabhu > > _______________________________________________ > 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 prabupsgit at gmail.com Sat Aug 29 05:46:24 2009 From: prabupsgit at gmail.com (Prabhu Mohan) Date: Sat, 29 Aug 2009 09:16:24 +0530 Subject: [IronPython] Users Digest, Vol 61, Issue 57 In-Reply-To: References: Message-ID: <76b190ae0908282046i6d1b45cbn267c6dacf75bd3bb@mail.gmail.com> The problem is having both Main.exe and Main.dll. Since I am planning to have a large number of exes, shipping a dll for each exe looks like a bad approach On Sat, Aug 29, 2009 at 1:39 AM, wrote: > Send Users mailing list submissions to > users at lists.ironpython.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > or, via email, send a message with subject or body 'help' to > users-request at lists.ironpython.com > > You can reach the person managing the list at > users-owner at lists.ironpython.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Users digest..." > > > Today's Topics: > > 1. Generating executables out of IronPython script (Prabhu Mohan) > 2. Re: Generating executables out of IronPython script > (Dino Viehland) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 28 Aug 2009 19:09:22 +0530 > From: Prabhu Mohan > To: users at lists.ironpython.com > Subject: [IronPython] Generating executables out of IronPython script > Message-ID: > <76b190ae0908280639k718ef575o6766cbc0d42ecfb8 at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hi, > > I have been using IronPython 2.0.2 to develop a Microsoft SharePoint > application. I use IronPython studio (Integrated with Visual Studio 2008). > When I build the project, I get an executable along with IronPython.dll and > IronMath.dll which I need to redistribute with the executable. But when I > try to create an executable using PYC I get an executable along with a dll > (say Main.dll with Main.exe). In this case, I need to redistribute > Main.dll, > IronPython.dll, IronMath.dll, IronPython.Modules.dll, > Microsoft.Scripting.Core.dll, Microsoft.Scripting.dll etc., So I need to > know if it is possible to get the same way as IronPython studio provides > without using the studio (using command line or any other tool) > > -- > Kind Regards, > Prabhu > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20090828/066c33c3/attachment.html > > > > ------------------------------ > > Message: 2 > Date: Fri, 28 Aug 2009 17:58:50 +0000 > From: Dino Viehland > To: Discussion of IronPython > Subject: Re: [IronPython] Generating executables out of IronPython > script > Message-ID: > < > 1A472770E042064698CB5ADC83A12ACD04574035 at TK5EX14MBXC116.redmond.corp.microsoft.com > > > > Content-Type: text/plain; charset="us-ascii" > > You might be able to use al.exe to link them together - but otherwise no. > Is the problem having both Main.dll + Main.exe (which we could presumably > fix)? Or is it just the large number of assemblies overall? > > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Prabhu Mohan > Sent: Friday, August 28, 2009 6:39 AM > To: users at lists.ironpython.com > Subject: [IronPython] Generating executables out of IronPython script > > Hi, > > I have been using IronPython 2.0.2 to develop a Microsoft SharePoint > application. I use IronPython studio (Integrated with Visual Studio 2008). > When I build the project, I get an executable along with IronPython.dll and > IronMath.dll which I need to redistribute with the executable. But when I > try to create an executable using PYC I get an executable along with a dll > (say Main.dll with Main.exe). In this case, I need to redistribute Main.dll, > IronPython.dll, IronMath.dll, IronPython.Modules.dll, > Microsoft.Scripting.Core.dll, Microsoft.Scripting.dll etc., So I need to > know if it is possible to get the same way as IronPython studio provides > without using the studio (using command line or any other tool) > > -- > Kind Regards, > Prabhu > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20090828/5de00a03/attachment-0001.htm > > > > ------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > End of Users Digest, Vol 61, Issue 57 > ************************************* > -- Kind Regards, Prabhu -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Sat Aug 29 21:56:33 2009 From: dinov at microsoft.com (Dino Viehland) Date: Sat, 29 Aug 2009 19:56:33 +0000 Subject: [IronPython] Users Digest, Vol 61, Issue 57 In-Reply-To: <76b190ae0908282046i6d1b45cbn267c6dacf75bd3bb@mail.gmail.com> References: <76b190ae0908282046i6d1b45cbn267c6dacf75bd3bb@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD045B0DFC@TK5EX14MBXC116.redmond.corp.microsoft.com> Could you open a bug on CodePlex for this? I'm not certain that we'd be able to get it into 2.6 RC1 but if the remaining work goes well we might be able to. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Prabhu Mohan Sent: Friday, August 28, 2009 8:46 PM To: users at lists.ironpython.com Subject: Re: [IronPython] Users Digest, Vol 61, Issue 57 The problem is having both Main.exe and Main.dll. Since I am planning to have a large number of exes, shipping a dll for each exe looks like a bad approach On Sat, Aug 29, 2009 at 1:39 AM, > wrote: Send Users mailing list submissions to users at lists.ironpython.com To subscribe or unsubscribe via the World Wide Web, visit http://lists.ironpython.com/listinfo.cgi/users-ironpython.com or, via email, send a message with subject or body 'help' to users-request at lists.ironpython.com You can reach the person managing the list at users-owner at lists.ironpython.com When replying, please edit your Subject line so it is more specific than "Re: Contents of Users digest..." Today's Topics: 1. Generating executables out of IronPython script (Prabhu Mohan) 2. Re: Generating executables out of IronPython script (Dino Viehland) ---------------------------------------------------------------------- Message: 1 Date: Fri, 28 Aug 2009 19:09:22 +0530 From: Prabhu Mohan > To: users at lists.ironpython.com Subject: [IronPython] Generating executables out of IronPython script Message-ID: <76b190ae0908280639k718ef575o6766cbc0d42ecfb8 at mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Hi, I have been using IronPython 2.0.2 to develop a Microsoft SharePoint application. I use IronPython studio (Integrated with Visual Studio 2008). When I build the project, I get an executable along with IronPython.dll and IronMath.dll which I need to redistribute with the executable. But when I try to create an executable using PYC I get an executable along with a dll (say Main.dll with Main.exe). In this case, I need to redistribute Main.dll, IronPython.dll, IronMath.dll, IronPython.Modules.dll, Microsoft.Scripting.Core.dll, Microsoft.Scripting.dll etc., So I need to know if it is possible to get the same way as IronPython studio provides without using the studio (using command line or any other tool) -- Kind Regards, Prabhu -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Fri, 28 Aug 2009 17:58:50 +0000 From: Dino Viehland > To: Discussion of IronPython > Subject: Re: [IronPython] Generating executables out of IronPython script Message-ID: <1A472770E042064698CB5ADC83A12ACD04574035 at TK5EX14MBXC116.redmond.corp.microsoft.com> Content-Type: text/plain; charset="us-ascii" You might be able to use al.exe to link them together - but otherwise no. Is the problem having both Main.dll + Main.exe (which we could presumably fix)? Or is it just the large number of assemblies overall? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Prabhu Mohan Sent: Friday, August 28, 2009 6:39 AM To: users at lists.ironpython.com Subject: [IronPython] Generating executables out of IronPython script Hi, I have been using IronPython 2.0.2 to develop a Microsoft SharePoint application. I use IronPython studio (Integrated with Visual Studio 2008). When I build the project, I get an executable along with IronPython.dll and IronMath.dll which I need to redistribute with the executable. But when I try to create an executable using PYC I get an executable along with a dll (say Main.dll with Main.exe). In this case, I need to redistribute Main.dll, IronPython.dll, IronMath.dll, IronPython.Modules.dll, Microsoft.Scripting.Core.dll, Microsoft.Scripting.dll etc., So I need to know if it is possible to get the same way as IronPython studio provides without using the studio (using command line or any other tool) -- Kind Regards, Prabhu -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com End of Users Digest, Vol 61, Issue 57 ************************************* -- Kind Regards, Prabhu -------------- next part -------------- An HTML attachment was scrubbed... URL: From normanbauer at gmail.com Sun Aug 30 14:26:33 2009 From: normanbauer at gmail.com (Norman Bauer) Date: Sun, 30 Aug 2009 08:26:33 -0400 Subject: [IronPython] Installation error - Vista Message-ID: Hello all, I have installed IPy 2.0 & 2.6 Beta on Vista Business (32 bit). I have .NET 2.0 and 3.5 installed, however I cannot seem to get it start. I keep getting the error below whenever i try to start ipy.exe Any suggestions? Norm Unhandled Exception: System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section system.codedom. (C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 13) at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors() at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) --- End of inner exception stack trace --- at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey) at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName)at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName) at System.Configuration.ConfigurationManager.GetSection(String sectionName) at Microsoft.Scripting.Hosting.Configuration.Section.LoadRuntimeSetup(ScriptR untimeSetup setup, Stream configFileStream) at Microsoft.Scripting.Hosting.Shell.ConsoleHost.CreateRuntimeSetup()at Microsoft.Scripting.Hosting.Shell.ConsoleHost.Run(String[] args)at PythonConsoleHost.Main(String[] args) From dfugate at microsoft.com Mon Aug 31 18:51:42 2009 From: dfugate at microsoft.com (Dave Fugate) Date: Mon, 31 Aug 2009 16:51:42 +0000 Subject: [IronPython] Users Digest, Vol 61, Issue 57 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD045B0DFC@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <76b190ae0908282046i6d1b45cbn267c6dacf75bd3bb@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD045B0DFC@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <7CEEC335D70FFE4B957737DDE836F51B9657E1@TK5EX14MBXC123.redmond.corp.microsoft.com> No need for a new bug. This was already covered by http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=19456. Dave From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Saturday, August 29, 2009 12:57 PM To: Discussion of IronPython Subject: Re: [IronPython] Users Digest, Vol 61, Issue 57 Could you open a bug on CodePlex for this? I'm not certain that we'd be able to get it into 2.6 RC1 but if the remaining work goes well we might be able to. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Prabhu Mohan Sent: Friday, August 28, 2009 8:46 PM To: users at lists.ironpython.com Subject: Re: [IronPython] Users Digest, Vol 61, Issue 57 The problem is having both Main.exe and Main.dll. Since I am planning to have a large number of exes, shipping a dll for each exe looks like a bad approach On Sat, Aug 29, 2009 at 1:39 AM, > wrote: Send Users mailing list submissions to users at lists.ironpython.com To subscribe or unsubscribe via the World Wide Web, visit http://lists.ironpython.com/listinfo.cgi/users-ironpython.com or, via email, send a message with subject or body 'help' to users-request at lists.ironpython.com You can reach the person managing the list at users-owner at lists.ironpython.com When replying, please edit your Subject line so it is more specific than "Re: Contents of Users digest..." Today's Topics: 1. Generating executables out of IronPython script (Prabhu Mohan) 2. Re: Generating executables out of IronPython script (Dino Viehland) ---------------------------------------------------------------------- Message: 1 Date: Fri, 28 Aug 2009 19:09:22 +0530 From: Prabhu Mohan > To: users at lists.ironpython.com Subject: [IronPython] Generating executables out of IronPython script Message-ID: <76b190ae0908280639k718ef575o6766cbc0d42ecfb8 at mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Hi, I have been using IronPython 2.0.2 to develop a Microsoft SharePoint application. I use IronPython studio (Integrated with Visual Studio 2008). When I build the project, I get an executable along with IronPython.dll and IronMath.dll which I need to redistribute with the executable. But when I try to create an executable using PYC I get an executable along with a dll (say Main.dll with Main.exe). In this case, I need to redistribute Main.dll, IronPython.dll, IronMath.dll, IronPython.Modules.dll, Microsoft.Scripting.Core.dll, Microsoft.Scripting.dll etc., So I need to know if it is possible to get the same way as IronPython studio provides without using the studio (using command line or any other tool) -- Kind Regards, Prabhu -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Fri, 28 Aug 2009 17:58:50 +0000 From: Dino Viehland > To: Discussion of IronPython > Subject: Re: [IronPython] Generating executables out of IronPython script Message-ID: <1A472770E042064698CB5ADC83A12ACD04574035 at TK5EX14MBXC116.redmond.corp.microsoft.com> Content-Type: text/plain; charset="us-ascii" You might be able to use al.exe to link them together - but otherwise no. Is the problem having both Main.dll + Main.exe (which we could presumably fix)? Or is it just the large number of assemblies overall? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Prabhu Mohan Sent: Friday, August 28, 2009 6:39 AM To: users at lists.ironpython.com Subject: [IronPython] Generating executables out of IronPython script Hi, I have been using IronPython 2.0.2 to develop a Microsoft SharePoint application. I use IronPython studio (Integrated with Visual Studio 2008). When I build the project, I get an executable along with IronPython.dll and IronMath.dll which I need to redistribute with the executable. But when I try to create an executable using PYC I get an executable along with a dll (say Main.dll with Main.exe). In this case, I need to redistribute Main.dll, IronPython.dll, IronMath.dll, IronPython.Modules.dll, Microsoft.Scripting.Core.dll, Microsoft.Scripting.dll etc., So I need to know if it is possible to get the same way as IronPython studio provides without using the studio (using command line or any other tool) -- Kind Regards, Prabhu -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com End of Users Digest, Vol 61, Issue 57 ************************************* -- Kind Regards, Prabhu -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Aug 31 23:25:41 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 31 Aug 2009 22:25:41 +0100 Subject: [IronPython] IronPython Tools and IDEs Message-ID: <4A9C3FD5.4010501@voidspace.org.uk> Hello all, I've written a roundup of the IronPython support in several of the major IDEs (Visual Studio, SharpDevelop, Wing, Eclipse with PyDev), plus a bunch of other 'standard' IronPython and Python development tools: - Other Editors - Windbg SOS - Code Quality Checkers - Debugging and the Python Pdb Module - Code Coverage and Profiling - Refactoring and Complexity http://www.voidspace.org.uk/ironpython/tools-and-ides.shtml All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog