From merllab at microsoft.com Mon Feb 1 17:53:50 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 1 Feb 2010 08:53:50 -0800 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <3c7936ee-4945-4049-b90c-c07e81443810@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/63710. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPythonTest/DynamicRegressions.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/AssemblyVersion.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Properties/ExtensionAssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Tests/interop/net/dynamic/dynamic_regressions.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1544225 Date: 1/29/2010 4:53:31 PM Added regression tests for a handful of 'dynamic' bugs filed internally. (Shelveset: DYN_REGRESSIONS;REDMOND\dfugate | SNAP CheckinId: 10237) From merllab at microsoft.com Mon Feb 1 21:16:04 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 1 Feb 2010 12:16:04 -0800 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <05da72ea-5b49-489c-b960-a6f94ce68ae4@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/63715. MODIFIED SOURCES $/IronPython/IronPython_2_6/Src/AssemblyVersion.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Dynamic/Properties/AssemblyInfo.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting.Core/Properties/ExtensionAssemblyInfo.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting.Core/Properties/AssemblyInfo.cs $/IronPython/IronPython_2_6/Src/Hosts/SilverLight/Chiron/Properties/AssemblyInfo.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting.Debugging/AssemblyInfo.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Properties/AssemblyInfo.cs From dinov at microsoft.com Mon Feb 1 21:19:50 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 1 Feb 2010 20:19:50 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <4B65E6A7.904@voidspace.org.uk> References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> The following tests break: test_str.test_conversion We already disable a single test case (Foo9 called with unicode) but now we would disable 3 (Foo6, Foo7, and Foo9 called with str). Supporting it on old-style classes also causes us to disable Foo0. test_unicode.test_conversion: We currently disable most of the test cases here - all except for Foo8 (Unicode)/Foo9 (str). After the change those two are failing and everything else is now passing. Test_traceback.test_format_exception_only_bad__str__: BaseException defines __unicode__ and so it gets called instead of __str__ - it looks like I can fix this one. Test_doctest: There's one failure here, it's the same as the test_traceback issue, and again it looks like it's fixable. So the net result is that tests which specifically check for differences with __unicode__ / __str__ when called with Unicode/str change behavior. Everything else works the same. My initial test job didn't include support for __unicode__ on old-style classes or have the fix for exceptions. I'm sending it through again to make sure those two changes didn't break anything else. But I'm inclined to say that this change is for the better. Thoughts? > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Sunday, January 31, 2010 12:23 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Django, __unicode__, and #20366 > > On 31/01/2010 20:14, Dino Viehland wrote: > > I'll take a look and see what breaks if we call __unicode__ when it's > defined > > when the user calls str/unicode. > > > > > Great. Given that *currently* IronPython will do the wrong thing I can't > *imagine* any failures caused by this, but this probably a lack of > imagination on my part... > > All the best, > > Michael > > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > >> bounces at lists.ironpython.com] On Behalf Of Michael Foord > >> Sent: Sunday, January 31, 2010 11:25 AM > >> To: Discussion of IronPython > >> Subject: Re: [IronPython] Django, __unicode__, and #20366 > >> > >> On 31/01/2010 01:21, Jeff Hardy wrote: > >> > >>> Hi all, > >>> I've got a question regarding __unicode__ and issue #20366[0]. Django > >>> explicitly encourages the use of __unicode__ on models[1], which > >>> > >> would > >> > >>> not be available on IronPython. Also, they have some lazy evaluation > >>> functions that depend on differences between str and unicode, and > >>> default to using __unicode__. Now, these differences could be worked > >>> around in Django, but I wonder if that's the right place for them. > >>> > >> There's *unlikely* to be an easy fix in IronPython any time soon, > >> although I would love to be proved wrong. The Django team have > >> *explicitly* said that they are open to patches (or even just bug > >> reports) to make Django compatible with IronPython. > >> > >> > >>> I > >>> also have no idea how this will play out under 3.0. > >>> > >>> > >>> > >> Django is not expecting to move to Python 3 for quite some time as I > >> understand it. > >> > >> > >>> I'm working around by checking `str is unicode`; I'm not sure there's > >>> really a better option. > >>> > >>> > >> That sounds like a good solution to me. > >> > >> > >>> - Jeff > >>> > >>> > >>> [0] > >>> > >> http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=20366 > >> > >>> > >> I still think the partial-fix I suggest in that issue would be much > >> better than the current situation... > >> > >> All the best, > >> > >> Michael > >> > >> > >>> [1] > >>> > >> http://docs.djangoproject.com/en/1.1/ref/models/instances/#django.db.mo > >> dels.Model.__unicode__ > >> > >>> _______________________________________________ > >>> 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 > >> > >> READ CAREFULLY. By accepting and reading this email you agree, on > >> behalf of your employer, to release me from all obligations and waivers > >> arising from any and all NON-NEGOTIATED agreements, licenses, terms-of- > >> service, shrinkwrap, clickwrap, browsewrap, confidentiality, non- > >> disclosure, non-compete and acceptable use policies ("BOGUS > >> AGREEMENTS") that I have entered into with your employer, its partners, > >> licensors, agents and assigns, in perpetuity, without prejudice to my > >> ongoing rights and privileges. You further represent that you have the > >> authority to release me from any BOGUS AGREEMENTS on behalf of your > >> employer. > >> > >> > >> _______________________________________________ > >> 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 > > READ CAREFULLY. By accepting and reading this email you agree, on behalf of > your employer, to release me from all obligations and waivers arising from any > and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, > clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and > acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with > your employer, its partners, licensors, agents and assigns, in perpetuity, > without prejudice to my ongoing rights and privileges. You further represent > that you have the authority to release me from any BOGUS AGREEMENTS on behalf > of your employer. > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jdhardy at gmail.com Mon Feb 1 22:16:14 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 1 Feb 2010 14:16:14 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Mon, Feb 1, 2010 at 1:19 PM, Dino Viehland wrote: > My initial test job didn't include support for __unicode__ on old-style classes or have the fix for exceptions. ?I'm sending it through again to make sure those two changes didn't break anything else. ?But I'm inclined to say that this change is for the better. ?Thoughts? How does the implementation work? Does always it prefer __unicode__ to __str__, or does it only call __unicode__ if it is present and __str__ is missing? - Jeff From dinov at microsoft.com Mon Feb 1 22:21:27 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 1 Feb 2010 21:21:27 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> It always prefers __unicode__ over __str__. We can't really only call __unicode__ when __str__ isn't there because __str__ is always there. We could do a search based upon MRO and call the first one we find but I don't think that'll change the behavior very much and it'll certainly be more difficult to understand. The actual code is added to StringOps.FastNew: if (x is string) { // check ascii return CheckAsciiString(context, (string)x); } + object value; + if (PythonTypeOps.TryInvokeUnaryOperator(context, x, "__unicode__", out value)) { + if (value is string || value is Extensible) { + return value; + } + throw PythonOps.TypeError("coercing to Unicode: exected string, got {0}", PythonTypeOps.GetName(value)); + } + + OldInstance oi = x as OldInstance; + + if (oi != null && oi.TryGetBoundCustomMember(context, "__unicode__", out value)) { + value = context.LanguageContext.Call(context, value); + if (value is string || value is Extensible) { + return value; + } + throw PythonOps.TypeError("coercing to Unicode: exected string, got {0}", PythonTypeOps.GetName(value)); + } // we don't invoke PythonOps.StringRepr here because we want to return the // Extensible directly back if that's what we received from __str__. value = PythonContext.InvokeUnaryOperator(context, UnaryOperators.String, x); if (value is string || value is Extensible) { return value; } > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Jeff Hardy > Sent: Monday, February 01, 2010 1:16 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Django, __unicode__, and #20366 > > On Mon, Feb 1, 2010 at 1:19 PM, Dino Viehland wrote: > > My initial test job didn't include support for __unicode__ on old-style > classes or have the fix for exceptions. ?I'm sending it through again to make > sure those two changes didn't break anything else. ?But I'm inclined to say > that this change is for the better. ?Thoughts? > > How does the implementation work? Does always it prefer __unicode__ to > __str__, or does it only call __unicode__ if it is present and __str__ > is missing? > > - Jeff > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jdhardy at gmail.com Mon Feb 1 22:35:31 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 1 Feb 2010 14:35:31 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Mon, Feb 1, 2010 at 2:21 PM, Dino Viehland wrote: > It always prefers __unicode__ over __str__. ?We can't really only call > __unicode__ when __str__ isn't there because __str__ is always there. OK - didn't realize that. Not sure it would really improve the behaviour all that much anyway. Anything that really needs to know the difference and support IronPython can just check `str is unicode` anyway. Random thought: str(x, yes_really=True) to always call __str__? :) - Jeff From fuzzyman at voidspace.org.uk Mon Feb 1 22:40:35 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 01 Feb 2010 21:40:35 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4B674A53.5000109@voidspace.org.uk> On 01/02/2010 21:35, Jeff Hardy wrote: > On Mon, Feb 1, 2010 at 2:21 PM, Dino Viehland wrote: > >> It always prefers __unicode__ over __str__. We can't really only call >> __unicode__ when __str__ isn't there because __str__ is always there. >> > OK - didn't realize that. Not sure it would really improve the > behaviour all that much anyway. > > Anything that really needs to know the difference and support > IronPython can just check `str is unicode` anyway. > > Random thought: str(x, yes_really=True) to always call __str__? :) > How about having str and unicode as different objects internally - so IronPython can tell the difference - but fake equality and identity checks *inside* IronPython. :-) Or do something a bit similar to what Python 3 does with super... Compile different code for str(...) and unicode(...). I think I prefer that to the above. :-) Michael > - Jeff > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. From dinov at microsoft.com Mon Feb 1 22:46:55 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 1 Feb 2010 21:46:55 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <4B674A53.5000109@voidspace.org.uk> References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> > How about having str and unicode as different objects internally - so > IronPython can tell the difference - but fake equality and identity > checks *inside* IronPython. :-) > > Or do something a bit similar to what Python 3 does with super... > Compile different code for str(...) and unicode(...). I think I prefer > that to the above. :-) > Messing with identity starts to get really scary and I'd rather not go there - I'm sure there will be lots of edge cases which will be broken. I could see is making unicode(foo) do something different. If you aliased unicode then you'd get str's behavior though but that might be perfectly acceptable. It's definitely a solution I had not considered and it'd probably fix multiple issues. From dinov at microsoft.com Mon Feb 1 22:47:44 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 1 Feb 2010 21:47:44 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD391F602B@TK5EX14MBXC116.redmond.corp.microsoft.com> Jeff wrote: > OK - didn't realize that. Not sure it would really improve the > behaviour all that much anyway. > > Anything that really needs to know the difference and support > IronPython can just check `str is unicode` anyway. > > Random thought: str(x, yes_really=True) to always call __str__? :) I'm not sure that'll help with compatibility w/ Django go unless other implementations were to support it as well. From fuzzyman at voidspace.org.uk Mon Feb 1 22:49:45 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 01 Feb 2010 21:49:45 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4B674C79.7090300@voidspace.org.uk> On 01/02/2010 21:46, Dino Viehland wrote: >> How about having str and unicode as different objects internally - so >> IronPython can tell the difference - but fake equality and identity >> checks *inside* IronPython. :-) >> >> Or do something a bit similar to what Python 3 does with super... >> Compile different code for str(...) and unicode(...). I think I prefer >> that to the above. :-) >> >> > Messing with identity starts to get really scary and I'd rather not go > there - I'm sure there will be lots of edge cases which will be broken. > > I can imagine. > I could see is making unicode(foo) do something different. If you aliased > unicode then you'd get str's behavior though but that might be perfectly > acceptable. It's definitely a solution I had not considered and it'd > probably fix multiple issues. > > It might be worth a try if it isn't too much work. I think it would help *most* situations, aliasing unicode and str isn't *that* common. 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. From jdhardy at gmail.com Tue Feb 2 00:58:12 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 1 Feb 2010 16:58:12 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland wrote: > I could see is making unicode(foo) do something different. ?If you aliased > unicode then you'd get str's behavior though but that might be perfectly > acceptable. ?It's definitely a solution I had not considered and it'd > probably fix multiple issues. Presumably then str and unicode would no longer be equal? Or are you thinking of something fancier? Also, in what cases would anyone *want* to alias unicode? - Jeff From fuzzyman at voidspace.org.uk Tue Feb 2 01:01:55 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 02 Feb 2010 00:01:55 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4B676B73.708@voidspace.org.uk> On 01/02/2010 23:58, Jeff Hardy wrote: > On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland wrote: > >> I could see is making unicode(foo) do something different. If you aliased >> unicode then you'd get str's behavior though but that might be perfectly >> acceptable. It's definitely a solution I had not considered and it'd >> probably fix multiple issues. >> > Presumably then str and unicode would no longer be equal? Or are you > thinking of something fancier? > > They would still be the same object - so would continue to compare equal and have the same identity. What I'm suggesting is similar to how Python 3 treats the use of super - and that is compile different code when you call str(...) from when you call unicode(....) - only when you use those literal identifiers in source code. Any use of them other than calling them directly would continue to behave as IronPython does currently. > Also, in what cases would anyone *want* to alias unicode? > > Well, like aliasing super in Python 3, with my suggestion that would then be broken (or at least would fall back to standard str behaviour). As this is uncommon anyway it shouldn't break *much* code. All the best, Michael > - Jeff > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. From Jimmy.Schementi at microsoft.com Tue Feb 2 01:02:47 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 2 Feb 2010 00:02:47 +0000 Subject: [IronPython] IronPython 2.6 and Moonlight In-Reply-To: <4B65D345.40005@bakalari.cz> References: <4B65D345.40005@bakalari.cz> Message-ID: <1B42307CD4AADD438CDDA2FE1121CC920EEDA2@TK5EX14MBXC136.redmond.corp.microsoft.com> Not sure ... I'll see if it still works against Silverlight 2; I'm not sure if the SILVERLIGHT_3 flag is still needed. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Lukas Cenovsky > Sent: Sunday, January 31, 2010 11:00 AM > To: Discussion of IronPython > Subject: [IronPython] IronPython 2.6 and Moonlight > > Hi all, > does anybody know why Silverlight app developed in IronPython 2.6 does not > work in Moonlight 2? Is it because of SILVERLIGHT_3 flag? Is there any > workaround? > > I tested it with the SL template, Ubuntu 9.10, Firefox 3.5.7, Moonlight 2.0: > http://gui-at.cendaweb.cz/SLLinux/ > > -- > -- Luk?? > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From vernondcole at gmail.com Tue Feb 2 01:13:37 2010 From: vernondcole at gmail.com (Vernon Cole) Date: Mon, 1 Feb 2010 17:13:37 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <4B65D91C.4030902@voidspace.org.uk> References: <4B65D91C.4030902@voidspace.org.uk> Message-ID: Actually there is a project underway at the University of Toronto as we speak to port Django to Python 3. See Porting Django to Python 3on the django developers group. I think it might be a Really Good idea if someone with an IronPython interest were to volunteer to help the group. Personally, I'm going to be rather busy getting my django-capable version of adodbapi ready.) Perhaps some of you might want to check them out. In my experience Python 3 support and IronPython support go hand in hand. -- Vernon Cole On Sun, Jan 31, 2010 at 12:25 PM, Michael Foord wrote: > On 31/01/2010 01:21, Jeff Hardy wrote: > >> Hi all, >> I've got a question regarding __unicode__ and issue #20366[0]. Django >> explicitly encourages the use of __unicode__ on models[1], which would >> not be available on IronPython. Also, they have some lazy evaluation >> functions that depend on differences between str and unicode, and >> default to using __unicode__. Now, these differences could be worked >> around in Django, but I wonder if that's the right place for them. >> > There's *unlikely* to be an easy fix in IronPython any time soon, although > I would love to be proved wrong. The Django team have *explicitly* said that > they are open to patches (or even just bug reports) to make Django > compatible with IronPython. > > > I >> also have no idea how this will play out under 3.0. >> >> >> > > Django is not expecting to move to Python 3 for quite some time as I > understand it. > > > I'm working around by checking `str is unicode`; I'm not sure there's >> really a better option. >> >> > > That sounds like a good solution to me. > > > - Jeff >> >> >> [0] http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=20366 >> >> > I still think the partial-fix I suggest in that issue would be much better > than the current situation... > > All the best, > > Michael > > > [1] >> http://docs.djangoproject.com/en/1.1/ref/models/instances/#django.db.models.Model.__unicode__ >> _______________________________________________ >> 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 > > READ CAREFULLY. By accepting and reading this email you agree, on behalf of > your employer, to release me from all obligations and waivers arising from > any and all NON-NEGOTIATED agreements, licenses, terms-of-service, > shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, > non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have > entered into with your employer, its partners, licensors, agents and > assigns, in perpetuity, without prejudice to my ongoing rights and > privileges. You further represent that you have the authority to release me > from any BOGUS AGREEMENTS on behalf of your employer. > > > > _______________________________________________ > 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 steventon at gmail.com Tue Feb 2 11:23:16 2010 From: steventon at gmail.com (Richard Steventon) Date: Tue, 2 Feb 2010 05:23:16 -0500 Subject: [IronPython] XNA and how to specify the type arguments explicitly Message-ID: A newbie here. I am trying to use the XNA infrastructure to render some data, since all I need is points and colored triangles and a movable camera. Code snippet: def SetupVerticies(self): l = Array.CreateInstance(VertexPositionColor,6) l[0] = VertexPositionColor(Vector3(0., 0., 0.), Color.White) l[1] = VertexPositionColor(Vector3(5., 0., 0.), Color.White) l[2] = VertexPositionColor(Vector3(10., 0., 0.), Color.White) l[3] = VertexPositionColor(Vector3(5., 0., -5.), Color.White) l[4] = VertexPositionColor(Vector3(0., 0., 0.), Color.White) l[5] = VertexPositionColor(Vector3(10., 0., -5.), Color.White) self.vertices = l def CopyTerrainToGraphicsBuffers(self): self.VertexBuffer = VertexBuffer(self.graphics.GraphicsDevice, \ len(self.vertices) * VertexPositionColor.SizeInBytes, \ BufferUsage.WriteOnly) self.VertexBuffer.SetData(self.vertices) This dies with: TypeError: The type arguments for method 'SetData' cannot be inferred from the usage. Try specifying the type arguments explicitly. Any idea how to do this ? From fuzzyman at voidspace.org.uk Tue Feb 2 11:44:24 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 02 Feb 2010 10:44:24 +0000 Subject: [IronPython] XNA and how to specify the type arguments explicitly In-Reply-To: References: Message-ID: <4B680208.5090101@voidspace.org.uk> On 02/02/2010 10:23, Richard Steventon wrote: > A newbie here. I am trying to use the XNA infrastructure to render > some data, since all I need is points and colored triangles and a > movable camera. > > Code snippet: > def SetupVerticies(self): > l = Array.CreateInstance(VertexPositionColor,6) > l[0] = VertexPositionColor(Vector3(0., 0., 0.), Color.White) > l[1] = VertexPositionColor(Vector3(5., 0., 0.), Color.White) > l[2] = VertexPositionColor(Vector3(10., 0., 0.), Color.White) > l[3] = VertexPositionColor(Vector3(5., 0., -5.), Color.White) > l[4] = VertexPositionColor(Vector3(0., 0., 0.), Color.White) > l[5] = VertexPositionColor(Vector3(10., 0., -5.), Color.White) > self.vertices = l > > def CopyTerrainToGraphicsBuffers(self): > self.VertexBuffer = VertexBuffer(self.graphics.GraphicsDevice, \ > len(self.vertices) * VertexPositionColor.SizeInBytes, \ > BufferUsage.WriteOnly) > self.VertexBuffer.SetData(self.vertices) > > This dies with: > TypeError: The type arguments for method 'SetData' cannot be inferred > from the usage. Try specifying the type arguments explicitly. > > > Any idea how to do this ? > Try this: self.VertexBuffer.SetData[Array[VertexPositionColor]](self.vertices) 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. From marco.parenzan at libero.it Tue Feb 2 14:08:41 2010 From: marco.parenzan at libero.it (Marco Parenzan) Date: Tue, 2 Feb 2010 14:08:41 +0100 Subject: [IronPython] Hosting DLR under ASP.NET In-Reply-To: References: Message-ID: <004501caa408$d88d6840$89a838c0$@parenzan@libero.it> Dear All, are there any advices about hosting DLR under ASP.NET for scripting? (not for views!)? Where hosting ScriptingRuntime, ScriptingEngine? As static variables in Global.asax? In Application? Where hosting ScriptingScope? In Session? Destroy and reistantiate at each call? I have to develop an ASP.NET MVC application, with no serious performance issues, but I don't want to abuse... Thanks in advance Marco Parenzan From steventon at gmail.com Tue Feb 2 16:51:20 2010 From: steventon at gmail.com (Richard Steventon) Date: Tue, 2 Feb 2010 10:51:20 -0500 Subject: [IronPython] XNA and how to specify the type arguments explicitly In-Reply-To: References: Message-ID: Okay, so problem #2.... calling the correct version of the interface (I think this is the problem?), since I am getting a "violates the constraint of type 'T'" error. I set up a XNA VertexBuffer using: l = Array.CreateInstance(VertexPositionColor,6) ..... self.vertices = l Then: self.VertexBuffer = VertexBuffer(self.graphics.GraphicsDevice, \ len(self.vertices) * VertexPositionColor.SizeInBytes, \ BufferUsage.WriteOnly) self.VertexBuffer.SetData[Array[VertexPositionColor]](self.vertices) And I get: ValueError: GenericArguments[0], 'Microsoft.Xna.Framework.Graphics.VertexPositionColor[]', on 'Void SetData[T](Int32, T[], Int32, Int32, Int32)' violates the constraint of type 'T'. The documentation for the VertexBuffer.SetData method can be found here: http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.vertexbuffer.setdata.aspx The methods are: VertexBuffer.SetData (Int32, T[], Int32, Int32, Int32) VertexBuffer.SetData (T[]) VertexBuffer.SetData (T[], Int32, Int32) This works fine in C# with a List of VertexPositionColor objects, so I assume that Array in IronPython is the equivalent ? So why does it not work ? From curt at hagenlocher.org Tue Feb 2 17:18:49 2010 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 2 Feb 2010 08:18:49 -0800 Subject: [IronPython] XNA and how to specify the type arguments explicitly In-Reply-To: References: Message-ID: You should template on VertexPositionColor, not on VertexPositionColor[]. The reason for the error message is that you're saying T is VertexPositionColor[]. An array is a reference type, while the template constraint specifies a value type. On Tue, Feb 2, 2010 at 7:51 AM, Richard Steventon wrote: > Okay, so problem #2.... calling the correct version of the interface > (I think this is the problem?), since I am getting a "violates the > constraint of type 'T'" error. > > I set up a XNA VertexBuffer using: > l = Array.CreateInstance(VertexPositionColor,6) > ..... > self.vertices = l > > Then: > self.VertexBuffer = VertexBuffer(self.graphics.GraphicsDevice, \ > len(self.vertices) * VertexPositionColor.SizeInBytes, \ > BufferUsage.WriteOnly) > self.VertexBuffer.SetData[Array[VertexPositionColor]](self.vertices) > > And I get: > ValueError: GenericArguments[0], > 'Microsoft.Xna.Framework.Graphics.VertexPositionColor[]', on 'Void > SetData[T](Int32, T[], Int32, Int32, Int32)' violates the constraint > of type 'T'. > > The documentation for the VertexBuffer.SetData method can be found here: > > http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.vertexbuffer.setdata.aspx > > The methods are: > VertexBuffer.SetData (Int32, T[], Int32, Int32, Int32) > VertexBuffer.SetData (T[]) > VertexBuffer.SetData (T[], Int32, Int32) > > This works fine in C# with a List of VertexPositionColor objects, so I > assume that Array in IronPython is the equivalent ? So why does it > not work ? > _______________________________________________ > 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 Feb 2 18:53:12 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 2 Feb 2010 17:53:12 +0000 Subject: [IronPython] Hosting DLR under ASP.NET In-Reply-To: <004501caa408$d88d6840$89a838c0$@parenzan@libero.it> References: <004501caa408$d88d6840$89a838c0$@parenzan@libero.it> Message-ID: <1B42307CD4AADD438CDDA2FE1121CC920EF458@TK5EX14MBXC136.redmond.corp.microsoft.com> Recreating them on each call is OK for really simple script usages, since multiple requests of an ASP.NET app run in the same CLR instance, and the result of ScriptRuntime.GetEngine("langName") is cached, so the app will only incur a performance hit (because of the language's assemblies JITing) on the first request. However, if you want to keep some state around, let's say by defining some functions or importing a library for your script code to use, then you'll want to at least keep track of a ScriptScope, and then you might as well keep track of a ScriptEngine as well. You can store those anywhere you'd normally store things that need to persist between requests. ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Marco Parenzan > Sent: Tuesday, February 02, 2010 5:09 AM > To: ironruby-core at rubyforge.org; users at lists.ironpython.com > Subject: [IronPython] Hosting DLR under ASP.NET > > Dear All, > > are there any advices about hosting DLR under ASP.NET for scripting? (not for > views!)? > Where hosting ScriptingRuntime, ScriptingEngine? > As static variables in Global.asax? In Application? > Where hosting ScriptingScope? In Session? Destroy and reistantiate at each > call? > > I have to develop an ASP.NET MVC application, with no serious performance > issues, but I don't want to abuse... > > Thanks in advance > > Marco Parenzan > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Tue Feb 2 19:27:31 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 2 Feb 2010 18:27:31 +0000 Subject: [IronPython] Hosting DLR under ASP.NET In-Reply-To: <1B42307CD4AADD438CDDA2FE1121CC920EF458@TK5EX14MBXC136.redmond.corp.microsoft.com> References: <004501caa408$d88d6840$89a838c0$@parenzan@libero.it> <1B42307CD4AADD438CDDA2FE1121CC920EF458@TK5EX14MBXC136.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392002C2@TK5EX14MBXC116.redmond.corp.microsoft.com> I would recommend: Keep 1 ScriptRuntime/ScriptEngine (as Jimmy mentions you can repeatedly grab the SE off the SR) Compile the code to a CompiledCode object and repeatedly execute it rather than re-compiling and executing Create a new ScriptScope for each request That's basically what the ASP.NET integration for IronPython does. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi > Sent: Tuesday, February 02, 2010 9:53 AM > To: Discussion of IronPython; ironruby-core at rubyforge.org > Subject: Re: [IronPython] Hosting DLR under ASP.NET > > Recreating them on each call is OK for really simple script usages, since > multiple requests of an ASP.NET app run in the same CLR instance, and the > result of ScriptRuntime.GetEngine("langName") is cached, so the app will only > incur a performance hit (because of the language's assemblies JITing) on the > first request. However, if you want to keep some state around, let's say by > defining some functions or importing a library for your script code to use, > then you'll want to at least keep track of a ScriptScope, and then you might > as well keep track of a ScriptEngine as well. You can store those anywhere > you'd normally store things that need to persist between requests. > > ~js > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of Marco Parenzan > > Sent: Tuesday, February 02, 2010 5:09 AM > > To: ironruby-core at rubyforge.org; users at lists.ironpython.com > > Subject: [IronPython] Hosting DLR under ASP.NET > > > > Dear All, > > > > are there any advices about hosting DLR under ASP.NET for scripting? (not > for > > views!)? > > Where hosting ScriptingRuntime, ScriptingEngine? > > As static variables in Global.asax? In Application? > > Where hosting ScriptingScope? In Session? Destroy and reistantiate at each > > call? > > > > I have to develop an ASP.NET MVC application, with no serious performance > > issues, but I don't want to abuse... > > > > Thanks in advance > > > > Marco Parenzan > > > > _______________________________________________ > > 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 loocas at duber.cz Tue Feb 2 22:00:50 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Tue, 02 Feb 2010 22:00:50 +0100 Subject: [IronPython] A good dotNET gui designer, plus IronPython VS2008 integration? Message-ID: <4B689282.1050305@duber.cz> Hi there everybody, I'd really appretiate if anyone could share their experience with any good dotNET GUI designer. I'd love to have such functionality I can get out of QtDesigner, where I visually design my forms and buttons and what not and then just save that GUI into a file or generate a usable Python code out of it for my scripts. And another question, is there any good integration of IronPython into Visual Studio 2008? Or newer? I'm not a VS user, but since we can get the VS Express for free, this'd be a valuable tool for my IronPython programming. Thanks a lot in advnace, cheers, -- Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe From brian.curtin at gmail.com Tue Feb 2 22:08:25 2010 From: brian.curtin at gmail.com (Brian Curtin) Date: Tue, 2 Feb 2010 15:08:25 -0600 Subject: [IronPython] A good dotNET gui designer, plus IronPython VS2008 integration? In-Reply-To: <4B689282.1050305@duber.cz> References: <4B689282.1050305@duber.cz> Message-ID: On Tue, Feb 2, 2010 at 15:00, Luk?? Dub?da wrote: > Hi there everybody, > > I'd really appretiate if anyone could share their experience > with any good dotNET GUI designer. I'd love to have such > functionality I can get out of QtDesigner, where I visually > design my forms and buttons and what not and then just save > that GUI into a file or generate a usable Python code > out of it for my scripts. > > And another question, is there any good integration of IronPython > into Visual Studio 2008? Or newer? I'm not a VS user, but since > we can get the VS Express for free, this'd be a valuable tool > for my IronPython programming. > > Thanks a lot in advnace, cheers, > > I don't have a lot of experience with it, but Sharp Develop ( http://www.icsharpcode.net/OpenSource/SD/) supports IronPython, and may be worth a look. Others have reported success. If you do look into Visual Studio, you can write GUI code in C# using the Visual Studio designer, then subclass it from Python code. You can even, with a little modification, design GUIs in C# in Visual Studio and copy/paste the C# code into a Python file and run with it. You'll need to convert things like true/false to True/False, null to None, etc...but with a little effort it works :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Tue Feb 2 23:50:58 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 02 Feb 2010 22:50:58 +0000 Subject: [IronPython] A good dotNET gui designer, plus IronPython VS2008 integration? In-Reply-To: References: <4B689282.1050305@duber.cz> Message-ID: <4B68AC52.9000805@voidspace.org.uk> On 02/02/2010 21:08, Brian Curtin wrote: > On Tue, Feb 2, 2010 at 15:00, Luk?? Dub?da > wrote: > > Hi there everybody, > > I'd really appretiate if anyone could share their experience > with any good dotNET GUI designer. I'd love to have such > functionality I can get out of QtDesigner, where I visually > design my forms and buttons and what not and then just save > that GUI into a file or generate a usable Python code > out of it for my scripts. > > And another question, is there any good integration of IronPython > into Visual Studio 2008? Or newer? I'm not a VS user, but since > we can get the VS Express for free, this'd be a valuable tool > for my IronPython programming. > > Thanks a lot in advnace, cheers, > > I don't have a lot of experience with it, but Sharp Develop > (http://www.icsharpcode.net/OpenSource/SD/) supports IronPython, and > may be worth a look. Others have reported success. > > If you do look into Visual Studio, you can write GUI code in C# using > the Visual Studio designer, then subclass it from Python code. > This is the approach I usually recommend. The only thing you miss out on is hooking up your events from the designer - but if you're doing TDD then you'll want to write your tests first anyway... :-) Michael > You can even, with a little modification, design GUIs in C# in Visual > Studio and copy/paste the C# code into a Python file and run with it. > You'll need to convert things like true/false to True/False, null to > None, etc...but with a little effort it works :) > > > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From loocas at duber.cz Wed Feb 3 00:41:22 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Wed, 03 Feb 2010 00:41:22 +0100 Subject: [IronPython] A good dotNET gui designer, plus IronPython VS2008 integration? In-Reply-To: <4B68AC52.9000805@voidspace.org.uk> References: <4B689282.1050305@duber.cz> <4B68AC52.9000805@voidspace.org.uk> Message-ID: <4B68B822.5040906@duber.cz> Thanks a lot for the recommendation, I've installed the SharpCode and it seems quite useful. It presents a little inconvenience, but I'm not sure if it's my lack of knowledge or something else, but when I design the UI, the SharpCode puts the whole path to each of the control: clr.addReference("System.Drawing") insideAClass: someControl = System.Drawing.etcEtc which IronPython then throws an error on, saying that the "System" hasn't been declared and thus doesn't exist. I had to remove the whole path from the controls' name in order to make it run in IronPython. But then the visual designer stopped working :D as it requires the full path to the controls, for some reason. Anyways, thanks a lot for the tip! Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe Michael Foord wrote: > On 02/02/2010 21:08, Brian Curtin wrote: >> On Tue, Feb 2, 2010 at 15:00, Luk?? Dub?da > > wrote: >> >> Hi there everybody, >> >> I'd really appretiate if anyone could share their experience >> with any good dotNET GUI designer. I'd love to have such >> functionality I can get out of QtDesigner, where I visually >> design my forms and buttons and what not and then just save >> that GUI into a file or generate a usable Python code >> out of it for my scripts. >> >> And another question, is there any good integration of IronPython >> into Visual Studio 2008? Or newer? I'm not a VS user, but since >> we can get the VS Express for free, this'd be a valuable tool >> for my IronPython programming. >> >> Thanks a lot in advnace, cheers, >> >> I don't have a lot of experience with it, but Sharp Develop >> (http://www.icsharpcode.net/OpenSource/SD/) supports IronPython, and >> may be worth a look. Others have reported success. >> >> If you do look into Visual Studio, you can write GUI code in C# using >> the Visual Studio designer, then subclass it from Python code. >> > > This is the approach I usually recommend. The only thing you miss out on > is hooking up your events from the designer - but if you're doing TDD > then you'll want to write your tests first anyway... :-) > > Michael > >> You can even, with a little modification, design GUIs in C# in Visual >> Studio and copy/paste the C# code into a Python file and run with it. >> You'll need to convert things like true/false to True/False, null to >> None, etc...but with a little effort it works :) >> >> >> _______________________________________________ >> 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 > > READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Wed Feb 3 00:48:57 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 2 Feb 2010 23:48:57 +0000 Subject: [IronPython] A good dotNET gui designer, plus IronPython VS2008 integration? In-Reply-To: <4B68B822.5040906@duber.cz> References: <4B689282.1050305@duber.cz> <4B68AC52.9000805@voidspace.org.uk> <4B68B822.5040906@duber.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD39202698@TK5EX14MBXC116.redmond.corp.microsoft.com> Would adding an import System at the top make both the designer and the code happy? > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Luk?? Dubeda > Sent: Tuesday, February 02, 2010 3:41 PM > To: Discussion of IronPython > Subject: Re: [IronPython] A good dotNET gui designer, plus IronPython VS2008 > integration? > > Thanks a lot for the recommendation, > > I've installed the SharpCode and it seems quite useful. It presents > a little inconvenience, but I'm not sure if it's my lack of knowledge > or something else, but when I design the UI, the SharpCode puts > the whole path to each of the control: > > clr.addReference("System.Drawing") > > insideAClass: > someControl = System.Drawing.etcEtc > > which IronPython then throws an error on, saying that the "System" > hasn't been declared and thus doesn't exist. > > I had to remove the whole path from the controls' name in order to > make it run in IronPython. But then the visual designer stopped > working :D as it requires the full path to the controls, for some > reason. > > Anyways, thanks a lot for the tip! > > Luk?? Dub?da > Director > [T] +420 602 444 164 > > duber studio(tm) > [M] info at duber.cz > [W] http://www.duber.cz > > [A] R.A.Dvorsk?ho 601, Praha 10 > [A] 10900, Czech Republic, Europe > > Michael Foord wrote: > > On 02/02/2010 21:08, Brian Curtin wrote: > >> On Tue, Feb 2, 2010 at 15:00, Luk?? Dub?da >> > wrote: > >> > >> Hi there everybody, > >> > >> I'd really appretiate if anyone could share their experience > >> with any good dotNET GUI designer. I'd love to have such > >> functionality I can get out of QtDesigner, where I visually > >> design my forms and buttons and what not and then just save > >> that GUI into a file or generate a usable Python code > >> out of it for my scripts. > >> > >> And another question, is there any good integration of IronPython > >> into Visual Studio 2008? Or newer? I'm not a VS user, but since > >> we can get the VS Express for free, this'd be a valuable tool > >> for my IronPython programming. > >> > >> Thanks a lot in advnace, cheers, > >> > >> I don't have a lot of experience with it, but Sharp Develop > >> (http://www.icsharpcode.net/OpenSource/SD/) supports IronPython, and > >> may be worth a look. Others have reported success. > >> > >> If you do look into Visual Studio, you can write GUI code in C# using > >> the Visual Studio designer, then subclass it from Python code. > >> > > > > This is the approach I usually recommend. The only thing you miss out on > > is hooking up your events from the designer - but if you're doing TDD > > then you'll want to write your tests first anyway... :-) > > > > Michael > > > >> You can even, with a little modification, design GUIs in C# in Visual > >> Studio and copy/paste the C# code into a Python file and run with it. > >> You'll need to convert things like true/false to True/False, null to > >> None, etc...but with a little effort it works :) > >> > >> > >> _______________________________________________ > >> 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 > > > > READ CAREFULLY. By accepting and reading this email you agree, on behalf of > your employer, to release me from all obligations and waivers arising from any > and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, > clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and > acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with > your employer, its partners, licensors, agents and assigns, in perpetuity, > without prejudice to my ongoing rights and privileges. You further represent > that you have the authority to release me from any BOGUS AGREEMENTS on behalf > of your employer. > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > 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 loocas at duber.cz Wed Feb 3 01:01:37 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Wed, 03 Feb 2010 01:01:37 +0100 Subject: [IronPython] A good dotNET gui designer, plus IronPython VS2008 integration? In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39202698@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B689282.1050305@duber.cz> <4B68AC52.9000805@voidspace.org.uk> <4B68B822.5040906@duber.cz> <1A472770E042064698CB5ADC83A12ACD39202698@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4B68BCE1.9030907@duber.cz> Ah, nope, it was something else after all. The SharpCode didn't like anything after the Class declaration, for some reason. Whenever I put something in there, the designer stops working. As soon as I delete it, it works agin. Might be a bug? Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe Dino Viehland wrote: > Would adding an import System at the top make both the designer and the code happy? > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Luk?? Dubeda >> Sent: Tuesday, February 02, 2010 3:41 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] A good dotNET gui designer, plus IronPython VS2008 >> integration? >> >> Thanks a lot for the recommendation, >> >> I've installed the SharpCode and it seems quite useful. It presents >> a little inconvenience, but I'm not sure if it's my lack of knowledge >> or something else, but when I design the UI, the SharpCode puts >> the whole path to each of the control: >> >> clr.addReference("System.Drawing") >> >> insideAClass: >> someControl = System.Drawing.etcEtc >> >> which IronPython then throws an error on, saying that the "System" >> hasn't been declared and thus doesn't exist. >> >> I had to remove the whole path from the controls' name in order to >> make it run in IronPython. But then the visual designer stopped >> working :D as it requires the full path to the controls, for some >> reason. >> >> Anyways, thanks a lot for the tip! >> >> Luk?? Dub?da >> Director >> [T] +420 602 444 164 >> >> duber studio(tm) >> [M] info at duber.cz >> [W] http://www.duber.cz >> >> [A] R.A.Dvorsk?ho 601, Praha 10 >> [A] 10900, Czech Republic, Europe >> >> Michael Foord wrote: >>> On 02/02/2010 21:08, Brian Curtin wrote: >>>> On Tue, Feb 2, 2010 at 15:00, Luk?? Dub?da >>> > wrote: >>>> >>>> Hi there everybody, >>>> >>>> I'd really appretiate if anyone could share their experience >>>> with any good dotNET GUI designer. I'd love to have such >>>> functionality I can get out of QtDesigner, where I visually >>>> design my forms and buttons and what not and then just save >>>> that GUI into a file or generate a usable Python code >>>> out of it for my scripts. >>>> >>>> And another question, is there any good integration of IronPython >>>> into Visual Studio 2008? Or newer? I'm not a VS user, but since >>>> we can get the VS Express for free, this'd be a valuable tool >>>> for my IronPython programming. >>>> >>>> Thanks a lot in advnace, cheers, >>>> >>>> I don't have a lot of experience with it, but Sharp Develop >>>> (http://www.icsharpcode.net/OpenSource/SD/) supports IronPython, and >>>> may be worth a look. Others have reported success. >>>> >>>> If you do look into Visual Studio, you can write GUI code in C# using >>>> the Visual Studio designer, then subclass it from Python code. >>>> >>> This is the approach I usually recommend. The only thing you miss out on >>> is hooking up your events from the designer - but if you're doing TDD >>> then you'll want to write your tests first anyway... :-) >>> >>> Michael >>> >>>> You can even, with a little modification, design GUIs in C# in Visual >>>> Studio and copy/paste the C# code into a Python file and run with it. >>>> You'll need to convert things like true/false to True/False, null to >>>> None, etc...but with a little effort it works :) >>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >>> READ CAREFULLY. By accepting and reading this email you agree, on behalf of >> your employer, to release me from all obligations and waivers arising from any >> and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, >> clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and >> acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with >> your employer, its partners, licensors, agents and assigns, in perpetuity, >> without prejudice to my ongoing rights and privileges. You further represent >> that you have the authority to release me from any BOGUS AGREEMENTS on behalf >> of your employer. >>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From david.mcwright at usbfmi.com Wed Feb 3 05:14:12 2010 From: david.mcwright at usbfmi.com (David McWright) Date: Tue, 2 Feb 2010 20:14:12 -0800 (PST) Subject: [IronPython] A good dotNET gui designer, plus IronPython VS2008 integration? In-Reply-To: <4B68BCE1.9030907@duber.cz> References: <4B689282.1050305@duber.cz> <4B68AC52.9000805@voidspace.org.uk> <4B68B822.5040906@duber.cz> <1A472770E042064698CB5ADC83A12ACD39202698@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B68BCE1.9030907@duber.cz> Message-ID: Normally, I haven't had much trouble with #Develop not displaying the form so long as I limit my edits to InitializeComponent to either event hookups or properties of the visual elements. Everything else, I keep in separate methods or another class altogether and that seems to keep the designer happy. That being said, if you put something in there that shouldn't break the designer, then report it as a bug. The folks at #develop are pretty responsive. Additionally, if you take the code out of #Develop's IDE and try to run it in IP, then you'll need to import the clr and add references to the appropriate libraries. #Develop puts these imports in the "Program.py" file for your project, so unless you run your form outside of the IDE by importing "Program.py", the imports are lost. David On Feb 2, 7:01?pm, Luk?? Dub?da wrote: > Ah, nope, it was something else after all. > > The SharpCode didn't like anything after the Class > declaration, for some reason. Whenever I put something > in there, the designer stops working. As soon as I delete > it, it works agin. > > Might be a bug? > > Luk?? Dub?da > Director > [T] +420 602 444 164 > > duber studio(tm) > [M] i... at duber.cz > [W]http://www.duber.cz > > [A] R.A.Dvorsk?ho 601, Praha 10 > [A] 10900, Czech Republic, Europe > > > > Dino Viehland wrote: > > Would adding an import System at the top make both the designer and the code happy? > > >> -----Original Message----- > >> From: users-boun... at lists.ironpython.com [mailto:users- > >> boun... at lists.ironpython.com] On Behalf Of Luk?? Dubeda > >> Sent: Tuesday, February 02, 2010 3:41 PM > >> To: Discussion of IronPython > >> Subject: Re: [IronPython] A good dotNET gui designer, plus IronPython VS2008 > >> integration? > > >> Thanks a lot for the recommendation, > > >> I've installed the SharpCode and it seems quite useful. It presents > >> a little inconvenience, but I'm not sure if it's my lack of knowledge > >> or something else, but when I design the UI, the SharpCode puts > >> the whole path to each of the control: > > >> clr.addReference("System.Drawing") > > >> insideAClass: > >> someControl = System.Drawing.etcEtc > > >> which IronPython then throws an error on, saying that the "System" > >> hasn't been declared and thus doesn't exist. > > >> I had to remove the whole path from the controls' name in order to > >> make it run in IronPython. But then the visual designer stopped > >> working :D as it requires the full path to the controls, for some > >> reason. > > >> Anyways, thanks a lot for the tip! > > >> Luk?? Dub?da > >> Director > >> [T] +420 602 444 164 > > >> duber studio(tm) > >> [M] i... at duber.cz > >> [W]http://www.duber.cz > > >> [A] R.A.Dvorsk?ho 601, Praha 10 > >> [A] 10900, Czech Republic, Europe > > >> Michael Foord wrote: > >>> On 02/02/2010 21:08, Brian Curtin wrote: > >>>> On Tue, Feb 2, 2010 at 15:00, Luk?? Dub?da >>>> > wrote: > > >>>> ? ? Hi there everybody, > > >>>> ? ? I'd really appretiate if anyone could share their experience > >>>> ? ? with any good dotNET GUI designer. I'd love to have such > >>>> ? ? functionality I can get out of QtDesigner, where I visually > >>>> ? ? design my forms and buttons and what not and then just save > >>>> ? ? that GUI into a file or generate a usable Python code > >>>> ? ? out of it for my scripts. > > >>>> ? ? And another question, is there any good integration of IronPython > >>>> ? ? into Visual Studio 2008? Or newer? I'm not a VS user, but since > >>>> ? ? we can get the VS Express for free, this'd be a valuable tool > >>>> ? ? for my IronPython programming. > > >>>> ? ? Thanks a lot in advnace, cheers, > > >>>> I don't have a lot of experience with it, but Sharp Develop > >>>> (http://www.icsharpcode.net/OpenSource/SD/) supports IronPython, and > >>>> may be worth a look. Others have reported success. > > >>>> If you do look into Visual Studio, you can write GUI code in C# using > >>>> the Visual Studio designer, then subclass it from Python code. > > >>> This is the approach I usually recommend. The only thing you miss out on > >>> is hooking up your events from the designer - but if you're doing TDD > >>> then you'll want to write your tests first anyway... :-) > > >>> Michael > > >>>> You can even, with a little modification, design GUIs in C# in Visual > >>>> Studio and copy/paste the C# code into a Python file and run with it. > >>>> You'll need to convert things like true/false to True/False, null to > >>>> None, etc...but with a little effort it works :) > > >>>> _______________________________________________ > >>>> Users mailing list > >>>> Us... at lists.ironpython.com > >>>>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > >>> -- > >>>http://www.ironpythoninaction.com/ > >>>http://www.voidspace.org.uk/blog > > >>> READ CAREFULLY. By accepting and reading this email you agree, on behalf of > >> your employer, to release me from all obligations and waivers arising from any > >> and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, > >> clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and > >> acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with > >> your employer, its partners, licensors, agents and assigns, in perpetuity, > >> without prejudice to my ongoing rights and privileges. You further represent > >> that you have the authority to release me from any BOGUS AGREEMENTS on behalf > >> of your employer. > > >>> ------------------------------------------------------------------------ > > >>> _______________________________________________ > >>> Users mailing list > >>> Us... at lists.ironpython.com > >>>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >> _______________________________________________ > >> Users mailing list > >> Us... at lists.ironpython.com > >>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.com > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com From merllab at microsoft.com Wed Feb 3 17:55:48 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 3 Feb 2010 08:55:48 -0800 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <96ce35b7-95f9-4364-a8f7-b7a86e5415c3@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/63773. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Modules/Builtin.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/_collections.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/ByteArray.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/CommonDictionaryStorage.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/array.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/ObjectOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/StringOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/InstanceOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/List.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/_weakref.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Parser.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/NewTypeMaker.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonFunction.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonDictionary.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonTuple.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/OldInstance.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/UserTypeOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Set.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Runtime/BaseSymbolDictionary.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/GlobalSuppressions.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/IValueEquality.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/TypeInfo.cs $/IronPython/IronPython_Main/Src/Tests/test_bytes.py $/IronPython/IronPython_Main/Src/Tests/test_class.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1551907 Date: 2/3/2010 12:47:59 AM Adds a copy of .NET 4?s IStructuralEquatable and IStructuralComparable interfaces to the CLR2 version, and implements these interfaces on many of our Python types. Changes resolution of __hash__, __eq__, __ne__, __gt__, __lt__, __ge__, __le__ to look for these interfaces first, as well as IComparable later (after OperatorResolver) if the type is non-primitive. In CLR4, we eliminate the IValueEquality interface entirely, replacing it with IStructuralEquatable where appropriate. It is kept in CLR2 only to avoid breaking changes. Also fixes some broken equality and comparison behavior in dict, list, and tuple when __len__ is overridden. (Shelveset: cp23338;REDMOND\ddicato | SNAP CheckinId: 10269) From merllab at microsoft.com Wed Feb 3 21:11:26 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 3 Feb 2010 12:11:26 -0800 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/63779. MODIFIED SOURCES $/IronPython/IronPython_2_6/Src/IronPython/Lib/iptest/test_env.py $/IronPython/IronPython_2_6/Src/IronPython/Runtime/ClrModule.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Dynamic/Ast/ExpressionCollectionBuilder.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Dynamic/Generation/CompilerHelpers.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/FunctionCode.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Dynamic/Hosting/Shell/CommandLine.cs $/IronPython/IronPython_2_6/Src/Tests/test_clrload.py From merllab at microsoft.com Thu Feb 4 17:53:33 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Thu, 4 Feb 2010 08:53:33 -0800 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <4ef2eb85-371f-4d3b-82a7-2c09097c9bb4@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/63796. ADDED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonDocumentationProvider.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/DocumentationOperations.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/MemberDoc.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/MemberKind.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/OverloadDoc.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ParameterDoc.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ParameterFlags.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Runtime/DocumentationProvider.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Runtime/ModuleContext.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Importer.cs $/IronPython/IronPython_Main/Src/IronPython/IronPython.csproj $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonDocumentationProvider.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/DocumentationOperations.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/MemberDoc.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/MemberKind.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/OverloadDoc.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ExceptionOperations.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/CompiledCode.cs $/IronPython/IronPython_Main/Src/IronPythonTest/EngineTest.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ParameterDoc.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ParameterFlags.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ScriptEngine.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/Providers/HostingHelpers.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Microsoft.Scripting.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Runtime/DocumentationProvider.cs CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1555382 Date: 2/3/2010 4:09:16 PM Adds improved documentation for REPL windows. Adds a new service ? DocumentationOperations and a corresponding language side class (DocumentationProvider). Adds various serializable classes for providing the documentation: MemberDoc, MemberKind, OverloadDoc, ParameterDoc, and ParameterFlags. Implements a DocumentationProvider for IronPython that recognizes our objects and associated test cases. Also adds a new ExecuteAndWrap overload which catches the exception and provides an ObjectHandle to it. (Shelveset: ReplDocumentation;REDMOND\dinov | SNAP CheckinId: 10273) From giles.thomas at resolversystems.com Fri Feb 5 18:02:14 2010 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Fri, 05 Feb 2010 17:02:14 +0000 Subject: [IronPython] Resolver One 1.8 released! Message-ID: <4B6C4F16.4060509@resolversystems.com> Hi all, We've just released version 1.8 of Resolver One, our first version based on IronPython 2.6. It's much faster and "snappier", at least in part due to the new platform: many thanks to the IronPython team for that! In case you've not heard of it before, Resolver One is a Windows-based spreadsheet that integrates IronPython deeply into its recalculation loop, making the models you build more reliable and more maintainable. It's also still (we think) the largest IronPython application in the world, with 45,000 lines of code backed up by 180,000 lines of unit and functional tests. In version 1.8, we've worked hard on improving performance above and beyond the gains we got from IronPython 2.6, and we've also added a number of new statistical functions, along with various minor bugfixes and smaller enhancements. You can read more about Resolver One here: We have a 31-day free trial version, so if you would like to take a look, you can download it from our website: If you want to use Resolver One in an Open Source project, we offer free licenses for that: Best regards, Giles -- Giles Thomas giles.thomas at resolversystems.com +44 (0) 20 7253 6372 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK From dinov at microsoft.com Fri Feb 5 19:16:52 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 5 Feb 2010 18:16:52 +0000 Subject: [IronPython] Resolver One 1.8 released! In-Reply-To: <4B6C4F16.4060509@resolversystems.com> References: <4B6C4F16.4060509@resolversystems.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD39241243@TK5EX14MBXC116.redmond.corp.microsoft.com> Congratulations on the release and I'm happy to hear we helped improve perf! > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Giles Thomas > Sent: Friday, February 05, 2010 9:02 AM > To: IronPython list > Subject: [IronPython] Resolver One 1.8 released! > > Hi all, > > We've just released version 1.8 of Resolver One, our first version based > on IronPython 2.6. It's much faster and "snappier", at least in part > due to the new platform: many thanks to the IronPython team for that! > > In case you've not heard of it before, Resolver One is a Windows-based > spreadsheet that integrates IronPython deeply into its recalculation > loop, making the models you build more reliable and more maintainable. > It's also still (we think) the largest IronPython application in the > world, with 45,000 lines of code backed up by 180,000 lines of unit and > functional tests. > > In version 1.8, we've worked hard on improving performance above and > beyond the gains we got from IronPython 2.6, and we've also added a > number of new statistical functions, along with various minor bugfixes > and smaller enhancements. > > You can read more about Resolver One here: > > > > We have a 31-day free trial version, so if you would like to take a > look, you can download it from our website: > > > > If you want to use Resolver One in an Open Source project, we offer free > licenses for that: > > > > Best regards, > > Giles > > -- > Giles Thomas > giles.thomas at resolversystems.com > +44 (0) 20 7253 6372 > > 17a Clerkenwell Road, London EC1M 5RD, UK > VAT No.: GB 893 5643 79 > Registered in England and Wales as company number 5467329. > Registered address: 843 Finchley Road, London NW11 8NA, UK > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From cenovsky at bakalari.cz Sat Feb 6 12:19:51 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Sat, 06 Feb 2010 12:19:51 +0100 Subject: [IronPython] clrtype: How to subclass ClrClass? Message-ID: <4B6D5057.50302@bakalari.cz> Hi all, it looks like I cannot subclass a class based on ClrClass metaclass: IronPython 2.6 (2.6.10920.0) on .NET 2.0.50727.4927 Type "help", "copyright", "credits" or "license" for more information. >>> import clr >>> import clrtype >>> >>> class Product(object): ... __metaclass__ = clrtype.ClrClass ... >>> p = Product() >>> print "CLR type name: %s" % p.GetType().FullName CLR type name: Product >>> >>> class MyProduct(Product): ... pass ... Traceback (most recent call last): File "", line 1, in KeyError: The given key was not present in the dictionary. Is it a bug or am I doing something wrong? Thanks. -- -- Luk?? From fuzzyman at voidspace.org.uk Sat Feb 6 13:10:00 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 06 Feb 2010 12:10:00 +0000 Subject: [IronPython] clrtype: How to subclass ClrClass? In-Reply-To: <4B6D5057.50302@bakalari.cz> References: <4B6D5057.50302@bakalari.cz> Message-ID: <4B6D5C18.600@voidspace.org.uk> On 06/02/2010 11:19, Lukas Cenovsky wrote: > Hi all, > it looks like I cannot subclass a class based on ClrClass metaclass: > > IronPython 2.6 (2.6.10920.0) on .NET 2.0.50727.4927 > Type "help", "copyright", "credits" or "license" for more information. > >>> import clr > >>> import clrtype > >>> > >>> class Product(object): > ... __metaclass__ = clrtype.ClrClass > ... > >>> p = Product() > >>> print "CLR type name: %s" % p.GetType().FullName > CLR type name: Product > >>> > >>> class MyProduct(Product): > ... pass > ... > Traceback (most recent call last): > File "", line 1, in > KeyError: The given key was not present in the dictionary. > > Is it a bug or am I doing something wrong? Thanks. Hehe, I ran into this a couple of days ago on Silverlight as well. All the best, Michael > > -- > -- Luk?? > > > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. From Shri.Borde at microsoft.com Sat Feb 6 23:59:25 2010 From: Shri.Borde at microsoft.com (Shri Borde) Date: Sat, 6 Feb 2010 22:59:25 +0000 Subject: [IronPython] clrtype: How to subclass ClrClass? In-Reply-To: <4B6D5C18.600@voidspace.org.uk> References: <4B6D5057.50302@bakalari.cz> <4B6D5C18.600@voidspace.org.uk> Message-ID: <8E45365BECA665489F3CB8878A6C1B7D0C95ABD7@TK5EX14MBXC140.redmond.corp.microsoft.com> It is a know bug. I can take a look next week. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, February 06, 2010 4:10 AM To: Discussion of IronPython Subject: Re: [IronPython] clrtype: How to subclass ClrClass? On 06/02/2010 11:19, Lukas Cenovsky wrote: > Hi all, > it looks like I cannot subclass a class based on ClrClass metaclass: > > IronPython 2.6 (2.6.10920.0) on .NET 2.0.50727.4927 > Type "help", "copyright", "credits" or "license" for more information. > >>> import clr > >>> import clrtype > >>> > >>> class Product(object): > ... __metaclass__ = clrtype.ClrClass > ... > >>> p = Product() > >>> print "CLR type name: %s" % p.GetType().FullName > CLR type name: Product > >>> > >>> class MyProduct(Product): > ... pass > ... > Traceback (most recent call last): > File "", line 1, in > KeyError: The given key was not present in the dictionary. > > Is it a bug or am I doing something wrong? Thanks. Hehe, I ran into this a couple of days ago on Silverlight as well. All the best, Michael > > -- > -- Luk?? > > > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From cenovsky at bakalari.cz Sun Feb 7 11:02:04 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Sun, 07 Feb 2010 11:02:04 +0100 Subject: [IronPython] clrtype: How to subclass ClrClass? In-Reply-To: <8E45365BECA665489F3CB8878A6C1B7D0C95ABD7@TK5EX14MBXC140.redmond.corp.microsoft.com> References: <4B6D5057.50302@bakalari.cz> <4B6D5C18.600@voidspace.org.uk> <8E45365BECA665489F3CB8878A6C1B7D0C95ABD7@TK5EX14MBXC140.redmond.corp.microsoft.com> Message-ID: <4B6E8F9C.1090406@bakalari.cz> That would be nice. Thanks. -- -- Luk?? Shri Borde wrote: > It is a know bug. I can take a look next week. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, February 06, 2010 4:10 AM > To: Discussion of IronPython > Subject: Re: [IronPython] clrtype: How to subclass ClrClass? > > On 06/02/2010 11:19, Lukas Cenovsky wrote: > >> Hi all, >> it looks like I cannot subclass a class based on ClrClass metaclass: >> >> IronPython 2.6 (2.6.10920.0) on .NET 2.0.50727.4927 >> Type "help", "copyright", "credits" or "license" for more information. >> >>>>> import clr >>>>> import clrtype >>>>> >>>>> class Product(object): >>>>> >> ... __metaclass__ = clrtype.ClrClass >> ... >> >>>>> p = Product() >>>>> print "CLR type name: %s" % p.GetType().FullName >>>>> >> CLR type name: Product >> >>>>> class MyProduct(Product): >>>>> >> ... pass >> ... >> Traceback (most recent call last): >> File "", line 1, in >> KeyError: The given key was not present in the dictionary. >> >> Is it a bug or am I doing something wrong? Thanks. >> > > Hehe, I ran into this a couple of days ago on Silverlight as well. > > All the best, > > Michael > > >> -- >> -- Luk?? >> >> >> _______________________________________________ >> 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 Mon Feb 8 10:01:10 2010 From: k.kanryu at gmail.com (KATO Kanryu) Date: Mon, 8 Feb 2010 18:01:10 +0900 Subject: [IronPython] threading.thread sometimes forced termination! Message-ID: Hi, I'm developping multithread application with threading.thread class. But sometimes the thread terminates suddenly without any exeption. What countermeasure for this problem? -----------sample code--------------- import threading class MyThread(threading.Thread): def __init__(self): pass def run(self): print "begin thread!" try: # some codes... pass except: # not called this point :( print "catched something!" finally: print "end MyThread" mythread = MyThread() mythread.start() ----------console------------------ begin thread! ... end MyThread ----------console------------------ KATO Kanryu From k.kanryu at gmail.com Mon Feb 8 10:25:13 2010 From: k.kanryu at gmail.com (KATO Kanryu) Date: Mon, 8 Feb 2010 18:25:13 +0900 Subject: [IronPython] threading.thread sometimes forced termination! In-Reply-To: References: Message-ID: I tryed to call mythread.start() again after the terminating. -----------sample code--------------- ... self.terminated = False try: # some codes... pass except: # not called this point :( print "catched something!" finally: self.terminated = True print "end MyThread" ... # in Main Thread if mythread.terminated: print "join!" mythread.join() print "restart!" mythread.start() ----------console------------------ ... join! restart! IronPython.Runtime.Exceptions.RuntimeException: thread already started ?? DLRCachedCode.start$222(Closure , PythonFunction $function, Object self) ?? IronPython.Runtime.PythonFunction.FunctionCaller`1.Call1(CallSite site, CodeContext context, Object func, T0 arg0) ?? CallSite.Target(Closure , CallSite , CodeContext , Object ) ?? System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) ?? DLRCachedCode.update$375(Closure , PythonFunction $function, Object self) ?? IronPython.Runtime.PythonFunction.FunctionCaller`1.Call1(CallSite site, CodeContext context, Object func, T0 arg0) ?? CallSite.Target(Closure , CallSite , CodeContext , Object ) ?? DLRCachedCode.update$11(Closure , PythonFunction $function, Object self) ?? IronPython.Runtime.PythonFunction.FunctionCaller`1.Call1(CallSite site, CodeContext context, Object func, T0 arg0) ?? CallSite.Target(Closure , CallSite , CodeContext , Object ) ?? DLRCachedCode.on_update$3(Closure , PythonFunction $function, Object sender, Object e) ?? CallSite.Target(Closure , CallSite , Object , Object , CancelEventArgs ) ?? _Scripting_(Object[] , Object , CancelEventArgs ) KATO Kanryu From merllab at microsoft.com Mon Feb 8 17:55:25 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 8 Feb 2010 08:55:25 -0800 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <691a9cb4-b2c9-4013-b7e7-720aa4475d0a@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/63854. ADDED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/ParameterInfoWrapper.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/OverloadInfo.cs DELETED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Generation/ParameterInfoWrapper.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/ParameterInfoWrapper.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/BindingTarget.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/CandidateSet.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/agdlr.css $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Repl.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonOverloadResolver.cs $/IronPython/IronPython_Main/Config/Unsigned/App.config $/IronPython/IronPython_Main/Config/Signed/App.config $/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/SlotOrFunction.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/DocBuilder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/BuiltinFunction.cs $/IronPython/IronPython_Main/Src/IronPython/IronPython.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/OverloadInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/ParameterMapping.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/OverloadResolver.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/ParameterWrapper.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/DefaultArgBuilder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/DefaultOverloadResolver.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/MethodCandidate.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/ParamsDictArgBuilder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/SimpleArgBuilder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/TypeInferer.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Utils/ArrayUtils.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Utils/ReflectionUtils.cs From dinov at microsoft.com Mon Feb 8 19:16:37 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 8 Feb 2010 18:16:37 +0000 Subject: [IronPython] threading.thread sometimes forced termination! In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD392B6C90@TK5EX14MBXC116.redmond.corp.microsoft.com> Is there anything in your program that would introduce a .NET thread abort exception or a Python KeyboardInterrupt? > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of KATO Kanryu > Sent: Monday, February 08, 2010 1:01 AM > To: users at lists.ironpython.com > Subject: [IronPython] threading.thread sometimes forced termination! > > Hi, > > I'm developping multithread application with threading.thread class. > But sometimes the thread terminates suddenly without any exeption. > What countermeasure for this problem? > > -----------sample code--------------- > import threading > > class MyThread(threading.Thread): > def __init__(self): > pass > > def run(self): > print "begin thread!" > try: > # some codes... > pass > except: # not called this point :( > print "catched something!" > finally: > print "end MyThread" > > > mythread = MyThread() > mythread.start() > ----------console------------------ > begin thread! > ... > end MyThread > ----------console------------------ > > > KATO Kanryu > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From merllab at microsoft.com Mon Feb 8 21:08:06 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 8 Feb 2010 12:08:06 -0800 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/63857. ADDED SOURCES $/IronPython/IronPython_2_6/Src/IronPython/Runtime/PythonDocumentationProvider.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/DocumentationOperations.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/MemberDoc.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/MemberKind.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/OverloadDoc.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/ParameterDoc.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/ParameterFlags.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Runtime/DocumentationProvider.cs MODIFIED SOURCES $/IronPython/IronPython_2_6/Src/IronPython/Runtime/PythonDocumentationProvider.cs $/IronPython/IronPython_2_6/Src/IronPython.Modules/_weakref.cs $/IronPython/IronPython_2_6/Src/IronPython.Modules/_collections.cs $/IronPython/IronPython_2_6/Src/IronPython.Modules/array.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/Types/OldInstance.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/Types/DocBuilder.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/Operations/UserTypeOps.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/Operations/StringOps.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/CommonDictionaryStorage.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/PythonTuple.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/PythonFunction.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/ByteArray.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/List.cs $/IronPython/IronPython_2_6/Src/IronPython/Modules/Builtin.cs $/IronPython/IronPython_2_6/Src/IronPython/Compiler/Parser.cs $/IronPython/IronPython_2_6/Src/IronPython/IronPython.csproj $/IronPython/IronPython_2_6/Src/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/Operations/ObjectOps.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/Importer.cs $/IronPython/IronPython_2_6/Src/IronPythonTest/DynamicRegressions.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Dynamic/IValueEquality.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/CompiledCode.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Dynamic/Runtime/BaseSymbolDictionary.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Dynamic/GlobalSuppressions.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting.Core/Properties/ExtensionAssemblyInfo.cs $/IronPython/IronPython_2_6/Config/Unsigned/App.config $/IronPython/IronPython_2_6/Config/Signed/App.config $/IronPython/IronPython_2_6/Src/IronPython/Runtime/Types/NewTypeMaker.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/Types/TypeInfo.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/Operations/InstanceOps.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/PythonDictionary.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/Set.cs $/IronPython/IronPython_2_6/Src/IronPython/Runtime/ModuleContext.cs $/IronPython/IronPython_2_6/Src/IronPythonTest/EngineTest.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/DocumentationOperations.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/MemberDoc.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/MemberKind.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/OverloadDoc.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/ParameterDoc.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/ParameterFlags.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/ExceptionOperations.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/Providers/HostingHelpers.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Runtime/DocumentationProvider.cs $/IronPython/IronPython_2_6/Src/Tests/interop/net/dynamic/dynamic_regressions.py $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Hosting/ScriptEngine.cs $/IronPython/IronPython_2_6/Src/Runtime/Microsoft.Scripting/Microsoft.Scripting.csproj $/IronPython/IronPython_2_6/Src/Tests/test_bytes.py $/IronPython/IronPython_2_6/Src/Tests/test_class.py From fuzzyman at voidspace.org.uk Mon Feb 8 21:20:32 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 08 Feb 2010 20:20:32 +0000 Subject: [IronPython] Databinding a color in the datagrid in Silverlight Message-ID: <4B707210.7070406@voidspace.org.uk> Hello all, We've been successfully using clrtype with IronPython 2.6 and Silverlight for databinding, based on the example provided by Luk?s(: http://gui-at.blogspot.com/2009/11/inotifypropertychanged-and-databinding.html We create the binding when we create the datagrid columns programatically. Today I've been trying (and failing) to get a column in the grid show different colors based on databinding. I've got the colored bubble *showing* in the grid, but can't get databinding to the color to work. First the basics. This is the xaml for the bubble with a fixed color: I can add a column based on this template very simply: from com_modules.loadxaml import loadXaml from System.Windows.Controls import DataGridTemplateColumn column = DataGridTemplateColumn() column.CellTemplate = loadXaml('templatecolumn') column.Header = 'Bubble' grid.Columns.Add(column) If I try to naively specify a binding in the xaml then I get a PARSER_BAD_PROPERTY_VALUE when I attempt to load the xaml (so no hope of setting up the binding after load): One approach I tried was to create a ValueConverter. Here is the skeleton of the class I created: from System import Type from System.Globalization import CultureInfo from System.Windows.Data import IValueConverter class ColorConverter(IValueConverter): _clrnamespace = "Converters" __metaclass__ = clrtype.ClrClass @clrtype.accepts(object, Type, object, CultureInfo) @clrtype.returns(object) def Convert(self, value, targetType, parameter, culture): pass @clrtype.accepts(object, Type, object, CultureInfo) @clrtype.returns(object) def ConvertBack(self, value, targetType, parameter, culture): pass As there is a _clrnamespace specified I thought I might then be able to use this converter in xaml. Trying to reference the ColorConverter class in the Converters namespace in a resources dictionary again causes blow ups when loading the xaml. Setting this up programatically would be ideal. Anyone got any ideas? All the best, Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From k.kanryu at gmail.com Tue Feb 9 03:09:54 2010 From: k.kanryu at gmail.com (KATO Kanryu) Date: Tue, 9 Feb 2010 11:09:54 +0900 Subject: [IronPython] threading.thread sometimes forced termination! In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392B6C90@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD392B6C90@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: > Is there anything in your program that would introduce a .NET thread > abort exception or a Python KeyboardInterrupt? No. But the problem looks like ThreadAbortExeption or Python.KeyboardInterrupt. My program is WinForms appliction, and not throw KeyboardInterrupt exeption. and it seems that my program and libraries(includes O.S.S. libs) don't throw ThreadAbortExeption or call Thread.Abort() . By the way, I found Thread.Abort() in IronPython_2_6\Src\Runtime\Microsoft.Dynamic\Interpreter\Instruction.cs . Does this concern? From dinov at microsoft.com Tue Feb 9 03:19:30 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 9 Feb 2010 02:19:30 +0000 Subject: [IronPython] threading.thread sometimes forced termination! In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD392B6C90@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392C28B8@TK5EX14MBXC116.redmond.corp.microsoft.com> That Thread.Abort should be fine - we should only ever get to it if someone else already started aborting the thread. Can you attach a .NET debugger that logs all the exceptions? > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of KATO Kanryu > Sent: Monday, February 08, 2010 6:10 PM > To: Discussion of IronPython > Subject: Re: [IronPython] threading.thread sometimes forced > termination! > > > Is there anything in your program that would introduce a .NET thread > > abort exception or a Python KeyboardInterrupt? > > No. > But the problem looks like ThreadAbortExeption or > Python.KeyboardInterrupt. > > My program is WinForms appliction, and not throw KeyboardInterrupt > exeption. > and it seems that my program and libraries(includes O.S.S. libs) don't > throw ThreadAbortExeption or call Thread.Abort() . > > By the way, I found Thread.Abort() in > IronPython_2_6\Src\Runtime\Microsoft.Dynamic\Interpreter\Instruction.cs > . > > Does this concern? > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Tue Feb 9 04:07:11 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 9 Feb 2010 03:07:11 +0000 Subject: [IronPython] Databinding a color in the datagrid in Silverlight In-Reply-To: <4B707210.7070406@voidspace.org.uk> References: <4B707210.7070406@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD392C2DAC@TK5EX14MBXC116.redmond.corp.microsoft.com> On the IValueConverter side of things: I haven't debugged through this but I have a guess as to what could be going on. When we emit a type via reflection I don't believe it's available via Type.GetType - which is the way types usually get loaded by name. If you attach a debugger I think you'd probably see an exception when trying to load the type. The usual solution for this would be to combine pre-compiled subtypes and then save the generated type to disk and re-load it. You need the pre-compiled subtypes because you can't reference a transient assembly (which our in-memory subtypes are) from a non-transient one. But that's not going to be immediately viable in Silverlight because the pre-compiled type will be a desktop CLR type. So you could use pre-compiled types on the desktop and try to re-write the generated assembly but it seems like that's never worked for anyone in the past. I have no clue on the PARSER_BAD_PROPERTY_VALUE error. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, February 08, 2010 12:21 PM To: Discussion of IronPython Subject: [IronPython] Databinding a color in the datagrid in Silverlight Hello all, We've been successfully using clrtype with IronPython 2.6 and Silverlight for databinding, based on the example provided by Luk??: http://gui-at.blogspot.com/2009/11/inotifypropertychanged-and-databinding.html We create the binding when we create the datagrid columns programatically. Today I've been trying (and failing) to get a column in the grid show different colors based on databinding. I've got the colored bubble *showing* in the grid, but can't get databinding to the color to work. First the basics. This is the xaml for the bubble with a fixed color: I can add a column based on this template very simply: from com_modules.loadxaml import loadXaml from System.Windows.Controls import DataGridTemplateColumn column = DataGridTemplateColumn() column.CellTemplate = loadXaml('templatecolumn') column.Header = 'Bubble' grid.Columns.Add(column) If I try to naively specify a binding in the xaml then I get a PARSER_BAD_PROPERTY_VALUE when I attempt to load the xaml (so no hope of setting up the binding after load): One approach I tried was to create a ValueConverter. Here is the skeleton of the class I created: from System import Type from System.Globalization import CultureInfo from System.Windows.Data import IValueConverter class ColorConverter(IValueConverter): _clrnamespace = "Converters" __metaclass__ = clrtype.ClrClass @clrtype.accepts(object, Type, object, CultureInfo) @clrtype.returns(object) def Convert(self, value, targetType, parameter, culture): pass @clrtype.accepts(object, Type, object, CultureInfo) @clrtype.returns(object) def ConvertBack(self, value, targetType, parameter, culture): pass As there is a _clrnamespace specified I thought I might then be able to use this converter in xaml. Trying to reference the ColorConverter class in the Converters namespace in a resources dictionary again causes blow ups when loading the xaml. Setting this up programatically would be ideal. Anyone got any ideas? All the best, Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ejstembler at mac.com Tue Feb 9 04:36:06 2010 From: ejstembler at mac.com (Edward J. Stembler) Date: Mon, 08 Feb 2010 22:36:06 -0500 Subject: [IronPython] Databinding a color in the datagrid in Silverlight In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392C2DAC@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B707210.7070406@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392C2DAC@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: I guess in some ways this also addresses my post from January which was never answered. On Feb 8, 2010, at 10:07 PM, Dino Viehland wrote: > On the IValueConverter side of things: I haven?t debugged through this but I have a guess as to what could be going on. When we emit a type via reflection I don?t believe it?s available via Type.GetType ? which is the way types usually get loaded by name. If you attach a debugger I think you?d probably see an exception when trying to load the type. > > The usual solution for this would be to combine pre-compiled subtypes and then save the generated type to disk and re-load it. You need the pre-compiled subtypes because you can?t reference a transient assembly (which our in-memory subtypes are) from a non-transient one. But that?s not going to be immediately viable in Silverlight because the pre-compiled type will be a desktop CLR type. So you could use pre-compiled types on the desktop and try to re-write the generated assembly but it seems like that?s never worked for anyone in the past. > > I have no clue on the PARSER_BAD_PROPERTY_VALUE error. > > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, February 08, 2010 12:21 PM > To: Discussion of IronPython > Subject: [IronPython] Databinding a color in the datagrid in Silverlight > > Hello all, > > We've been successfully using clrtype with IronPython 2.6 and Silverlight for databinding, based on the example provided by Luk??: > > http://gui-at.blogspot.com/2009/11/inotifypropertychanged-and-databinding.html > > We create the binding when we create the datagrid columns programatically. > > Today I've been trying (and failing) to get a column in the grid show different colors based on databinding. > > I've got the colored bubble *showing* in the grid, but can't get databinding to the color to work. First the basics. > > This is the xaml for the bubble with a fixed color: > > xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'> > > > > Color="#FF00FF40" /> > > > > > > > I can add a column based on this template very simply: > > from com_modules.loadxaml import loadXaml > from System.Windows.Controls import DataGridTemplateColumn > column = DataGridTemplateColumn() > column.CellTemplate = loadXaml('templatecolumn') > column.Header = 'Bubble' > > grid.Columns.Add(column) > > If I try to naively specify a binding in the xaml then I get a PARSER_BAD_PROPERTY_VALUE when I attempt to load the xaml (so no hope of setting up the binding after load): > > > > > One approach I tried was to create a ValueConverter. Here is the skeleton of the class I created: > > from System import Type > from System.Globalization import CultureInfo > from System.Windows.Data import IValueConverter > > class ColorConverter(IValueConverter): > _clrnamespace = "Converters" > __metaclass__ = clrtype.ClrClass > > @clrtype.accepts(object, Type, object, CultureInfo) > @clrtype.returns(object) > def Convert(self, value, targetType, parameter, culture): > pass > > @clrtype.accepts(object, Type, object, CultureInfo) > @clrtype.returns(object) > def ConvertBack(self, value, targetType, parameter, culture): > pass > > As there is a _clrnamespace specified I thought I might then be able to use this converter in xaml. Trying to reference the ColorConverter class in the Converters namespace in a resources dictionary again causes blow ups when loading the xaml. > > Setting this up programatically would be ideal. Anyone got any ideas? > > All the best, > > Michael > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. > > _______________________________________________ > 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 Feb 9 12:03:54 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 09 Feb 2010 11:03:54 +0000 Subject: [IronPython] Databinding a color in the datagrid in Silverlight In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392C2DAC@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B707210.7070406@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392C2DAC@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4B71411A.6040402@voidspace.org.uk> On 09/02/2010 03:07, Dino Viehland wrote: > > On the IValueConverter side of things: I haven't debugged through this > but I have a guess as to what could be going on. When we emit a type > via reflection I don't believe it's available via Type.GetType -- > which is the way types usually get loaded by name. If you attach a > debugger I think you'd probably see an exception when trying to load > the type. > Thanks for the reply. Looks like an IValueConverter based solution is doomed to failure with IronPython and Silverlight. > The usual solution for this would be to combine pre-compiled subtypes > and then save the generated type to disk and re-load it. You need the > pre-compiled subtypes because you can't reference a transient assembly > (which our in-memory subtypes are) from a non-transient one. But > that's not going to be immediately viable in Silverlight because the > pre-compiled type will be a desktop CLR type. So you could use > pre-compiled types on the desktop and try to re-write the generated > assembly but it seems like that's never worked for anyone in the past. > > I have no clue on the PARSER_BAD_PROPERTY_VALUE error. > I asked this same question on Stack Overflow [1] and someone said that you can't bind to a Color at all until Silverlight 4. Maybe that is the reason for the parser error. My colleague is suggesting that maybe we can use the new Silverlight 3 Feature "Element to Element Binding" [2], so I will look into that. All the best, Michael [1] http://stackoverflow.com/questions/2224805/silverlight-databinding-with-ironpython-and-datagrid [2] http://weblogs.asp.net/dwahlin/archive/2009/07/13/using-element-to-element-binding-for-tooltips-in-silverlight-3.aspx > > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Michael Foord > *Sent:* Monday, February 08, 2010 12:21 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] Databinding a color in the datagrid in Silverlight > > Hello all, > > We've been successfully using clrtype with IronPython 2.6 and > Silverlight for databinding, based on the example provided by Luk??: > > http://gui-at.blogspot.com/2009/11/inotifypropertychanged-and-databinding.html > > We create the binding when we create the datagrid columns programatically. > > Today I've been trying (and failing) to get a column in the grid show > different colors based on databinding. > > I've got the colored bubble *showing* in the grid, but can't get > databinding to the color to work. First the basics. > > This is the xaml for the bubble with a fixed color: > > xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'> > > > > Color="#FF00FF40" /> > > > > > > > I can add a column based on this template very simply: > > from com_modules.loadxaml import loadXaml > from System.Windows.Controls import DataGridTemplateColumn > column = DataGridTemplateColumn() > column.CellTemplate = loadXaml('templatecolumn') > column.Header = 'Bubble' > > grid.Columns.Add(column) > > If I try to naively specify a binding in the xaml then I get a > PARSER_BAD_PROPERTY_VALUE when I attempt to load the xaml (so no hope > of setting up the binding after load): > > > > > One approach I tried was to create a ValueConverter. Here is the > skeleton of the class I created: > > from System import Type > from System.Globalization import CultureInfo > from System.Windows.Data import IValueConverter > > class ColorConverter(IValueConverter): > _clrnamespace = "Converters" > __metaclass__ = clrtype.ClrClass > > @clrtype.accepts(object, Type, object, CultureInfo) > @clrtype.returns(object) > def Convert(self, value, targetType, parameter, culture): > pass > > @clrtype.accepts(object, Type, object, CultureInfo) > @clrtype.returns(object) > def ConvertBack(self, value, targetType, parameter, culture): > pass > > As there is a _clrnamespace specified I thought I might then be able > to use this converter in xaml. Trying to reference the ColorConverter > class in the Converters namespace in a resources dictionary again > causes blow ups when loading the xaml. > > Setting this up programatically would be ideal. Anyone got any ideas? > > All the best, > > Michael > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. > > > > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ejstembler at mac.com Tue Feb 9 15:29:46 2010 From: ejstembler at mac.com (Edward J. Stembler) Date: Tue, 09 Feb 2010 09:29:46 -0500 Subject: [IronPython] Databinding a color in the datagrid in Silverlight In-Reply-To: <4B71411A.6040402@voidspace.org.uk> References: <4B707210.7070406@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392C2DAC@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B71411A.6040402@voidspace.org.uk> Message-ID: <96599742-CB70-448F-BA3C-79BF3A6F75C2@mac.com> You're correct, you cannot bind to a color. I do something similar in my C# Silverlight 3 project, where I had to create a ColorToSolidBrushConverter. On Feb 9, 2010, at 6:03 AM, Michael Foord wrote: > On 09/02/2010 03:07, Dino Viehland wrote: >> >> On the IValueConverter side of things: I haven?t debugged through >> this but I have a guess as to what could be going on. When we emi >> t a type via reflection I don?t believe it?s available via >> Type.GetType ? which is the way types usually get loaded by name. >> If you attach a debugger I think you?d probably see an exception >> when trying to load the type. >> > Thanks for the reply. Looks like an IValueConverter based solution > is doomed to failure with IronPython and Silverlight. > >> The usual solution for this would be to combine pre-compiled >> subtypes and then save the generated type to disk and re-load it. >> You need the pre-compiled subtypes because you can?t reference a t >> ransient assembly (which our in-memory subtypes are) from a non-tr >> ansient one. But that?s not going to be immediately viable in Sil >> verlight because the pre-compiled type will be a desktop CLR type. >> So you could use pre-compiled types on the desktop and try to re >> -write the generated assembly but it seems like that?s never worke >> d for anyone in the past. >> >> I have no clue on the PARSER_BAD_PROPERTY_VALUE error. > > I asked this same question on Stack Overflow [1] and someone said > that you can't bind to a Color at all until Silverlight 4. Maybe > that is the reason for the parser error. My colleague is suggesting > that maybe we can use the new Silverlight 3 Feature "Element to > Element Binding" [2], so I will look into that. > > All the best, > > > Michael > > [1] http://stackoverflow.com/questions/2224805/silverlight-databinding-with-ironpython-and-datagrid > [2] http://weblogs.asp.net/dwahlin/archive/2009/07/13/using-element-to-element-binding-for-tooltips-in-silverlight-3.aspx >> >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Monday, February 08, 2010 12:21 PM >> To: Discussion of IronPython >> Subject: [IronPython] Databinding a color in the datagrid in >> Silverlight >> >> Hello all, >> >> We've been successfully using clrtype with IronPython 2.6 and >> Silverlight for databinding, based on the example provided by Luk >> ??: >> >> http://gui-at.blogspot.com/2009/11/inotifypropertychanged-and-databinding.html >> >> We create the binding when we create the datagrid columns >> programatically. >> >> Today I've been trying (and failing) to get a column in the grid >> show different colors based on databinding. >> >> I've got the colored bubble *showing* in the grid, but can't get >> databinding to the color to work. First the basics. >> >> This is the xaml for the bubble with a fixed color: >> >> > xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'> >> >> >> >> > Color="#FF00FF40" /> >> >> >> >> >> >> >> I can add a column based on this template very simply: >> >> from com_modules.loadxaml import loadXaml >> from System.Windows.Controls import DataGridTemplateColumn >> column = DataGridTemplateColumn() >> column.CellTemplate = loadXaml('templatecolumn') >> column.Header = 'Bubble' >> >> grid.Columns.Add(column) >> >> If I try to naively specify a binding in the xaml then I get a >> PARSER_BAD_PROPERTY_VALUE when I attempt to load the xaml (so no >> hope of setting up the binding after load): >> >> > Color="{Binding color}" /> >> >> >> One approach I tried was to create a ValueConverter. Here is the >> skeleton of the class I created: >> >> from System import Type >> from System.Globalization import CultureInfo >> from System.Windows.Data import IValueConverter >> >> class ColorConverter(IValueConverter): >> _clrnamespace = "Converters" >> __metaclass__ = clrtype.ClrClass >> >> @clrtype.accepts(object, Type, object, CultureInfo) >> @clrtype.returns(object) >> def Convert(self, value, targetType, parameter, culture): >> pass >> >> @clrtype.accepts(object, Type, object, CultureInfo) >> @clrtype.returns(object) >> def ConvertBack(self, value, targetType, parameter, culture): >> pass >> >> As there is a _clrnamespace specified I thought I might then be >> able to use this converter in xaml. Trying to reference the >> ColorConverter class in the Converters namespace in a resources >> dictionary again causes blow ups when loading the xaml. >> >> Setting this up programatically would be ideal. Anyone got any ideas? >> >> All the best, >> >> Michael >> >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/blog >> >> READ CAREFULLY. By accepting and reading this email you agree, on >> behalf of your employer, to release me from all obligations and >> waivers arising from any and all NON-NEGOTIATED agreements, >> licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, >> confidentiality, non-disclosure, non-compete and acceptable use >> policies (?BOGUS AGREEMENTS?) that I have entered into with your >> employer, its partners, licensors, agents and assigns, in perpetui >> ty, without prejudice to my ongoing rights and privileges. You fur >> ther represent that you have the authority to release me from any >> BOGUS AGREEMENTS on behalf of your employer. >> >> >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/blog >> >> READ CAREFULLY. By accepting and reading this email you agree, on >> behalf of your employer, to release me from all obligations and >> waivers arising from any and all NON-NEGOTIATED agreements, >> licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, >> confidentiality, non-disclosure, non-compete and acceptable use >> policies (?BOGUS AGREEMENTS?) that I have entered into with your >> employer, its partners, licensors, agents and assigns, in perpetui >> ty, without prejudice to my ongoing rights and privileges. You fur >> ther represent that you have the authority to release me from any >> BOGUS AGREEMENTS on behalf of your employer. >> >> >> _______________________________________________ >> 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 > > READ CAREFULLY. By accepting and reading this email you agree, on > behalf of your employer, to release me from all obligations and > waivers arising from any and all NON-NEGOTIATED agreements, > licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, > confidentiality, non-disclosure, non-compete and acceptable use > policies (?BOGUS AGREEMENTS?) that I have entered into with your > employer, its partners, licensors, agents and assigns, in perpetuity > , without prejudice to my ongoing rights and privileges. You further > represent that you have the authority to release me from any BOGUS > AGREEMENTS on behalf of your employer. > > _______________________________________________ > 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 Feb 9 15:33:55 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 09 Feb 2010 14:33:55 +0000 Subject: [IronPython] Databinding a color in the datagrid in Silverlight In-Reply-To: <96599742-CB70-448F-BA3C-79BF3A6F75C2@mac.com> References: <4B707210.7070406@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392C2DAC@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B71411A.6040402@voidspace.org.uk> <96599742-CB70-448F-BA3C-79BF3A6F75C2@mac.com> Message-ID: <4B717253.40106@voidspace.org.uk> On 09/02/2010 14:29, Edward J. Stembler wrote: > You're correct, you cannot bind to a color. > > I do something similar in my C# Silverlight 3 project, where I had to > create a ColorToSolidBrushConverter. Right, and I can't do that from pure-Python with Silverlight. Binding to the .Fill on the ellipsis wouldn't be a problem. Maybe I just need to write the ValueConverter in C#. The issue is that the objects we're binding too are written in straight Python, but we do use clrtype so it might work (except that we still might have to setup the binding in xaml whereas at the moment we can do it all programmatically, but oh well). Thanks Michael > > On Feb 9, 2010, at 6:03 AM, Michael Foord > wrote: > >> On 09/02/2010 03:07, Dino Viehland wrote: >>> >>> On the IValueConverter side of things: I haven?t debugged through >>> this but I have a guess as to what could be going on. When we emit >>> a type via reflection I don?t believe it?s available via >>> Type.GetType ? which is the way types usually get loaded by name. >>> If you attach a debugger I think you?d probably see an exception >>> when trying to load the type. >>> >> Thanks for the reply. Looks like an IValueConverter based solution is >> doomed to failure with IronPython and Silverlight. >> >>> The usual solution for this would be to combine pre-compiled >>> subtypes and then save the generated type to disk and re-load it. >>> You need the pre-compiled subtypes because you can?t reference a >>> transient assembly (which our in-memory subtypes are) from a >>> non-transient one. But that?s not going to be immediately viable in >>> Silverlight because the pre-compiled type will be a desktop CLR >>> type. So you could use pre-compiled types on the desktop and try to >>> re-write the generated assembly but it seems like that?s never >>> worked for anyone in the past. >>> >>> I have no clue on the PARSER_BAD_PROPERTY_VALUE error. >>> >> >> I asked this same question on Stack Overflow [1] and someone said >> that you can't bind to a Color at all until Silverlight 4. Maybe that >> is the reason for the parser error. My colleague is suggesting that >> maybe we can use the new Silverlight 3 Feature "Element to Element >> Binding" [2], so I will look into that. >> >> All the best, >> >> >> Michael >> >> [1] >> http://stackoverflow.com/questions/2224805/silverlight-databinding-with-ironpython-and-datagrid >> [2] >> http://weblogs.asp.net/dwahlin/archive/2009/07/13/using-element-to-element-binding-for-tooltips-in-silverlight-3.aspx >>> >>> *From:* users-bounces at lists.ironpython.com >>> >>> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Michael Foord >>> *Sent:* Monday, February 08, 2010 12:21 PM >>> *To:* Discussion of IronPython >>> *Subject:* [IronPython] Databinding a color in the datagrid in >>> Silverlight >>> >>> Hello all, >>> >>> We've been successfully using clrtype with IronPython 2.6 and >>> Silverlight for databinding, based on the example provided by Luk??: >>> >>> http://gui-at.blogspot.com/2009/11/inotifypropertychanged-and-databinding.html >>> >>> We create the binding when we create the datagrid columns >>> programatically. >>> >>> Today I've been trying (and failing) to get a column in the grid >>> show different colors based on databinding. >>> >>> I've got the colored bubble *showing* in the grid, but can't get >>> databinding to the color to work. First the basics. >>> >>> This is the xaml for the bubble with a fixed color: >>> >>> >> xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'> >>> >>> >>> >>> >> Color="#FF00FF40" /> >>> >>> >>> >>> >>> >>> >>> I can add a column based on this template very simply: >>> >>> from com_modules.loadxaml import loadXaml >>> from System.Windows.Controls import DataGridTemplateColumn >>> column = DataGridTemplateColumn() >>> column.CellTemplate = loadXaml('templatecolumn') >>> column.Header = 'Bubble' >>> >>> grid.Columns.Add(column) >>> >>> If I try to naively specify a binding in the xaml then I get a >>> PARSER_BAD_PROPERTY_VALUE when I attempt to load the xaml (so no >>> hope of setting up the binding after load): >>> >>> >>> >>> >>> One approach I tried was to create a ValueConverter. Here is the >>> skeleton of the class I created: >>> >>> from System import Type >>> from System.Globalization import CultureInfo >>> from System.Windows.Data import IValueConverter >>> >>> class ColorConverter(IValueConverter): >>> _clrnamespace = "Converters" >>> __metaclass__ = clrtype.ClrClass >>> >>> @clrtype.accepts(object, Type, object, CultureInfo) >>> @clrtype.returns(object) >>> def Convert(self, value, targetType, parameter, culture): >>> pass >>> >>> @clrtype.accepts(object, Type, object, CultureInfo) >>> @clrtype.returns(object) >>> def ConvertBack(self, value, targetType, parameter, culture): >>> pass >>> >>> As there is a _clrnamespace specified I thought I might then be able >>> to use this converter in xaml. Trying to reference the >>> ColorConverter class in the Converters namespace in a resources >>> dictionary again causes blow ups when loading the xaml. >>> >>> Setting this up programatically would be ideal. Anyone got any ideas? >>> >>> All the best, >>> >>> Michael >>> >>> >>> -- >>> http://www.ironpythoninaction.com/ >>> http://www.voidspace.org.uk/blog >>> >>> READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. >>> >>> >>> >>> >>> -- >>> http://www.ironpythoninaction.com/ >>> http://www.voidspace.org.uk/blog >>> >>> READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. >>> >>> >>> >>> _______________________________________________ >>> 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 >> >> READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. >> >> >> _______________________________________________ >> 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/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Tue Feb 9 20:35:05 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 9 Feb 2010 19:35:05 +0000 Subject: [IronPython] Databinding a color in the datagrid in Silverlight In-Reply-To: <4B717253.40106@voidspace.org.uk> References: <4B707210.7070406@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392C2DAC@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B71411A.6040402@voidspace.org.uk> <96599742-CB70-448F-BA3C-79BF3A6F75C2@mac.com> <4B717253.40106@voidspace.org.uk> Message-ID: <1B42307CD4AADD438CDDA2FE1121CC920460C709@TK5EX14MBXC136.redmond.corp.microsoft.com> I believe Silverlight 4 supports DataBinding on DependencyObjects, like Brush and Animation, so binding to a SolidColorBrush will work. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Tuesday, February 09, 2010 6:34 AM To: Discussion of IronPython Cc: stephan.mitt at comsulting.de Subject: Re: [IronPython] Databinding a color in the datagrid in Silverlight On 09/02/2010 14:29, Edward J. Stembler wrote: You're correct, you cannot bind to a color. I do something similar in my C# Silverlight 3 project, where I had to create a ColorToSolidBrushConverter. Right, and I can't do that from pure-Python with Silverlight. Binding to the .Fill on the ellipsis wouldn't be a problem. Maybe I just need to write the ValueConverter in C#. The issue is that the objects we're binding too are written in straight Python, but we do use clrtype so it might work (except that we still might have to setup the binding in xaml whereas at the moment we can do it all programmatically, but oh well). Thanks Michael On Feb 9, 2010, at 6:03 AM, Michael Foord > wrote: On 09/02/2010 03:07, Dino Viehland wrote: On the IValueConverter side of things: I haven?t debugged through this but I have a guess as to what could be going on. When we emit a type via reflection I don?t believe it?s available via Type.GetType ? which is the way types usually get loaded by name. If you attach a debugger I think you?d probably see an exception when trying to load the type. Thanks for the reply. Looks like an IValueConverter based solution is doomed to failure with IronPython and Silverlight. The usual solution for this would be to combine pre-compiled subtypes and then save the generated type to disk and re-load it. You need the pre-compiled subtypes because you can?t reference a transient assembly (which our in-memory subtypes are) from a non-transient one. But that?s not going to be immediately viable in Silverlight because the pre-compiled type will be a desktop CLR type. So you could use pre-compiled types on the desktop and try to re-write the generated assembly but it seems like that?s never worked for anyone in the past. I have no clue on the PARSER_BAD_PROPERTY_VALUE error. I asked this same question on Stack Overflow [1] and someone said that you can't bind to a Color at all until Silverlight 4. Maybe that is the reason for the parser error. My colleague is suggesting that maybe we can use the new Silverlight 3 Feature "Element to Element Binding" [2], so I will look into that. All the best, Michael [1] http://stackoverflow.com/questions/2224805/silverlight-databinding-with-ironpython-and-datagrid [2] http://weblogs.asp.net/dwahlin/archive/2009/07/13/using-element-to-element-binding-for-tooltips-in-silverlight-3.aspx From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, February 08, 2010 12:21 PM To: Discussion of IronPython Subject: [IronPython] Databinding a color in the datagrid in Silverlight Hello all, We've been successfully using clrtype with IronPython 2.6 and Silverlight for databinding, based on the example provided by Luk??: http://gui-at.blogspot.com/2009/11/inotifypropertychanged-and-databinding.html We create the binding when we create the datagrid columns programatically. Today I've been trying (and failing) to get a column in the grid show different colors based on databinding. I've got the colored bubble *showing* in the grid, but can't get databinding to the color to work. First the basics. This is the xaml for the bubble with a fixed color: I can add a column based on this template very simply: from com_modules.loadxaml import loadXaml from System.Windows.Controls import DataGridTemplateColumn column = DataGridTemplateColumn() column.CellTemplate = loadXaml('templatecolumn') column.Header = 'Bubble' grid.Columns.Add(column) If I try to naively specify a binding in the xaml then I get a PARSER_BAD_PROPERTY_VALUE when I attempt to load the xaml (so no hope of setting up the binding after load): One approach I tried was to create a ValueConverter. Here is the skeleton of the class I created: from System import Type from System.Globalization import CultureInfo from System.Windows.Data import IValueConverter class ColorConverter(IValueConverter): _clrnamespace = "Converters" __metaclass__ = clrtype.ClrClass @clrtype.accepts(object, Type, object, CultureInfo) @clrtype.returns(object) def Convert(self, value, targetType, parameter, culture): pass @clrtype.accepts(object, Type, object, CultureInfo) @clrtype.returns(object) def ConvertBack(self, value, targetType, parameter, culture): pass As there is a _clrnamespace specified I thought I might then be able to use this converter in xaml. Trying to reference the ColorConverter class in the Converters namespace in a resources dictionary again causes blow ups when loading the xaml. Setting this up programatically would be ideal. Anyone got any ideas? All the best, Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. _______________________________________________ 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. _______________________________________________ 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/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From listasalberto at totalmar.com Wed Feb 10 11:59:02 2010 From: listasalberto at totalmar.com (Alberto Fernandez) Date: Wed, 10 Feb 2010 11:59:02 +0100 (CET) Subject: [IronPython] Problem with com object In-Reply-To: <325721328.184.1265788420697.JavaMail.root@correo.totalmar.com> Message-ID: <623477234.196.1265799542403.JavaMail.root@correo.totalmar.com> Hello all, Please excuse me if what I'm asking is trivial but I'm just starting with anything .net related and ironpython. I have a little experience programing c++ and python but I'm not a professional programmer. What I'm trying to do is write a macro for a program through its com connectivity. The reason is that I do not know much (and I don't like what I know) about VBA. I also would like to reuse code that I've written in pyhton. The problem that I have is that I get an error message "HRESULT E_FAIL" when I try to do anything with the generated object. However, I can see that the application launches. In fact, what I think is the equivalent code in VB seems to work. VB code: Module Program Sub Main() Dim catia As INFITF.Application catia = CreateObject("CATIA.Application") 'catia = System.Runtime.InteropServices.Marshal.getActiveObject("CATIA.Application") Console.Write(catia.Caption) Console.Write(" Press any key to continue . . . ") Console.ReadKey(True) End Sub End Module The code that I'm using in ironpython is: import System import INFITF t = System.Type.GetTypeFromProgID("CATIA.Application") CATIA = System.Activator.CreateInstance(t) print CATIA.caption print "final" I can see the application starting too but as soon as I try to probe it or do something I get the error. I'm sure missing something but I do not know what. By the way I'm using sharpDevelop as IDE. It is one of the reason I would like to go this route, it facilitates me a lot any GUI that I may want to include. I've been fighting with this for two days. I can connect and work using win32com in regular python but I'm not able to go that route with ironpython either. thank you a lot for your time. Alberto Fernandez From dfugate at microsoft.com Wed Feb 10 17:48:04 2010 From: dfugate at microsoft.com (Dave Fugate) Date: Wed, 10 Feb 2010 16:48:04 +0000 Subject: [IronPython] Problem with com object In-Reply-To: <623477234.196.1265799542403.JavaMail.root@correo.totalmar.com> References: <325721328.184.1265788420697.JavaMail.root@correo.totalmar.com> <623477234.196.1265799542403.JavaMail.root@correo.totalmar.com> Message-ID: <7CEEC335D70FFE4B957737DDE836F51B2A4ABFF5@TK5EX14MBXC125.redmond.corp.microsoft.com> Offhand, the Python snippet you've sent appears fine. When you run this against IronPython, can you pass the "-X:ExceptionDetail" flag to ipy.exe and send back the results? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Alberto Fernandez Sent: Wednesday, February 10, 2010 2:59 AM To: users at lists.ironpython.com Subject: [IronPython] Problem with com object Hello all, Please excuse me if what I'm asking is trivial but I'm just starting with anything .net related and ironpython. I have a little experience programing c++ and python but I'm not a professional programmer. What I'm trying to do is write a macro for a program through its com connectivity. The reason is that I do not know much (and I don't like what I know) about VBA. I also would like to reuse code that I've written in pyhton. The problem that I have is that I get an error message "HRESULT E_FAIL" when I try to do anything with the generated object. However, I can see that the application launches. In fact, what I think is the equivalent code in VB seems to work. VB code: Module Program Sub Main() Dim catia As INFITF.Application catia = CreateObject("CATIA.Application") 'catia = System.Runtime.InteropServices.Marshal.getActiveObject("CATIA.Application") Console.Write(catia.Caption) Console.Write(" Press any key to continue . . . ") Console.ReadKey(True) End Sub End Module The code that I'm using in ironpython is: import System import INFITF t = System.Type.GetTypeFromProgID("CATIA.Application") CATIA = System.Activator.CreateInstance(t) print CATIA.caption print "final" I can see the application starting too but as soon as I try to probe it or do something I get the error. I'm sure missing something but I do not know what. By the way I'm using sharpDevelop as IDE. It is one of the reason I would like to go this route, it facilitates me a lot any GUI that I may want to include. I've been fighting with this for two days. I can connect and work using win32com in regular python but I'm not able to go that route with ironpython either. thank you a lot for your time. Alberto Fernandez _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From merllab at microsoft.com Wed Feb 10 17:53:22 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 10 Feb 2010 08:53:22 -0800 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/63891. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/CallSignature.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Repl.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/_codecs.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Microsoft.Scripting.Silverlight.csproj $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapBuilder.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Chiron.csproj $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonGetMemberBinder.cs $/IronPython/IronPython_Main/Src/IronPython.sln $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Math/BigIntegerV4.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Utils/HashSet.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/PlatformAdaptationLayer.cs $/IronPython/IronPython_Main/Src/Tests/modules/io_related/codecs_test.py $/IronPython/IronPython_Main/Src/Tests/Tools/baselines/_codecs.log CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1570244 Date: 2/8/2010 10:38:26 PM Implements _codecs.charmap_build. This enables us to use the windows-1252 encoding which enables html5lib to run on IronPython. (Shelveset: ImplementCodecsCharmapBuildFinal;REDMOND\dinov | SNAP CheckinId: 10314) From jdhardy at gmail.com Wed Feb 10 18:21:12 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 10 Feb 2010 10:21:12 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland wrote: > Messing with identity starts to get really scary and I'd rather not go > there - I'm sure there will be lots of edge cases which will be broken. > > I could see is making unicode(foo) do something different. ?If you aliased > unicode then you'd get str's behavior though but that might be perfectly > acceptable. ?It's definitely a solution I had not considered and it'd > probably fix multiple issues. Hi Dino, It looks like this is a major impediment to running Django; the majority of the test suite failures are because IronPython calls __str__ instead of __unicode__. Any chance this could be fixed for 2.6.1? I know it's a big change, but IMHO it's pretty critical as well. - Jeff From dinov at microsoft.com Wed Feb 10 18:38:00 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 10 Feb 2010 17:38:00 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> It definitely won't be in 2.6RC1 but could be in 2.6 final (or RC2 or whatever). I'm still looking into Michael's proposed fix of recognizing calls to unicode - it's a little tricky dealing with * and **args calls to it and I got distracted by preparing for PyCon. Hopefully I can finish that up in the next couple of days and see how that works vs. just calling __unicode__ when __str__ gets called. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Jeff Hardy > Sent: Wednesday, February 10, 2010 9:21 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Django, __unicode__, and #20366 > > On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland wrote: > > Messing with identity starts to get really scary and I'd rather not go > > there - I'm sure there will be lots of edge cases which will be broken. > > > > I could see is making unicode(foo) do something different. ?If you aliased > > unicode then you'd get str's behavior though but that might be perfectly > > acceptable. ?It's definitely a solution I had not considered and it'd > > probably fix multiple issues. > > Hi Dino, > It looks like this is a major impediment to running Django; the > majority of the test suite failures are because IronPython calls > __str__ instead of __unicode__. Any chance this could be fixed for > 2.6.1? I know it's a big change, but IMHO it's pretty critical as > well. > > - Jeff > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jdhardy at gmail.com Wed Feb 10 18:51:51 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 10 Feb 2010 10:51:51 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: Sounds good, Dino. Thanks. - Jeff On Wed, Feb 10, 2010 at 10:38 AM, Dino Viehland wrote: > It definitely won't be in 2.6RC1 but could be in 2.6 final (or RC2 or whatever). > > I'm still looking into Michael's proposed fix of recognizing calls to unicode - > it's a little tricky dealing with * and **args calls to it and I got distracted > by preparing for PyCon. > > Hopefully I can finish that up in the next couple of days and see how that > works vs. just calling __unicode__ when __str__ gets called. > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Jeff Hardy >> Sent: Wednesday, February 10, 2010 9:21 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Django, __unicode__, and #20366 >> >> On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland wrote: >> > Messing with identity starts to get really scary and I'd rather not go >> > there - I'm sure there will be lots of edge cases which will be broken. >> > >> > I could see is making unicode(foo) do something different. ?If you aliased >> > unicode then you'd get str's behavior though but that might be perfectly >> > acceptable. ?It's definitely a solution I had not considered and it'd >> > probably fix multiple issues. >> >> Hi Dino, >> It looks like this is a major impediment to running Django; the >> majority of the test suite failures are because IronPython calls >> __str__ instead of __unicode__. Any chance this could be fixed for >> 2.6.1? I know it's a big change, but IMHO it's pretty critical as >> well. >> >> - Jeff >> _______________________________________________ >> 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 listasalberto at totalmar.com Wed Feb 10 19:17:38 2010 From: listasalberto at totalmar.com (Alberto Fernandez) Date: Wed, 10 Feb 2010 19:17:38 +0100 (CET) Subject: [IronPython] Problem with com object In-Reply-To: <581705228.250.1265825013937.JavaMail.root@correo.totalmar.com> Message-ID: <370599892.254.1265825858286.JavaMail.root@correo.totalmar.com> Here it goes: Devuelto error HRESULT E_FAIL de una llamada a un componente COM. en System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) en Microsoft.Scripting.ComInterop.ComRuntimeHelpers.GetITypeInfoFromIDispatch(IDispatch dispatch, Boolean throwIfMissingExpectedTypeInfo) en Microsoft.Scripting.ComInterop.IDispatchComObject.EnsureScanDefinedMethods() en Microsoft.Scripting.ComInterop.IDispatchComObject.System.Dynamic.IDynamicMetaObjectProvider.GetMetaObject(Expression parameter) en System.Dynamic.DynamicMetaObject.Create(Object value, Expression expression) en System.Dynamic.DynamicMetaObjectBinder.Bind(Object[] args, ReadOnlyCollection`1 parameters, LabelTarget returnLabel) en System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite`1 site, Object[] args) en System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) en CallSite.Target(Closure , CallSite , Object ) en System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) en CallSite.Target(Closure , CallSite , Object , CodeContext ) en System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) en Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) en Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) en Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0) en IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) en IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) en IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) en IronPython.Hosting.PythonCommandLine.RunFile(String fileName) EnvironmentError: System.Runtime.InteropServices.COMException (0x80004005): Devuelto error HRESULT E_FAIL de una llamada a un componente COM en System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) en Microsoft.Scripting.ComInterop.ComRuntimeHelpers.GetITypeInfoFromIDispatch(IDispatch dispatch, Boolean throwIfMissingExpectedTypeInfo) en Microsoft.Scripting.ComInterop.IDispatchComObject.EnsureScanDefinedMethods() en Microsoft.Scripting.ComInterop.IDispatchComObject.System.Dynamic.IDynamicMetaObjectProvider.GetMetaObject(Expression parameter) en System.Dynamic.DynamicMetaObject.Create(Object value, Expression expression) en System.Dynamic.DynamicMetaObjectBinder.Bind(Object[] args, ReadOnlyCollection`1 parameters, LabelTarget returnLabel) en System.Runtime.CompilerServices.CallSiteBinder.BindCore[T](CallSite`1 site, Object[] args) en System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) en CallSite.Target(Closure , CallSite , Object ) en System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) en CallSite.Target(Closure , CallSite , Object , CodeContext ) en System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) en Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame) en Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) en Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0) en IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) en IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) en IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) en IronPython.Hosting.PythonCommandLine.RunFile(String fileName) Hope this helps Alberto Fernandez From ddicato at microsoft.com Wed Feb 10 22:55:44 2010 From: ddicato at microsoft.com (David DiCato) Date: Wed, 10 Feb 2010 21:55:44 +0000 Subject: [IronPython] Announcing IronPython 2.6.1 RC1 Message-ID: Hello Python Community, We're pleased to announce the release of IronPython 2.6.1 RC1. This version of IronPython makes great strides in stability and compatibility, including a considerable number of targeted bugfixes. Because this is our largest servicing release to date, and due to our decision against incrementing the assembly version numbers, it is important that we get everything right. To this end, we present our first-ever RC for a minor dot release. Of course, your feedback is imperative to the quality of this release, so we'd love to hear from you! IronPython 2.6.1 comes in two flavors - one that runs on top of .NET 4.0 RC, and one that runs on any other framework starting with .NET 2.0 SP1. They can be downloaded here: - IronPython 2.6.1 RC1 for .NET 2.0 SP1: http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=40144 - IronPython 2.6.1 RC1 for .NET 4.0 RC: http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=40146 Note: The .NET Framework 4.0 RC is required for the latter release and can be downloaded at http://www.microsoft.com/downloads/details.aspx?FamilyID=a9ef9a95-58d2-4e51-a4b7-bea3cc6962cb&displaylang=en IronPython 2.6.1 RC1 includes fixes for well over 50 bugs, large and small. Ctypes has had a number of significant updates, including union support, variant_bool, and wintypes. Another focus has been on sys.settrace, making debugging more reliable. For example, sys.settrace now returns the correct frame, supports tracing through modules, and no longer interferes with "import os". Other notable fixes include thread-safe importing, and the missing error code in _winreg exception. In addition, we've made a substantial improvement in import time. Not only does this reduce startup time, but can speed up the importing of large, definition-heavy modules by up to 50%. As you might imagine, the .NET 4.0 flavor of IronPython 2.6.1 RC1 has a few of its own changes designed for better interoperability with the framework. These include fixing some errors with Func<> and better runtime isolation when similarly-named assemblies in different locations are loaded in multiple engines. In addition, both the .NET 2.0 and .NET 4.0 builds support the new .NET 4.0 IStructuralEquatable and IStructuralComparable interfaces and maps them to the appropriate operations (__eq__, __hash__, __gt__, etc.). In the case of .NET 4.0, this replaces IValueEquality as the gold standard for defining equality in an interop-friendly manner. In the .NET 2.0 build, these interfaces are copied so that their use can be phased in while retaining IValueEquality for backwards compatibility. Special thanks to Albert Szilvasy, cendalc, clovery, egonw_, essey, fabiofz, igalse, jazzcat, jlunder, laughingboy, marten_range, L?szl? de Alm?sy, lbaker, Lukas Cenovsky, pl6306, roinet, sanxiyn, Thomas Heller, vernondcole, and Wolfram for reporting issues. Happy Scripting! - The IronPython Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Wed Feb 10 23:30:39 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 10 Feb 2010 22:30:39 +0000 Subject: [IronPython] Announcing IronPython 2.6.1 RC1 In-Reply-To: References: Message-ID: <4B73338F.4010502@voidspace.org.uk> Congratulations and thanks and make sure Jimmy updates IronPython.net with the new announcement. :-) Michael On 10/02/2010 21:55, David DiCato wrote: > > Hello Python Community, > > We're pleased to announce the release of IronPython 2.6.1 RC1. This > version of IronPython makes great strides in stability and > compatibility, including a considerable number of targeted bugfixes. > Because this is our largest servicing release to date, and due to our > decision against incrementing the assembly version numbers, it is > important that we get everything right. To this end, we present our > first-ever RC for a minor dot release. Of course, your feedback is > imperative to the quality of this release, so we'd love to hear from you! > > IronPython 2.6.1 comes in two flavors -- one that runs on top of .NET > 4.0 RC, and one that runs on any other framework starting with .NET > 2.0 SP1. They can be downloaded here: > > - IronPython 2.6.1 RC1 for .NET 2.0 SP1: > http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=40144 > > - IronPython 2.6.1 RC1 for .NET 4.0 RC: > http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=40146 > > Note: The .NET Framework 4.0 RC is required for the latter release and > can be downloaded at > http://www.microsoft.com/downloads/details.aspx?FamilyID=a9ef9a95-58d2-4e51-a4b7-bea3cc6962cb&displaylang=en > > > IronPython 2.6.1 RC1 includes fixes for well over 50 bugs, large and > small. Ctypes has had a number of significant updates, including union > support, variant_bool, and wintypes. Another focus has been on > sys.settrace, making debugging more reliable. For example, > sys.settrace now returns the correct frame, supports tracing through > modules, and no longer interferes with "import os". Other notable > fixes include thread-safe importing, and the missing error code in > _winreg exception. > > In addition, we've made a substantial improvement in import time. Not > only does this reduce startup time, but can speed up the importing of > large, definition-heavy modules by up to 50%. > > As you might imagine, the .NET 4.0 flavor of IronPython 2.6.1 RC1 has > a few of its own changes designed for better interoperability with the > framework. These include fixing some errors with Func<> and better > runtime isolation when similarly-named assemblies in different > locations are loaded in multiple engines. In addition, both the .NET > 2.0 and .NET 4.0 builds support the new .NET 4.0 IStructuralEquatable > and IStructuralComparable interfaces and maps them to the appropriate > operations (__eq__, __hash__, __gt__, etc.). In the case of .NET 4.0, > this replaces IValueEquality as the gold standard for defining > equality in an interop-friendly manner. In the .NET 2.0 build, these > interfaces are copied so that their use can be phased in while > retaining IValueEquality for backwards compatibility. > > Special thanks to Albert Szilvasy, cendalc, clovery, egonw_, essey, > fabiofz, igalse, jazzcat, jlunder, laughingboy, marten_range, L?szl? > de Alm?sy, lbaker, Lukas Cenovsky, pl6306, roinet, sanxiyn, Thomas > Heller, vernondcole, and Wolfram for reporting issues. Happy Scripting! > > - The IronPython Team > > > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gzlist at googlemail.com Thu Feb 11 01:09:24 2010 From: gzlist at googlemail.com (Martin (gzlist)) Date: Thu, 11 Feb 2010 00:09:24 +0000 Subject: [IronPython] Announcing IronPython 2.6.1 RC1 In-Reply-To: References: Message-ID: On 10/02/2010, David DiCato wrote: > > In addition, we've made a substantial improvement in import time. Not only > does this reduce startup time, but can speed up the importing of large, > definition-heavy modules by up to 50%. This is an good improvement, has reduced the running time of a minimal test suite I use from 45 seconds to 30 seconds. > IronPython 2.6.1 RC1 includes fixes for well over 50 bugs, large and small. Unfortunately, testing this it seems that the support for os.O_TEMPORARY that Dino implemented is not sufficient to solve the tempfile problem: The remaining issue seems to be that os.fdopen doesn't take 'ownership' of the underlying file. So, though explicitly calling 'close' on the file it returns works, it will never get collected, so tempfiles still pile up: IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.3082 Type "help", "copyright", "credits" or "license" for more information. >>> import os, gc >>> f = file("test", "w") >>> del f >>> gc.collect() 217732 >>> os.remove("test") # this works fine, the file has been closed >>> fd = os.open("test", os.O_WRONLY | os.O_CREAT) >>> f = os.fdopen(fd, "w") >>> del f >>> gc.collect() 93588 >>> os.remove("test") # this fails, the fd is keeping the file alive Traceback (most recent call last): File "", line 1, in WindowsError: [Errno 13] The process cannot access the file because it is being used by another process >>> os.close(fd) >>> os.remove("test") Don't know how much work that'd be to resolve, but would be good to get it in 2.6.2 at least. Martin From Jimmy.Schementi at microsoft.com Thu Feb 11 02:29:09 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 11 Feb 2010 01:29:09 +0000 Subject: [IronPython] Announcing IronPython 2.6.1 RC1 In-Reply-To: <4B73338F.4010502@voidspace.org.uk> References: <4B73338F.4010502@voidspace.org.uk> Message-ID: <1B42307CD4AADD438CDDA2FE1121CC920460D54E@TK5EX14MBXC136.redmond.corp.microsoft.com> Done =) It's only added to the announcements section ... the download links will be updated when the final 2.6.1 is released. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, February 10, 2010 2:31 PM To: Discussion of IronPython Subject: Re: [IronPython] Announcing IronPython 2.6.1 RC1 Congratulations and thanks and make sure Jimmy updates IronPython.net with the new announcement. :-) Michael On 10/02/2010 21:55, David DiCato wrote: Hello Python Community, We're pleased to announce the release of IronPython 2.6.1 RC1. This version of IronPython makes great strides in stability and compatibility, including a considerable number of targeted bugfixes. Because this is our largest servicing release to date, and due to our decision against incrementing the assembly version numbers, it is important that we get everything right. To this end, we present our first-ever RC for a minor dot release. Of course, your feedback is imperative to the quality of this release, so we'd love to hear from you! IronPython 2.6.1 comes in two flavors - one that runs on top of .NET 4.0 RC, and one that runs on any other framework starting with .NET 2.0 SP1. They can be downloaded here: IronPython 2.6.1 RC1 for .NET 2.0 SP1: http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=40144 IronPython 2.6.1 RC1 for .NET 4.0 RC: http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=40146 Note: The .NET Framework 4.0 RC is required for the latter release and can be downloaded at http://www.microsoft.com/downloads/details.aspx?FamilyID=a9ef9a95-58d2-4e51-a4b7-bea3cc6962cb&displaylang=en IronPython 2.6.1 RC1 includes fixes for well over 50 bugs, large and small. Ctypes has had a number of significant updates, including union support, variant_bool, and wintypes. Another focus has been on sys.settrace, making debugging more reliable. For example, sys.settrace now returns the correct frame, supports tracing through modules, and no longer interferes with "import os". Other notable fixes include thread-safe importing, and the missing error code in _winreg exception. In addition, we've made a substantial improvement in import time. Not only does this reduce startup time, but can speed up the importing of large, definition-heavy modules by up to 50%. As you might imagine, the .NET 4.0 flavor of IronPython 2.6.1 RC1 has a few of its own changes designed for better interoperability with the framework. These include fixing some errors with Func<> and better runtime isolation when similarly-named assemblies in different locations are loaded in multiple engines. In addition, both the .NET 2.0 and .NET 4.0 builds support the new .NET 4.0 IStructuralEquatable and IStructuralComparable interfaces and maps them to the appropriate operations (__eq__, __hash__, __gt__, etc.). In the case of .NET 4.0, this replaces IValueEquality as the gold standard for defining equality in an interop-friendly manner. In the .NET 2.0 build, these interfaces are copied so that their use can be phased in while retaining IValueEquality for backwards compatibility. Special thanks to Albert Szilvasy, cendalc, clovery, egonw_, essey, fabiofz, igalse, jazzcat, jlunder, laughingboy, marten_range, L?szl? de Alm?sy, lbaker, Lukas Cenovsky, pl6306, roinet, sanxiyn, Thomas Heller, vernondcole, and Wolfram for reporting issues. Happy Scripting! - The IronPython Team _______________________________________________ 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Thu Feb 11 03:20:22 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 10 Feb 2010 19:20:22 -0700 Subject: [IronPython] Announcing IronPython 2.6.1 RC1 In-Reply-To: References: Message-ID: On Wed, Feb 10, 2010 at 2:55 PM, David DiCato wrote: > due to our decision against incrementing the assembly version numbers, Thank you, thank you, thank you. I'll try to find time to test it out this weekend. Good work, guys. - Jeff From jdhardy at gmail.com Thu Feb 11 03:21:53 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 10 Feb 2010 19:21:53 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: I understand now why it couldn't get into RC1 :) I thought 2.6.1 was further out than this - if you have to hold it for 2.6.2, it won't be that big a deal. It's a pretty big change to slip into an RC. - Jeff On Wed, Feb 10, 2010 at 10:38 AM, Dino Viehland wrote: > It definitely won't be in 2.6RC1 but could be in 2.6 final (or RC2 or whatever). > > I'm still looking into Michael's proposed fix of recognizing calls to unicode - > it's a little tricky dealing with * and **args calls to it and I got distracted > by preparing for PyCon. > > Hopefully I can finish that up in the next couple of days and see how that > works vs. just calling __unicode__ when __str__ gets called. > From stephen.p.lepisto at intel.com Thu Feb 11 16:39:26 2010 From: stephen.p.lepisto at intel.com (Lepisto, Stephen P) Date: Thu, 11 Feb 2010 07:39:26 -0800 Subject: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value Message-ID: <6AF28EB9F93A354894F2F3916DF6F96E0C9990485B@orsmsx510.amr.corp.intel.com> Thank you for your efforts with IronPython 2.6.1. I am looking forward to the final product. I was testing 2.6.1 RC1 to see if an issue I was having with v2.6.0 was fixed and I ran into an interesting problem with pyReadLine (v1.13), which I had installed under CPython v2.6.4. A python-based program I am testing requires the readline module but I am getting an odd error when readline is loaded. The error is "SystemError: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I created a simple test case that shows the problem in action. This test case runs fine under CPython v2.6.4 but fails under IronPython v2.6.1 RC1. Please ignore the fact that it is really weird-looking code and not something that would normally be used. The test case demonstrates the problem in as few lines as possible while exercising the same steps that readline uses (see the install_readline() function in readline's Console.py). import ctypes msvcrt = ctypes.cdll.LoadLibrary("msvcrt") systemfn = ctypes.c_int.from_address(ctypes.addressof(msvcrt.system)) systemfn.value = ctypes.c_int.from_address(ctypes.addressof(msvcrt.system)).value The last line triggers the error: "SystemError: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Apparently readline overwrites a function pointer ("PyOS_ReadlineFunctionPointer") inside the DLL that implements the sys module so that the line input functionality passes through the python readline module. Since readline uses the sys.dllhandle to get access to the DLL and in IronPython v2.6.1 RC1 the sys.dllhandle is 0, I'm thinking the pyReadline package won't work on IronPython even if the above error is fixed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vernondcole at gmail.com Thu Feb 11 16:44:48 2010 From: vernondcole at gmail.com (Vernon Cole) Date: Thu, 11 Feb 2010 08:44:48 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: Just a little reminder in all this noise... The correct thing to do with unicode(u'a unicode string') is MAKE NO CHANGE. The correct thing to do with str('an ASCII string') is MAKE NO CHANGE. The Zen of Python says: Explicit is better than implicit. Special cases aren't special enough to break the rules. In the face of ambiguity, refuse the temptation to guess. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. IMHO, if a programmer expects str() or unicode() to make a change in the encoding of a string-like object, (s)he should be encouraged/forced to use .encode() or .decode() to get his(er) intended result. -- Vernon Cole -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Thu Feb 11 16:48:32 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 11 Feb 2010 15:48:32 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4B7426D0.1090308@voidspace.org.uk> On 11/02/2010 15:44, Vernon Cole wrote: > Just a little reminder in all this noise... > > The correct thing to do with unicode(u'a unicode string') is MAKE NO > CHANGE. > The correct thing to do with str('an ASCII string') is MAKE NO CHANGE. I assume by ASCII string you actually mean bytestring? (hint: ascii is not the opposite of unicode in this case...) And how do you propose to tell the difference between a bytestring and a unicode string in IronPython? Michael > > The Zen of Python says: > Explicit is better than implicit. > Special cases aren't special enough to break the rules. > In the face of ambiguity, refuse the temptation to guess. > If the implementation is hard to explain, it's a bad idea. > If the implementation is easy to explain, it may be a good idea. > > IMHO, if a programmer expects str() or unicode() to make a change in > the encoding of a string-like object, (s)he should be > encouraged/forced to use .encode() or .decode() to get his(er) > intended result. > -- > Vernon Cole > > > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Thu Feb 11 16:49:49 2010 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 11 Feb 2010 07:49:49 -0800 Subject: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value In-Reply-To: <6AF28EB9F93A354894F2F3916DF6F96E0C9990485B@orsmsx510.amr.corp.intel.com> References: <6AF28EB9F93A354894F2F3916DF6F96E0C9990485B@orsmsx510.amr.corp.intel.com> Message-ID: Wow, that's awful. I imagine that you would need to use VirtualProtect to make that page writeable in order for this to work. I can't see how modifying IronPython's ctypes to make this possible would be a good idea -- the vast majority of uses for ctypes don't involve writing into arbitrary DLL code pages, and it's an extremely useful protection against stray writes. On Thu, Feb 11, 2010 at 7:39 AM, Lepisto, Stephen P < stephen.p.lepisto at intel.com> wrote: > Thank you for your efforts with IronPython 2.6.1. I am looking forward > to the final product. > > > > I was testing 2.6.1 RC1 to see if an issue I was having with v2.6.0 was > fixed and I ran into an interesting problem with pyReadLine (v1.13), which I > had installed under CPython v2.6.4. A python-based program I am testing > requires the readline module but I am getting an odd error when readline is > loaded. The error is ?SystemError: Attempted to read or write protected > memory. This is often an indication that other memory is corrupt.? > > > > I created a simple test case that shows the problem in action. This test > case runs fine under CPython v2.6.4 but fails under IronPython v2.6.1 RC1. > Please ignore the fact that it is really weird-looking code and not > something that would normally be used. The test case demonstrates the > problem in as few lines as possible while exercising the same steps that > readline uses (see the install_readline() function in readline?s > Console.py). > > > > import ctypes > > msvcrt = ctypes.cdll.LoadLibrary("msvcrt") > > systemfn = ctypes.c_int.from_address(ctypes.addressof(msvcrt.system)) > > systemfn.value = > ctypes.c_int.from_address(ctypes.addressof(msvcrt.system)).value > > > > The last line triggers the error: ?SystemError: Attempted to read or write > protected memory. This is often an indication that other memory is corrupt.? > > > > Apparently readline overwrites a function pointer > (?PyOS_ReadlineFunctionPointer?) inside the DLL that implements the sys > module so that the line input functionality passes through the python > readline module. Since readline uses the sys.dllhandle to get access to the > DLL and in IronPython v2.6.1 RC1 the sys.dllhandle is 0, I?m thinking the > pyReadline package won?t work on IronPython even if the above error is > fixed. > > > > _______________________________________________ > 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 giles.thomas at resolversystems.com Thu Feb 11 17:36:39 2010 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Thu, 11 Feb 2010 16:36:39 +0000 Subject: [IronPython] Announcing IronPython 2.6.1 RC1 In-Reply-To: References: Message-ID: <4B743217.7010400@resolversystems.com> David, A big thank you to you and all of the IP team for this; the import speed enhancement is particularly welcome. We'll try it out in Resolver One and report back to the list. Regards, Giles On 10/02/2010 21:55, David DiCato wrote: > > Hello Python Community, > > We're pleased to announce the release of IronPython 2.6.1 RC1. This > version of IronPython makes great strides in stability and > compatibility, including a considerable number of targeted bugfixes. > Because this is our largest servicing release to date, and due to our > decision against incrementing the assembly version numbers, it is > important that we get everything right. To this end, we present our > first-ever RC for a minor dot release. Of course, your feedback is > imperative to the quality of this release, so we'd love to hear from you! > > IronPython 2.6.1 comes in two flavors -- one that runs on top of .NET > 4.0 RC, and one that runs on any other framework starting with .NET > 2.0 SP1. They can be downloaded here: > > - IronPython 2.6.1 RC1 for .NET 2.0 SP1: > http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=40144 > > - IronPython 2.6.1 RC1 for .NET 4.0 RC: > http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=40146 > > Note: The .NET Framework 4.0 RC is required for the latter release and > can be downloaded at > http://www.microsoft.com/downloads/details.aspx?FamilyID=a9ef9a95-58d2-4e51-a4b7-bea3cc6962cb&displaylang=en > > > IronPython 2.6.1 RC1 includes fixes for well over 50 bugs, large and > small. Ctypes has had a number of significant updates, including union > support, variant_bool, and wintypes. Another focus has been on > sys.settrace, making debugging more reliable. For example, > sys.settrace now returns the correct frame, supports tracing through > modules, and no longer interferes with "import os". Other notable > fixes include thread-safe importing, and the missing error code in > _winreg exception. > > In addition, we've made a substantial improvement in import time. Not > only does this reduce startup time, but can speed up the importing of > large, definition-heavy modules by up to 50%. > > As you might imagine, the .NET 4.0 flavor of IronPython 2.6.1 RC1 has > a few of its own changes designed for better interoperability with the > framework. These include fixing some errors with Func<> and better > runtime isolation when similarly-named assemblies in different > locations are loaded in multiple engines. In addition, both the .NET > 2.0 and .NET 4.0 builds support the new .NET 4.0 IStructuralEquatable > and IStructuralComparable interfaces and maps them to the appropriate > operations (__eq__, __hash__, __gt__, etc.). In the case of .NET 4.0, > this replaces IValueEquality as the gold standard for defining > equality in an interop-friendly manner. In the .NET 2.0 build, these > interfaces are copied so that their use can be phased in while > retaining IValueEquality for backwards compatibility. > > Special thanks to Albert Szilvasy, cendalc, clovery, egonw_, essey, > fabiofz, igalse, jazzcat, jlunder, laughingboy, marten_range, L?szl? > de Alm?sy, lbaker, Lukas Cenovsky, pl6306, roinet, sanxiyn, Thomas > Heller, vernondcole, and Wolfram for reporting issues. Happy Scripting! > > - The IronPython Team > > > _______________________________________________ > 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 Thu Feb 11 17:54:26 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Thu, 11 Feb 2010 08:54:26 -0800 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/63918. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/PythonAst.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonDocumentationProvider.cs CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1586475 Date: 2/10/2010 10:16:11 AM Fixes documentation on module objects ? currently we don?t recognize them and don?t return any useful information. Fixes a regression in the ASTs from 2.6 ? we aren?t properly re-writing CodeContext so dir() ends up not working in re-written code (it points at the wrong context). (Shelveset: FixModuleDocAndRegression;REDMOND\dinov | SNAP CheckinId: 10322) From jdhardy at gmail.com Thu Feb 11 18:35:40 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Thu, 11 Feb 2010 10:35:40 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Thu, Feb 11, 2010 at 8:44 AM, Vernon Cole wrote: > Just a little reminder in all this noise... > > The correct thing to do with unicode(u'a unicode string') is MAKE NO CHANGE. > The correct thing to do with str('an ASCII string') is MAKE NO CHANGE. Ah, but it's not string literals we're worried about here - it's objects that implement __str__ or __unicode__. class Foo(object): def __str__(self): return 'Foo str' def __unicode__(self): return 'Foo unicode' >>> f = Foo() >>> str(f) 'Foo str' >>> unicode(f) 'Foo str' This is bad for Django. Besides, u'...' and '...' are identical in IronPython anyway - every string literal is already unicode. - Jeff From dinov at microsoft.com Thu Feb 11 19:14:15 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 11 Feb 2010 18:14:15 +0000 Subject: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value In-Reply-To: References: <6AF28EB9F93A354894F2F3916DF6F96E0C9990485B@orsmsx510.amr.corp.intel.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392DF451@TK5EX14MBXC116.redmond.corp.microsoft.com> Actually this looks like a bug in IronPython. ctypes.addressof(msvcrt.system) is returning the wrong value - in CPython it's returning the address which points to the function. In IronPython it's returning the address of the function it's self. Hopefully the real code is doing something more useful than this though because this seems to only be patching the ctypes pointer to the function, not any other pointers to the function. So every call to system() will still go directly to the msvcrt impl. I would assume this code really wanted to patch the exported address over in msvcrt.dll so all callers would be intercepted. This doesn't even patch it if someone gets a 2nd copy of msvcrt via ctypes: On my machine ctypes.addressof(msvcrt.system) is 12ff940 and msvcrt.system is "<_FuncPtr object at 0x012FF918>". Then I do: msvcrt2 = ctypes.cdll.LoadLibrary("msvcrt") msvcrt2.system I get a new _FuncPtr object: >>> msvcrt2.system <_FuncPtr object at 0x012FF990> >>> hex(ctypes.addressof(msvcrt2.system)) '0x12ff9b8' And now a different address would be patched. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Thursday, February 11, 2010 7:50 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value Wow, that's awful. I imagine that you would need to use VirtualProtect to make that page writeable in order for this to work. I can't see how modifying IronPython's ctypes to make this possible would be a good idea -- the vast majority of uses for ctypes don't involve writing into arbitrary DLL code pages, and it's an extremely useful protection against stray writes. On Thu, Feb 11, 2010 at 7:39 AM, Lepisto, Stephen P > wrote: Thank you for your efforts with IronPython 2.6.1. I am looking forward to the final product. I was testing 2.6.1 RC1 to see if an issue I was having with v2.6.0 was fixed and I ran into an interesting problem with pyReadLine (v1.13), which I had installed under CPython v2.6.4. A python-based program I am testing requires the readline module but I am getting an odd error when readline is loaded. The error is "SystemError: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I created a simple test case that shows the problem in action. This test case runs fine under CPython v2.6.4 but fails under IronPython v2.6.1 RC1. Please ignore the fact that it is really weird-looking code and not something that would normally be used. The test case demonstrates the problem in as few lines as possible while exercising the same steps that readline uses (see the install_readline() function in readline's Console.py). import ctypes msvcrt = ctypes.cdll.LoadLibrary("msvcrt") systemfn = ctypes.c_int.from_address(ctypes.addressof(msvcrt.system)) systemfn.value = ctypes.c_int.from_address(ctypes.addressof(msvcrt.system)).value The last line triggers the error: "SystemError: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Apparently readline overwrites a function pointer ("PyOS_ReadlineFunctionPointer") inside the DLL that implements the sys module so that the line input functionality passes through the python readline module. Since readline uses the sys.dllhandle to get access to the DLL and in IronPython v2.6.1 RC1 the sys.dllhandle is 0, I'm thinking the pyReadline package won't work on IronPython even if the above error is fixed. _______________________________________________ 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 Feb 11 19:39:32 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 11 Feb 2010 18:39:32 +0000 Subject: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392DF451@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <6AF28EB9F93A354894F2F3916DF6F96E0C9990485B@orsmsx510.amr.corp.intel.com> <1A472770E042064698CB5ADC83A12ACD392DF451@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392DF75B@TK5EX14MBXC116.redmond.corp.microsoft.com> I've created http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26185 but I already have a fix for this. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, February 11, 2010 10:14 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value Actually this looks like a bug in IronPython. ctypes.addressof(msvcrt.system) is returning the wrong value - in CPython it's returning the address which points to the function. In IronPython it's returning the address of the function it's self. Hopefully the real code is doing something more useful than this though because this seems to only be patching the ctypes pointer to the function, not any other pointers to the function. So every call to system() will still go directly to the msvcrt impl. I would assume this code really wanted to patch the exported address over in msvcrt.dll so all callers would be intercepted. This doesn't even patch it if someone gets a 2nd copy of msvcrt via ctypes: On my machine ctypes.addressof(msvcrt.system) is 12ff940 and msvcrt.system is "<_FuncPtr object at 0x012FF918>". Then I do: msvcrt2 = ctypes.cdll.LoadLibrary("msvcrt") msvcrt2.system I get a new _FuncPtr object: >>> msvcrt2.system <_FuncPtr object at 0x012FF990> >>> hex(ctypes.addressof(msvcrt2.system)) '0x12ff9b8' And now a different address would be patched. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Thursday, February 11, 2010 7:50 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value Wow, that's awful. I imagine that you would need to use VirtualProtect to make that page writeable in order for this to work. I can't see how modifying IronPython's ctypes to make this possible would be a good idea -- the vast majority of uses for ctypes don't involve writing into arbitrary DLL code pages, and it's an extremely useful protection against stray writes. On Thu, Feb 11, 2010 at 7:39 AM, Lepisto, Stephen P > wrote: Thank you for your efforts with IronPython 2.6.1. I am looking forward to the final product. I was testing 2.6.1 RC1 to see if an issue I was having with v2.6.0 was fixed and I ran into an interesting problem with pyReadLine (v1.13), which I had installed under CPython v2.6.4. A python-based program I am testing requires the readline module but I am getting an odd error when readline is loaded. The error is "SystemError: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I created a simple test case that shows the problem in action. This test case runs fine under CPython v2.6.4 but fails under IronPython v2.6.1 RC1. Please ignore the fact that it is really weird-looking code and not something that would normally be used. The test case demonstrates the problem in as few lines as possible while exercising the same steps that readline uses (see the install_readline() function in readline's Console.py). import ctypes msvcrt = ctypes.cdll.LoadLibrary("msvcrt") systemfn = ctypes.c_int.from_address(ctypes.addressof(msvcrt.system)) systemfn.value = ctypes.c_int.from_address(ctypes.addressof(msvcrt.system)).value The last line triggers the error: "SystemError: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Apparently readline overwrites a function pointer ("PyOS_ReadlineFunctionPointer") inside the DLL that implements the sys module so that the line input functionality passes through the python readline module. Since readline uses the sys.dllhandle to get access to the DLL and in IronPython v2.6.1 RC1 the sys.dllhandle is 0, I'm thinking the pyReadline package won't work on IronPython even if the above error is fixed. _______________________________________________ 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 Thu Feb 11 19:41:31 2010 From: vernondcole at gmail.com (Vernon Cole) Date: Thu, 11 Feb 2010 11:41:31 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <4B7426D0.1090308@voidspace.org.uk> References: <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B7426D0.1090308@voidspace.org.uk> Message-ID: On Thu, Feb 11, 2010 at 8:48 AM, Michael Foord wrote: > On 11/02/2010 15:44, Vernon Cole wrote: > > Just a little reminder in all this noise... > > The correct thing to do with unicode(u'a unicode string') is MAKE NO > CHANGE. > The correct thing to do with str('an ASCII string') is MAKE NO CHANGE. > > > I assume by ASCII string you actually mean bytestring? (hint: ascii is not > the opposite of unicode in this case...) > > You are correct. By definition, the American Standard Code for Information Interchange only defines values for seven bit characters (i.e. the range from 0 <= chr <= 127). I was using the term as shorthand for "an eight-bit character string" as you understood. > And how do you propose to tell the difference between a bytestring and a > unicode string in IronPython? > Michael > > Exactly my point. If you can't tell whether or not you should be mucking with the contents of the string, "refuse the temptation to guess." That is, treat all calls of unicode('string'), str('string'), str(u'ustring'), and unicode('u'string') as copy functions only with no transformations. If a programmer needs to explicitly specify a string which is true eight bit bytes, then he should use either buffer() or bytes() to create it, and the result should be a different class as indicated. The definition of __str__() and __unicode__() object methods in those classes should contain an appropriate transformation (which I can override by subclassing if I need to.) You need the 'byte' class for Python 3 anyway. Implement it now. A small sample... import sys u = u'1234\u00f6' s = '1234' x = str(s) print type(x), repr(x) x = unicode(s) print type(x), repr(x) try: x = unicode(u) print type(x), repr(x) except: print 'Error=',sys.exc_info()[0] try: x = str(u) print type(x), repr(x) except: print 'Error=',sys.exc_info()[0] -------------------- The results... >c:\python26\python.exe x.py '1234' u'1234' u'1234\xf6' Error= >"c:\program files\Ironpython 2.6\ipy.exe" x.py '1234' '1234' Error= Error= >copy x.py x3.py >2to3 -w x3.py >c:\python31\python.exe x3.py '1234' '1234' '1234?' '1234?' ------------------------------ One would think that IronPython should produce the same output as Python 3 -- since 'str' and 'unicode' are the same thing in both dialects. In particular, the exception when 'converting' unicode to unicode is just plain wrong. -- Vernon -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.p.lepisto at intel.com Thu Feb 11 19:46:07 2010 From: stephen.p.lepisto at intel.com (Lepisto, Stephen P) Date: Thu, 11 Feb 2010 10:46:07 -0800 Subject: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392DF75B@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <6AF28EB9F93A354894F2F3916DF6F96E0C9990485B@orsmsx510.amr.corp.intel.com> <1A472770E042064698CB5ADC83A12ACD392DF451@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392DF75B@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <6AF28EB9F93A354894F2F3916DF6F96E0C99904B3E@orsmsx510.amr.corp.intel.com> Dino, The readline module is patching the PyOS_ReadLineFunctionPointer variable in the DLL that implements the sys module (in CPython's case, this is the Python26.dll). Since IronPython doesn't support intercepting line reads in this way (or at all, apparently), this isn't going to work on IronPython in any event. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, February 11, 2010 10:40 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value I've created http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26185 but I already have a fix for this. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, February 11, 2010 10:14 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value Actually this looks like a bug in IronPython. ctypes.addressof(msvcrt.system) is returning the wrong value - in CPython it's returning the address which points to the function. In IronPython it's returning the address of the function it's self. Hopefully the real code is doing something more useful than this though because this seems to only be patching the ctypes pointer to the function, not any other pointers to the function. So every call to system() will still go directly to the msvcrt impl. I would assume this code really wanted to patch the exported address over in msvcrt.dll so all callers would be intercepted. This doesn't even patch it if someone gets a 2nd copy of msvcrt via ctypes: On my machine ctypes.addressof(msvcrt.system) is 12ff940 and msvcrt.system is "<_FuncPtr object at 0x012FF918>". Then I do: msvcrt2 = ctypes.cdll.LoadLibrary("msvcrt") msvcrt2.system I get a new _FuncPtr object: >>> msvcrt2.system <_FuncPtr object at 0x012FF990> >>> hex(ctypes.addressof(msvcrt2.system)) '0x12ff9b8' And now a different address would be patched. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Thursday, February 11, 2010 7:50 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value Wow, that's awful. I imagine that you would need to use VirtualProtect to make that page writeable in order for this to work. I can't see how modifying IronPython's ctypes to make this possible would be a good idea -- the vast majority of uses for ctypes don't involve writing into arbitrary DLL code pages, and it's an extremely useful protection against stray writes. On Thu, Feb 11, 2010 at 7:39 AM, Lepisto, Stephen P > wrote: Thank you for your efforts with IronPython 2.6.1. I am looking forward to the final product. I was testing 2.6.1 RC1 to see if an issue I was having with v2.6.0 was fixed and I ran into an interesting problem with pyReadLine (v1.13), which I had installed under CPython v2.6.4. A python-based program I am testing requires the readline module but I am getting an odd error when readline is loaded. The error is "SystemError: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I created a simple test case that shows the problem in action. This test case runs fine under CPython v2.6.4 but fails under IronPython v2.6.1 RC1. Please ignore the fact that it is really weird-looking code and not something that would normally be used. The test case demonstrates the problem in as few lines as possible while exercising the same steps that readline uses (see the install_readline() function in readline's Console.py). import ctypes msvcrt = ctypes.cdll.LoadLibrary("msvcrt") systemfn = ctypes.c_int.from_address(ctypes.addressof(msvcrt.system)) systemfn.value = ctypes.c_int.from_address(ctypes.addressof(msvcrt.system)).value The last line triggers the error: "SystemError: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Apparently readline overwrites a function pointer ("PyOS_ReadlineFunctionPointer") inside the DLL that implements the sys module so that the line input functionality passes through the python readline module. Since readline uses the sys.dllhandle to get access to the DLL and in IronPython v2.6.1 RC1 the sys.dllhandle is 0, I'm thinking the pyReadline package won't work on IronPython even if the above error is fixed. _______________________________________________ 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 Feb 11 20:06:58 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 11 Feb 2010 19:06:58 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B7426D0.1090308@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD392DFB95@TK5EX14MBXC116.redmond.corp.microsoft.com> Vernon wrote: > You need the 'byte' class for Python 3 anyway. Implement it now. Done! Assuming you mean bytes it?s in 2.6 already. Now if everyone would upgrade their code to use b?? :) > A small sample... > > > import sys > u = u'1234\u00f6' > s = '1234' > x = str(s) > print type(x), repr(x) > x = unicode(s) > print type(x), repr(x) > try: >??? x = unicode(u) >??? print type(x), repr(x) > except: >??? print 'Error=',sys.exc_info()[0] > try: >??? x = str(u) >??? print type(x), repr(x) > except: >??? print 'Error=',sys.exc_info()[0] > > -------------------- > > The results... > > >c:\python26\python.exe x.py > '1234' > u'1234' > u'1234\xf6' > Error= > > >"c:\program files\Ironpython 2.6\ipy.exe" x.py > '1234' > '1234' > Error= > Error= > > >copy x.py x3.py > >2to3 -w x3.py > >c:\python31\python.exe x3.py > '1234' > '1234' > '1234?' > '1234?' > ------------------------------ > One would think that IronPython should produce the same output as Python 3 -- since 'str' and 'unicode' are the same thing in both dialects. In particular, the exception when 'converting' unicode to > unicode is just plain wrong. I'm not going to argue the exception isn't wrong. But saying IronPython should output the same thing as an entirely different script isn't right either. After running 2to3 the script looks like this for me: import sys u = '1234\u00f6' s = '1234' x = str(s) print(type(x), repr(x)) x = str(s) print(type(x), repr(x)) try: x = str(u) print(type(x), repr(x)) except: print('Error=',sys.exc_info()[0]) try: x = str(u) print(type(x), repr(x)) except: print('Error=',sys.exc_info()[0]) You can argue whether or not 2to3 did the right thing here - it has completely dropped the distinction between str and unicode. In reality if this was a script written for Python 2.5 and above your usage of str here is ambiguous. If this script was written for 2.6 and above then it's clear you want strings and not bytes because you'd have used bytes/bytearray/b'' to indicate bytes. The problem is there's still lots of code which runs on 2.5+ and won't be using bytes/bytearray/b'' but really is dealing with bytes and not strings. The fact is this is going to be broken unless we were to make str be a distinct type from Unicode - then there'd be no ambiguity and we wouldn't have to guess. But that's a massive change which propagates through the entire IronPython code base and involves tons of breaking changes. I've looked at doing this before and it's spreads everywhere and there's lots of new ugliness. We could look at doing it again but it seems like making that massive change and then switching to 3k and changing it all back isn't very productive. From dinov at microsoft.com Thu Feb 11 20:08:31 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 11 Feb 2010 19:08:31 +0000 Subject: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value In-Reply-To: <6AF28EB9F93A354894F2F3916DF6F96E0C99904B3E@orsmsx510.amr.corp.intel.com> References: <6AF28EB9F93A354894F2F3916DF6F96E0C9990485B@orsmsx510.amr.corp.intel.com> <1A472770E042064698CB5ADC83A12ACD392DF451@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392DF75B@TK5EX14MBXC116.redmond.corp.microsoft.com> <6AF28EB9F93A354894F2F3916DF6F96E0C99904B3E@orsmsx510.amr.corp.intel.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392DFBE4@TK5EX14MBXC116.redmond.corp.microsoft.com> No reason not to fix this bug though :) I'd suggest that readline should check for dllhandle being 0 and have some sort of graceful fallback. Long term we might find having a fake dllhandle might be useful - that way we could work better with ctypes code doing low level stuff. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lepisto, Stephen P Sent: Thursday, February 11, 2010 10:46 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value Dino, The readline module is patching the PyOS_ReadLineFunctionPointer variable in the DLL that implements the sys module (in CPython's case, this is the Python26.dll). Since IronPython doesn't support intercepting line reads in this way (or at all, apparently), this isn't going to work on IronPython in any event. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, February 11, 2010 10:40 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value I've created http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26185 but I already have a fix for this. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, February 11, 2010 10:14 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value Actually this looks like a bug in IronPython. ctypes.addressof(msvcrt.system) is returning the wrong value - in CPython it's returning the address which points to the function. In IronPython it's returning the address of the function it's self. Hopefully the real code is doing something more useful than this though because this seems to only be patching the ctypes pointer to the function, not any other pointers to the function. So every call to system() will still go directly to the msvcrt impl. I would assume this code really wanted to patch the exported address over in msvcrt.dll so all callers would be intercepted. This doesn't even patch it if someone gets a 2nd copy of msvcrt via ctypes: On my machine ctypes.addressof(msvcrt.system) is 12ff940 and msvcrt.system is "<_FuncPtr object at 0x012FF918>". Then I do: msvcrt2 = ctypes.cdll.LoadLibrary("msvcrt") msvcrt2.system I get a new _FuncPtr object: >>> msvcrt2.system <_FuncPtr object at 0x012FF990> >>> hex(ctypes.addressof(msvcrt2.system)) '0x12ff9b8' And now a different address would be patched. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Thursday, February 11, 2010 7:50 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value Wow, that's awful. I imagine that you would need to use VirtualProtect to make that page writeable in order for this to work. I can't see how modifying IronPython's ctypes to make this possible would be a good idea -- the vast majority of uses for ctypes don't involve writing into arbitrary DLL code pages, and it's an extremely useful protection against stray writes. On Thu, Feb 11, 2010 at 7:39 AM, Lepisto, Stephen P > wrote: Thank you for your efforts with IronPython 2.6.1. I am looking forward to the final product. I was testing 2.6.1 RC1 to see if an issue I was having with v2.6.0 was fixed and I ran into an interesting problem with pyReadLine (v1.13), which I had installed under CPython v2.6.4. A python-based program I am testing requires the readline module but I am getting an odd error when readline is loaded. The error is "SystemError: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I created a simple test case that shows the problem in action. This test case runs fine under CPython v2.6.4 but fails under IronPython v2.6.1 RC1. Please ignore the fact that it is really weird-looking code and not something that would normally be used. The test case demonstrates the problem in as few lines as possible while exercising the same steps that readline uses (see the install_readline() function in readline's Console.py). import ctypes msvcrt = ctypes.cdll.LoadLibrary("msvcrt") systemfn = ctypes.c_int.from_address(ctypes.addressof(msvcrt.system)) systemfn.value = ctypes.c_int.from_address(ctypes.addressof(msvcrt.system)).value The last line triggers the error: "SystemError: Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Apparently readline overwrites a function pointer ("PyOS_ReadlineFunctionPointer") inside the DLL that implements the sys module so that the line input functionality passes through the python readline module. Since readline uses the sys.dllhandle to get access to the DLL and in IronPython v2.6.1 RC1 the sys.dllhandle is 0, I'm thinking the pyReadline package won't work on IronPython even if the above error is fixed. _______________________________________________ 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 Feb 11 20:11:33 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 11 Feb 2010 19:11:33 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392DFB95@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B7426D0.1090308@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392DFB95@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392DFC55@TK5EX14MBXC116.redmond.corp.microsoft.com> Oh, I should also add I think Michael's proposed fix makes this code work correctly. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Thursday, February 11, 2010 11:07 AM > To: Discussion of IronPython; Michael Foord > Subject: Re: [IronPython] Django, __unicode__, and #20366 > > Vernon wrote: > > You need the 'byte' class for Python 3 anyway. Implement it now. > > Done! Assuming you mean bytes it?s in 2.6 already. Now if everyone > would upgrade their code to use b?? :) > > > A small sample... > > > > > > import sys > > u = u'1234\u00f6' > > s = '1234' > > x = str(s) > > print type(x), repr(x) > > x = unicode(s) > > print type(x), repr(x) > > try: > >??? x = unicode(u) > >??? print type(x), repr(x) > > except: > >??? print 'Error=',sys.exc_info()[0] > > try: > >??? x = str(u) > >??? print type(x), repr(x) > > except: > >??? print 'Error=',sys.exc_info()[0] > > > > -------------------- > > > > The results... > > > > >c:\python26\python.exe x.py > > '1234' > > u'1234' > > u'1234\xf6' > > Error= > > > > >"c:\program files\Ironpython 2.6\ipy.exe" x.py > > '1234' > > '1234' > > Error= > > Error= > > > > >copy x.py x3.py > > >2to3 -w x3.py > > >c:\python31\python.exe x3.py > > '1234' > > '1234' > > '1234?' > > '1234?' > > ------------------------------ > > One would think that IronPython should produce the same output as > Python 3 -- since 'str' and 'unicode' are the same thing in both > dialects. In particular, the exception when 'converting' unicode to > > unicode is just plain wrong. > > > I'm not going to argue the exception isn't wrong. But saying > IronPython should output the same thing as an entirely different script > isn't right either. After running 2to3 the script looks like this for > me: > > import sys > u = '1234\u00f6' > s = '1234' > x = str(s) > print(type(x), repr(x)) > x = str(s) > print(type(x), repr(x)) > try: > x = str(u) > print(type(x), repr(x)) > except: > print('Error=',sys.exc_info()[0]) > try: > x = str(u) > print(type(x), repr(x)) > except: > print('Error=',sys.exc_info()[0]) > > You can argue whether or not 2to3 did the right thing here - it has > completely dropped the distinction between str and unicode. In reality > if this was a script written for Python 2.5 and above your usage of str > here is ambiguous. If this script was written for 2.6 and above then > it's clear you want strings and not bytes because you'd have used > bytes/bytearray/b'' to indicate bytes. The problem is there's still > lots of code which runs on 2.5+ and won't be using bytes/bytearray/b'' > but really is dealing with bytes and not strings. > > The fact is this is going to be broken unless we were to make str be a > distinct type from Unicode - then there'd be no ambiguity and we > wouldn't have to guess. But that's a massive change which propagates > through the entire IronPython code base and involves tons of breaking > changes. I've looked at doing this before and it's spreads everywhere > and there's lots of new ugliness. We could look at doing it again but > it seems like making that massive change and then switching to 3k and > changing it all back isn't very productive. > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From vernondcole at gmail.com Thu Feb 11 21:42:08 2010 From: vernondcole at gmail.com (Vernon Cole) Date: Thu, 11 Feb 2010 13:42:08 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392DFC55@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B7426D0.1090308@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392DFB95@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392DFC55@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: Dear Dino and Jeff: I think we are all on the same wavelength. IronPython makes unicode and str the same implicitly. Python 3 makes them the same explicitly -- by getting rid of __unicode__ completely. The effort to make django (or any other application) run on IronPython and the effort to make it run on Python 3 should be compatible. The same code changes should be applicable to both platforms, since they both make the same underlying change in design -- that all strings are unicode. I discovered that my efforts to make adodbapi run on IronPython went a long way toward getting it ready to run on Python 3. That's why I included a 2to3 pass on my earlier code sample. It clearly shows that IronPython's implementation of str() overshoots the mark. A tiny flaw in an amazing project. (Did you notice that CPython 2.6 raised an Encode exception while IPy raised Decode? I almost missed that.) So, yes, any changes in the str vs. unicode handling of IronPython should be moves TOWARD Python 3, and should use the same syntax if possible. Module authors should be able to do something like: if sys.platform == 'cli' or sys.version_info[0] >= '3': def __str__(self): #blah blah blah else: def __unicode__(self): #blah blah blah def __str__(self): #different blah blah -- Vernon -- P.S.: Speaking of django, I placed an alpha-test version of adodbapi (with django compatability added) on the mercurial source tree at http://sourceforge.net/projects/adodbapi . It is heavily refactored, so I would be grateful to anyone who is willing to kick it around to see how well it holds up. All volunteers happily accepted. It should work on either IronPython or Python 3. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Feb 12 04:37:39 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 12 Feb 2010 03:37:39 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> And it turns out this works great! We now pass all of the tests in test_str and test_unicode related to calling str/unicode and getting the appropriate __str__/__unicode__ method called. We also now properly don't decode strings when you do unicode('foo') so we no longer throw for Vernon's exception case where CPython doesn't throw. So I'm inclined to go with this fix. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Wednesday, February 10, 2010 9:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Django, __unicode__, and #20366 > > It definitely won't be in 2.6RC1 but could be in 2.6 final (or RC2 or > whatever). > > I'm still looking into Michael's proposed fix of recognizing calls to > unicode - > it's a little tricky dealing with * and **args calls to it and I got > distracted > by preparing for PyCon. > > Hopefully I can finish that up in the next couple of days and see how > that > works vs. just calling __unicode__ when __str__ gets called. > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of Jeff Hardy > > Sent: Wednesday, February 10, 2010 9:21 AM > > To: Discussion of IronPython > > Subject: Re: [IronPython] Django, __unicode__, and #20366 > > > > On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland > wrote: > > > Messing with identity starts to get really scary and I'd rather not > go > > > there - I'm sure there will be lots of edge cases which will be > broken. > > > > > > I could see is making unicode(foo) do something different. ?If you > aliased > > > unicode then you'd get str's behavior though but that might be > perfectly > > > acceptable. ?It's definitely a solution I had not considered and > it'd > > > probably fix multiple issues. > > > > Hi Dino, > > It looks like this is a major impediment to running Django; the > > majority of the test suite failures are because IronPython calls > > __str__ instead of __unicode__. Any chance this could be fixed for > > 2.6.1? I know it's a big change, but IMHO it's pretty critical as > > well. > > > > - Jeff > > _______________________________________________ > > 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 jdhardy at gmail.com Fri Feb 12 05:32:40 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Thu, 11 Feb 2010 21:32:40 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Thu, Feb 11, 2010 at 8:37 PM, Dino Viehland wrote: > And it turns out this works great! ?We now pass all of the tests in > test_str and test_unicode related to calling str/unicode and getting > the appropriate __str__/__unicode__ method called. ?We also now properly > don't decode strings when you do unicode('foo') so we no longer throw > for Vernon's exception case where CPython doesn't throw. > > So I'm inclined to go with this fix. Awesome. Looking forward to trying it out. - Jeff From fuzzyman at voidspace.org.uk Fri Feb 12 11:23:37 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 12 Feb 2010 10:23:37 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4B752C29.6060700@voidspace.org.uk> On 12/02/2010 03:37, Dino Viehland wrote: > And it turns out this works great! We now pass all of the tests in > test_str and test_unicode related to calling str/unicode and getting > the appropriate __str__/__unicode__ method called. We also now properly > don't decode strings when you do unicode('foo') so we no longer throw > for Vernon's exception case where CPython doesn't throw. > > So I'm inclined to go with this fix. > That's great news. Michael > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Dino Viehland >> Sent: Wednesday, February 10, 2010 9:38 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Django, __unicode__, and #20366 >> >> It definitely won't be in 2.6RC1 but could be in 2.6 final (or RC2 or >> whatever). >> >> I'm still looking into Michael's proposed fix of recognizing calls to >> unicode - >> it's a little tricky dealing with * and **args calls to it and I got >> distracted >> by preparing for PyCon. >> >> Hopefully I can finish that up in the next couple of days and see how >> that >> works vs. just calling __unicode__ when __str__ gets called. >> >> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> bounces at lists.ironpython.com] On Behalf Of Jeff Hardy >>> Sent: Wednesday, February 10, 2010 9:21 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] Django, __unicode__, and #20366 >>> >>> On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland >>> >> wrote: >> >>>> Messing with identity starts to get really scary and I'd rather not >>>> >> go >> >>>> there - I'm sure there will be lots of edge cases which will be >>>> >> broken. >> >>>> I could see is making unicode(foo) do something different. If you >>>> >> aliased >> >>>> unicode then you'd get str's behavior though but that might be >>>> >> perfectly >> >>>> acceptable. It's definitely a solution I had not considered and >>>> >> it'd >> >>>> probably fix multiple issues. >>>> >>> Hi Dino, >>> It looks like this is a major impediment to running Django; the >>> majority of the test suite failures are because IronPython calls >>> __str__ instead of __unicode__. Any chance this could be fixed for >>> 2.6.1? I know it's a big change, but IMHO it's pretty critical as >>> well. >>> >>> - Jeff >>> _______________________________________________ >>> 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. From josh at globalherald.net Fri Feb 12 19:08:46 2010 From: josh at globalherald.net (Joshua Kramer) Date: Fri, 12 Feb 2010 13:08:46 -0500 (EST) Subject: [IronPython] Minor Weirdness with 2.6.1 RC1 Message-ID: Hello, I noticed some minor weirdness with RC1. I un-installed 2.6 and installed 2.6.1 RC1, then went to run a database backup script I have. The first line in the script is... import clr When I ran the script, it said, "Can not import module clr". Tried this a few times with the same result. Then, I ran ipy from the command line, and tried 'import clr' at the prompt. Everything was working fine after that, even across reboots. Cheers, -JK From merllab at microsoft.com Fri Feb 12 17:55:16 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Fri, 12 Feb 2010 08:55:16 -0800 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <55b376a2-a031-43d7-8e15-c96dd05347ec@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/63940. ADDED SOURCES $/IronPython/IronPython_Main/Src/Tests/encoded_files/cp20472.py MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPythonTest/EngineTest.cs $/IronPython/IronPython_Main/Src/Tests/encoded_files/cp20472.py $/IronPython/IronPython_Main/Src/Tests/regressions.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1588985 Date: 2/11/2010 4:02:25 PM - CodePlex 18222: run adodbapitest.py in SNAP - CodePlex 20472: added regression. Not fixed - CodePlex 22692: added regression. Not fixed - CodePlex 23545: added regression. Fixed - CodePlex 20174: added regression. Fixed (Shelveset: CP02;REDMOND\dfugate | SNAP CheckinId: 10335) From glenn.k.jones+ipy at gmail.com Fri Feb 12 17:59:34 2010 From: glenn.k.jones+ipy at gmail.com (Glenn Jones) Date: Fri, 12 Feb 2010 16:59:34 +0000 Subject: [IronPython] Blocker in Ipy 2.6.1 RC1 Message-ID: <2679f6511002120859k415818c8m835dead435881512@mail.gmail.com> Hey guys, Great work on 2.6.1! Resolver One startup is noticeably faster and, so far, everything is working well except that compiling is removing docstrings. Since we use ply for parsing, and ply requires docstrings on its productions, we have a module that we cannot import if it is compiled. I have raised an issue on codeplex: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26196 Thanks Glenn -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Feb 12 19:35:56 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 12 Feb 2010 18:35:56 +0000 Subject: [IronPython] Blocker in Ipy 2.6.1 RC1 In-Reply-To: <2679f6511002120859k415818c8m835dead435881512@mail.gmail.com> References: <2679f6511002120859k415818c8m835dead435881512@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392E63DA@TK5EX14MBXC116.redmond.corp.microsoft.com> Thanks for reporting this - this should pbe easy enough to fix but I probably won't get to it until after PyCon. Glad to hear startup improved some more especially because I wasn't expecting much improvement because you're pre-compiled. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Glenn Jones Sent: Friday, February 12, 2010 9:00 AM To: users at lists.ironpython.com Subject: [IronPython] Blocker in Ipy 2.6.1 RC1 Hey guys, Great work on 2.6.1! Resolver One startup is noticeably faster and, so far, everything is working well except that compiling is removing docstrings. Since we use ply for parsing, and ply requires docstrings on its productions, we have a module that we cannot import if it is compiled. I have raised an issue on codeplex: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26196 Thanks Glenn -------------- next part -------------- An HTML attachment was scrubbed... URL: From merllab at microsoft.com Fri Feb 12 21:09:02 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Fri, 12 Feb 2010 12:09:02 -0800 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/63942. MODIFIED SOURCES $/IronPython/IronPython_2_6/Src/Tests/specialcontext/Consoleless.ps1 $/IronPython/IronPython_2_6/Src/Tests/test_cliclass.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1590069 Date: 2/12/2010 8:51:05 AM (dfugate) Addressing issues uncovered during the 2.6.1 RC1 test pass: - increased the GenericTest timeout for test_cgcheck.py - give ipyw.exe processes a longer timeframe to peacefully die in from test_ipyw - test_load_ruby should not be in test_cliclass.py. That is, the absense of IronRuby should never cause this particular CLR test to fail. Until we have a better story around X-lang testing, I've simply disabled this test case when IronRuby.dll is not on disk in the expected location (Shelveset: IP261RC1_ISSUES_01;REDMOND\dfugate | SNAP CheckinId: 10324) From jdhardy at gmail.com Fri Feb 12 21:40:27 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 12 Feb 2010 13:40:27 -0700 Subject: [IronPython] Improvements to the hosting APIs Message-ID: Hi all, Dave F. mentioned on Twitter that he was looking at the hosting APIs, and the made the mistake of accepting my unsolicited advice. So, here are a couple of my wishes (both form NWSGI): * A version of PythonOps.MakeException that doesn't take a code context - It's not hard to create one, but every time I do I feel like I'm doing something wrong. * An easy way to wrap a Stream as a PythonFile. I don't know where these make the most sense, but engine.MakeException and engine.MakeFile both seem right to me. Other than that, the hosting APIs are very nice to use. I'm really reaching to come up with those issues. - Jeff From dinov at microsoft.com Fri Feb 12 21:47:55 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 12 Feb 2010 20:47:55 +0000 Subject: [IronPython] Improvements to the hosting APIs In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD392E6C57@TK5EX14MBXC116.redmond.corp.microsoft.com> Jeff wrote: > Hi all, > Dave F. mentioned on Twitter that he was looking at the hosting APIs, > and the made the mistake of accepting my unsolicited advice. So, here > are a couple of my wishes (both form NWSGI): > > * A version of PythonOps.MakeException that doesn't take a code > context - It's not hard to create one, but every time I do I feel like > I'm doing something wrong. > * An easy way to wrap a Stream as a PythonFile. I'm guessing you also want the Stream->PythonFile to not take a CodeContext? Do you think an extension method on Stream would be nice - such as stream.ToPythonFile(string filename, string mode)? > > I don't know where these make the most sense, but engine.MakeException > and engine.MakeFile both seem right to me. > > Other than that, the hosting APIs are very nice to use. I'm really > reaching to come up with those issues. > > - Jeff > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jdhardy at gmail.com Fri Feb 12 22:22:03 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 12 Feb 2010 14:22:03 -0700 Subject: [IronPython] Improvements to the hosting APIs In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392E6C57@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD392E6C57@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Fri, Feb 12, 2010 at 1:47 PM, Dino Viehland wrote: > > Jeff wrote: >> * A version of PythonOps.MakeException that doesn't take a code >> context - It's not hard to create one, but every time I do I feel like >> I'm doing something wrong. >> * An easy way to wrap a Stream as a PythonFile. > > I'm guessing you also want the Stream->PythonFile to not take a CodeContext? Yep. Ideally IMO I should never see one when hosting IronPython. > > Do you think an extension method on Stream would be nice - such as > stream.ToPythonFile(string filename, string mode)? Yeah, actually - I didn't mention it because I didn't think it would be possible (I thought you might need some context from the engine), but that might even be better. Maybe an overload (ToPythonFile()) that just makes up a filename/mode as well, for when it doesn't matter. My only concern with extension methods is that they're just not very discoverable. - Jeff From dinov at microsoft.com Fri Feb 12 22:39:25 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 12 Feb 2010 21:39:25 +0000 Subject: [IronPython] Improvements to the hosting APIs In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD392E6C57@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392E6F0F@TK5EX14MBXC116.redmond.corp.microsoft.com> Jeff wrote: > On Fri, Feb 12, 2010 at 1:47 PM, Dino Viehland wrote: > > > > Jeff wrote: > >> * A version of PythonOps.MakeException that doesn't take a code > >> context - It's not hard to create one, but every time I do I feel like > >> I'm doing something wrong. > >> * An easy way to wrap a Stream as a PythonFile. > > > > I'm guessing you also want the Stream->PythonFile to not take a CodeContext? > > Yep. Ideally IMO I should never see one when hosting IronPython. > > > > > Do you think an extension method on Stream would be nice - such as > > stream.ToPythonFile(string filename, string mode)? > > Yeah, actually - I didn't mention it because I didn't think it would > be possible (I thought you might need some context from the engine), > but that might even be better. Maybe an overload (ToPythonFile()) that > just makes up a filename/mode as well, for when it doesn't matter. My > only concern with extension methods is that they're just not very > discoverable. I'd plan to continuing to put our extension methods on the Python class So you'd also be able to do Python.ToPythonFile(stream, ...). My big problem w/ extension methods is they're verbose to explain how to use (just call .ToPythonFile! Oh, you don't have the namespace included...?) I agree you should never see a CodeContext especially given that they break the remoting story. From ddicato at microsoft.com Fri Feb 12 23:56:42 2010 From: ddicato at microsoft.com (David DiCato) Date: Fri, 12 Feb 2010 22:56:42 +0000 Subject: [IronPython] Minor Weirdness with 2.6.1 RC1 In-Reply-To: References: Message-ID: In IronPython, clr is a builtin module, so this error should theoretically be impossible. How did you run the script when it gave you the "Can not import module clr" error? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Joshua Kramer Sent: Friday, February 12, 2010 10:09 AM To: users at lists.ironpython.com Subject: [IronPython] Minor Weirdness with 2.6.1 RC1 Hello, I noticed some minor weirdness with RC1. I un-installed 2.6 and installed 2.6.1 RC1, then went to run a database backup script I have. The first line in the script is... import clr When I ran the script, it said, "Can not import module clr". Tried this a few times with the same result. Then, I ran ipy from the command line, and tried 'import clr' at the prompt. Everything was working fine after that, even across reboots. Cheers, -JK _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Sun Feb 14 23:06:24 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Sun, 14 Feb 2010 22:06:24 +0000 Subject: [IronPython] Monkey-patching CLR types Message-ID: <1B42307CD4AADD438CDDA2FE1121CC92046102AF@TK5EX14MBXC136.redmond.corp.microsoft.com> (Yes, I'm asking a question this time =P) I want to know my options for adding functionality to an existing CLR type. Specifically I want to make hooking DOM events cleaner: in Silverlight today you cannot hook DOM events with the standard += syntax that IronPython uses for CLR events: object.onclick += foo Instead you must do this: object.AttachEvent("onclick", EventHandler[HtmlEventArgs](foo)) In IronRuby I fixed that by just monkey-patching System.Windows.Browser.HtmlObject, but in IronPython I cannot monkey-patch built-in types. However, I do something similar with accessing DOM properties (instead of element.GetProperty("innerHTML") it's just element.innerHTML) with DLR's ExtensionType, which is the same way IronPython exposes special methods on CLR types as well: [assembly: ExtensionType(typeof(HtmlElement), typeof(HtmlElementExtension))] public static class HtmlElementExtension { [SpecialName] public static object GetBoundMember(HtmlElement element, string name) { return element.GetProperty(name); } } But after looking through Python's Binder and the DLR's ActionBinder for how they use ExtensionTypes, I couldn't get a definitive answer on how to capture an method call plus an operator. Any ideas? ~Jimmy From adamb at silverkeytech.com Sun Feb 14 23:30:01 2010 From: adamb at silverkeytech.com (Adam Brand) Date: Sun, 14 Feb 2010 14:30:01 -0800 Subject: [IronPython] Fwd: IronPython for ASP.Net In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC07C0CBCB@tk5ex14mbxc106.redmond.corp.microsoft.com> References: <8cd017b80905201321t3cf2c033x62353cb484a8905b@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC07C0CBCB@tk5ex14mbxc106.redmond.corp.microsoft.com> Message-ID: <8bd92c0e1002141430h67b31082l31c39434467b61fe@mail.gmail.com> "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." Any update on this front? Did legal/the team give up on on the idea? Would be awesome to see this happen for the community (and for 2.6.1 RC1 goodness). Adam ---------- Forwarded message ---------- From: Jimmy Schementi Date: Wed, May 20, 2009 at 7:17 PM Subject: Re: [IronPython] IronPython for ASP.Net To: "dody at nomadlife.org" , Discussion of IronPython < users at lists.ironpython.com> 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 _______________________________________________ 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 Mon Feb 15 01:58:01 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 15 Feb 2010 00:58:01 +0000 Subject: [IronPython] Monkey-patching CLR types In-Reply-To: <1B42307CD4AADD438CDDA2FE1121CC92046102AF@TK5EX14MBXC136.redmond.corp.microsoft.com> References: <1B42307CD4AADD438CDDA2FE1121CC92046102AF@TK5EX14MBXC136.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392F723D@TK5EX14MBXC116.redmond.corp.microsoft.com> You can define an extension property that gets/sets a value which supports in place addition / subtraction. Something like this: [assembly: ExtensionType(typeof(HtmlElement), typeof(HtmlElementExtension))] public static class HtmlElementExtension { [SpecialName, PropertyMethod] public static MyEvent Getonclick(HtmlElement element) { return new MyEvent(element); } [SpecialName, PropertyMethod] public static void Setonclick(HtmlElement element, object value) { // You could return a value from InPlaceAdd and validate it here // to report an error on a direct assignment - this is what // ReflectedEvent does in IronPython. } } public class MyEvent { private readonly HtmlElement _element; public MyEvent(HtmlElement element) { _element = element; } [SpecialName] public object InPlaceAdd(EventHandler[HtmlEventArgs] handler) { _element.AttachEvent("onclick", handler); return null; } // also needs InPlaceSubtract } -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Sunday, February 14, 2010 2:06 PM To: Discussion of IronPython Subject: [IronPython] Monkey-patching CLR types (Yes, I'm asking a question this time =P) I want to know my options for adding functionality to an existing CLR type. Specifically I want to make hooking DOM events cleaner: in Silverlight today you cannot hook DOM events with the standard += syntax that IronPython uses for CLR events: object.onclick += foo Instead you must do this: object.AttachEvent("onclick", EventHandler[HtmlEventArgs](foo)) In IronRuby I fixed that by just monkey-patching System.Windows.Browser.HtmlObject, but in IronPython I cannot monkey-patch built-in types. However, I do something similar with accessing DOM properties (instead of element.GetProperty("innerHTML") it's just element.innerHTML) with DLR's ExtensionType, which is the same way IronPython exposes special methods on CLR types as well: [assembly: ExtensionType(typeof(HtmlElement), typeof(HtmlElementExtension))] public static class HtmlElementExtension { [SpecialName] public static object GetBoundMember(HtmlElement element, string name) { return element.GetProperty(name); } } But after looking through Python's Binder and the DLR's ActionBinder for how they use ExtensionTypes, I couldn't get a definitive answer on how to capture an method call plus an operator. Any ideas? ~Jimmy _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From donsaw at comcast.net Mon Feb 15 16:41:07 2010 From: donsaw at comcast.net (Don Sawatzky) Date: Mon, 15 Feb 2010 07:41:07 -0800 Subject: [IronPython] CPickle problem Message-ID: This assert works in CPython 2.6 and not in IronPython 2.6.1 RC 1 with a failure in dumps(): from collections import namedtuple # verify that instances can be pickled from cPickle import loads, dumps Point = namedtuple('Point', 'x, y', False) p = Point(x=10, y=20) assert p == loads(dumps(p)) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon Feb 15 17:04:52 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 15 Feb 2010 16:04:52 +0000 Subject: [IronPython] CPickle problem In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD392FB6F3@TK5EX14MBXC116.redmond.corp.microsoft.com> This works if you run with the -X:Frames option. This is because namedtuple is using sys._getframe to find the calling module name and setting it on the created class. Alternately you could do this yourself: Point.__module__ = __name__ You could file a bug on this on CodePlex but to fix it we probably need to modify the standard library and provide an alternate namedtuple implementation which doesn't require sys._getframe. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Don Sawatzky Sent: Monday, February 15, 2010 7:41 AM To: users at lists.ironpython.com Subject: [IronPython] CPickle problem This assert works in CPython 2.6 and not in IronPython 2.6.1 RC 1 with a failure in dumps(): from collections import namedtuple # verify that instances can be pickled from cPickle import loads, dumps Point = namedtuple('Point', 'x, y', False) p = Point(x=10, y=20) assert p == loads(dumps(p)) -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Feb 15 17:16:35 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 15 Feb 2010 16:16:35 +0000 Subject: [IronPython] CPickle problem In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392FB6F3@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD392FB6F3@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4B797363.6050806@voidspace.org.uk> On 15/02/2010 16:04, Dino Viehland wrote: > > This works if you run with the --X:Frames option. This is because > namedtuple is using sys._getframe to find the calling module name and > setting it on the created class. Alternately you could do this yourself: > > Point.__module__ = __name__ > > You could file a bug on this on CodePlex but to fix it we probably > need to modify the standard library and provide an alternate > namedtuple implementation which doesn't require sys._getframe. > Could the namedtuple API be changed to better support IronPython - perhaps an optional __module__ argument? Michael > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Don Sawatzky > *Sent:* Monday, February 15, 2010 7:41 AM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] CPickle problem > > This assert works in CPython 2.6 and not in IronPython 2.6.1 RC 1 with > a failure > > in dumps(): > > from collections import namedtuple > # verify that instances can be pickled > from cPickle import loads, dumps > Point = namedtuple('Point', 'x, y', False) > p = Point(x=10, y=20) > assert p == loads(dumps(p)) > > > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon Feb 15 17:22:35 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 15 Feb 2010 16:22:35 +0000 Subject: [IronPython] CPickle problem In-Reply-To: <4B797363.6050806@voidspace.org.uk> References: <1A472770E042064698CB5ADC83A12ACD392FB6F3@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B797363.6050806@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD392FB827@TK5EX14MBXC116.redmond.corp.microsoft.com> Michael wrote: > Could the namedtuple API be changed to better support IronPython - perhaps an optional __module__ argument? That'd be one way to do it - but I'm not sure it helps much compared to just setting __module__ when you get it back. It would certainly be more discoverable though. From fuzzyman at voidspace.org.uk Mon Feb 15 17:31:36 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 15 Feb 2010 16:31:36 +0000 Subject: [IronPython] CPickle problem In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392FB827@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD392FB6F3@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B797363.6050806@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FB827@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4B7976E8.7010500@voidspace.org.uk> On 15/02/2010 16:22, Dino Viehland wrote: > Michael wrote: > >> Could the namedtuple API be changed to better support IronPython - perhaps an optional __module__ argument? >> > That'd be one way to do it - but I'm not sure it helps much compared to just setting __module__ when you get it back. It would certainly be more discoverable though. > I'll ping Raymond on the idea and see what he thinks. 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. From merllab at microsoft.com Mon Feb 15 17:54:14 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 15 Feb 2010 08:54:14 -0800 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/63991. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/AstMethods.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/_ctypes/CFuncPtr.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/_ctypes/_ctypes.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/CallExpression.cs $/IronPython/IronPython_Main/Src/Tests/modules/io_related/marshal_test.py $/IronPython/IronPython_Main/Src/IronPythonTest/Stress/Engine.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/StringOps.cs $/IronPython/IronPython_Main/Src/IronPythonTest/EngineTest.cs $/IronPython/IronPython_Main/Src/Tests/modules/system_related/sys_test.py $/IronPython/IronPython_Main/Src/Tests/regressions.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1591043 Date: 2/13/2010 7:30:01 AM - Bug 359739 (test_name.py) is fixed - CP23878: added a regression. Fixed - CP23914: added a regression. Fixed - CP23992: added a regression. Not fixed - CP24169: added a regression. Fixed - CP24077: added a regression. Fixed (Shelveset: CP03;REDMOND\dfugate | SNAP CheckinId: 10360) -------------------------------------------------------------------------------- Changeset Id: 1590796 Date: 2/12/2010 6:36:38 PM Modifies calls to ?unicode(?)? so that they behave like calls to unicode on CPython 2.6. When we see a call to a NameExpression where the name is ?unicode? we generate an in-line check to see if the object we?re calling is actually str. If it is then we generate a call to a set of methods defined on a UnicodeHelper class. These methods do the same thing as CPython?s unicode function: Call __unicode__ first if it?s defined, otherwise try __str__ when called with just oen param Decode strings/bytes/buffers/etc if an encoding type is provided when called with >1 param. Also includes a change to make ipyw.exe on Dev10 be a real windows app. (Shelveset: UnicodeStr;REDMOND\dinov | SNAP CheckinId: 10353) -------------------------------------------------------------------------------- Changeset Id: 1590569 Date: 2/12/2010 3:25:41 PM Fixes a bug where addressof() returns the address of a function instead the address where the address of the function is stored. (Shelveset: FixCtypesAddressBug;REDMOND\dinov | SNAP CheckinId: 10345) -------------------------------------------------------------------------------- Changeset Id: 1590268 Date: 2/12/2010 11:53:12 AM - CodePlex 20370: added regression. Fixed - CodePlex 23562: added regression. Fixed - CodePlex 18595: added regression. Fixed (Shelveset: CP03;REDMOND\dfugate | SNAP CheckinId: 10343) -------------------------------------------------------------------------------- Changeset Id: 1591043 Date: 2/13/2010 7:30:01 AM - Bug 359739 (test_name.py) is fixed - CP23878: added a regression. Fixed - CP23914: added a regression. Fixed - CP23992: added a regression. Not fixed - CP24169: added a regression. Fixed - CP24077: added a regression. Fixed (Shelveset: CP03;REDMOND\dfugate | SNAP CheckinId: 10360) From dinov at microsoft.com Mon Feb 15 18:49:14 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 15 Feb 2010 17:49:14 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <4B752C29.6060700@voidspace.org.uk> References: <4B65D91C.4030902@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391EE281@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B65E6A7.904@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F5938@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> This is now checked into the Main branch if anyone wants to download, compile, and give it a shot. I'll push it to the 2.6 branch post-PyCon. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, February 12, 2010 2:24 AM To: Discussion of IronPython Subject: Re: [IronPython] Django, __unicode__, and #20366 On 12/02/2010 03:37, Dino Viehland wrote: > And it turns out this works great! We now pass all of the tests in > test_str and test_unicode related to calling str/unicode and getting > the appropriate __str__/__unicode__ method called. We also now properly > don't decode strings when you do unicode('foo') so we no longer throw > for Vernon's exception case where CPython doesn't throw. > > So I'm inclined to go with this fix. > That's great news. Michael > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Dino Viehland >> Sent: Wednesday, February 10, 2010 9:38 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Django, __unicode__, and #20366 >> >> It definitely won't be in 2.6RC1 but could be in 2.6 final (or RC2 or >> whatever). >> >> I'm still looking into Michael's proposed fix of recognizing calls to >> unicode - >> it's a little tricky dealing with * and **args calls to it and I got >> distracted >> by preparing for PyCon. >> >> Hopefully I can finish that up in the next couple of days and see how >> that >> works vs. just calling __unicode__ when __str__ gets called. >> >> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> bounces at lists.ironpython.com] On Behalf Of Jeff Hardy >>> Sent: Wednesday, February 10, 2010 9:21 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] Django, __unicode__, and #20366 >>> >>> On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland >>> >> wrote: >> >>>> Messing with identity starts to get really scary and I'd rather not >>>> >> go >> >>>> there - I'm sure there will be lots of edge cases which will be >>>> >> broken. >> >>>> I could see is making unicode(foo) do something different. If you >>>> >> aliased >> >>>> unicode then you'd get str's behavior though but that might be >>>> >> perfectly >> >>>> acceptable. It's definitely a solution I had not considered and >>>> >> it'd >> >>>> probably fix multiple issues. >>>> >>> Hi Dino, >>> It looks like this is a major impediment to running Django; the >>> majority of the test suite failures are because IronPython calls >>> __str__ instead of __unicode__. Any chance this could be fixed for >>> 2.6.1? I know it's a big change, but IMHO it's pretty critical as >>> well. >>> >>> - Jeff >>> _______________________________________________ >>> 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From tristanz at gmail.com Mon Feb 15 20:24:27 2010 From: tristanz at gmail.com (Tristan Zajonc) Date: Mon, 15 Feb 2010 14:24:27 -0500 Subject: [IronPython] Adding new infix operators to IronPython Message-ID: <94d1cdd21002151124p524a7812k2c54787d1fc5fcbb@mail.gmail.com> Hi, I'm interested in experimenting with adding new infix operators to IronPython to support objectwise and elementwise operators. PEP 225 (http://www.python.org/dev/peps/pep-0225/) describes the potential use cases for such operators. Matlab style matrix operations are the chief example. Clearly new operators won't be added to Python any time soon, but I am interested in exploring the issue nonetheless. Before diving in, I am wondering if there are any helpful pointers more experienced IronPython developers can offer about adding new syntax to IronPython. Is there an overall strategy I should obviously be following? Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon Feb 15 20:43:28 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 15 Feb 2010 19:43:28 +0000 Subject: [IronPython] Adding new infix operators to IronPython In-Reply-To: <94d1cdd21002151124p524a7812k2c54787d1fc5fcbb@mail.gmail.com> References: <94d1cdd21002151124p524a7812k2c54787d1fc5fcbb@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392FCC19@TK5EX14MBXC116.redmond.corp.microsoft.com> Hopefully updating the tokenizer and parser should be fairly obvious. Once you've done that you'll need to actually implement the operators themselves. If the implementation of these operators is effectively exactly the same as the normal binary operators it should be pretty easy - you just need to add a new value to PythonOperationKind and PythonOperator, update Symbols.Generated.cs so it maps to the __*__ methods, and update BinaryExpression so PythonOperatorToAction maps between PythonOperator and PythonOperationKind. By "exactly the same" I mean try __*__ on the LHS if RHS is not a subclass of RHS, __r*__ on the RHS, check for not-implemented, support coercion, etc... If you wanted to define your unique behavior for the operations you could just change BinaryExpression.cs to generate whatever code you want. That could even be as simple as calling into a method in PythonOps that figures out what to do. Or you could create a new DynamicMetaObjectBinder subclass which does some custom binding which gets cached and runs fast. If you want to go that for you should take a look at some of the existing binders in IronPython.Runtime.Binding. The PythonProtocol class has the implementation of binary operators, unary operators, and indexing - I'd suggest looking at unary as they're the simplest (binary's quite complex, but hopefully you don't need to go this far). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tristan Zajonc Sent: Monday, February 15, 2010 11:24 AM To: users at lists.ironpython.com Subject: [IronPython] Adding new infix operators to IronPython Hi, I'm interested in experimenting with adding new infix operators to IronPython to support objectwise and elementwise operators. PEP 225 (http://www.python.org/dev/peps/pep-0225/) describes the potential use cases for such operators. Matlab style matrix operations are the chief example. Clearly new operators won't be added to Python any time soon, but I am interested in exploring the issue nonetheless. Before diving in, I am wondering if there are any helpful pointers more experienced IronPython developers can offer about adding new syntax to IronPython. Is there an overall strategy I should obviously be following? Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From markjoel60 at gmail.com Mon Feb 15 22:54:23 2010 From: markjoel60 at gmail.com (Mark Grice) Date: Mon, 15 Feb 2010 16:54:23 -0500 Subject: [IronPython] How can I exit from Python Script File? Message-ID: <294f1ba41002151354k42155624med8ba3d713767a3b@mail.gmail.com> I am using IronPython within a C# .NET application. I have a class that the Python code uses, so I create a scope and set the variable, then execute the engine like this: private ScriptEngine scptEngine = null; private ScriptRuntime scptRuntime = null; private ScriptScope scptScope; private ScriptSource scptSource; public pyEngine() { scptEngine = Python.CreateEngine(); scptRuntime = scptEngine.Runtime; scptScope = scptEngine.CreateScope(); AddAssemblies(scptRuntime); SOA SOA_screen = new SOA(); // my Class scptScope.SetVariable("screen", SOA_screen); scptSource = scptEngine.CreateScriptSourceFromFile(scriptFile); scptSource.Execute(scptScope); } This runs fine. But within the Python code, if I detect an error, I want to exit out of scriptFile. I check a flag and try to exit if flag is false: so, the basic python is: if MessageScreenIsActive == False : screen.Say("CAN NOT PROCEED: " + screen.lastResultMessage); sys.exit() This throws an exception. But this: if MessageScreenIsActive == False : screen.Say("CAN NOT PROCEED: " + screen.lastResultMessage); sys.exit only exits the -- not the whole script. Of course, I can bracket off all of my code with if/else and control it this way, but there must be a simple way to simple exit the script... isn't there? Thanks for reading! -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Feb 15 22:58:26 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 15 Feb 2010 21:58:26 +0000 Subject: [IronPython] How can I exit from Python Script File? In-Reply-To: <294f1ba41002151354k42155624med8ba3d713767a3b@mail.gmail.com> References: <294f1ba41002151354k42155624med8ba3d713767a3b@mail.gmail.com> Message-ID: <4B79C382.8000408@voidspace.org.uk> On 15/02/2010 21:54, Mark Grice wrote: > I am using IronPython within a C# .NET application. > > I have a class that the Python code uses, so I create a scope and set > the variable, then execute the engine like this: > > private ScriptEngine scptEngine = null; > private ScriptRuntime scptRuntime = null; > private ScriptScope scptScope; > private ScriptSource scptSource; > > public pyEngine() > { > scptEngine = Python.CreateEngine(); > scptRuntime = scptEngine.Runtime; > scptScope = scptEngine.CreateScope(); > AddAssemblies(scptRuntime); > SOA SOA_screen = new SOA(); // my Class > scptScope.SetVariable("screen", SOA_screen); > scptSource = > scptEngine.CreateScriptSourceFromFile(scriptFile); > scptSource.Execute(scptScope); > } > > This runs fine. But within the Python code, if I detect an error, I > want to exit out of scriptFile. > > I check a flag and try to exit if flag is false: so, the basic python is: > > if MessageScreenIsActive == False : > screen.Say("CAN NOT PROCEED: " + screen.lastResultMessage); > sys.exit() > > This throws an exception. That will throw a SystemExit exception. You can have exception handling in your C# that catches this specific error. > But this: > > if MessageScreenIsActive == False : > screen.Say("CAN NOT PROCEED: " + screen.lastResultMessage); > sys.exit You're not actually calling sys.exit here... All the best, Michael > > only exits the -- not the whole script. > > Of course, I can bracket off all of my code with if/else and control > it this way, but there must be a simple way to simple exit the > script... isn't there? > > Thanks for reading! > > > > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Mon Feb 15 23:26:45 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 15 Feb 2010 15:26:45 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: Works for me - lots more Django tests passing, now. Awesome work, Dino! (PS: do you even sleep?) - Jeff On Mon, Feb 15, 2010 at 10:49 AM, Dino Viehland wrote: > This is now checked into the Main branch if anyone wants to download, compile, and give it a shot. > > I'll push it to the 2.6 branch post-PyCon. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, February 12, 2010 2:24 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Django, __unicode__, and #20366 > > On 12/02/2010 03:37, Dino Viehland wrote: >> And it turns out this works great! ?We now pass all of the tests in >> test_str and test_unicode related to calling str/unicode and getting >> the appropriate __str__/__unicode__ method called. ?We also now properly >> don't decode strings when you do unicode('foo') so we no longer throw >> for Vernon's exception case where CPython doesn't throw. >> >> So I'm inclined to go with this fix. >> > > That's great news. > > Michael >> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> bounces at lists.ironpython.com] On Behalf Of Dino Viehland >>> Sent: Wednesday, February 10, 2010 9:38 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] Django, __unicode__, and #20366 >>> >>> It definitely won't be in 2.6RC1 but could be in 2.6 final (or RC2 or >>> whatever). >>> >>> I'm still looking into Michael's proposed fix of recognizing calls to >>> unicode - >>> it's a little tricky dealing with * and **args calls to it and I got >>> distracted >>> by preparing for PyCon. >>> >>> Hopefully I can finish that up in the next couple of days and see how >>> that >>> works vs. just calling __unicode__ when __str__ gets called. >>> >>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> bounces at lists.ironpython.com] On Behalf Of Jeff Hardy >>>> Sent: Wednesday, February 10, 2010 9:21 AM >>>> To: Discussion of IronPython >>>> Subject: Re: [IronPython] Django, __unicode__, and #20366 >>>> >>>> On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland >>>> >>> wrote: >>> >>>>> Messing with identity starts to get really scary and I'd rather not >>>>> >>> go >>> >>>>> there - I'm sure there will be lots of edge cases which will be >>>>> >>> broken. >>> >>>>> I could see is making unicode(foo) do something different. ?If you >>>>> >>> aliased >>> >>>>> unicode then you'd get str's behavior though but that might be >>>>> >>> perfectly >>> >>>>> acceptable. ?It's definitely a solution I had not considered and >>>>> >>> it'd >>> >>>>> probably fix multiple issues. >>>>> >>>> Hi Dino, >>>> It looks like this is a major impediment to running Django; the >>>> majority of the test suite failures are because IronPython calls >>>> __str__ instead of __unicode__. Any chance this could be fixed for >>>> 2.6.1? I know it's a big change, but IMHO it's pretty critical as >>>> well. >>>> >>>> - Jeff >>>> _______________________________________________ >>>> 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 > > READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. > > > _______________________________________________ > 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 Feb 15 23:57:44 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 15 Feb 2010 22:57:44 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392FE1A3@TK5EX14MBXC116.redmond.corp.microsoft.com> This was relatively easy, it was just work once Michael came up with the great idea. But I do manage to get plenty of sleep - I just put off other mundane but important things on my TODO list like updating our perf infrastructure. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy Sent: Monday, February 15, 2010 2:27 PM To: Discussion of IronPython Subject: Re: [IronPython] Django, __unicode__, and #20366 Works for me - lots more Django tests passing, now. Awesome work, Dino! (PS: do you even sleep?) - Jeff On Mon, Feb 15, 2010 at 10:49 AM, Dino Viehland wrote: > This is now checked into the Main branch if anyone wants to download, compile, and give it a shot. > > I'll push it to the 2.6 branch post-PyCon. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, February 12, 2010 2:24 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Django, __unicode__, and #20366 > > On 12/02/2010 03:37, Dino Viehland wrote: >> And it turns out this works great! ?We now pass all of the tests in >> test_str and test_unicode related to calling str/unicode and getting >> the appropriate __str__/__unicode__ method called. ?We also now properly >> don't decode strings when you do unicode('foo') so we no longer throw >> for Vernon's exception case where CPython doesn't throw. >> >> So I'm inclined to go with this fix. >> > > That's great news. > > Michael >> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> bounces at lists.ironpython.com] On Behalf Of Dino Viehland >>> Sent: Wednesday, February 10, 2010 9:38 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] Django, __unicode__, and #20366 >>> >>> It definitely won't be in 2.6RC1 but could be in 2.6 final (or RC2 or >>> whatever). >>> >>> I'm still looking into Michael's proposed fix of recognizing calls to >>> unicode - >>> it's a little tricky dealing with * and **args calls to it and I got >>> distracted >>> by preparing for PyCon. >>> >>> Hopefully I can finish that up in the next couple of days and see how >>> that >>> works vs. just calling __unicode__ when __str__ gets called. >>> >>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> bounces at lists.ironpython.com] On Behalf Of Jeff Hardy >>>> Sent: Wednesday, February 10, 2010 9:21 AM >>>> To: Discussion of IronPython >>>> Subject: Re: [IronPython] Django, __unicode__, and #20366 >>>> >>>> On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland >>>> >>> wrote: >>> >>>>> Messing with identity starts to get really scary and I'd rather not >>>>> >>> go >>> >>>>> there - I'm sure there will be lots of edge cases which will be >>>>> >>> broken. >>> >>>>> I could see is making unicode(foo) do something different. ?If you >>>>> >>> aliased >>> >>>>> unicode then you'd get str's behavior though but that might be >>>>> >>> perfectly >>> >>>>> acceptable. ?It's definitely a solution I had not considered and >>>>> >>> it'd >>> >>>>> probably fix multiple issues. >>>>> >>>> Hi Dino, >>>> It looks like this is a major impediment to running Django; the >>>> majority of the test suite failures are because IronPython calls >>>> __str__ instead of __unicode__. Any chance this could be fixed for >>>> 2.6.1? I know it's a big change, but IMHO it's pretty critical as >>>> well. >>>> >>>> - Jeff >>>> _______________________________________________ >>>> 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 > > READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. > > > _______________________________________________ > 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 jdhardy at gmail.com Tue Feb 16 00:00:05 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 15 Feb 2010 16:00:05 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392FE1A3@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392FE1A3@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Mon, Feb 15, 2010 at 3:57 PM, Dino Viehland wrote: > This was relatively easy, it was just work once Michael came up with the > great idea. ?But I do manage to get plenty of sleep - I just put off other > mundane but important things on my TODO list like updating our perf > infrastructure. Can you use the Unladen Swallow perf tests? They seem pretty comprehensive. - Jeff From dinov at microsoft.com Tue Feb 16 00:10:28 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 15 Feb 2010 23:10:28 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392FE1A3@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392FE320@TK5EX14MBXC116.redmond.corp.microsoft.com> It's not the tests, it's the infrastructure. Years ago when we were on the CLR team we wired up everything to run on their perf testing infrastructure. They've since moved on and we've been running on the old stuff that's been bit-rotting away. But the Developer Division has some division-wide infrastructure that we should have switched to long ago. But whatever the infrastructure is we can run whatever tests. We do want to bring the Unladen Swallow tests in and that'll be something to do after we've made the switch. I know some of their infrastructure works fine - I can run individual test cases because I was looking at html5lib for fun just last week (and fixed a bug which prevented html5lib from running but the test stuff ran fine). But I'm not sure all of their infrastructure will run fine. They used to have a dependency on subprocess that could still be there somewhere higher in their perf testing stack. But they've also had a bug open to get it running on other implementations so maybe that's been fixed. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy Sent: Monday, February 15, 2010 3:00 PM To: Discussion of IronPython Subject: Re: [IronPython] Django, __unicode__, and #20366 On Mon, Feb 15, 2010 at 3:57 PM, Dino Viehland wrote: > This was relatively easy, it was just work once Michael came up with the > great idea. ?But I do manage to get plenty of sleep - I just put off other > mundane but important things on my TODO list like updating our perf > infrastructure. Can you use the Unladen Swallow perf tests? They seem pretty comprehensive. - Jeff _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jdhardy at gmail.com Tue Feb 16 00:11:54 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 15 Feb 2010 16:11:54 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: I found one more issue: class Foo(object): def __unicode__(self): return 'uFoo' print 'Foo: %s' % Foo() print u'Foo: %s' % Foo() >python test_u.py Foo: <__main__.Foo object at 0x003E8370> Foo: uFoo >ipy.exe test_u.py Foo: Foo: See http://docs.python.org/library/stdtypes.html#string-formatting-operations (esp. note 6) for reference. - Jeff On Mon, Feb 15, 2010 at 10:49 AM, Dino Viehland wrote: > This is now checked into the Main branch if anyone wants to download, compile, and give it a shot. > > I'll push it to the 2.6 branch post-PyCon. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, February 12, 2010 2:24 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Django, __unicode__, and #20366 > > On 12/02/2010 03:37, Dino Viehland wrote: >> And it turns out this works great! ?We now pass all of the tests in >> test_str and test_unicode related to calling str/unicode and getting >> the appropriate __str__/__unicode__ method called. ?We also now properly >> don't decode strings when you do unicode('foo') so we no longer throw >> for Vernon's exception case where CPython doesn't throw. >> >> So I'm inclined to go with this fix. >> > > That's great news. > > Michael >> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> bounces at lists.ironpython.com] On Behalf Of Dino Viehland >>> Sent: Wednesday, February 10, 2010 9:38 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] Django, __unicode__, and #20366 >>> >>> It definitely won't be in 2.6RC1 but could be in 2.6 final (or RC2 or >>> whatever). >>> >>> I'm still looking into Michael's proposed fix of recognizing calls to >>> unicode - >>> it's a little tricky dealing with * and **args calls to it and I got >>> distracted >>> by preparing for PyCon. >>> >>> Hopefully I can finish that up in the next couple of days and see how >>> that >>> works vs. just calling __unicode__ when __str__ gets called. >>> >>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> bounces at lists.ironpython.com] On Behalf Of Jeff Hardy >>>> Sent: Wednesday, February 10, 2010 9:21 AM >>>> To: Discussion of IronPython >>>> Subject: Re: [IronPython] Django, __unicode__, and #20366 >>>> >>>> On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland >>>> >>> wrote: >>> >>>>> Messing with identity starts to get really scary and I'd rather not >>>>> >>> go >>> >>>>> there - I'm sure there will be lots of edge cases which will be >>>>> >>> broken. >>> >>>>> I could see is making unicode(foo) do something different. ?If you >>>>> >>> aliased >>> >>>>> unicode then you'd get str's behavior though but that might be >>>>> >>> perfectly >>> >>>>> acceptable. ?It's definitely a solution I had not considered and >>>>> >>> it'd >>> >>>>> probably fix multiple issues. >>>>> >>>> Hi Dino, >>>> It looks like this is a major impediment to running Django; the >>>> majority of the test suite failures are because IronPython calls >>>> __str__ instead of __unicode__. Any chance this could be fixed for >>>> 2.6.1? I know it's a big change, but IMHO it's pretty critical as >>>> well. >>>> >>>> - Jeff >>>> _______________________________________________ >>>> 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 > > READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. > > > _______________________________________________ > 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 Feb 16 00:13:37 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 15 Feb 2010 23:13:37 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD391F5D6D@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392FE382@TK5EX14MBXC116.redmond.corp.microsoft.com> Is the template string really a constant in the case that you care about? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy Sent: Monday, February 15, 2010 3:12 PM To: Discussion of IronPython Subject: Re: [IronPython] Django, __unicode__, and #20366 I found one more issue: class Foo(object): def __unicode__(self): return 'uFoo' print 'Foo: %s' % Foo() print u'Foo: %s' % Foo() >python test_u.py Foo: <__main__.Foo object at 0x003E8370> Foo: uFoo >ipy.exe test_u.py Foo: Foo: See http://docs.python.org/library/stdtypes.html#string-formatting-operations (esp. note 6) for reference. - Jeff On Mon, Feb 15, 2010 at 10:49 AM, Dino Viehland wrote: > This is now checked into the Main branch if anyone wants to download, compile, and give it a shot. > > I'll push it to the 2.6 branch post-PyCon. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, February 12, 2010 2:24 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Django, __unicode__, and #20366 > > On 12/02/2010 03:37, Dino Viehland wrote: >> And it turns out this works great! ?We now pass all of the tests in >> test_str and test_unicode related to calling str/unicode and getting >> the appropriate __str__/__unicode__ method called. ?We also now properly >> don't decode strings when you do unicode('foo') so we no longer throw >> for Vernon's exception case where CPython doesn't throw. >> >> So I'm inclined to go with this fix. >> > > That's great news. > > Michael >> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> bounces at lists.ironpython.com] On Behalf Of Dino Viehland >>> Sent: Wednesday, February 10, 2010 9:38 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] Django, __unicode__, and #20366 >>> >>> It definitely won't be in 2.6RC1 but could be in 2.6 final (or RC2 or >>> whatever). >>> >>> I'm still looking into Michael's proposed fix of recognizing calls to >>> unicode - >>> it's a little tricky dealing with * and **args calls to it and I got >>> distracted >>> by preparing for PyCon. >>> >>> Hopefully I can finish that up in the next couple of days and see how >>> that >>> works vs. just calling __unicode__ when __str__ gets called. >>> >>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> bounces at lists.ironpython.com] On Behalf Of Jeff Hardy >>>> Sent: Wednesday, February 10, 2010 9:21 AM >>>> To: Discussion of IronPython >>>> Subject: Re: [IronPython] Django, __unicode__, and #20366 >>>> >>>> On Mon, Feb 1, 2010 at 2:46 PM, Dino Viehland >>>> >>> wrote: >>> >>>>> Messing with identity starts to get really scary and I'd rather not >>>>> >>> go >>> >>>>> there - I'm sure there will be lots of edge cases which will be >>>>> >>> broken. >>> >>>>> I could see is making unicode(foo) do something different. ?If you >>>>> >>> aliased >>> >>>>> unicode then you'd get str's behavior though but that might be >>>>> >>> perfectly >>> >>>>> acceptable. ?It's definitely a solution I had not considered and >>>>> >>> it'd >>> >>>>> probably fix multiple issues. >>>>> >>>> Hi Dino, >>>> It looks like this is a major impediment to running Django; the >>>> majority of the test suite failures are because IronPython calls >>>> __str__ instead of __unicode__. Any chance this could be fixed for >>>> 2.6.1? I know it's a big change, but IMHO it's pretty critical as >>>> well. >>>> >>>> - Jeff >>>> _______________________________________________ >>>> 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 > > READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. > > > _______________________________________________ > 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 jdhardy at gmail.com Tue Feb 16 00:31:59 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 15 Feb 2010 16:31:59 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392FE382@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392FE382@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Mon, Feb 15, 2010 at 4:13 PM, Dino Viehland wrote: > Is the template string really a constant in the case that you care about? Yeah, it is, thankfully. I doubt there's a ton of cases where it occurs, and I really hope there aren't any where the format string is in a variable - I think I'd just curl up and cry in that case. Unfortunately it's a weird situation - doctest expects a specific output, so I need to coax IronPython to output that to get the tests to pass. - Jeff From dfugate at microsoft.com Tue Feb 16 00:36:05 2010 From: dfugate at microsoft.com (Dave Fugate) Date: Mon, 15 Feb 2010 23:36:05 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392FE320@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392FE1A3@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392FE320@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <7CEEC335D70FFE4B957737DDE836F51B2A4B0079@TK5EX14MBXC125.redmond.corp.microsoft.com> For anyone attending PyCon, I'll be presenting a poster session entitled "Behind the Iron Curtain: How Python is Tested at Microsoft". Any ways, one of the focuses of this session is our old performance lab infrastructure. Not only will you hear some details about how performance testing is accomplished at Microsoft, we're also very interested in hearing from YOU! E.g., are the benchmarks we're running really relevant or should we be using Unladen Swallow's metrics? The update to our perf infrastructure Dino mentions below will give us a chance to make some major improvements in this area. We'd like to base these changes off of the Python community's valuable feedback. Dave -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, February 15, 2010 3:10 PM To: Discussion of IronPython Subject: Re: [IronPython] Django, __unicode__, and #20366 It's not the tests, it's the infrastructure. Years ago when we were on the CLR team we wired up everything to run on their perf testing infrastructure. They've since moved on and we've been running on the old stuff that's been bit-rotting away. But the Developer Division has some division-wide infrastructure that we should have switched to long ago. But whatever the infrastructure is we can run whatever tests. We do want to bring the Unladen Swallow tests in and that'll be something to do after we've made the switch. I know some of their infrastructure works fine - I can run individual test cases because I was looking at html5lib for fun just last week (and fixed a bug which prevented html5lib from running but the test stuff ran fine). But I'm not sure all of their infrastructure will run fine. They used to have a dependency on subprocess that could still be there somewhere higher in their perf testing stack. But they've also had a bug open to get it running on other implementations so maybe that's been fixed. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy Sent: Monday, February 15, 2010 3:00 PM To: Discussion of IronPython Subject: Re: [IronPython] Django, __unicode__, and #20366 On Mon, Feb 15, 2010 at 3:57 PM, Dino Viehland wrote: > This was relatively easy, it was just work once Michael came up with the > great idea. ?But I do manage to get plenty of sleep - I just put off other > mundane but important things on my TODO list like updating our perf > infrastructure. Can you use the Unladen Swallow perf tests? They seem pretty comprehensive. - Jeff _______________________________________________ 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 Feb 16 00:41:44 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 15 Feb 2010 23:41:44 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <4B674A53.5000109@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD391F601D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392FE382@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD392FE7BF@TK5EX14MBXC116.redmond.corp.microsoft.com> We could make % on a Unicode literal do something special much like we're doing for calls to unicode(...). Alternately we could make % try to invoke __unicode__ before __str__ - but that would sometimes be wrong. Probably not very often, it's hard to imagine someone defining __unicode__ and expecting __str__ to be returned with a significant difference. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy Sent: Monday, February 15, 2010 3:32 PM To: Discussion of IronPython Subject: Re: [IronPython] Django, __unicode__, and #20366 On Mon, Feb 15, 2010 at 4:13 PM, Dino Viehland wrote: > Is the template string really a constant in the case that you care about? Yeah, it is, thankfully. I doubt there's a ton of cases where it occurs, and I really hope there aren't any where the format string is in a variable - I think I'd just curl up and cry in that case. Unfortunately it's a weird situation - doctest expects a specific output, so I need to coax IronPython to output that to get the tests to pass. - Jeff _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jdhardy at gmail.com Tue Feb 16 00:51:46 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 15 Feb 2010 16:51:46 -0700 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392FE7BF@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392FE382@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392FE7BF@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Mon, Feb 15, 2010 at 4:41 PM, Dino Viehland wrote: > We could make % on a Unicode literal do something special much like > we're doing for calls to unicode(...). ?Alternately we could make % > try to invoke __unicode__ before __str__ - but that would sometimes > be wrong. ?Probably not very often, it's hard to imagine someone > defining __unicode__ and expecting __str__ to be returned with > a significant difference. Fixing up u"..." literals is probably the lowest impact change, especially for a point release. You never know what crazy stuff people might do. - Jeff From fuzzyman at voidspace.org.uk Tue Feb 16 00:53:32 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 15 Feb 2010 23:53:32 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392FE382@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392FE7BF@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4B79DE7C.9080408@voidspace.org.uk> On 15/02/2010 23:51, Jeff Hardy wrote: > On Mon, Feb 15, 2010 at 4:41 PM, Dino Viehland wrote: > >> We could make % on a Unicode literal do something special much like >> we're doing for calls to unicode(...). Alternately we could make % >> try to invoke __unicode__ before __str__ - but that would sometimes >> be wrong. Probably not very often, it's hard to imagine someone >> defining __unicode__ and expecting __str__ to be returned with >> a significant difference. >> > Fixing up u"..." literals is probably the lowest impact change, > especially for a point release. You never know what crazy stuff people > might do. > > Yeah - u'%s' % foo is basically equivalent to u'%s' % unicode(foo) anyway... Michael > - Jeff > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. From fuzzyman at voidspace.org.uk Tue Feb 16 00:55:52 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 15 Feb 2010 23:55:52 +0000 Subject: [IronPython] Django, __unicode__, and #20366 In-Reply-To: <4B79DE7C.9080408@voidspace.org.uk> References: <1A472770E042064698CB5ADC83A12ACD392D586B@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392E30FF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B752C29.6060700@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD392FC104@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392FE382@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392FE7BF@TK5EX14MBXC116.redmond.corp.microsoft.com> <4B79DE7C.9080408@voidspace.org.uk> Message-ID: <4B79DF08.4050800@voidspace.org.uk> On 15/02/2010 23:53, Michael Foord wrote: > On 15/02/2010 23:51, Jeff Hardy wrote: >> On Mon, Feb 15, 2010 at 4:41 PM, Dino Viehland >> wrote: >>> We could make % on a Unicode literal do something special much like >>> we're doing for calls to unicode(...). Alternately we could make % >>> try to invoke __unicode__ before __str__ - but that would sometimes >>> be wrong. Probably not very often, it's hard to imagine someone >>> defining __unicode__ and expecting __str__ to be returned with >>> a significant difference. >> Fixing up u"..." literals is probably the lowest impact change, >> especially for a point release. You never know what crazy stuff people >> might do. >> > > Yeah - u'%s' % foo is basically equivalent to u'%s' % unicode(foo) > anyway... Of course if you had a *really* good type inferencer that you could use at compile time then you could infer a few places where names *must* be bound to unicode strings (trace unicode literals or the results of calls to unicode) and catch a few more places to fix up as well. Possibly a bit out of scope though... Michael > > Michael > >> - Jeff >> _______________________________________________ >> 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (?BOGUS AGREEMENTS?) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. From Jimmy.Schementi at microsoft.com Tue Feb 16 04:08:06 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 16 Feb 2010 03:08:06 +0000 Subject: [IronPython] Monkey-patching CLR types In-Reply-To: <1A472770E042064698CB5ADC83A12ACD392F723D@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1B42307CD4AADD438CDDA2FE1121CC92046102AF@TK5EX14MBXC136.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392F723D@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1B42307CD4AADD438CDDA2FE1121CC9204610E8A@TK5EX14MBXC136.redmond.corp.microsoft.com> Thanks Dino! I've got something to at least compile, but I'm getting the error "ArgumentTypeException: unsupported operand type(s) for +=: 'PythonBrowserEvent' and 'function'". OK, makes sense, it's not finding InPlaceAdd(Python.Runtime.Method), right? Since I can't link against IronPython, what type should I use instead of Python.Runtime.Method? System.Dynamic.IDynamicMetaObjectProvider, as that's the only DLR interface that Method implements? If so, then I'm not sure how to convert it to an Action. Also, should I be using "op_AdditionAssignment" instead of InPlaceAdd? The usage in ReflectedEvent.cs (http://ironpython.codeplex.com/sourcecontrol/changeset/view/63991?projectName=IronPython#384571) seems to say that. If it helps, here's what I have so far: public static class HtmlElementExtension { [SpecialName] public static object GetBoundMember(HtmlElement element, string name) { object propertyValue = element.GetProperty(name); // No way to tell if a property actually exists, so best we can do // do is check if it's null ... if (propertyValue == null) { return new PythonBrowserEvent(element, name); } return propertyValue; } } public class PythonBrowserEvent { private readonly HtmlElement _element; private readonly string _event; internal PythonBrowserEvent(HtmlElement element, string eventStr) { _element = element; _event = eventStr; } [SpecialName] public object InPlaceAdd(object handler) { _element.AttachEvent(_event, new EventHandler((Action)handler)); return null; } } > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Sunday, February 14, 2010 4:58 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Monkey-patching CLR types > > You can define an extension property that gets/sets a value which supports in > place addition / subtraction. Something like this: > > [assembly: ExtensionType(typeof(HtmlElement), > typeof(HtmlElementExtension))] > public static class HtmlElementExtension { > [SpecialName, PropertyMethod] > public static MyEvent Getonclick(HtmlElement element) { > return new MyEvent(element); > } > [SpecialName, PropertyMethod] > public static void Setonclick(HtmlElement element, object value) { > // You could return a value from InPlaceAdd and validate it > here > // to report an error on a direct assignment - this is what > // ReflectedEvent does in IronPython. > } > } > > public class MyEvent { > private readonly HtmlElement _element; > public MyEvent(HtmlElement element) { > _element = element; > } > [SpecialName] > public object InPlaceAdd(EventHandler[HtmlEventArgs] handler) { > _element.AttachEvent("onclick", handler); > return null; > } > // also needs InPlaceSubtract > } > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi > Sent: Sunday, February 14, 2010 2:06 PM > To: Discussion of IronPython > Subject: [IronPython] Monkey-patching CLR types > > (Yes, I'm asking a question this time =P) > > I want to know my options for adding functionality to an existing CLR type. > Specifically I want to make hooking DOM events cleaner: in Silverlight today > you cannot hook DOM events with the standard += syntax that IronPython uses > for CLR events: > > object.onclick += foo > > Instead you must do this: > > object.AttachEvent("onclick", EventHandler[HtmlEventArgs](foo)) > > In IronRuby I fixed that by just monkey-patching > System.Windows.Browser.HtmlObject, but in IronPython I cannot monkey-patch > built-in types. However, I do something similar with accessing DOM properties > (instead of element.GetProperty("innerHTML") it's just element.innerHTML) > with DLR's ExtensionType, which is the same way IronPython exposes special > methods on CLR types as well: > > [assembly: ExtensionType(typeof(HtmlElement), > typeof(HtmlElementExtension))] > public static class HtmlElementExtension { > [SpecialName] > public static object GetBoundMember(HtmlElement element, string name) > { > return element.GetProperty(name); > } > } > > But after looking through Python's Binder and the DLR's ActionBinder for how > they use ExtensionTypes, I couldn't get a definitive answer on how to capture > an method call plus an operator. Any ideas? > > ~Jimmy > > _______________________________________________ > 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 Feb 16 04:18:01 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 16 Feb 2010 03:18:01 +0000 Subject: [IronPython] Monkey-patching CLR types In-Reply-To: <1B42307CD4AADD438CDDA2FE1121CC9204610E8A@TK5EX14MBXC136.redmond.corp.microsoft.com> References: <1B42307CD4AADD438CDDA2FE1121CC92046102AF@TK5EX14MBXC136.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392F723D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1B42307CD4AADD438CDDA2FE1121CC9204610E8A@TK5EX14MBXC136.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD39300378@TK5EX14MBXC116.redmond.corp.microsoft.com> If you strongly type handler to a delegate type IronPython should convert the function to the delegate type on the call. I had meant to write "EventHandler" in my original sample code but somehow I ended up using the Python syntax EventHandler[HtmlEventArgs] :) Yeah, the comment's write, I'm wrong http://msdn.microsoft.com/en-us/library/2sk3x8a7(VS.71).aspx lists op_AdditionAssignment but not InPlaceAdd. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi > Sent: Monday, February 15, 2010 7:08 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Monkey-patching CLR types > > Thanks Dino! > > I've got something to at least compile, but I'm getting the error > "ArgumentTypeException: unsupported operand type(s) for +=: > 'PythonBrowserEvent' and 'function'". OK, makes sense, it's not finding > InPlaceAdd(Python.Runtime.Method), right? Since I can't link against > IronPython, what type should I use instead of Python.Runtime.Method? > System.Dynamic.IDynamicMetaObjectProvider, as that's the only DLR > interface that Method implements? If so, then I'm not sure how to > convert it to an Action. > > Also, should I be using "op_AdditionAssignment" instead of InPlaceAdd? > The usage in ReflectedEvent.cs > (http://ironpython.codeplex.com/sourcecontrol/changeset/view/63991?proj > ectName=IronPython#384571) seems to say that. > > If it helps, here's what I have so far: > > public static class HtmlElementExtension { > [SpecialName] > public static object GetBoundMember(HtmlElement element, string > name) { > object propertyValue = element.GetProperty(name); > // No way to tell if a property actually exists, so best we > can do > // do is check if it's null ... > if (propertyValue == null) { > return new PythonBrowserEvent(element, name); > } > return propertyValue; > } > } > > public class PythonBrowserEvent { > private readonly HtmlElement _element; > private readonly string _event; > > internal PythonBrowserEvent(HtmlElement element, string > eventStr) { > _element = element; > _event = eventStr; > } > > [SpecialName] > public object InPlaceAdd(object handler) { > _element.AttachEvent(_event, > new EventHandler((Action HtmlEventArgs>)handler)); > return null; > } > } > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of Dino Viehland > > Sent: Sunday, February 14, 2010 4:58 PM > > To: Discussion of IronPython > > Subject: Re: [IronPython] Monkey-patching CLR types > > > > You can define an extension property that gets/sets a value which > supports in > > place addition / subtraction. Something like this: > > > > [assembly: ExtensionType(typeof(HtmlElement), > > typeof(HtmlElementExtension))] > > public static class HtmlElementExtension { > > [SpecialName, PropertyMethod] > > public static MyEvent Getonclick(HtmlElement element) { > > return new MyEvent(element); > > } > > [SpecialName, PropertyMethod] > > public static void Setonclick(HtmlElement element, object > value) { > > // You could return a value from InPlaceAdd and validate it > > here > > // to report an error on a direct assignment - this is what > > // ReflectedEvent does in IronPython. > > } > > } > > > > public class MyEvent { > > private readonly HtmlElement _element; > > public MyEvent(HtmlElement element) { > > _element = element; > > } > > [SpecialName] > > public object InPlaceAdd(EventHandler[HtmlEventArgs] > handler) { > > _element.AttachEvent("onclick", handler); > > return null; > > } > > // also needs InPlaceSubtract > > } > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi > > Sent: Sunday, February 14, 2010 2:06 PM > > To: Discussion of IronPython > > Subject: [IronPython] Monkey-patching CLR types > > > > (Yes, I'm asking a question this time =P) > > > > I want to know my options for adding functionality to an existing CLR > type. > > Specifically I want to make hooking DOM events cleaner: in > Silverlight today > > you cannot hook DOM events with the standard += syntax that > IronPython uses > > for CLR events: > > > > object.onclick += foo > > > > Instead you must do this: > > > > object.AttachEvent("onclick", EventHandler[HtmlEventArgs](foo)) > > > > In IronRuby I fixed that by just monkey-patching > > System.Windows.Browser.HtmlObject, but in IronPython I cannot monkey- > patch > > built-in types. However, I do something similar with accessing DOM > properties > > (instead of element.GetProperty("innerHTML") it's just > element.innerHTML) > > with DLR's ExtensionType, which is the same way IronPython exposes > special > > methods on CLR types as well: > > > > [assembly: ExtensionType(typeof(HtmlElement), > > typeof(HtmlElementExtension))] > > public static class HtmlElementExtension { > > [SpecialName] > > public static object GetBoundMember(HtmlElement element, > string name) > > { > > return element.GetProperty(name); > > } > > } > > > > But after looking through Python's Binder and the DLR's ActionBinder > for how > > they use ExtensionTypes, I couldn't get a definitive answer on how to > capture > > an method call plus an operator. Any ideas? > > > > ~Jimmy > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Tue Feb 16 09:08:59 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 16 Feb 2010 08:08:59 +0000 Subject: [IronPython] Monkey-patching CLR types In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39300378@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1B42307CD4AADD438CDDA2FE1121CC92046102AF@TK5EX14MBXC136.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392F723D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1B42307CD4AADD438CDDA2FE1121CC9204610E8A@TK5EX14MBXC136.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD39300378@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1B42307CD4AADD438CDDA2FE1121CC9204611002@TK5EX14MBXC136.redmond.corp.microsoft.com> Dino Viehland wrote: > If you strongly type handler to a delegate type IronPython should convert the > function to the delegate type on the call. Unfortunately it doesn't seem to :(. I repro'd that it doesn't on the desktop as well as in Silverlight; here's a desktop repro: >>> import clr >>> clr.AddReferenceToFile("pyext") >>> import pyext >>> t = pyext.TestClass() >>> def foo(s, e): pass ... >>> import System >>> t.AttachEvent("foo", System.EventHandler(foo)) foo hooked! >>> t.foo += foo Traceback (most recent call last): File "", line unknown, in TypeError: unsupported operand type(s) for +=: 'MyEvent' and 'function' Also, when using a EventHandler as the right-hand-side of the +=, the AttachEvent method gets called, but still complains that the "foo" attribute doesn't exist: >>> t.foo += System.EventHandler(foo) foo hooked! Traceback (most recent call last): File "", line unknown, in AttributeError: 'TestClass' object has no attribute 'foo' Any ideas? Here's the pyext.cs stub that I used: // // pyext.cs // using Microsoft.Scripting.Runtime; using System; using Microsoft.Scripting.Utils; using System.Runtime.CompilerServices; [assembly: ExtensionType(typeof(pyext.TestClass), typeof(pyext.TestClassExtension))] namespace pyext { public class TestClass { public void AttachEvent(string eventName, EventHandler handler) { Console.WriteLine(string.Format("{0} hooked!", eventName)); } } public static class TestClassExtension { [System.Runtime.CompilerServices.SpecialNameAttribute] public static object GetBoundMember(TestClass obj, string name) { return new MyEvent(obj, name); } } public class MyEvent { private readonly TestClass _obj; private readonly string _event; internal MyEvent(TestClass obj, string eventStr) { _obj = obj; _event = eventStr; } [System.Runtime.CompilerServices.SpecialNameAttribute] public object op_AdditionAssignment(EventHandler func) { _obj.AttachEvent(_event, func); return null; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From merllab at microsoft.com Tue Feb 16 17:52:59 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 16 Feb 2010 08:52:59 -0800 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/64019. ADDED SOURCES $/IronPython/IronPython_Main/Src/Tests/stress $/IronPython/IronPython_Main/Src/Tests/stress/__init__.py $/IronPython/IronPython_Main/Src/Tests/stress/bigimport1_test.py MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Tests/harness.py $/IronPython/IronPython_Main/Src/Tests/modules/system_related/sys_test.py $/IronPython/IronPython_Main/Src/Tests/regressions.py $/IronPython/IronPython_Main/Src/Tests/RunAgainstCpy.py $/IronPython/IronPython_Main/Src/Tests/stress/__init__.py $/IronPython/IronPython_Main/Src/Tests/stress/bigimport1_test.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1592690 Date: 2/15/2010 3:14:43 PM - (CPy) test_re.py: Bug 305774 has been fixed - stress: new test package - CP24484: Fixed - CP23555: Fixed - CP24677: Fixed - CP24381: Not fixed (Shelveset: CP04;REDMOND\dfugate | SNAP CheckinId: 10365) From justin.hartman at gmail.com Tue Feb 16 20:59:39 2010 From: justin.hartman at gmail.com (Justin Hartman) Date: Tue, 16 Feb 2010 14:59:39 -0500 Subject: [IronPython] Using a C# class in IronPython Message-ID: Hi all, I've been using IronPython (and IronRuby) for about a year for a project at work, and I'm thrilled with them both! I encountered something strange today and was hoping someone could shed some light on it. I was attempting to set a property on an instance of a class which is defined in C#, and I kept getting a SystemError indicating something about an ambiguous match. After a pretty thorough search of my codespace, I could not find any class names that would be conflicting or ambiguous. After looking at the stack trace and doing a little more digging, I found out that System.Type.GetMethod was throwing the error when searching for the SetMember method. Then it all clicked -- my C# class has a SetMember method (actually, 6 of them with different parameters). So, admittedly I've never spent any time in the IronPython codebase, so this is pure conjecture, and here's where I'm looking for some guidance. I'm guessing that the IronPython runtime, as part of its binding magic, is looking to see if the class has implemented SetMember to accomplish the setting of the attribute. However, rather than looking for a method with a particular signature, it simply looks for it by name, and fails when it encounters more than one (an ambiguous match). So, given that my C# class has a good reason for implementing the SetMember method (because it makes sense in our application domain), what's an IronPython user to do? Do I have to just rename my SetMember method to something else? Should the IronPython runtime do a more specific lookup for SetMember, maybe with a specific signature? Thanks in advance, -Justin -------------- next part -------------- An HTML attachment was scrubbed... URL: From markjoel60 at gmail.com Tue Feb 16 21:49:10 2010 From: markjoel60 at gmail.com (Mark Grice) Date: Tue, 16 Feb 2010 15:49:10 -0500 Subject: [IronPython] How can I exit from Python Script File? Message-ID: <294f1ba41002161249i2f400386pd4a0b52de51e23c8@mail.gmail.com> Michael Foord Wrote: >"That will throw a SystemExit exception. You can have exception handling >in your C# that catches this specific error." Doh! Yeah... should have checked that. I just didn't figure calling sys.Exit() was a code exception, so I thought it was something else I was doing wrong... Interestingly, when I check the exception message, it is empty. (ie ex.message == "") But I can catch that as a quick exit from python and handle it in the C# code. That's working. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Wed Feb 17 07:05:27 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 17 Feb 2010 06:05:27 +0000 Subject: [IronPython] Monkey-patching CLR types References: <1B42307CD4AADD438CDDA2FE1121CC92046102AF@TK5EX14MBXC136.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392F723D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1B42307CD4AADD438CDDA2FE1121CC9204610E8A@TK5EX14MBXC136.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD39300378@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1B42307CD4AADD438CDDA2FE1121CC92046125D0@TK5EX14MBXC136.redmond.corp.microsoft.com> By the way, I fixed this by just overloading the "+" operator the normal way C# operators are overloaded, had it accept "object" on the right-hand-side so Python functions would make their way into it, and then used ObjectOperations.ConvertTo to convert the Python function to a System.EventHandler. From: Jimmy Schementi Sent: Tuesday, February 16, 2010 12:09 AM To: Discussion of IronPython Subject: RE: Monkey-patching CLR types Dino Viehland wrote: > If you strongly type handler to a delegate type IronPython should convert the > function to the delegate type on the call. Unfortunately it doesn't seem to :(. I repro'd that it doesn't on the desktop as well as in Silverlight; here's a desktop repro: >>> import clr >>> clr.AddReferenceToFile("pyext") >>> import pyext >>> t = pyext.TestClass() >>> def foo(s, e): pass ... >>> import System >>> t.AttachEvent("foo", System.EventHandler(foo)) foo hooked! >>> t.foo += foo Traceback (most recent call last): File "", line unknown, in TypeError: unsupported operand type(s) for +=: 'MyEvent' and 'function' Also, when using a EventHandler as the right-hand-side of the +=, the AttachEvent method gets called, but still complains that the "foo" attribute doesn't exist: >>> t.foo += System.EventHandler(foo) foo hooked! Traceback (most recent call last): File "", line unknown, in AttributeError: 'TestClass' object has no attribute 'foo' Any ideas? Here's the pyext.cs stub that I used: // // pyext.cs // using Microsoft.Scripting.Runtime; using System; using Microsoft.Scripting.Utils; using System.Runtime.CompilerServices; [assembly: ExtensionType(typeof(pyext.TestClass), typeof(pyext.TestClassExtension))] namespace pyext { public class TestClass { public void AttachEvent(string eventName, EventHandler handler) { Console.WriteLine(string.Format("{0} hooked!", eventName)); } } public static class TestClassExtension { [System.Runtime.CompilerServices.SpecialNameAttribute] public static object GetBoundMember(TestClass obj, string name) { return new MyEvent(obj, name); } } public class MyEvent { private readonly TestClass _obj; private readonly string _event; internal MyEvent(TestClass obj, string eventStr) { _obj = obj; _event = eventStr; } [System.Runtime.CompilerServices.SpecialNameAttribute] public object op_AdditionAssignment(EventHandler func) { _obj.AttachEvent(_event, func); return null; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From markjoel60 at gmail.com Wed Feb 17 15:58:29 2010 From: markjoel60 at gmail.com (Mark Grice) Date: Wed, 17 Feb 2010 09:58:29 -0500 Subject: [IronPython] Using a C# class in IronPython Message-ID: <294f1ba41002170658t7c8f590bk8ecb95547379efc2@mail.gmail.com> I'm not sure if this helps, but I use a C# class in my IronPython, and it works fine. Class is defined using the shorthand get; set; ie: public class ScreenTags { public String appWindowName { get; set; } public String fieldName { get; set; } public bool isDataField { get; set; } public bool isManual { get; set; } public String screenLabel { get; set; } public String description { get; set; } } (In actuality, it is a lot more than this, consisting of other classes, methods, etc...) Now, it may be bad practice, but I then simply use an object reference in Python, and assume it was instantiated. In other words, as far as Python is concerned, there is an instantiated object of ScreenTags called "screen". Python simply calls this whenever it wants to do something: ie. screen. appWindowName = "ThisName" I create the screen object in my C# code, and then add it as a reference to the python scope before I call the IronPython engine. So, on the C# side I: scptEngine = Python.CreateEngine(); scptRuntime = scptEngine.Runtime; scptScope = scptEngine.CreateScope(); AddAssemblies(scptRuntime); // call if you need to add other libraries, such as my class And before I actually call the Engine, I set the class in the Python scope -- still in C#: ScreenTags SOA_screen = new ScreenTags(); scptScope.SetVariable("screen", SOA_screen); scptSource = scptEngine.CreateScriptSourceFromFile(scriptFile); // scriptFile is Python code scptSource.Execute(scptScope); This is working fine. The class is actually really a loaded class, and it has all kind of goodies in it (ie pop up Windows forms, calls out to unmanaged code... all sorts of stuff). I never have a problem with any of it. I don't know if this helps (or even if it is good practice!) but it is working here. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Feb 17 17:01:37 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 17 Feb 2010 16:01:37 +0000 Subject: [IronPython] Monkey-patching CLR types In-Reply-To: <1B42307CD4AADD438CDDA2FE1121CC92046125D0@TK5EX14MBXC136.redmond.corp.microsoft.com> References: <1B42307CD4AADD438CDDA2FE1121CC92046102AF@TK5EX14MBXC136.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD392F723D@TK5EX14MBXC116.redmond.corp.microsoft.com> <1B42307CD4AADD438CDDA2FE1121CC9204610E8A@TK5EX14MBXC136.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD39300378@TK5EX14MBXC116.redmond.corp.microsoft.com> <1B42307CD4AADD438CDDA2FE1121CC92046125D0@TK5EX14MBXC136.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD3930B4EE@TK5EX14MBXC116.redmond.corp.microsoft.com> You could of used ObjectOps in the InPlaceAdd function as well. The problem with just overriding + is something like "myobj.myevent + myhandler" will now add an event as well - which is probably not the expected behavior. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Tuesday, February 16, 2010 10:05 PM To: Discussion of IronPython Subject: Re: [IronPython] Monkey-patching CLR types By the way, I fixed this by just overloading the "+" operator the normal way C# operators are overloaded, had it accept "object" on the right-hand-side so Python functions would make their way into it, and then used ObjectOperations.ConvertTo to convert the Python function to a System.EventHandler. From: Jimmy Schementi Sent: Tuesday, February 16, 2010 12:09 AM To: Discussion of IronPython Subject: RE: Monkey-patching CLR types Dino Viehland wrote: > If you strongly type handler to a delegate type IronPython should convert the > function to the delegate type on the call. Unfortunately it doesn't seem to :(. I repro'd that it doesn't on the desktop as well as in Silverlight; here's a desktop repro: >>> import clr >>> clr.AddReferenceToFile("pyext") >>> import pyext >>> t = pyext.TestClass() >>> def foo(s, e): pass ... >>> import System >>> t.AttachEvent("foo", System.EventHandler(foo)) foo hooked! >>> t.foo += foo Traceback (most recent call last): File "", line unknown, in TypeError: unsupported operand type(s) for +=: 'MyEvent' and 'function' Also, when using a EventHandler as the right-hand-side of the +=, the AttachEvent method gets called, but still complains that the "foo" attribute doesn't exist: >>> t.foo += System.EventHandler(foo) foo hooked! Traceback (most recent call last): File "", line unknown, in AttributeError: 'TestClass' object has no attribute 'foo' Any ideas? Here's the pyext.cs stub that I used: // // pyext.cs // using Microsoft.Scripting.Runtime; using System; using Microsoft.Scripting.Utils; using System.Runtime.CompilerServices; [assembly: ExtensionType(typeof(pyext.TestClass), typeof(pyext.TestClassExtension))] namespace pyext { public class TestClass { public void AttachEvent(string eventName, EventHandler handler) { Console.WriteLine(string.Format("{0} hooked!", eventName)); } } public static class TestClassExtension { [System.Runtime.CompilerServices.SpecialNameAttribute] public static object GetBoundMember(TestClass obj, string name) { return new MyEvent(obj, name); } } public class MyEvent { private readonly TestClass _obj; private readonly string _event; internal MyEvent(TestClass obj, string eventStr) { _obj = obj; _event = eventStr; } [System.Runtime.CompilerServices.SpecialNameAttribute] public object op_AdditionAssignment(EventHandler func) { _obj.AttachEvent(_event, func); return null; } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From merllab at microsoft.com Wed Feb 17 17:53:19 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 17 Feb 2010 08:53:19 -0800 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/64033. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonGetMemberBinder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.Core.csproj From cold_fusion at fastmail.fm Thu Feb 18 09:25:42 2010 From: cold_fusion at fastmail.fm (cold_fusion at fastmail.fm) Date: Thu, 18 Feb 2010 10:25:42 +0200 Subject: [IronPython] TraceBackFrame, f_globals, f_locals Message-ID: <1266481542.3740.1360597111@webmail.messagingengine.com> Hello, I'm helping a coworker embed IronPython with some debugging functions into a C# app (following DevHawks example). The thing I don't understand is how the f_globals and f_locals fields work when executing the main script, neither contains the global/local names in the top most scope, but do work correctly when executing a function withing the same code scope. I know about the "$globalContext" name in the f_globals for the main script, but would actually like to understand what's happening. Regards, Avi. -- http://www.fastmail.fm - Does exactly what it says on the tin From idan at cloudshare.com Thu Feb 18 11:57:51 2010 From: idan at cloudshare.com (Idan Zaltzberg) Date: Thu, 18 Feb 2010 12:57:51 +0200 Subject: [IronPython] Bug fixes in Ipy 2.6.1 Message-ID: <000601cab089$37569630$a603c290$@com> Hi, In Ipy 2.6 there some issues of memory leak when using generator methods. I downloaded Ipy 2.6.1 RC1 and indeed most of them were fixed. Still, one issue still remains the same but I'm not entirely sure this is a real bug: The following code shows that in some cases, some memory is not released even after GC, is that ok? def coroutine(): just_numbers = range(1,1000000) def inner_method(): return just_numbers yield None raise Exception("some exception") # comment out this line to make the test not work from System import GC def get_memory(): for _ in xrange(4): GC.Collect() GC.WaitForPendingFinalizers() return GC.GetTotalMemory(True)/1e6 before = get_memory() crt = coroutine() try: crt.next() crt.next() except: pass crt = None after = get_memory() self.assert_(after-before > 10,'There should be a memory leak in this case.before=%s after=%s' % (before,after)) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu Feb 18 17:02:39 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 18 Feb 2010 16:02:39 +0000 Subject: [IronPython] TraceBackFrame, f_globals, f_locals In-Reply-To: <1266481542.3740.1360597111@webmail.messagingengine.com> References: <1266481542.3740.1360597111@webmail.messagingengine.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD3931161C@TK5EX14MBXC116.redmond.corp.microsoft.com> This is a bug - f_locals / f_globals should be returning the module globals/locals but it's currently returning the locals for the actual compiled code. I've opened bug 26243: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26243 There's apparently 1 other sys.settrace bug that needs to still be fixed for the final 2.6.1 release and I would guess this should be pretty easy to fix along w/ it - worst case we just need to pull the dictionary from the $codeContext variable. I would suggest checking for the $codeContext variable and pulling locals from it for the time being. If it's no there (because after fixing this it won't be) then I would just use the dictionary as-is. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of cold_fusion at fastmail.fm > Sent: Thursday, February 18, 2010 12:26 AM > To: users at lists.ironpython.com > Subject: [IronPython] TraceBackFrame, f_globals, f_locals > > Hello, > > I'm helping a coworker embed IronPython with some debugging functions > into a C# app (following DevHawks example). > The thing I don't understand is how the f_globals and f_locals fields > work when executing the main script, neither contains the global/local > names in the top most scope, but do work correctly when executing a > function withing the same code scope. > > I know about the "$globalContext" name in the f_globals for the main > script, but would actually like to understand what's happening. > > Regards, > Avi. > > > > > -- > http://www.fastmail.fm - Does exactly what it says on the tin > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Thu Feb 18 17:15:59 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 18 Feb 2010 16:15:59 +0000 Subject: [IronPython] Bug fixes in Ipy 2.6.1 In-Reply-To: <000601cab089$37569630$a603c290$@com> References: <000601cab089$37569630$a603c290$@com> Message-ID: <1A472770E042064698CB5ADC83A12ACD393117F9@TK5EX14MBXC116.redmond.corp.microsoft.com> This is interesting - there's a .NET exception object which is keeping a traceback frame alive which is keeping the just_numbers list alive. We should clear out the local .NET exception and the memory will then be eligible for collection. The good news is that as soon as this method is no longer on the stack the memory is reclaimable (so it's really just that we're not collecting soon enough - not that we're actually leaking the memory) but we should fix it anyway. I've opened this bug: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26244 From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Idan Zaltzberg Sent: Thursday, February 18, 2010 2:58 AM To: users at lists.ironpython.com Cc: Ronnie Maor; Avner Rosenan Subject: [IronPython] Bug fixes in Ipy 2.6.1 Hi, In Ipy 2.6 there some issues of memory leak when using generator methods. I downloaded Ipy 2.6.1 RC1 and indeed most of them were fixed. Still, one issue still remains the same but I'm not entirely sure this is a real bug: The following code shows that in some cases, some memory is not released even after GC, is that ok? def coroutine(): just_numbers = range(1,1000000) def inner_method(): return just_numbers yield None raise Exception("some exception") # comment out this line to make the test not work from System import GC def get_memory(): for _ in xrange(4): GC.Collect() GC.WaitForPendingFinalizers() return GC.GetTotalMemory(True)/1e6 before = get_memory() crt = coroutine() try: crt.next() crt.next() except: pass crt = None after = get_memory() self.assert_(after-before > 10,'There should be a memory leak in this case.before=%s after=%s' % (before,after)) -------------- next part -------------- An HTML attachment was scrubbed... URL: From gzlist at googlemail.com Thu Feb 18 19:30:14 2010 From: gzlist at googlemail.com (Martin (gzlist)) Date: Thu, 18 Feb 2010 18:30:14 +0000 Subject: [IronPython] Last change needed for working tempfiles Message-ID: As mentioned in the release thread[1] tempfiles nearly work in IronPython 2.6.1 RC 1 now, they go away when explicitly closed or when the process ends, thanks to adding support[2] for the os.O_TEMPORARY flag. The current bug[3] is actually fixed as stated in IronPython 2.6.1 RC 1 as can be seen by the following testcase: def test_named_temporary_file_is_removed_by_close(): """Temporary files should be removed from the filesystem when closed""" import os, tempfile tf = tempfile.NamedTemporaryFile() f = tf.file try: tf.close() if os.path.exists(tf.name): raise AssertionError( "Temporary file not removed on close") except: f.close() raise However, the larger problem with tempfiles isn't quite done yet, as can be seen by the following failing case: def test_named_temporary_file_is_removed_by_gc(): """Unreferenced temporary files should be removed from the filesystem""" import os, tempfile, weakref, gc tf = tempfile.NamedTemporaryFile(dir=".") wf = weakref.ref(tf.file) try: fname = tf.name del tf gc.collect() if os.path.exists(fname): raise AssertionError( "Temporary file not removed on deletion") except: f = wf() if f is not None: f.close() raise Both those tests are from my mini-suite[4] of issues I've needed to workaround. The underlying problem is in Src\IronPython.Modules\nt.cs here: public static object fdopen(CodeContext/*!*/ context, int fd, string mode, int bufsize) { // check for a valid file mode... PythonFile.ValidateMode(mode); PythonContext pythonContext = PythonContext.GetContext(context); PythonFile pf = pythonContext.FileManager.GetFileFromId(pythonContext, fd); return pf; } A change like this should prevent the file from being kept alive: PythonFile pf = pythonContext.FileManager.GetFileFromId(pythonContext, fd); + pythonContext.FileManager.Remove(pf); return pf; However, will that trip the following assertion? Some code might rely on this. f = os.fdopen(fd) assert fd == f.fileno() A better fix would be something like: PythonFile pf = pythonContext.FileManager.GetFileFromId(pythonContext, fd); + pythonContext.FileManager.Weaken(fd); return pf; That needs some new methods in the underlying mappings to turn the strong reference into a weak one though. There may be some code that does variations of the following: IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.3082 Type "help", "copyright", "credits" or "license" for more information. >>> import tempfile >>> for _ in range(4096): ... f = tempfile.NamedTemporaryFile() ... Traceback (most recent call last): File "C:\Program Files\IronPython 2.6\Lib\tempfile.py", line 444, in NamedTemporaryFile File "C:\Program Files\IronPython 2.6\Lib\tempfile.py", line 228, in _mkstemp_inner OSError: [Errno -2146233079] HybridMapping is full Which might still run into problems depending on how the GC operates, but isn't very likely. (I'd have posted this straight on the tracker rather than to list, but it doesn't seem to do wiki markup and having it eat spaces is rather deadly for example Python code). Martin [1]: http://lists.ironpython.com/pipermail/users-ironpython.com/2010-February/012116.html [2]: http://lists.ironpython.com/pipermail/users-ironpython.com/2009-October/011457.html [3]: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=23936 [4]: http://float.endofinternet.org/bazaar/simple/test_noncpython/test_noncpython.py From Shri.Borde at microsoft.com Thu Feb 18 20:50:33 2010 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 18 Feb 2010 19:50:33 +0000 Subject: [IronPython] clrtype: How to subclass ClrClass? In-Reply-To: <4B7D4083.9030607@bakalari.cz> References: <4B6D5057.50302@bakalari.cz> <4B6D5C18.600@voidspace.org.uk> <8E45365BECA665489F3CB8878A6C1B7D0C95ABD7@TK5EX14MBXC140.redmond.corp.microsoft.com> <4B7D4083.9030607@bakalari.cz> Message-ID: <6459203F8B1AF641995AE49D47FA51A703D734@TK5EX14MBXC134.redmond.corp.microsoft.com> Sorry, I have not, and unfortunately will not be able to get to it until next week. Please vote on http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26249 if you want to see it fixed in 2.6.1. Depending on the fix, it might have to wait until after 2.6.1 From: Lukas Cenovsky [mailto:cenovsky at bakalari.cz] Sent: Thursday, February 18, 2010 5:29 AM To: Shri Borde Subject: Re: [IronPython] clrtype: How to subclass ClrClass? Hello Shri, have you had chance to look at this bug? -- -- Luk?? Shri Borde wrote: It is a know bug. I can take a look next week. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, February 06, 2010 4:10 AM To: Discussion of IronPython Subject: Re: [IronPython] clrtype: How to subclass ClrClass? On 06/02/2010 11:19, Lukas Cenovsky wrote: Hi all, it looks like I cannot subclass a class based on ClrClass metaclass: IronPython 2.6 (2.6.10920.0) on .NET 2.0.50727.4927 Type "help", "copyright", "credits" or "license" for more information. import clr import clrtype class Product(object): ... __metaclass__ = clrtype.ClrClass ... p = Product() print "CLR type name: %s" % p.GetType().FullName CLR type name: Product class MyProduct(Product): ... pass ... Traceback (most recent call last): File "", line 1, in KeyError: The given key was not present in the dictionary. Is it a bug or am I doing something wrong? Thanks. Hehe, I ran into this a couple of days ago on Silverlight as well. All the best, Michael -- -- Luk?? _______________________________________________ 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 tristanz at gmail.com Thu Feb 18 20:54:10 2010 From: tristanz at gmail.com (Tristan Zajonc) Date: Thu, 18 Feb 2010 14:54:10 -0500 Subject: [IronPython] Internals documentation Message-ID: <94d1cdd21002181154r28cf3b14wce155a5fef2be93a@mail.gmail.com> Hi, I'm poking around the IronPython sources and am trying to understand how things works. I haven't found a good source of documentation that gives an overview of IronPython's internals, and how IronPython can be extended / modified. I'm looking for more details than are available in books like IronPython in Action, which really only cover the very basics. The best overview I have found is Dino's talk: http://us.pycon.org/2009/conference/schedule/event/86/ Are there any more reference documents that I can read to get up to speed on IronPython details. Many thanks, Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From drken567 at gmail.com Thu Feb 18 21:17:53 2010 From: drken567 at gmail.com (Ken MacDonald) Date: Thu, 18 Feb 2010 15:17:53 -0500 Subject: [IronPython] [Noob]Ironpython catching Windows 'destroy' message, and posting confirm dialog Message-ID: <3468cae11002181217x7333ae7fp835c2a3d54193a50@mail.gmail.com> Hi, Real new (since yesterday) to IronPython. I've just inherited a project in I-P/XAML/.NET and a big bug list to go with it. In our main app, we display a "Close" button; clicking it brings up a confirmation dialog and exits the app only if user clicks "yes, I want to quit". We'd like to have the same behavior if the user clicks the 'Windows close' ("X" in the top right corner). I've found examples that supposedly do this in other languages, but they don't seem to translate to Python readily. Anyone know how to do this successfully in I-P? Thanks, Ken -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu Feb 18 21:24:07 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 18 Feb 2010 20:24:07 +0000 Subject: [IronPython] Internals documentation In-Reply-To: <94d1cdd21002181154r28cf3b14wce155a5fef2be93a@mail.gmail.com> References: <94d1cdd21002181154r28cf3b14wce155a5fef2be93a@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD39312DDC@TK5EX14MBXC116.redmond.corp.microsoft.com> For the DLR side of things you might find the DLR discussions to be useful: http://dlr.codeplex.com/Thread/List.aspx This post to the mailing list might also be useful - it covers implementing new modules in .NET for IronPython: http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011729.html That documentation will be included in IronPython once we start including the Python docs + IronPython specific documentation (could be 2.6.1 or 2.6.2). There's also some useful (although fairly low-level and detailed) information up here: http://ironpython.codeplex.com/wikipage?title=More%20Information such as the exception model and information on value types. If there's something specific that you'd think helpful let us know - I can probably work to write something up and incorporate it into some documentation. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tristan Zajonc Sent: Thursday, February 18, 2010 11:54 AM To: users at lists.ironpython.com Subject: [IronPython] Internals documentation Hi, I'm poking around the IronPython sources and am trying to understand how things works. I haven't found a good source of documentation that gives an overview of IronPython's internals, and how IronPython can be extended / modified. I'm looking for more details than are available in books like IronPython in Action, which really only cover the very basics. The best overview I have found is Dino's talk: http://us.pycon.org/2009/conference/schedule/event/86/ Are there any more reference documents that I can read to get up to speed on IronPython details. Many thanks, Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu Feb 18 21:25:29 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 18 Feb 2010 20:25:29 +0000 Subject: [IronPython] [Noob]Ironpython catching Windows 'destroy' message, and posting confirm dialog In-Reply-To: <3468cae11002181217x7333ae7fp835c2a3d54193a50@mail.gmail.com> References: <3468cae11002181217x7333ae7fp835c2a3d54193a50@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD39312DFB@TK5EX14MBXC116.redmond.corp.microsoft.com> I assume there's just some event handler that you can hook up to a Python function. If you post the C# or VB code someone here can probably quickly translate it to IronPython. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ken MacDonald Sent: Thursday, February 18, 2010 12:18 PM To: users at lists.ironpython.com Subject: [IronPython] [Noob]Ironpython catching Windows 'destroy' message, and posting confirm dialog Hi, Real new (since yesterday) to IronPython. I've just inherited a project in I-P/XAML/.NET and a big bug list to go with it. In our main app, we display a "Close" button; clicking it brings up a confirmation dialog and exits the app only if user clicks "yes, I want to quit". We'd like to have the same behavior if the user clicks the 'Windows close' ("X" in the top right corner). I've found examples that supposedly do this in other languages, but they don't seem to translate to Python readily. Anyone know how to do this successfully in I-P? Thanks, Ken -------------- next part -------------- An HTML attachment was scrubbed... URL: From drken567 at gmail.com Thu Feb 18 21:59:26 2010 From: drken567 at gmail.com (Ken MacDonald) Date: Thu, 18 Feb 2010 15:59:26 -0500 Subject: [IronPython] [Noob]Ironpython catching Windows 'destroy' message, and posting confirm dialog In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39312DFB@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <3468cae11002181217x7333ae7fp835c2a3d54193a50@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD39312DFB@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <3468cae11002181259p774c8938pa498b05bbcda57b2@mail.gmail.com> Thanks Dino, http://blogs.msdn.com/nickkramer/default.aspx?p=4 I found an example in the above blog, describing catching the WM_DESTROY event; page down to the article titled: Subclassing Window's WndProcThe handler for our WPF 'Close' button looks like this: def close_button_click(self, sender, args): """ Click handler for close button. Close the app. """ if confirm_message( \ "Are you sure you want to exit %s?" % TITLE): if app_state.patron_menu_meal: try: app_state.patron_menu_meal.save() except model.TallyException as e: message_box("Can't Save Changes: %s" % e.message) else: self.check_print_before_close(False) app_state.patron_menu_meal.release_lock() self._w.Close() Any clues for trapping the DESTROY in IronPython and routing it to our 'close' handler much appreciated... Thanks, Ken On Thu, Feb 18, 2010 at 3:25 PM, Dino Viehland wrote: > I assume there?s just some event handler that you can hook up to a Python > function. If you post the C# or VB code someone here can probably quickly > translate it to IronPython. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Ken MacDonald > *Sent:* Thursday, February 18, 2010 12:18 PM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] [Noob]Ironpython catching Windows 'destroy' > message, and posting confirm dialog > > > > Hi, > Real new (since yesterday) to IronPython. I've just inherited a project in > I-P/XAML/.NET and a big bug list to go with it. In our main app, we display > a > "Close" button; clicking it brings up a confirmation dialog and exits the > app only if user clicks "yes, I want to quit". We'd like to have the same > behavior if the user clicks the 'Windows close' ("X" in the top right > corner). I've found examples that supposedly do this in other languages, but > they don't seem to translate to Python readily. Anyone know how to do this > successfully in I-P? > Thanks, > Ken > > _______________________________________________ > 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 Feb 18 22:07:49 2010 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 18 Feb 2010 13:07:49 -0800 Subject: [IronPython] [Noob]Ironpython catching Windows 'destroy' message, and posting confirm dialog In-Reply-To: <3468cae11002181259p774c8938pa498b05bbcda57b2@mail.gmail.com> References: <3468cae11002181217x7333ae7fp835c2a3d54193a50@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD39312DFB@TK5EX14MBXC116.redmond.corp.microsoft.com> <3468cae11002181259p774c8938pa498b05bbcda57b2@mail.gmail.com> Message-ID: Anything that talks about "window messages" or "subclassing" is pretty-much incompatible with WPF. What you really want to do is handle the Closing event on the WPF Window object. This will give you the opportunity to cancel. On Thu, Feb 18, 2010 at 12:59 PM, Ken MacDonald wrote: > Thanks Dino, > http://blogs.msdn.com/nickkramer/default.aspx?p=4 > > I found an example in the above blog, describing catching the WM_DESTROY > event; page down to the article titled: > Subclassing Window's WndProcThe > handler for our WPF 'Close' button looks like this: > > def close_button_click(self, sender, args): > """ Click handler for close button. > > Close the app. > """ > if confirm_message( \ > "Are you sure you want to exit %s?" % TITLE): > > if app_state.patron_menu_meal: > try: > app_state.patron_menu_meal.save() > except model.TallyException as e: > message_box("Can't Save Changes: %s" % e.message) > else: > self.check_print_before_close(False) > > app_state.patron_menu_meal.release_lock() > > self._w.Close() > > > Any clues for trapping the DESTROY in IronPython and routing it to our > 'close' handler much appreciated... > Thanks, > Ken > > On Thu, Feb 18, 2010 at 3:25 PM, Dino Viehland wrote: > >> I assume there?s just some event handler that you can hook up to a >> Python function. If you post the C# or VB code someone here can probably >> quickly translate it to IronPython. >> >> >> >> *From:* users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Ken MacDonald >> *Sent:* Thursday, February 18, 2010 12:18 PM >> *To:* users at lists.ironpython.com >> *Subject:* [IronPython] [Noob]Ironpython catching Windows 'destroy' >> message, and posting confirm dialog >> >> >> >> Hi, >> Real new (since yesterday) to IronPython. I've just inherited a project in >> I-P/XAML/.NET and a big bug list to go with it. In our main app, we display >> a >> "Close" button; clicking it brings up a confirmation dialog and exits the >> app only if user clicks "yes, I want to quit". We'd like to have the same >> behavior if the user clicks the 'Windows close' ("X" in the top right >> corner). I've found examples that supposedly do this in other languages, but >> they don't seem to translate to Python readily. Anyone know how to do this >> successfully in I-P? >> Thanks, >> Ken >> >> _______________________________________________ >> 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 tristanz at gmail.com Thu Feb 18 22:54:53 2010 From: tristanz at gmail.com (Tristan Zajonc) Date: Thu, 18 Feb 2010 16:54:53 -0500 Subject: [IronPython] Internals documentation In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39312DDC@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <94d1cdd21002181154r28cf3b14wce155a5fef2be93a@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD39312DDC@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <94d1cdd21002181354i73411468sbfd48047ded571e7@mail.gmail.com> Dino - Thanks, those links are helpful. Can I ask how you plan to merge the IronPython and Python documentation? In terms of using IronPython as a DSL for a specific application, this is an area I've been wondering about. Pointing users to the official CPython docs doesn't provide the nicest experience for users who aren't interested in the difference between CPython and IronPython and just want to program within an application (resolver one, say). Perhaps it's unavoidable. In terms of internals documentation. Obviously a detailed discussion of programming Python modules would be nice (your links help here). Perhaps including a discussion of how to write a library that gives a first class experience in both IronPython and the CLR languages. When should I write a wrapper in Python vs. use attributes, etc, and stay in C# completely? I'd also be interested in examples of adding new language constructs to IronPython. While perhaps not something you want to encourage, IronPython is appealing as base language for DSLs and showing examples of adding new language features would also show how IronPython works internally. Examples include adding new infix operators (PEP 225 or 211, say) or showing how to implement the with statement. Tristan On Thu, Feb 18, 2010 at 3:24 PM, Dino Viehland wrote: > For the DLR side of things you might find the DLR discussions to be > useful: http://dlr.codeplex.com/Thread/List.aspx > > > > This post to the mailing list might also be useful ? it covers implementing > new modules in .NET for IronPython: > http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011729.html > That documentation will be included in IronPython once we start including > the Python docs + IronPython specific documentation (could be 2.6.1 or > 2.6.2). > > > > There?s also some useful (although fairly low-level and detailed) > information up here: > http://ironpython.codeplex.com/wikipage?title=More%20Information such as > the exception model and information on value types. > > > > If there?s something specific that you?d think helpful let us know ? I can > probably work to write something up and incorporate it into some > documentation. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Tristan Zajonc > *Sent:* Thursday, February 18, 2010 11:54 AM > > *To:* users at lists.ironpython.com > *Subject:* [IronPython] Internals documentation > > > > Hi, > > > > I'm poking around the IronPython sources and am trying to understand how > things works. I haven't found a good source of documentation that gives an > overview of IronPython's internals, and how IronPython can be extended / > modified. I'm looking for more details than are available in books like > IronPython in Action, which really only cover the very basics. The best > overview I have found is Dino's talk: > > > > http://us.pycon.org/2009/conference/schedule/event/86/ > > > > Are there any more reference documents that I can read to get up to speed > on IronPython details. > > > > Many thanks, > > Tristan > > _______________________________________________ > 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 drken567 at gmail.com Thu Feb 18 22:54:53 2010 From: drken567 at gmail.com (Ken MacDonald) Date: Thu, 18 Feb 2010 16:54:53 -0500 Subject: [IronPython] [Noob]Ironpython catching Windows 'destroy' message, and posting confirm dialog In-Reply-To: References: <3468cae11002181217x7333ae7fp835c2a3d54193a50@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD39312DFB@TK5EX14MBXC116.redmond.corp.microsoft.com> <3468cae11002181259p774c8938pa498b05bbcda57b2@mail.gmail.com> Message-ID: <3468cae11002181354g22a96a50te85908c7bc1713e9@mail.gmail.com> Thanks, Curt! That looks interesting; I found a pretty explicit article on how the 'Closing' event works at: http://msdn.microsoft.com/en-us/library/ms748948.aspx (about 1/2 way down the page). It looks like an event handler similar to mine could be used to cancel the 'Closing' event and preserve the window, but I haven't been able to determine how to attach the event handler to my window in IronPython. Would I be doing something like: mywindow.Closing += myCloseHandler to get the handler to catch the Closing event? Thanks, Ken Anything that talks about "window messages" or "subclassing" is pretty-much > incompatible with WPF. > > What you really want to do is handle the Closing event on the WPF Window > object. This will give you the opportunity to cancel. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Feb 19 00:01:32 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 18 Feb 2010 23:01:32 +0000 Subject: [IronPython] [Noob]Ironpython catching Windows 'destroy' message, and posting confirm dialog In-Reply-To: <3468cae11002181354g22a96a50te85908c7bc1713e9@mail.gmail.com> References: <3468cae11002181217x7333ae7fp835c2a3d54193a50@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD39312DFB@TK5EX14MBXC116.redmond.corp.microsoft.com> <3468cae11002181259p774c8938pa498b05bbcda57b2@mail.gmail.com> <3468cae11002181354g22a96a50te85908c7bc1713e9@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD39313BEB@TK5EX14MBXC116.redmond.corp.microsoft.com> Yep, mywindow.Closing += myCloseHandler should work just fine. You might need to do call the event handler type if the conversion type doesn't automatically happen (but I think the conversion will happen automatically). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ken MacDonald Sent: Thursday, February 18, 2010 1:55 PM To: Discussion of IronPython Subject: Re: [IronPython] [Noob]Ironpython catching Windows 'destroy' message, and posting confirm dialog Thanks, Curt! That looks interesting; I found a pretty explicit article on how the 'Closing' event works at: http://msdn.microsoft.com/en-us/library/ms748948.aspx (about 1/2 way down the page). It looks like an event handler similar to mine could be used to cancel the 'Closing' event and preserve the window, but I haven't been able to determine how to attach the event handler to my window in IronPython. Would I be doing something like: mywindow.Closing += myCloseHandler to get the handler to catch the Closing event? Thanks, Ken Anything that talks about "window messages" or "subclassing" is pretty-much incompatible with WPF. What you really want to do is handle the Closing event on the WPF Window object. This will give you the opportunity to cancel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.turpin at gmail.com Fri Feb 19 04:16:08 2010 From: alex.turpin at gmail.com (Alex Turpin) Date: Thu, 18 Feb 2010 22:16:08 -0500 Subject: [IronPython] Don't execute files containing errors? Message-ID: <562af4a51002181916j15ae9170g16a090140d5e5ae9@mail.gmail.com> Hey all, I am currently embedding IronPython in a C# app of mine. I need to execute external script files, but to also be able to only executes the ones that will be error free. Here is an example script: a = "This is a test" print undefinedVariable b = "This is another test" If I execute this script, it will halt on line 1 and thus only executing half of it. This can be extremely confusing since declaring the variable "a" will have worked, but not "b". I am using PythonEngine.CreateScriptSourceFromFile. Is there any way to check if a script contains errors before executing it, or at the very least reverting the changes it made? Thanks. From davidjensen at usa.net Fri Feb 19 12:16:57 2010 From: davidjensen at usa.net (David Jensen) Date: Fri, 19 Feb 2010 06:16:57 -0500 Subject: [IronPython] autocompletion in silverlight Message-ID: <488oBsLP61816S10.1266578217@cmsweb10.cms.usa.net> I would like auto completion for ironpython, similar to autocompletion in Idle. How can this be done? I particularly want it for Silverlight. From davidjensen at usa.net Fri Feb 19 14:04:37 2010 From: davidjensen at usa.net (David Jensen) Date: Fri, 19 Feb 2010 08:04:37 -0500 Subject: [IronPython] autocompletion, silverlight 2 Message-ID: <075oBsNDl5502S01.1266584677@cmsweb01.cms.usa.net> I just ran into silvershell, and I have not tried it yet. I looks like it has all the autocompletion that Idle has. I am wondering why no work has been done on it for one year. It is a tremendous idea. Google has a browser shell for app engine, but it does not have autocompletion, as far as I know. Also, the interpreter should reside in memory. Many applications will suffer from trips to the server. I am hoping Silverlight/ironpython is the answer to people who wanted to do browser scripting in python, not javascript. Apparently, Silverlight is now installed on 50 percent of computers. I would try to help with silvershell, but I am somewhat busy. From curt at hagenlocher.org Fri Feb 19 14:38:10 2010 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 19 Feb 2010 05:38:10 -0800 Subject: [IronPython] Don't execute files containing errors? In-Reply-To: <562af4a51002181916j15ae9170g16a090140d5e5ae9@mail.gmail.com> References: <562af4a51002181916j15ae9170g16a090140d5e5ae9@mail.gmail.com> Message-ID: The short answer is "no, that's not possible". This is effectively a version of the halting problem ( http://en.wikipedia.org/wiki/Halting_problem). For an arbitrary script, you can check its syntax for correctness without executing fairly easily. Other errors are potentially detectable as long as the user refrains from using certain programming constructs. In your example below, you might be able to demonstrate that "undefinedVariable" was uninitialized. But the same test would probably also come to that conclusion in the following code: a = "This is a test" exec "undef" + "inedVariables"[:-1] + ' = 10' print undefinedVariable b = "This is another test" As for rolling back changes, you could run the script into a temporary scope if you knew that you were only setting variables. If it succeeds, then run it into a "real" scope. The problem is that an arbitrary script can have side effects. Consider the following short script: import sys sys.path = [] To protect against that, you effectively need a full sandbox to run code against. On Thu, Feb 18, 2010 at 7:16 PM, Alex Turpin wrote: > Hey all, > > I am currently embedding IronPython in a C# app of mine. I need to > execute external script files, but to also be able to only executes > the ones that will be error free. Here is an example script: > > a = "This is a test" > print undefinedVariable > b = "This is another test" > > If I execute this script, it will halt on line 1 and thus only > executing half of it. This can be extremely confusing since declaring > the variable "a" will have worked, but not "b". I am using > PythonEngine.CreateScriptSourceFromFile. > > Is there any way to check if a script contains errors before executing > it, or at the very least reverting the changes it made? > > Thanks. > _______________________________________________ > 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 alex.turpin at gmail.com Fri Feb 19 14:54:30 2010 From: alex.turpin at gmail.com (Alex Turpin) Date: Fri, 19 Feb 2010 08:54:30 -0500 Subject: [IronPython] Don't execute files containing errors? In-Reply-To: References: <562af4a51002181916j15ae9170g16a090140d5e5ae9@mail.gmail.com> Message-ID: <562af4a51002190554n7e77cedcl709549e0baa3f52e@mail.gmail.com> Aight, thanks a lot for your answer! On Feb 19, 2010 8:38 AM, "Curt Hagenlocher" wrote: The short answer is "no, that's not possible". This is effectively a version of the halting problem ( http://en.wikipedia.org/wiki/Halting_problem). For an arbitrary script, you can check its syntax for correctness without executing fairly easily. Other errors are potentially detectable as long as the user refrains from using certain programming constructs. In your example below, you might be able to demonstrate that "undefinedVariable" was uninitialized. But the same test would probably also come to that conclusion in the following code: a = "This is a test" exec "undef" + "inedVariables"[:-1] + ' = 10' print undefinedVariable b = "This is another test" As for rolling back changes, you could run the script into a temporary scope if you knew that you were only setting variables. If it succeeds, then run it into a "real" scope. The problem is that an arbitrary script can have side effects. Consider the following short script: import sys sys.path = [] To protect against that, you effectively need a full sandbox to run code against. On Thu, Feb 18, 2010 at 7:16 PM, Alex Turpin wrote: > > > Hey all, > > I am currently embedding IronPython in a C# app of mine. I > need to > execute extern... > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Fri Feb 19 15:14:02 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 19 Feb 2010 09:14:02 -0500 Subject: [IronPython] autocompletion, silverlight 2 In-Reply-To: <075oBsNDl5502S01.1266584677@cmsweb01.cms.usa.net> References: <075oBsNDl5502S01.1266584677@cmsweb01.cms.usa.net> Message-ID: <4B7E9CAA.9020206@voidspace.org.uk> On 19/02/2010 08:04, David Jensen wrote: > I just ran into silvershell, and I have not tried it yet. I looks like it has > all the autocompletion that Idle has. I am wondering why no work has been done > on it for one year. It is a tremendous idea. Google has a browser shell for > app engine, but it does not have autocompletion, as far as I know. Also, the > interpreter should reside in memory. Many applications will suffer from trips > to the server. I am hoping Silverlight/ironpython is the answer to people who > wanted to do browser scripting in python, not javascript. Apparently, > Silverlight is now installed on 50 percent of computers. I would try to help > with silvershell, but I am somewhat busy. > > The reason that Silvershell hasn't been worked on is because all the people interested are somewhat busy... :-) Michael > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ From fuzzyman at voidspace.org.uk Fri Feb 19 15:17:12 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 19 Feb 2010 09:17:12 -0500 Subject: [IronPython] autocompletion, silverlight 2 In-Reply-To: <075oBsNDl5502S01.1266584677@cmsweb01.cms.usa.net> References: <075oBsNDl5502S01.1266584677@cmsweb01.cms.usa.net> Message-ID: <4B7E9D68.5090900@voidspace.org.uk> On 19/02/2010 08:04, David Jensen wrote: > I just ran into silvershell, and I have not tried it yet. I looks like it has > all the autocompletion that Idle has. I am wondering why no work has been done > on it for one year. It is a tremendous idea. Google has a browser shell for > app engine, but it does not have autocompletion, as far as I know. Also, the > interpreter should reside in memory. Many applications will suffer from trips > to the server. I am hoping Silverlight/ironpython is the answer to people who > wanted to do browser scripting in python, not javascript. Apparently, > Silverlight is now installed on 50 percent of computers. I would try to help > with silvershell, but I am somewhat busy. > > The reason that Silvershell hasn't been worked on is because all the people interested are somewhat busy... :-) Michael > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ From Wolfram.Stanger at kratzer-automation.com Fri Feb 19 18:16:03 2010 From: Wolfram.Stanger at kratzer-automation.com (Stanger, Wolfram) Date: Fri, 19 Feb 2010 18:16:03 +0100 Subject: [IronPython] IronPython 2.6[.1]: UI Automation: Wrong values for ControlType, AutomationElementID and more. Message-ID: <279FB2C5A55A4A4DBAD10C001903701C07636F4C@server-b.kratzer.lan> Hello to all, over many years I have forced to implement a test automation scenerie in our company. Now they will do it and - who hat thougth that - I've got the job! And I had to bring the job to success! My Environment: ------------------------ I've succesfully presented a test automation solution only build from Internet-Software. It includes: Keyword-Driven Tables in HTML (done with Winword) ! Python 2.6 ! Robot-Framework ! ! ApplTestlib.py SeleniumLibrary ! ! pyWinAuto WEB-AppToTest ! WIN32-AppToTest Later we will embed the solution in a QAtrac process. Now it's time to test automate GUIs build from Windows-Forms and WPF too. First I switched Python 2.6 to IronPython 2.6[and 2.6.1 RC1] and got only one, but 'very magic', bug in Robot-Framework when creating the HTML-Report-File. Second I'm switched the pyWinAuto-Layer to Miscrosoft UI Automation (.NET >= 3.0) to support all GUI-Frameworks (WIN32, WINFORMS and WPF) I. In IronPython all UI Automation values ControlTypePropertys (w/o the window itself) where Type 'panel'. Other values are also not the same as you can see with UISpy or UIA Verify (Tool from Codeplex 'white'-Project). The AutomationIDs has the values from NativeWindowHandles (unique - but never the same from run to run!). Only the NamePropertys are OK but often empty (when control has no text content yet). II. All Controls in the window title (titlebar, menubar, menuitems, and min-, max- and close-Button) where completely hidden in Automation-Tree (I've tested with Raw-, Control- and ContentViews)! These eight controls are from IronPython-UI Automation not reachable. This may be a consequence from point I. above. In this situation it's unpossible for me to identify Controls in the application to automate! I have found, I run in exactly the same problems witch where reported from Jozef in November 2009: http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November /011583.html and heself stated a own solution in http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November /011630.html The solution reads: 'Thanks for your response. Solution to my problem is to first instantiate AutomationElement from dll, not from IronPython. Then all subsequent AutomationElement retrieved from IronPython looks ok.' About 30 years I have programmed in ANSI-C (Same SW on Windows,VMS, Linux, etc.) but now being a newbie to C#, .NET and Python. Therefore I should have an (syntax-)example for the expression: 'to first instantiate AutomationElement from dll' Witch DLL (Own written, .NET-DLL. ??) How to instantiate in C#? How to transport the AutomationElement to IronPython? The best will be if jozef.a... will give me some example lines of code from his solution in nov 2009 in C# and/or Python. Thanks. Greetings Wolfram -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffrey at extremeoptimization.com Fri Feb 19 18:17:18 2010 From: jeffrey at extremeoptimization.com (Jeffrey Sax) Date: Fri, 19 Feb 2010 12:17:18 -0500 Subject: [IronPython] Asymmetry in binary binding In-Reply-To: <562af4a51002181916j15ae9170g16a090140d5e5ae9@mail.gmail.com> References: <562af4a51002181916j15ae9170g16a090140d5e5ae9@mail.gmail.com> Message-ID: <00f301cab187$649b2170$2dd16450$@com> Hi, I have the following C# code: public class MyObject : IDynamicMetaObjectProvider { int value; public MyObject(int value) { this.value = value; } static public int operator *(int left, MyObject right) { return left * right.value; } static public int operator *(MyObject left, int right) { return left.value * right; } DynamicMetaObject IDynamicMetaObjectProvider.GetMetaObject(Expression parameter) { return new MyMetaObject(parameter, this); } class MyMetaObject : DynamicMetaObject { public MyMetaObject(Expression parameter, MyObject value) : base(parameter, BindingRestrictions.Empty, value) { } public override DynamicMetaObject BindBinaryOperation( BinaryOperationBinder binder, DynamicMetaObject arg) { Console.WriteLine("Binding: {0}", binder.Operation.ToString()); return base.BindBinaryOperation(binder, arg); } } } In IPy: >>> c = MyObject(10) >>> 5*c 50 >>> c*5 Binding: Multiply 50 So, MyObject's custom binding logic is only invoked if it is the left operand of a binary operation. This asymmetric behavior doesn't seem right: I expected MyMetaObject's binder to be called in both cases. I realize that this would have its own issues. For example: which bind method has precedence if the left and right operands both implement IDMOP? (You could come up with a mechanism similar to method call overload resolution.) Is there a way with the current DLR to still get MyObject's binder to be invoked if it's the right operand? Thanks, Jeffrey From justin.hartman at gmail.com Fri Feb 19 20:09:07 2010 From: justin.hartman at gmail.com (Justin Hartman) Date: Fri, 19 Feb 2010 14:09:07 -0500 Subject: [IronPython] Using a C# class in IronPython In-Reply-To: <294f1ba41002170658t7c8f590bk8ecb95547379efc2@mail.gmail.com> References: <294f1ba41002170658t7c8f590bk8ecb95547379efc2@mail.gmail.com> Message-ID: Thanks, Mark. That's all really good stuff, and essentially we are already doing the same things in our app. Where the problem comes in for me (I've narrowed it down a little bit) is that the IronPython binding code looks for a method called "SetMember" when I attempt to set an attribute. My class happens to have multiple overridden SetMember methods (which have nothing to do with Python, but make sense in my application domain), which causes Type.GetMethod() to throw an exception. I logged an issue in CodePlex (Item #26277: CLR class with overridden SetMember method causes "Ambiguous match found"); you can take a look if you want to see the whole issue and how to repro. On Wed, Feb 17, 2010 at 9:58 AM, Mark Grice wrote: > I'm not sure if this helps, but I use a C# class in my IronPython, and it > works fine. > > Class is defined using the shorthand get; set; > > ie: > > public class ScreenTags > { > public String appWindowName { get; set; } > public String fieldName { get; set; } > public bool isDataField { get; set; } > public bool isManual { get; set; } > public String screenLabel { get; set; } > public String description { get; set; } > } > > (In actuality, it is a lot more than this, consisting of other classes, > methods, etc...) > > Now, it may be bad practice, but I then simply use an object reference in > Python, and assume it was instantiated. In other words, as far as Python > is concerned, there is an instantiated object of ScreenTags called "screen". > > Python simply calls this whenever it wants to do something: > > ie. screen. appWindowName = "ThisName" > > I create the screen object in my C# code, and then add it as a reference to > the python scope before I call the IronPython engine. So, on the C# side I: > > scptEngine = Python.CreateEngine(); > scptRuntime = scptEngine.Runtime; > scptScope = scptEngine.CreateScope(); > AddAssemblies(scptRuntime); // call if you need to > add other libraries, such as my class > > And before I actually call the Engine, I set the class in the Python scope > -- still in C#: > > ScreenTags SOA_screen = new ScreenTags(); > scptScope.SetVariable("screen", SOA_screen); > scptSource = > scptEngine.CreateScriptSourceFromFile(scriptFile); // scriptFile is Python > code > scptSource.Execute(scptScope); > > This is working fine. The class is actually really a loaded class, and it > has all kind of goodies in it (ie pop up Windows forms, calls out to > unmanaged code... all sorts of stuff). I never have a problem with any of > it. > > I don't know if this helps (or even if it is good practice!) but it is > working here. > > > > _______________________________________________ > 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 ddicato at microsoft.com Fri Feb 19 21:30:58 2010 From: ddicato at microsoft.com (David DiCato) Date: Fri, 19 Feb 2010 20:30:58 +0000 Subject: [IronPython] Using a C# class in IronPython In-Reply-To: References: <294f1ba41002170658t7c8f590bk8ecb95547379efc2@mail.gmail.com> Message-ID: Hi Justin, this is definitely a valid bug; thanks for reporting it. We?re supposed to ignore any methods named GetMember/SetMember/DeleteMember unless they define the [SpecialName] attribute, but we fail to account for cases where there could be overloads. This is because the default binder calls type.GetMethod("SetMember") which throws when there are multiple matches. We should instead get all methods named SetMember and filter out the non-special ones. I already have a preliminary fix for this, and it should make it onto CodePlex within a few days. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Justin Hartman Sent: Friday, February 19, 2010 11:09 AM To: Discussion of IronPython Subject: Re: [IronPython] Using a C# class in IronPython Thanks, Mark. That's all really good stuff, and essentially we are already doing the same things in our app. Where the problem comes in for me (I've narrowed it down a little bit) is that the IronPython binding code looks for a method called "SetMember" when I attempt to set an attribute. My class happens to have multiple overridden SetMember methods (which have nothing to do with Python, but make sense in my application domain), which causes Type.GetMethod() to throw an exception. I logged an issue in CodePlex (Item #26277: CLR class with overridden SetMember method causes "Ambiguous match found"); you can take a look if you want to see the whole issue and how to repro. On Wed, Feb 17, 2010 at 9:58 AM, Mark Grice > wrote: I'm not sure if this helps, but I use a C# class in my IronPython, and it works fine. Class is defined using the shorthand get; set; ie: public class ScreenTags { public String appWindowName { get; set; } public String fieldName { get; set; } public bool isDataField { get; set; } public bool isManual { get; set; } public String screenLabel { get; set; } public String description { get; set; } } (In actuality, it is a lot more than this, consisting of other classes, methods, etc...) Now, it may be bad practice, but I then simply use an object reference in Python, and assume it was instantiated. In other words, as far as Python is concerned, there is an instantiated object of ScreenTags called "screen". Python simply calls this whenever it wants to do something: ie. screen. appWindowName = "ThisName" I create the screen object in my C# code, and then add it as a reference to the python scope before I call the IronPython engine. So, on the C# side I: scptEngine = Python.CreateEngine(); scptRuntime = scptEngine.Runtime; scptScope = scptEngine.CreateScope(); AddAssemblies(scptRuntime); // call if you need to add other libraries, such as my class And before I actually call the Engine, I set the class in the Python scope -- still in C#: ScreenTags SOA_screen = new ScreenTags(); scptScope.SetVariable("screen", SOA_screen); scptSource = scptEngine.CreateScriptSourceFromFile(scriptFile); // scriptFile is Python code scptSource.Execute(scptScope); This is working fine. The class is actually really a loaded class, and it has all kind of goodies in it (ie pop up Windows forms, calls out to unmanaged code... all sorts of stuff). I never have a problem with any of it. I don't know if this helps (or even if it is good practice!) but it is working here. _______________________________________________ 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 Fri Feb 19 21:07:04 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 19 Feb 2010 20:07:04 +0000 Subject: [IronPython] Asymmetry in binary binding In-Reply-To: <00f301cab187$649b2170$2dd16450$@com> References: <562af4a51002181916j15ae9170g16a090140d5e5ae9@mail.gmail.com> <00f301cab187$649b2170$2dd16450$@com> Message-ID: <1A472770E042064698CB5ADC83A12ACD3931A833@TK5EX14MBXC116.redmond.corp.microsoft.com> There's no general way to be ensure the RHS will be invoked for a binding in particular due to the issues you've come up with. It's also problematic for IronPython to ask the RHS to do the binding when the LHS is not an IDMOP because the operations may not be symmetric. Really we'll need to add some new operations to the DLR to support this (e.g. a BindReverseBinaryOperation or something along those lines). But we didn't get to that for DLR v1 - maybe we can do it for the next version and we can add some interfaces to the DLR outer layer to try it out in the mean time. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Jeffrey Sax > Sent: Friday, February 19, 2010 9:17 AM > To: 'Discussion of IronPython' > Subject: [IronPython] Asymmetry in binary binding > > Hi, > > I have the following C# code: > > public class MyObject : IDynamicMetaObjectProvider { > int value; > public MyObject(int value) { this.value = value; } > static public int operator *(int left, MyObject right) { return > left * > right.value; } > static public int operator *(MyObject left, int right) { return > left.value * right; } > DynamicMetaObject > IDynamicMetaObjectProvider.GetMetaObject(Expression > parameter) { > return new MyMetaObject(parameter, this); > } > > class MyMetaObject : DynamicMetaObject { > public MyMetaObject(Expression parameter, MyObject value) > : base(parameter, BindingRestrictions.Empty, value) { } > public override DynamicMetaObject BindBinaryOperation( > BinaryOperationBinder binder, DynamicMetaObject arg) { > Console.WriteLine("Binding: {0}", > binder.Operation.ToString()); > return base.BindBinaryOperation(binder, arg); > } > } > } > > In IPy: > >>> c = MyObject(10) > >>> 5*c > 50 > >>> c*5 > Binding: Multiply > 50 > > So, MyObject's custom binding logic is only invoked if it is the left > operand of a binary operation. This asymmetric behavior doesn't seem > right: > I expected MyMetaObject's binder to be called in both cases. > > I realize that this would have its own issues. For example: which bind > method has precedence if the left and right operands both implement > IDMOP? > (You could come up with a mechanism similar to method call overload > resolution.) > > Is there a way with the current DLR to still get MyObject's binder to > be > invoked if it's the right operand? > > Thanks, > Jeffrey > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Fri Feb 19 22:42:27 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 19 Feb 2010 21:42:27 +0000 Subject: [IronPython] Internals documentation In-Reply-To: <94d1cdd21002181354i73411468sbfd48047ded571e7@mail.gmail.com> References: <94d1cdd21002181154r28cf3b14wce155a5fef2be93a@mail.gmail.com> <1A472770E042064698CB5ADC83A12ACD39312DDC@TK5EX14MBXC116.redmond.corp.microsoft.com> <94d1cdd21002181354i73411468sbfd48047ded571e7@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD3931B514@TK5EX14MBXC116.redmond.corp.microsoft.com> We're picking up the RST files that IronPython documentation is based upon. We have a tree structure which currently includes the unmodified docs and a modified version which is updated w/ new IronPython specific content and tweaks to some of the existing content where things differ. We can then do a 3-way merge to bring in updates to the documentation. I've created a place holder bug for tracking misc. improvements to the documentation so your suggestions don't get lost (http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26256). Interestingly if you're at PyCon there will be an open space session tomorrow at 8 which the Jython developers have setup talking about implementation details. I'll be there for talking about the IronPython side of things. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tristan Zajonc Sent: Thursday, February 18, 2010 1:55 PM To: Discussion of IronPython Subject: Re: [IronPython] Internals documentation Dino - Thanks, those links are helpful. Can I ask how you plan to merge the IronPython and Python documentation? In terms of using IronPython as a DSL for a specific application, this is an area I've been wondering about. Pointing users to the official CPython docs doesn't provide the nicest experience for users who aren't interested in the difference between CPython and IronPython and just want to program within an application (resolver one, say). Perhaps it's unavoidable. In terms of internals documentation. Obviously a detailed discussion of programming Python modules would be nice (your links help here). Perhaps including a discussion of how to write a library that gives a first class experience in both IronPython and the CLR languages. When should I write a wrapper in Python vs. use attributes, etc, and stay in C# completely? I'd also be interested in examples of adding new language constructs to IronPython. While perhaps not something you want to encourage, IronPython is appealing as base language for DSLs and showing examples of adding new language features would also show how IronPython works internally. Examples include adding new infix operators (PEP 225 or 211, say) or showing how to implement the with statement. Tristan On Thu, Feb 18, 2010 at 3:24 PM, Dino Viehland > wrote: For the DLR side of things you might find the DLR discussions to be useful: http://dlr.codeplex.com/Thread/List.aspx This post to the mailing list might also be useful - it covers implementing new modules in .NET for IronPython: http://lists.ironpython.com/pipermail/users-ironpython.com/2009-November/011729.html That documentation will be included in IronPython once we start including the Python docs + IronPython specific documentation (could be 2.6.1 or 2.6.2). There's also some useful (although fairly low-level and detailed) information up here: http://ironpython.codeplex.com/wikipage?title=More%20Information such as the exception model and information on value types. If there's something specific that you'd think helpful let us know - I can probably work to write something up and incorporate it into some documentation. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tristan Zajonc Sent: Thursday, February 18, 2010 11:54 AM To: users at lists.ironpython.com Subject: [IronPython] Internals documentation Hi, I'm poking around the IronPython sources and am trying to understand how things works. I haven't found a good source of documentation that gives an overview of IronPython's internals, and how IronPython can be extended / modified. I'm looking for more details than are available in books like IronPython in Action, which really only cover the very basics. The best overview I have found is Dino's talk: http://us.pycon.org/2009/conference/schedule/event/86/ Are there any more reference documents that I can read to get up to speed on IronPython details. Many thanks, Tristan _______________________________________________ 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 loocas at duber.cz Sat Feb 20 18:58:35 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Sat, 20 Feb 2010 18:58:35 +0100 Subject: [IronPython] Importing standard Python libs Message-ID: <4B8022CB.1070608@duber.cz> Hi there everyone, I'm having problems importing a module, concretely win32com, from within IronPython. The problem is, when I run IronPython as a console, and add a path to the standard Python26 library, the module can be imported without any problems, but as soon as I try to embed IronPython and call it from within my application and then try to import the module, even though I'd added the path to the sys.path prior to importing the module, it still throws an error saying: "No module named win32api". I don't know what to do now. I've tried to manually add all the sub-directories of the Lib direcotry from Python26. I tried to copy the module's files to IronPython Lib directory, but nothing worked. Thanks a lot in advance, cheers, -- Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe From cenovsky at bakalari.cz Sat Feb 20 19:20:52 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Sat, 20 Feb 2010 19:20:52 +0100 Subject: [IronPython] Importing standard Python libs In-Reply-To: <4B8022CB.1070608@duber.cz> References: <4B8022CB.1070608@duber.cz> Message-ID: <4B802804.5050606@bakalari.cz> Luk?? Dub?da wrote: > Hi there everyone, > > I'm having problems importing a module, concretely win32com, from within > IronPython. > > The problem is, when I run IronPython as a console, and add a path to > the standard Python26 library, the module can be imported without > any problems, but as soon as I try to embed IronPython and call > it from within my application and then try to import the module, > even though I'd added the path to the sys.path prior to > importing the module, it still throws an error saying: > "No module named win32api". > > I don't know what to do now. I've tried to manually add > all the sub-directories of the Lib direcotry from Python26. > I tried to copy the module's files to IronPython Lib directory, > but nothing worked. > > Thanks a lot in advance, cheers, I don't know why you can't import the win32com module but I would not use it at all. I would rather use the Win32 API directly from IronPython via clrtype and pinvoke or via C# stub. For C# stub example see my blog: http://gui-at.blogspot.com/2008/07/simulate-users-input.html -- -- Luk?? From loocas at duber.cz Sat Feb 20 20:35:41 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Sat, 20 Feb 2010 20:35:41 +0100 Subject: [IronPython] Importing standard Python libs In-Reply-To: <4B802804.5050606@bakalari.cz> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> Message-ID: <4B80398D.9050605@duber.cz> Hi Lukas, thanks for the tip, it actually never occured to me. I'm used to using the win32com module for communicating with an OLE server I established in a separate application. I'm tryint to send code in different language, native to the app., via this OLE bridge and for that I used to use win32com.client module and then I registered the app and its exposed methods. But now when I come to think of it, it might be a much better idea doing it via .NET. However, I have no idea where to start. :) Thanks again, much appretiated, Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe Lukas Cenovsky wrote: > Luk?? Dub?da wrote: >> Hi there everyone, >> >> I'm having problems importing a module, concretely win32com, from within >> IronPython. >> >> The problem is, when I run IronPython as a console, and add a path to >> the standard Python26 library, the module can be imported without >> any problems, but as soon as I try to embed IronPython and call >> it from within my application and then try to import the module, >> even though I'd added the path to the sys.path prior to >> importing the module, it still throws an error saying: >> "No module named win32api". >> >> I don't know what to do now. I've tried to manually add >> all the sub-directories of the Lib direcotry from Python26. >> I tried to copy the module's files to IronPython Lib directory, >> but nothing worked. >> >> Thanks a lot in advance, cheers, > > I don't know why you can't import the win32com module but I would not > use it at all. > > I would rather use the Win32 API directly from IronPython via clrtype > and pinvoke or via C# stub. For C# stub example see my blog: > http://gui-at.blogspot.com/2008/07/simulate-users-input.html > > -- > -- Luk?? > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From brian.curtin at gmail.com Sat Feb 20 20:38:38 2010 From: brian.curtin at gmail.com (Brian Curtin) Date: Sat, 20 Feb 2010 14:38:38 -0500 Subject: [IronPython] Importing standard Python libs In-Reply-To: <4B802804.5050606@bakalari.cz> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> Message-ID: On Sat, Feb 20, 2010 at 13:20, Lukas Cenovsky wrote: > Luk?? Dub?da wrote: > >> Hi there everyone, >> >> I'm having problems importing a module, concretely win32com, from within >> IronPython. >> >> The problem is, when I run IronPython as a console, and add a path to >> the standard Python26 library, the module can be imported without >> any problems, but as soon as I try to embed IronPython and call >> it from within my application and then try to import the module, >> even though I'd added the path to the sys.path prior to >> importing the module, it still throws an error saying: >> "No module named win32api". >> >> I don't know what to do now. I've tried to manually add >> all the sub-directories of the Lib direcotry from Python26. >> I tried to copy the module's files to IronPython Lib directory, >> but nothing worked. >> >> Thanks a lot in advance, cheers, >> > > I don't know why you can't import the win32com module but I would not use > it at all. > > I would rather use the Win32 API directly from IronPython via clrtype and > pinvoke or via C# stub. For C# stub example see my blog: > http://gui-at.blogspot.com/2008/07/simulate-users-input.html > > What's wrong with win32com/win32api...? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cenovsky at bakalari.cz Sat Feb 20 21:47:06 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Sat, 20 Feb 2010 21:47:06 +0100 Subject: [IronPython] Importing standard Python libs In-Reply-To: <4B80398D.9050605@duber.cz> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B80398D.9050605@duber.cz> Message-ID: <4B804A4A.5030101@bakalari.cz> Luk?? Dub?da wrote: > Hi Lukas, > > thanks for the tip, it actually never occured to me. > I'm used to using the win32com module for communicating > with an OLE server I established in a separate application. > > I'm tryint to send code in different language, native > to the app., via this OLE bridge and for that I used > to use win32com.client module and then I registered > the app and its exposed methods. > > But now when I come to think of it, it might be a much > better idea doing it via .NET. However, I have > no idea where to start. :) Check this page: http://www.ironpython.info/index.php/Contents#Interop -- -- Luk?? From cenovsky at bakalari.cz Sat Feb 20 21:53:51 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Sat, 20 Feb 2010 21:53:51 +0100 Subject: [IronPython] Importing standard Python libs In-Reply-To: References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> Message-ID: <4B804BDF.9080403@bakalari.cz> Brian Curtin wrote: > On Sat, Feb 20, 2010 at 13:20, Lukas Cenovsky > wrote: > > Luk?? Dub?da wrote: > > Hi there everyone, > > I'm having problems importing a module, concretely win32com, > from within > IronPython. > > The problem is, when I run IronPython as a console, and add a > path to > the standard Python26 library, the module can be imported without > any problems, but as soon as I try to embed IronPython and call > it from within my application and then try to import the module, > even though I'd added the path to the sys.path prior to > importing the module, it still throws an error saying: > "No module named win32api". > > I don't know what to do now. I've tried to manually add > all the sub-directories of the Lib direcotry from Python26. > I tried to copy the module's files to IronPython Lib directory, > but nothing worked. > > Thanks a lot in advance, cheers, > > > I don't know why you can't import the win32com module but I would > not use it at all. > > I would rather use the Win32 API directly from IronPython via > clrtype and pinvoke or via C# stub. For C# stub example see my > blog: http://gui-at.blogspot.com/2008/07/simulate-users-input.html > > > What's wrong with win32com/win32api...? I think it is unecessary proxy level for accessing COM or win32api in IronPython. -- -- Luk?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sat Feb 20 21:55:24 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 20 Feb 2010 15:55:24 -0500 Subject: [IronPython] Importing standard Python libs In-Reply-To: <4B804BDF.9080403@bakalari.cz> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B804BDF.9080403@bakalari.cz> Message-ID: <4B804C3C.2070205@voidspace.org.uk> On 20/02/2010 15:53, Lukas Cenovsky wrote: > Brian Curtin wrote: >> On Sat, Feb 20, 2010 at 13:20, Lukas Cenovsky > > wrote: >> >> Luk?? Dub?da wrote: >> >> Hi there everyone, >> >> I'm having problems importing a module, concretely win32com, >> from within >> IronPython. >> >> The problem is, when I run IronPython as a console, and add a >> path to >> the standard Python26 library, the module can be imported without >> any problems, but as soon as I try to embed IronPython and call >> it from within my application and then try to import the module, >> even though I'd added the path to the sys.path prior to >> importing the module, it still throws an error saying: >> "No module named win32api". >> >> I don't know what to do now. I've tried to manually add >> all the sub-directories of the Lib direcotry from Python26. >> I tried to copy the module's files to IronPython Lib directory, >> but nothing worked. >> >> Thanks a lot in advance, cheers, >> >> >> I don't know why you can't import the win32com module but I would >> not use it at all. >> >> I would rather use the Win32 API directly from IronPython via >> clrtype and pinvoke or via C# stub. For C# stub example see my >> blog: http://gui-at.blogspot.com/2008/07/simulate-users-input.html >> >> What's wrong with win32com/win32api...? > > I think it is unecessary proxy level for accessing COM or win32api in > IronPython. win32com and win32api (as far as I know) rely on C extensions and won't work on IronPython anyway (unless you are using Ironclad). Michael Foord > > -- > -- Luk?? > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From loocas at duber.cz Sat Feb 20 22:19:13 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Sat, 20 Feb 2010 22:19:13 +0100 Subject: [IronPython] Importing standard Python libs In-Reply-To: <4B804A4A.5030101@bakalari.cz> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B80398D.9050605@duber.cz> <4B804A4A.5030101@bakalari.cz> Message-ID: <4B8051D1.1000100@duber.cz> Amazing! Thanks a lot, Lukas, the late bound Interop functionality really did work! I'll never get enough of .NET and IronPython. :) Je?t? jednou d?ky! ;) Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe Lukas Cenovsky wrote: > Luk?? Dub?da wrote: >> Hi Lukas, >> >> thanks for the tip, it actually never occured to me. >> I'm used to using the win32com module for communicating >> with an OLE server I established in a separate application. >> >> I'm tryint to send code in different language, native >> to the app., via this OLE bridge and for that I used >> to use win32com.client module and then I registered >> the app and its exposed methods. >> >> But now when I come to think of it, it might be a much >> better idea doing it via .NET. However, I have >> no idea where to start. :) > > Check this page: > http://www.ironpython.info/index.php/Contents#Interop > > -- > -- Luk?? > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From loocas at duber.cz Sat Feb 20 22:47:25 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Sat, 20 Feb 2010 22:47:25 +0100 Subject: [IronPython] Importing standard Python libs In-Reply-To: <4B804A4A.5030101@bakalari.cz> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B80398D.9050605@duber.cz> <4B804A4A.5030101@bakalari.cz> Message-ID: <4B80586D.9040308@duber.cz> Hmm, but this is strange. The Interop works, but IronPython throws a lot of exceptions at me when executing, or rather, passing a string to execute as a function, for example, in the remote application. Here's the exception: ************** Exception Text ************** System.Runtime.InteropServices.COMException (0x80040201): An event was unable to invoke any of the subscribers (Exception from HRESULT: 0x80040201) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at Microsoft.Scripting.ComInterop.ComRuntimeHelpers.CheckThrowException(Int32 hresult, ExcepInfo& excepInfo, UInt32 argErr, String message) at CallSite.Target(Closure , CallSite , Object , String ) at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at CallSite.Target(Closure , CallSite , Object , String ) at CallSite.Target(Closure , CallSite , CodeContext , Object , String ) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at onBtnPressed$101(Closure , PythonFunction , Object , Object , Object ) at IronPython.Compiler.PythonCallTargets.OriginalCallTarget3(PythonFunction function, Object arg0, Object arg1, Object arg2) at IronPython.Runtime.PythonFunction.FunctionCaller`3.Call3(CallSite site, CodeContext context, Object func, T0 arg0, T1 arg1, T2 arg2) at CallSite.Target(Closure , CallSite , Object , Object , EventArgs ) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at _Scripting_(Object[] , Object , EventArgs ) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) *********************************************** the code that I execute is simple, it looks like this: maxApp = Activator.CreateInstance(Type.GetTypeFromProgID('MAX.Application.2009')) then: maxApp.runMXS(r'colorMan.getColor #background') this is a call to a function of the remote app (colorMan) and its method for getting the app's color. The weirdest thing is, some functions, even though they throw an error, still get executed after I hit "Continue". Do you have any idea what might be causing this? Thanks a lot in advance, cheers, Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe Lukas Cenovsky wrote: > Luk?? Dub?da wrote: >> Hi Lukas, >> >> thanks for the tip, it actually never occured to me. >> I'm used to using the win32com module for communicating >> with an OLE server I established in a separate application. >> >> I'm tryint to send code in different language, native >> to the app., via this OLE bridge and for that I used >> to use win32com.client module and then I registered >> the app and its exposed methods. >> >> But now when I come to think of it, it might be a much >> better idea doing it via .NET. However, I have >> no idea where to start. :) > > Check this page: > http://www.ironpython.info/index.php/Contents#Interop > > -- > -- Luk?? > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From brian.curtin at gmail.com Sat Feb 20 22:55:33 2010 From: brian.curtin at gmail.com (Brian Curtin) Date: Sat, 20 Feb 2010 16:55:33 -0500 Subject: [IronPython] Importing standard Python libs In-Reply-To: <4B804C3C.2070205@voidspace.org.uk> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B804BDF.9080403@bakalari.cz> <4B804C3C.2070205@voidspace.org.uk> Message-ID: On Sat, Feb 20, 2010 at 15:55, Michael Foord wrote: > On 20/02/2010 15:53, Lukas Cenovsky wrote: > > Brian Curtin wrote: > > On Sat, Feb 20, 2010 at 13:20, Lukas Cenovsky wrote: > >> Luk?? Dub?da wrote: >> >>> Hi there everyone, >>> >>> I'm having problems importing a module, concretely win32com, from within >>> IronPython. >>> >>> The problem is, when I run IronPython as a console, and add a path to >>> the standard Python26 library, the module can be imported without >>> any problems, but as soon as I try to embed IronPython and call >>> it from within my application and then try to import the module, >>> even though I'd added the path to the sys.path prior to >>> importing the module, it still throws an error saying: >>> "No module named win32api". >>> >>> I don't know what to do now. I've tried to manually add >>> all the sub-directories of the Lib direcotry from Python26. >>> I tried to copy the module's files to IronPython Lib directory, >>> but nothing worked. >>> >>> Thanks a lot in advance, cheers, >>> >> >> I don't know why you can't import the win32com module but I would not use >> it at all. >> >> I would rather use the Win32 API directly from IronPython via clrtype and >> pinvoke or via C# stub. For C# stub example see my blog: >> http://gui-at.blogspot.com/2008/07/simulate-users-input.html >> >> > What's wrong with win32com/win32api...? > > > I think it is unecessary proxy level for accessing COM or win32api in > IronPython. > > > win32com and win32api (as far as I know) rely on C extensions and won't > work on IronPython anyway (unless you are using Ironclad). > > Michael Foord > Correct, but I figured I'd leave the ironclad plug to you :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From heiko at hhenkelmann.de Sun Feb 21 14:24:00 2010 From: heiko at hhenkelmann.de (Heiko Henkelmann) Date: Sun, 21 Feb 2010 14:24:00 +0100 Subject: [IronPython] How to include packages in compilation Message-ID: <4B8133F0.3030700@hhenkelmann.de> Dear All, I need to use the Queue and ctypes modules from the standard library in my project and I want to compile the project to distribute it. I'm using SharpDevelop 3.1 to do the compilation. For the Queue module I succeded by manually including all the needed py files from the Lib subdir of my IronPython 2.6 directory in the project. Due to the fact that ctypes is a package I was up to now unable to find a solution. I assume the problem would be the same if I would use pyc.py. Does anyone have an idea how to include packages in the compilation? Thank you in advance. Heiko From ward.matt at gmail.com Sun Feb 21 15:48:08 2010 From: ward.matt at gmail.com (Matt Ward) Date: Sun, 21 Feb 2010 14:48:08 +0000 Subject: [IronPython] How to include packages in compilation In-Reply-To: <4B8133F0.3030700@hhenkelmann.de> References: <4B8133F0.3030700@hhenkelmann.de> Message-ID: <7bf1a9b71002210648r3dca8e74o3833541adb06981c@mail.gmail.com> Hi Heiko, Can you use _ctypes provided by IronPython in IronPython.Modules? You may have to use a later version of SharpDevelop to get IronPython 2.6 with the _ctypes module. If not then you could compile ctypes into a separate assembly. Harry Pierson has a post on this: http://devhawk.net/2009/08/10/Compiling+Python+Packages+Into+Assemblies.aspx You should be able to do the same thing with SharpDevelop if you create a new class library project called ctypes, add the ctypes .py files to it, compile it and then reference the ctypes assembly in your main project. You will need to add quite a few other python files to your main project though (os.py, ntpath,py, stat.py, abc.py, _abcoll.py, genericpath.py, linecache.py, struct.py, types.py, UserDict.py, warnings.py) to be able to compile your application. Regards, Matt On 21 February 2010 13:24, Heiko Henkelmann wrote: > > Dear All, > > I need to use the Queue and ctypes modules from the standard library in my > project and I want to compile the project to distribute it. I'm using > SharpDevelop 3.1 to do the compilation. For the Queue module I succeded by > manually including all the needed py files from the Lib subdir of my > IronPython 2.6 directory in the project. Due to the fact that ctypes is a > package I was up to now unable to find a solution. I assume the problem > would be the same if I would use pyc.py. > > Does anyone have an idea how to include packages in the compilation? > > Thank you in advance. > > Heiko > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From cenovsky at bakalari.cz Sun Feb 21 17:54:44 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Sun, 21 Feb 2010 17:54:44 +0100 Subject: [IronPython] Importing standard Python libs In-Reply-To: <4B80586D.9040308@duber.cz> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B80398D.9050605@duber.cz> <4B804A4A.5030101@bakalari.cz> <4B80586D.9040308@duber.cz> Message-ID: <4B816554.5050806@bakalari.cz> I ethin?m you will have to dive deeper and debug your code with Windbg. It's not so hard - I described the basics (for myself to remember them) on http://gui-at.blogspot.com/2010/01/windbg-for-beginners.html. Basically run you code in Windbg and when you hit exception, you run !analyze -v. This tells you more about the exception so you might be able to figure out what's going on. -- -- Luk?? Luk?? Dub?da wrote: > Hmm, but this is strange. > > The Interop works, but IronPython throws a lot of exceptions > at me when executing, or rather, passing a string to execute > as a function, for example, in the remote application. > > Here's the exception: > > ************** Exception Text ************** > System.Runtime.InteropServices.COMException (0x80040201): An event was > unable to invoke any of the subscribers (Exception from HRESULT: > 0x80040201) > at > System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 > errorCode, IntPtr errorInfo) > at > Microsoft.Scripting.ComInterop.ComRuntimeHelpers.CheckThrowException(Int32 > hresult, ExcepInfo& excepInfo, UInt32 argErr, String message) > at CallSite.Target(Closure , CallSite , Object , String ) > at > System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite > site, T0 arg0, T1 arg1) > at CallSite.Target(Closure , CallSite , Object , String ) > at CallSite.Target(Closure , CallSite , CodeContext , Object , > String ) > at > System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2) > at onBtnPressed$101(Closure , PythonFunction , Object , Object , > Object ) > at > IronPython.Compiler.PythonCallTargets.OriginalCallTarget3(PythonFunction > function, Object arg0, Object arg1, Object arg2) > at > IronPython.Runtime.PythonFunction.FunctionCaller`3.Call3(CallSite > site, CodeContext context, Object func, T0 arg0, T1 arg1, T2 arg2) > at CallSite.Target(Closure , CallSite , Object , Object , EventArgs ) > at > System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2) > at _Scripting_(Object[] , Object , EventArgs ) > at System.Windows.Forms.Control.OnClick(EventArgs e) > at System.Windows.Forms.Button.WndProc(Message& m) > at > System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) > at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 > msg, IntPtr wparam, IntPtr lparam) > *********************************************** > > the code that I execute is simple, it looks like this: > > maxApp = > Activator.CreateInstance(Type.GetTypeFromProgID('MAX.Application.2009')) > > then: > > maxApp.runMXS(r'colorMan.getColor #background') > > this is a call to a function of the remote app (colorMan) and > its method for getting the app's color. > > The weirdest thing is, some functions, even though they > throw an error, still get executed after I hit "Continue". > > Do you have any idea what might be causing this? > > Thanks a lot in advance, cheers, > > Luk?? Dub?da > Director > [T] +420 602 444 164 > > duber studio(tm) > [M] info at duber.cz > [W] http://www.duber.cz > > [A] R.A.Dvorsk?ho 601, Praha 10 > [A] 10900, Czech Republic, Europe > > Lukas Cenovsky wrote: >> Luk?? Dub?da wrote: >>> Hi Lukas, >>> >>> thanks for the tip, it actually never occured to me. >>> I'm used to using the win32com module for communicating >>> with an OLE server I established in a separate application. >>> >>> I'm tryint to send code in different language, native >>> to the app., via this OLE bridge and for that I used >>> to use win32com.client module and then I registered >>> the app and its exposed methods. >>> >>> But now when I come to think of it, it might be a much >>> better idea doing it via .NET. However, I have >>> no idea where to start. :) >> >> Check this page: >> http://www.ironpython.info/index.php/Contents#Interop >> >> -- >> -- Luk?? >> >> _______________________________________________ >> 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 heiko at hhenkelmann.de Sun Feb 21 19:38:29 2010 From: heiko at hhenkelmann.de (Heiko Henkelmann) Date: Sun, 21 Feb 2010 19:38:29 +0100 Subject: [IronPython] How to include packages in compilation In-Reply-To: <7bf1a9b71002210648r3dca8e74o3833541adb06981c@mail.gmail.com> References: <4B8133F0.3030700@hhenkelmann.de> <7bf1a9b71002210648r3dca8e74o3833541adb06981c@mail.gmail.com> Message-ID: <4B817DA5.9000509@hhenkelmann.de> Hi Matt, thank you for the hint. It work as described. Creating a seperate assembly did the job. Heiko Am 21.02.2010 15:48, schrieb Matt Ward: > Hi Heiko, > > Can you use _ctypes provided by IronPython in IronPython.Modules? You > may have to use a later version of SharpDevelop to get IronPython 2.6 > with the _ctypes module. > > If not then you could compile ctypes into a separate assembly. Harry > Pierson has a post on this: > > http://devhawk.net/2009/08/10/Compiling+Python+Packages+Into+Assemblies.aspx > > You should be able to do the same thing with SharpDevelop if you > create a new class library project called ctypes, add the ctypes .py > files to it, compile it and then reference the ctypes assembly in your > main project. You will need to add quite a few other python files to > your main project though (os.py, ntpath,py, stat.py, abc.py, > _abcoll.py, genericpath.py, linecache.py, struct.py, types.py, > UserDict.py, warnings.py) to be able to compile your application. > > Regards, > > Matt > > On 21 February 2010 13:24, Heiko Henkelmann wrote: > >> Dear All, >> >> I need to use the Queue and ctypes modules from the standard library in my >> project and I want to compile the project to distribute it. I'm using >> SharpDevelop 3.1 to do the compilation. For the Queue module I succeded by >> manually including all the needed py files from the Lib subdir of my >> IronPython 2.6 directory in the project. Due to the fact that ctypes is a >> package I was up to now unable to find a solution. I assume the problem >> would be the same if I would use pyc.py. >> >> Does anyone have an idea how to include packages in the compilation? >> >> Thank you in advance. >> >> Heiko >> _______________________________________________ >> 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 cjac at colliertech.org Mon Feb 22 07:49:52 2010 From: cjac at colliertech.org (C.J. Adams-Collier) Date: Sun, 21 Feb 2010 22:49:52 -0800 Subject: [IronPython] Running the IronPython tests (on Mono) Message-ID: <1266821392.4977.3.camel@calcifer> Hey folks, I'm trying hard to shoehorn IronPython (and IronRuby) into Ubuntu Lucid, the next long-term stable release. They're asking if I can get the test suite to execute as part of the package build script. Can someone walk me through running the test suite? The one caveat is that this is a snapshot from git as of 08/05/2009. I've been working on this version since then in order to get it packaged up. It shouldn't take quite so long to get releases packaged up in the future. Let me know if you need a shell on ironruby.colliertech.org and when/if you can help me walk through getting the test suite going. Thanks in advance, C.J. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From pablodalma93 at hotmail.com Mon Feb 22 13:50:47 2010 From: pablodalma93 at hotmail.com (Pablo Dalmazzo) Date: Mon, 22 Feb 2010 10:50:47 -0200 Subject: [IronPython] Being unable to import module after succesfully adding reference, in asp.net IronPython Message-ID: Hi there, I'm adding a reference to a funciones.dll file using clr.AddReferenceToFileAndPath() because I couldnt get it to work other way with this file and it succesfully does it. The file is named funciones.dll , it only contains function definitions and it's in the bin folder. But when I do from funciones import * I get "no module named funciones" since the funciones.dll file it's a funciones.py file compiled, shouldnt the module name only be named funciones and no any other name? isnt the name the problem and it's another? I dont know what other info could be relevant here but if there is any let me know. BTW, in the VS 2008 object explorer, this assembly is listed differently than assemblies made from VB.NET or C# code files. A dll file made from a VB.NET code file named "conexiones" with a explicity declared "conexiones" namespace is listed as {}conexiones : "Namespace conexiones, member of conexiones". The IronPython assembly funciones is listed as DLRCachedCode[funciones]: "public class DLRCachedCode, member of funciones" My question is , what do I have to do for the function definitions from funciones.dll to be available from an asp.net ironpython aspx.py codefile ? Greetings, Pablo Dalmazzo _________________________________________________________________ Ahora chate? desde la playa con tu celu. Registrate gratis a SMS Messenger. http://www.somosmessengersiempre.com/?ocid=TWLH -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablodalma93 at hotmail.com Mon Feb 22 13:58:16 2010 From: pablodalma93 at hotmail.com (Pablo Dalmazzo) Date: Mon, 22 Feb 2010 10:58:16 -0200 Subject: [IronPython] Is it possible to associate an IronPython asp.net webform to a dll file? Message-ID: Hi there, In ASP.NET with the normal ASP model you could have the codefile of the aspx file in a dll by inheriting the class inside the dll. In IronPython you have another model and the only option in the aspx page is "codefile" and there is no "inherits". My question is, is there any way to associate an aspx file to a source file which is not directly viewable such as a dll or a pyc file? Greetings, Pablo Dalmazzo _________________________________________________________________ ?Busc?s compa?ero de viaje para estas vacaciones? Aprovech? MSN Amor y Amistad http://match.ar.msn.com/channel/index.aspx?trackingid=1056241 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Tomas.Matousek at microsoft.com Mon Feb 22 18:19:56 2010 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Mon, 22 Feb 2010 17:19:56 +0000 Subject: [IronPython] Running the IronPython tests (on Mono) In-Reply-To: <1266821392.4977.3.camel@calcifer> References: <1266821392.4977.3.camel@calcifer> Message-ID: <4B342496A3EFEB48839E10BB4BF5964C3DB72768@TK5EX14MBXC122.redmond.corp.microsoft.com> To run IronRuby tests you can use Merlin\Main\Languages\Ruby\Scripts\irtests.rb. But it won't run on Linux as is due to dependencies on various batch files. We should replace all of them by Ruby scripts in future so that it runs on Linux as well. Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of C.J. Adams-Collier Sent: Sunday, February 21, 2010 10:50 PM To: users at lists.ironpython.com Subject: [IronPython] Running the IronPython tests (on Mono) Hey folks, I'm trying hard to shoehorn IronPython (and IronRuby) into Ubuntu Lucid, the next long-term stable release. They're asking if I can get the test suite to execute as part of the package build script. Can someone walk me through running the test suite? The one caveat is that this is a snapshot from git as of 08/05/2009. I've been working on this version since then in order to get it packaged up. It shouldn't take quite so long to get releases packaged up in the future. Let me know if you need a shell on ironruby.colliertech.org and when/if you can help me walk through getting the test suite going. Thanks in advance, C.J. From empirebuilder at gmail.com Mon Feb 22 18:27:56 2010 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Mon, 22 Feb 2010 19:27:56 +0200 Subject: [IronPython] Is it possible to associate an IronPython asp.net webform to a dll file? In-Reply-To: References: Message-ID: <8cd017b81002220927g66f882dj774dc3f4f143589a@mail.gmail.com> hmm..there's nothing that I am aware of. The only thing that I found working is setting up a single custom class to be inherited by all the aspx.py file. On Mon, Feb 22, 2010 at 2:58 PM, Pablo Dalmazzo wrote: > Hi there, > > In ASP.NET with the normal ASP model you could have the codefile of the > aspx file in a dll by inheriting the class inside the dll. In IronPython you > have another model and the only option in the aspx page is "codefile" and > there is no "inherits". My question is, is there any way to associate an > aspx file to a source file which is not directly viewable such as a dll or a > pyc file? > > Greetings, Pablo Dalmazzo > > ------------------------------ > Windows Live Hotmail es m?s seguro con filtro Anti Spam mejorado un 80%. ?M?s > info aqu?! > > _______________________________________________ > 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 cjac at colliertech.org Mon Feb 22 19:08:02 2010 From: cjac at colliertech.org (C.J. Adams-Collier) Date: Mon, 22 Feb 2010 10:08:02 -0800 Subject: [IronPython] Running the IronPython tests (on Mono) In-Reply-To: <4B342496A3EFEB48839E10BB4BF5964C3DB72768@TK5EX14MBXC122.redmond.corp.microsoft.com> References: <1266821392.4977.3.camel@calcifer> <4B342496A3EFEB48839E10BB4BF5964C3DB72768@TK5EX14MBXC122.redmond.corp.microsoft.com> Message-ID: <1266862082.4977.7.camel@calcifer> Thanks Tomas, I recall doing a bit of work on this with Ivan last year. I think we got most of them performing reasonably. I don't remember whether we re-wrote the batch files in ruby or bash or whatever... we should probably do that at some point... Cheers, C.J. On Mon, 2010-02-22 at 17:19 +0000, Tomas Matousek wrote: > To run IronRuby tests you can use Merlin\Main\Languages\Ruby\Scripts\irtests.rb. > But it won't run on Linux as is due to dependencies on various batch files. We should replace all of them by Ruby scripts in future so that it runs on Linux as well. > > Tomas > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of C.J. Adams-Collier > Sent: Sunday, February 21, 2010 10:50 PM > To: users at lists.ironpython.com > Subject: [IronPython] Running the IronPython tests (on Mono) > > Hey folks, > > I'm trying hard to shoehorn IronPython (and IronRuby) into Ubuntu Lucid, the next long-term stable release. They're asking if I can get the test suite to execute as part of the package build script. > > Can someone walk me through running the test suite? > > The one caveat is that this is a snapshot from git as of 08/05/2009. > I've been working on this version since then in order to get it packaged up. It shouldn't take quite so long to get releases packaged up in the future. > > Let me know if you need a shell on ironruby.colliertech.org and when/if you can help me walk through getting the test suite going. > > Thanks in advance, > > C.J. > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From drken567 at gmail.com Mon Feb 22 21:55:36 2010 From: drken567 at gmail.com (Ken MacDonald) Date: Mon, 22 Feb 2010 15:55:36 -0500 Subject: [IronPython] Events on Buttons, and Focus, in IronPython Message-ID: <3468cae11002221255r58581bc8kdfe2596c3c507f10@mail.gmail.com> Hi, I've inherited an I-P app, and trying to make some sense of it... It has a login page, with several text fields including "user" and "password"; and "OK" and "CANCEL" buttons. Right now, you enter the user/password into the text fields, and then have to click the "OK" button to login. Customer would like this to work like most other apps, where filling in user/password and then typing the "Enter" key would also initiate the login. I've searched the I-P book and googled, but I can't find a workable reference to how to write a handler to determine the Enter key has been hit - actually, I was able to catch a keyboard event: pwd_fld.KeyDown += on_enter def on_enter(self, e, args) # what here??? but unable to determine what the keystroke is - "Iron Python In Action" suggests: if e.Key == Key.Enter: # start login but I get the error "e has no attribute 'Key'" Clues appreciated.... Ken -------------- next part -------------- An HTML attachment was scrubbed... URL: From drken567 at gmail.com Mon Feb 22 22:11:17 2010 From: drken567 at gmail.com (Ken MacDonald) Date: Mon, 22 Feb 2010 16:11:17 -0500 Subject: [IronPython] Events on Buttons, and Focus, in IronPython In-Reply-To: <3468cae11002221255r58581bc8kdfe2596c3c507f10@mail.gmail.com> References: <3468cae11002221255r58581bc8kdfe2596c3c507f10@mail.gmail.com> Message-ID: <3468cae11002221311h5a85d0cdnc2ca028179075c24@mail.gmail.com> Aaaah. Managed mix up my args; seems to work OK now. Sorry. Ken On Mon, Feb 22, 2010 at 3:55 PM, Ken MacDonald wrote: > Hi, > I've inherited an I-P app, and trying to make some sense of it... It has a > login page, with several text fields including "user" and "password"; and > "Oed to K" and "CANCEL" buttons. Right now, you enter the user/password into > the text fields, and then have to click the "OK" button to login. Customer > would like this to work like most other apps, where filling in user/password > and then typing the "Enter" key would also initiate the login. I've searched > the I-P book and googled, but I can't find a workable reference to how to > write a handler to determine the Enter key has been hit - actually, I was > able to catch a keyboard event: > > pwd_fld.KeyDown += on_enter > > def on_enter(self, e, args) > # what here??? > > but unable to determine what the keystroke is - "Iron Python In Action" > suggests: > > if e.Key == Key.Enter: > # start login > > but I get the error "e has no attribute 'Key'" > > Clues appreciated.... > Ken > -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Mon Feb 22 22:12:43 2010 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 22 Feb 2010 13:12:43 -0800 Subject: [IronPython] Events on Buttons, and Focus, in IronPython In-Reply-To: <3468cae11002221255r58581bc8kdfe2596c3c507f10@mail.gmail.com> References: <3468cae11002221255r58581bc8kdfe2596c3c507f10@mail.gmail.com> Message-ID: You want args.Key instead of e.Key. The standard event signature is function(object sender, EventArgs args). But the better way to do this is to set the OK button to be the default button. In Winforms, this is a property on the form: form.AcceptButton = self.ok_button. On Mon, Feb 22, 2010 at 12:55 PM, Ken MacDonald wrote: > Hi, > I've inherited an I-P app, and trying to make some sense of it... It has a > login page, with several text fields including "user" and "password"; and > "OK" and "CANCEL" buttons. Right now, you enter the user/password into the > text fields, and then have to click the "OK" button to login. Customer would > like this to work like most other apps, where filling in user/password and > then typing the "Enter" key would also initiate the login. I've searched the > I-P book and googled, but I can't find a workable reference to how to write > a handler to determine the Enter key has been hit - actually, I was able to > catch a keyboard event: > > pwd_fld.KeyDown += on_enter > > def on_enter(self, e, args) > # what here??? > > but unable to determine what the keystroke is - "Iron Python In Action" > suggests: > > if e.Key == Key.Enter: > # start login > > but I get the error "e has no attribute 'Key'" > > Clues appreciated.... > Ken > > _______________________________________________ > 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 drken567 at gmail.com Mon Feb 22 22:32:16 2010 From: drken567 at gmail.com (Ken MacDonald) Date: Mon, 22 Feb 2010 16:32:16 -0500 Subject: [IronPython] Events on Buttons, and Focus, in IronPython In-Reply-To: References: <3468cae11002221255r58581bc8kdfe2596c3c507f10@mail.gmail.com> Message-ID: <3468cae11002221332h795cbea3h9e56050d6516559@mail.gmail.com> On Mon, Feb 22, 2010 at 4:12 PM, Curt Hagenlocher wrote: > You want args.Key instead of e.Key. The standard event signature is > function(object sender, EventArgs args) > Tried that, but got runtime error saying that it was being called w/3 arguments, and only two were specified. Adding "self" as first argument worked, however. > But the better way to do this is to set the OK button to be the default > button. In Winforms, this is a property on the form: > form.AcceptButton = self.ok_button. > > tried this approach as well (self is the login dialog): ok_button == self.control("btnOk") // xaml name for it ok_button.Click = self.on_ok self.AcceptButton = ok_button but no event seemed to be triggered on it. Anyway, the on_enter handler works once I sorted out the arguments properly. Ken -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfugate at microsoft.com Mon Feb 22 22:59:39 2010 From: dfugate at microsoft.com (Dave Fugate) Date: Mon, 22 Feb 2010 21:59:39 +0000 Subject: [IronPython] Running the IronPython tests (on Mono) In-Reply-To: <1266862082.4977.7.camel@calcifer> References: <1266821392.4977.3.camel@calcifer> <4B342496A3EFEB48839E10BB4BF5964C3DB72768@TK5EX14MBXC122.redmond.corp.microsoft.com> <1266862082.4977.7.camel@calcifer> Message-ID: <7CEEC335D70FFE4B957737DDE836F51B34857BC6@TK5EX14MBXC125.redmond.corp.microsoft.com> For IronPython, try running: IronPython\Tests> ipy.exe harness.py I haven't tried running this recently, but it did work about a year ago... Dave -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of C.J. Adams-Collier Sent: Monday, February 22, 2010 1:08 PM To: Discussion of IronPython Subject: Re: [IronPython] Running the IronPython tests (on Mono) Thanks Tomas, I recall doing a bit of work on this with Ivan last year. I think we got most of them performing reasonably. I don't remember whether we re-wrote the batch files in ruby or bash or whatever... we should probably do that at some point... Cheers, C.J. On Mon, 2010-02-22 at 17:19 +0000, Tomas Matousek wrote: > To run IronRuby tests you can use Merlin\Main\Languages\Ruby\Scripts\irtests.rb. > But it won't run on Linux as is due to dependencies on various batch files. We should replace all of them by Ruby scripts in future so that it runs on Linux as well. > > Tomas > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of C.J. > Adams-Collier > Sent: Sunday, February 21, 2010 10:50 PM > To: users at lists.ironpython.com > Subject: [IronPython] Running the IronPython tests (on Mono) > > Hey folks, > > I'm trying hard to shoehorn IronPython (and IronRuby) into Ubuntu Lucid, the next long-term stable release. They're asking if I can get the test suite to execute as part of the package build script. > > Can someone walk me through running the test suite? > > The one caveat is that this is a snapshot from git as of 08/05/2009. > I've been working on this version since then in order to get it packaged up. It shouldn't take quite so long to get releases packaged up in the future. > > Let me know if you need a shell on ironruby.colliertech.org and when/if you can help me walk through getting the test suite going. > > Thanks in advance, > > C.J. > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From xaphiern at googlemail.com Tue Feb 23 13:17:02 2010 From: xaphiern at googlemail.com (Neidhoo Xaphier) Date: Tue, 23 Feb 2010 13:17:02 +0100 Subject: [IronPython] Can't start executable created with pyc.py Message-ID: Hello, I have a very simple python script I want to compile into an exe-File (with IronPython 2.6). The script is named "GuiTest.py": ### BEGIN GuiTest.py ### import clr clr.AddReference("PresentationFramework") clr.AddReference("PresentationCore") import System.Windows import System.Windows.Controls window = System.Windows.Window() window.Title = "GuiTest" window.Height = 200 window.Width = 450 stack = System.Windows.Controls.StackPanel() stack.Margin = System.Windows.Thickness(15) window.Content = stack button = System.Windows.Controls.Button() button.Content = "Push Me!" def onClick(sender, event): print "Button pushed!" button.Click += onClick stack.Children.Add(button) app = System.Windows.Application() app.Run(window) ### END GuiTest.py ### By using "pyc.py" I created "GuiTest.exe" with the following command line: ipy "C:\Programme\IronPython 2.6\Tools\Scripts\pyc.py" /main:GuiTest.py /target:exe Next I copied the following files into the same folder where GuiTest.exe is stored: IronPython.dll IronPython.Modules.dll Microsoft.Scripting.ExtensionAttribute.dll Microsoft.Dynamic.dll Microsoft.Scripting.Core.dll Microsoft.Scripting.Debugging.dll Microsoft.Scripting.dll Unfortunatelly GuiTest.exe still doesn't work. If I try to execute it from the command line I get the following error message: Unbehandelte Ausnahme: System.InvalidOperationException: Beim aufrufenden Thread muss es sich um einen STA-Thread handeln, da dies f?r viele Komponenten der Benutzeroberfl?che erforderlich ist. bei Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args, Boolean& shouldOptimize) bei IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`6.Call5(Ca llSite site, CodeContext context, TFuncType func, T0 arg0, T1 arg1, T2 arg2, T3arg3, T4 arg4) bei System.Dynamic.UpdateDelegates.UpdateAndExecute7[T0,T1,T2,T3,T4,T5,T6,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) bei IronPython.Runtime.Importer.Import(CodeContext context, String fullName, PythonTuple from, Int32 level) bei IronPython.Runtime.Operations.PythonOps.InitializeModule(Assembly precompiled, String main, String[] references) bei PythonMain.Main() Do you have any ideas how I can resolve this issue? Best regards, Xaphier N. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Tue Feb 23 18:11:40 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 23 Feb 2010 17:11:40 +0000 Subject: [IronPython] Can't start executable created with pyc.py Message-ID: <1A472770E042064698CB5ADC83A12ACD39354328@TK5EX14MBXC116.redmond.corp.microsoft.com> I think you need to compile with /target:winexe so the app will start on a sta thread. Sent from my Android phone using TouchDown (www.nitrodesk.com) -----Original Message----- From: Neidhoo Xaphier [xaphiern at googlemail.com] Received: 2/23/10 4:17 AM To: users at lists.ironpython.com [users at lists.ironpython.com] Subject: [IronPython] Can't start executable created with pyc.py Hello, I have a very simple python script I want to compile into an exe-File (with IronPython 2.6). The script is named "GuiTest.py": ### BEGIN GuiTest.py ### import clr clr.AddReference("PresentationFramework") clr.AddReference("PresentationCore") import System.Windows import System.Windows.Controls window = System.Windows.Window() window.Title = "GuiTest" window.Height = 200 window.Width = 450 stack = System.Windows.Controls.StackPanel() stack.Margin = System.Windows.Thickness(15) window.Content = stack button = System.Windows.Controls.Button() button.Content = "Push Me!" def onClick(sender, event): print "Button pushed!" button.Click += onClick stack.Children.Add(button) app = System.Windows.Application() app.Run(window) ### END GuiTest.py ### By using "pyc.py" I created "GuiTest.exe" with the following command line: ipy "C:\Programme\IronPython 2.6\Tools\Scripts\pyc.py" /main:GuiTest.py /target:exe Next I copied the following files into the same folder where GuiTest.exe is stored: IronPython.dll IronPython.Modules.dll Microsoft.Scripting.ExtensionAttribute.dll Microsoft.Dynamic.dll Microsoft.Scripting.Core.dll Microsoft.Scripting.Debugging.dll Microsoft.Scripting.dll Unfortunatelly GuiTest.exe still doesn't work. If I try to execute it from the command line I get the following error message: Unbehandelte Ausnahme: System.InvalidOperationException: Beim aufrufenden Thread muss es sich um einen STA-Thread handeln, da dies f?r viele Komponenten der Benutzeroberfl?che erforderlich ist. bei Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args, Boolean& shouldOptimize) bei IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`6.Call5(Ca llSite site, CodeContext context, TFuncType func, T0 arg0, T1 arg1, T2 arg2, T3arg3, T4 arg4) bei System.Dynamic.UpdateDelegates.UpdateAndExecute7[T0,T1,T2,T3,T4,T5,T6,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) bei IronPython.Runtime.Importer.Import(CodeContext context, String fullName, PythonTuple from, Int32 level) bei IronPython.Runtime.Operations.PythonOps.InitializeModule(Assembly precompiled, String main, String[] references) bei PythonMain.Main() Do you have any ideas how I can resolve this issue? Best regards, Xaphier N. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cjac at colliertech.org Wed Feb 24 00:08:23 2010 From: cjac at colliertech.org (C.J. Adams-Collier) Date: Tue, 23 Feb 2010 15:08:23 -0800 Subject: [IronPython] Running the IronPython tests (on Mono) In-Reply-To: <7CEEC335D70FFE4B957737DDE836F51B34857BC6@TK5EX14MBXC125.redmond.corp.microsoft.com> References: <1266821392.4977.3.camel@calcifer> <4B342496A3EFEB48839E10BB4BF5964C3DB72768@TK5EX14MBXC122.redmond.corp.microsoft.com> <1266862082.4977.7.camel@calcifer> <7CEEC335D70FFE4B957737DDE836F51B34857BC6@TK5EX14MBXC125.redmond.corp.microsoft.com> Message-ID: <1266966503.5756.3.camel@calcifer> I don't see a harness.py. Maybe the snapshot I'm working from is too old. 8/5/2009 On Mon, 2010-02-22 at 21:59 +0000, Dave Fugate wrote: > For IronPython, try running: > IronPython\Tests> ipy.exe harness.py > > I haven't tried running this recently, but it did work about a year ago... > > Dave > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of C.J. Adams-Collier > Sent: Monday, February 22, 2010 1:08 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Running the IronPython tests (on Mono) > > Thanks Tomas, > > I recall doing a bit of work on this with Ivan last year. I think we got most of them performing reasonably. I don't remember whether we re-wrote the batch files in ruby or bash or whatever... we should probably do that at some point... > > Cheers, > > C.J. > > > On Mon, 2010-02-22 at 17:19 +0000, Tomas Matousek wrote: > > To run IronRuby tests you can use Merlin\Main\Languages\Ruby\Scripts\irtests.rb. > > But it won't run on Linux as is due to dependencies on various batch files. We should replace all of them by Ruby scripts in future so that it runs on Linux as well. > > > > Tomas > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of C.J. > > Adams-Collier > > Sent: Sunday, February 21, 2010 10:50 PM > > To: users at lists.ironpython.com > > Subject: [IronPython] Running the IronPython tests (on Mono) > > > > Hey folks, > > > > I'm trying hard to shoehorn IronPython (and IronRuby) into Ubuntu Lucid, the next long-term stable release. They're asking if I can get the test suite to execute as part of the package build script. > > > > Can someone walk me through running the test suite? > > > > The one caveat is that this is a snapshot from git as of 08/05/2009. > > I've been working on this version since then in order to get it packaged up. It shouldn't take quite so long to get releases packaged up in the future. > > > > Let me know if you need a shell on ironruby.colliertech.org and when/if you can help me walk through getting the test suite going. > > > > Thanks in advance, > > > > C.J. > > > > _______________________________________________ > > 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 -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From dinov at microsoft.com Wed Feb 24 00:43:19 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 23 Feb 2010 23:43:19 +0000 Subject: [IronPython] Running the IronPython tests (on Mono) In-Reply-To: <1266966503.5756.3.camel@calcifer> References: <1266821392.4977.3.camel@calcifer> <4B342496A3EFEB48839E10BB4BF5964C3DB72768@TK5EX14MBXC122.redmond.corp.microsoft.com> <1266862082.4977.7.camel@calcifer> <7CEEC335D70FFE4B957737DDE836F51B34857BC6@TK5EX14MBXC125.redmond.corp.microsoft.com> <1266966503.5756.3.camel@calcifer> Message-ID: <1A472770E042064698CB5ADC83A12ACD39366C10@TK5EX14MBXC116.redmond.corp.microsoft.com> There's also run.py - that should work as well it'll run all of the IronPython specific tests. I'm not 100% sure that they'll all pass when run from run.py though. We're also looking at pushing our changes to the CPython test suite upstream. We'll be working on that over the next few months/year. Once that's done we should get to the point where we cleanly run CPython's tests and so you could just choose to run those. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of C.J. Adams-Collier > Sent: Tuesday, February 23, 2010 3:08 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Running the IronPython tests (on Mono) > > I don't see a harness.py. Maybe the snapshot I'm working from is too old. > 8/5/2009 > > On Mon, 2010-02-22 at 21:59 +0000, Dave Fugate wrote: > > For IronPython, try running: > > IronPython\Tests> ipy.exe harness.py > > > > I haven't tried running this recently, but it did work about a year ago... > > > > Dave > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of C.J. > > Adams-Collier > > Sent: Monday, February 22, 2010 1:08 PM > > To: Discussion of IronPython > > Subject: Re: [IronPython] Running the IronPython tests (on Mono) > > > > Thanks Tomas, > > > > I recall doing a bit of work on this with Ivan last year. I think we got > most of them performing reasonably. I don't remember whether we re-wrote the > batch files in ruby or bash or whatever... we should probably do that at some > point... > > > > Cheers, > > > > C.J. > > > > > > On Mon, 2010-02-22 at 17:19 +0000, Tomas Matousek wrote: > > > To run IronRuby tests you can use > Merlin\Main\Languages\Ruby\Scripts\irtests.rb. > > > But it won't run on Linux as is due to dependencies on various batch > files. We should replace all of them by Ruby scripts in future so that it runs > on Linux as well. > > > > > > Tomas > > > > > > -----Original Message----- > > > From: users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of C.J. > > > Adams-Collier > > > Sent: Sunday, February 21, 2010 10:50 PM > > > To: users at lists.ironpython.com > > > Subject: [IronPython] Running the IronPython tests (on Mono) > > > > > > Hey folks, > > > > > > I'm trying hard to shoehorn IronPython (and IronRuby) into Ubuntu Lucid, > the next long-term stable release. They're asking if I can get the test suite > to execute as part of the package build script. > > > > > > Can someone walk me through running the test suite? > > > > > > The one caveat is that this is a snapshot from git as of 08/05/2009. > > > I've been working on this version since then in order to get it packaged > up. It shouldn't take quite so long to get releases packaged up in the > future. > > > > > > Let me know if you need a shell on ironruby.colliertech.org and when/if > you can help me walk through getting the test suite going. > > > > > > Thanks in advance, > > > > > > C.J. > > > > > > _______________________________________________ > > > 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 pablodalma93 at hotmail.com Wed Feb 24 14:33:22 2010 From: pablodalma93 at hotmail.com (Pablo Dalmazzo) Date: Wed, 24 Feb 2010 10:33:22 -0300 Subject: [IronPython] protecting the sourcecode in ironpython asp.net projects Message-ID: Hi There, is there anybody developing applications in asp.net webforms with IronPython and protecting the code with some obfuscator? Considering there are some issues with ironpython for asp.net for having the code in dlls (like the codefile can only be a .py file afaik and some possible troubles for importing modules, at least I have those) how are you protecting your code for asp.net ironpython projects? :) Thanks in advance to anybody replying or reading Greetings, Pablo Dalmazzo _________________________________________________________________ Todo lo que quer?s saber sobre la TV y sus protagonistas en MSN http://msn.novebox.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From xaphiern at googlemail.com Wed Feb 24 16:07:51 2010 From: xaphiern at googlemail.com (Neidhoo Xaphier) Date: Wed, 24 Feb 2010 16:07:51 +0100 Subject: [IronPython] Can't start executable created with pyc.py In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39354328@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD39354328@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: Thank you very much Dino. This solved the problem. -------------- next part -------------- An HTML attachment was scrubbed... URL: From loocas at duber.cz Wed Feb 24 17:35:10 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Wed, 24 Feb 2010 17:35:10 +0100 Subject: [IronPython] IronPython Studio won't install, why? In-Reply-To: <4B802804.5050606@bakalari.cz> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> Message-ID: <4B85553E.3020301@duber.cz> Hi there everyone. I'm having issues installing the IronPython Studio IDE. I've downloaded the VS 2008 Shell Isolated and successfully installed it. But the .msi of IronPython studio still refuses to install. Is there anything else I need to do in order to get it installed? The website doesn't say anything about anything else, but the VS prerequisite. Thanks a lot in advance, cheers, Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe From loocas at duber.cz Wed Feb 24 17:42:24 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Wed, 24 Feb 2010 17:42:24 +0100 Subject: [IronPython] IronPython Studio won't install, why? In-Reply-To: <4B85553E.3020301@duber.cz> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B85553E.3020301@duber.cz> Message-ID: <4B8556F0.2010708@duber.cz> Oks, sorry. After some more Google search, I found out I had to "double-install" the VS, which is a bit strange. But it seems to be working now. Thanks, though. :) Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe Luk?? Dub?da wrote: > Hi there everyone. > > I'm having issues installing the IronPython Studio IDE. > I've downloaded the VS 2008 Shell Isolated and successfully > installed it. But the .msi of IronPython studio still > refuses to install. Is there anything else I need to do > in order to get it installed? The website doesn't > say anything about anything else, but the VS prerequisite. > > Thanks a lot in advance, cheers, > > Luk?? Dub?da > Director > [T] +420 602 444 164 > > duber studio(tm) > [M] info at duber.cz > [W] http://www.duber.cz > > [A] R.A.Dvorsk?ho 601, Praha 10 > [A] 10900, Czech Republic, Europe > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From merllab at microsoft.com Wed Feb 24 17:53:36 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 24 Feb 2010 08:53:36 -0800 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/64155. ADDED SOURCES $/IronPython/IronPython_Main/Src/IronPythonTest/MemberOverloadTest.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPythonTest/MemberOverloadTest.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/DefaultBinder.cs $/IronPython/IronPython_Main/Src/IronPythonConsoleAny/IronPythonConsoleAny.csproj $/IronPython/IronPython_Main/Src/IronPythonWindowAny/IronPythonWindowAny.csproj $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonModule.cs $/IronPython/IronPython_Main/Src/IronPythonTest/IronPythonTest.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Generation/AssemblyGen.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/DefaultBinder.GetMember.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/DefaultBinder.SetMember.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/DefaultBinder.DeleteMember.cs $/IronPython/IronPython_Main/Src/Tests/interop/net/dynamic/dynamic_regressions.py $/IronPython/IronPython_Main/Src/Tests/test_attrinjector.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1603597 Date: 2/23/2010 1:19:21 PM Fixes the following bugs: - 26089: implements BindInvokeMember on PythonModule's DynamicMetaObject - 26277: changes default binder to use type.GetMember and filter results instead of type.GetMethod which throws - 25008: adds icon files to IronPython[Console,Window]Any[.Build].csproj (Shelveset: Net40Bugs01;REDMOND\ddicato | SNAP CheckinId: 10387) From ddicato at microsoft.com Wed Feb 24 18:27:08 2010 From: ddicato at microsoft.com (David DiCato) Date: Wed, 24 Feb 2010 17:27:08 +0000 Subject: [IronPython] Using a C# class in IronPython In-Reply-To: References: <294f1ba41002170658t7c8f590bk8ecb95547379efc2@mail.gmail.com> Message-ID: The fix for this is now checked in and has been pushed to CodePlex. Thanks for reporting! From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of David DiCato Sent: Friday, February 19, 2010 12:31 PM To: Discussion of IronPython Subject: Re: [IronPython] Using a C# class in IronPython Hi Justin, this is definitely a valid bug; thanks for reporting it. We?re supposed to ignore any methods named GetMember/SetMember/DeleteMember unless they define the [SpecialName] attribute, but we fail to account for cases where there could be overloads. This is because the default binder calls type.GetMethod("SetMember") which throws when there are multiple matches. We should instead get all methods named SetMember and filter out the non-special ones. I already have a preliminary fix for this, and it should make it onto CodePlex within a few days. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Justin Hartman Sent: Friday, February 19, 2010 11:09 AM To: Discussion of IronPython Subject: Re: [IronPython] Using a C# class in IronPython Thanks, Mark. That's all really good stuff, and essentially we are already doing the same things in our app. Where the problem comes in for me (I've narrowed it down a little bit) is that the IronPython binding code looks for a method called "SetMember" when I attempt to set an attribute. My class happens to have multiple overridden SetMember methods (which have nothing to do with Python, but make sense in my application domain), which causes Type.GetMethod() to throw an exception. I logged an issue in CodePlex (Item #26277: CLR class with overridden SetMember method causes "Ambiguous match found"); you can take a look if you want to see the whole issue and how to repro. On Wed, Feb 17, 2010 at 9:58 AM, Mark Grice > wrote: I'm not sure if this helps, but I use a C# class in my IronPython, and it works fine. Class is defined using the shorthand get; set; ie: public class ScreenTags { public String appWindowName { get; set; } public String fieldName { get; set; } public bool isDataField { get; set; } public bool isManual { get; set; } public String screenLabel { get; set; } public String description { get; set; } } (In actuality, it is a lot more than this, consisting of other classes, methods, etc...) Now, it may be bad practice, but I then simply use an object reference in Python, and assume it was instantiated. In other words, as far as Python is concerned, there is an instantiated object of ScreenTags called "screen". Python simply calls this whenever it wants to do something: ie. screen. appWindowName = "ThisName" I create the screen object in my C# code, and then add it as a reference to the python scope before I call the IronPython engine. So, on the C# side I: scptEngine = Python.CreateEngine(); scptRuntime = scptEngine.Runtime; scptScope = scptEngine.CreateScope(); AddAssemblies(scptRuntime); // call if you need to add other libraries, such as my class And before I actually call the Engine, I set the class in the Python scope -- still in C#: ScreenTags SOA_screen = new ScreenTags(); scptScope.SetVariable("screen", SOA_screen); scptSource = scptEngine.CreateScriptSourceFromFile(scriptFile); // scriptFile is Python code scptSource.Execute(scptScope); This is working fine. The class is actually really a loaded class, and it has all kind of goodies in it (ie pop up Windows forms, calls out to unmanaged code... all sorts of stuff). I never have a problem with any of it. I don't know if this helps (or even if it is good practice!) but it is working here. _______________________________________________ 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 Feb 24 19:31:06 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 24 Feb 2010 18:31:06 +0000 Subject: [IronPython] IronPython Studio won't install, why? In-Reply-To: <4B8556F0.2010708@duber.cz> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B85553E.3020301@duber.cz> <4B8556F0.2010708@duber.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD39392703@TK5EX14MBXC118.redmond.corp.microsoft.com> Hopefully you won't get too attached to IronPython Studio - in April we will be releasing IronPython Tools for Visual Studio which should generally be of higher quality, better supported, and will work w/ Visual Studio 2010 and IronPython 2.6. You can see what we're planning over in the PDFs that are available here: http://us.pycon.org/2010/conference/schedule/event/9/ > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Luk?? Dubeda > Sent: Wednesday, February 24, 2010 8:42 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Studio won't install, why? > > Oks, sorry. After some more Google search, I found out > I had to "double-install" the VS, which is a bit strange. > > But it seems to be working now. Thanks, though. :) > > Luk?? Dub?da > Director > [T] +420 602 444 164 > > duber studio(tm) > [M] info at duber.cz > [W] http://www.duber.cz > > [A] R.A.Dvorsk?ho 601, Praha 10 > [A] 10900, Czech Republic, Europe > > Luk?? Dub?da wrote: > > Hi there everyone. > > > > I'm having issues installing the IronPython Studio IDE. > > I've downloaded the VS 2008 Shell Isolated and successfully > > installed it. But the .msi of IronPython studio still > > refuses to install. Is there anything else I need to do > > in order to get it installed? The website doesn't > > say anything about anything else, but the VS prerequisite. > > > > Thanks a lot in advance, cheers, > > > > Luk?? Dub?da > > Director > > [T] +420 602 444 164 > > > > duber studio(tm) > > [M] info at duber.cz > > [W] http://www.duber.cz > > > > [A] R.A.Dvorsk?ho 601, Praha 10 > > [A] 10900, Czech Republic, Europe > > _______________________________________________ > > 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 josh at globalherald.net Wed Feb 24 21:43:57 2010 From: josh at globalherald.net (Joshua Kramer) Date: Wed, 24 Feb 2010 15:43:57 -0500 (EST) Subject: [IronPython] So what is left for Django? Message-ID: Hello, Supposing 2.6.1 RC1 (or whatever updates are currently in line for RC2) becomes 2.6.1 Final - is there a list of things that need to be done AFTER 2.6.1 to get Django working under Ipy and MS-SQL? Cheers, -Josh From jdhardy at gmail.com Wed Feb 24 19:58:45 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 24 Feb 2010 11:58:45 -0700 Subject: [IronPython] So what is left for Django? In-Reply-To: References: Message-ID: Hi Josh, The main repo for this work is http://bitbucket.org/jdhardy/django-ironpython/; there are instructions there on running the test suite. The whole test suite needs to pass, and it looks like 2.6.1 will go a long way to helping that. That said, I don't think it will fix everything. I've basically stopped testing until 2.6.1 RC2 is released (w/ the unicode fixes) and then I'll start again. A list of things that are known to fail in the test suite is @ http://bitbucket.org/jdhardy/django-ironpython/issues/. (there are more that I haven't entered). The biggest issue is that not all of the tests are running: http://bitbucket.org/jdhardy/django-ironpython/issue/11/not-all-test-run-under-ironpython. MSSQL support needs some work yet; both the adodbapi backend and the django-mssql adapter need some changes to work with Django 1.2. I intend to commit those changes back to both projects as soon as the changes are stable. There also should be better IronPython sqlite support for dev/test, so I'm working on that as well @ http://bitbucket.org/jdhardy/ironpython.sqlite/. If you want to help out, the best way to start is by getting the test suite running, picking failures, and opening issues - and fixing them, if possible. Aside: does anyone object if this list is used for communication? It should be fairly low volume. - Jeff On Wed, Feb 24, 2010 at 1:43 PM, Joshua Kramer wrote: > > Hello, > > Supposing 2.6.1 RC1 (or whatever updates are currently in line for RC2) > becomes 2.6.1 Final - is there a list of things that need to be done AFTER > 2.6.1 to get Django working under Ipy and MS-SQL? > > Cheers, > -Josh > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From tcronin at asrclkrec.com Wed Feb 24 20:53:07 2010 From: tcronin at asrclkrec.com (Cronin, Ted) Date: Wed, 24 Feb 2010 11:53:07 -0800 Subject: [IronPython] IronPython Studio won't install, why? In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39392703@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B85553E.3020301@duber.cz> <4B8556F0.2010708@duber.cz> <1A472770E042064698CB5ADC83A12ACD39392703@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: Fantastic News, and definitely a plus for all of us who are trying to use it currently, Dino. Too bad we have to wait till April;) Ted Cronin County of Riverside ACR ValueGIS (951) 955 - 0487 -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, February 24, 2010 10:31 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Studio won't install, why? Hopefully you won't get too attached to IronPython Studio - in April we will be releasing IronPython Tools for Visual Studio which should generally be of higher quality, better supported, and will work w/ Visual Studio 2010 and IronPython 2.6. You can see what we're planning over in the PDFs that are available here: http://us.pycon.org/2010/conference/schedule/event/9/ > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Luk?? Dubeda > Sent: Wednesday, February 24, 2010 8:42 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Studio won't install, why? > > Oks, sorry. After some more Google search, I found out > I had to "double-install" the VS, which is a bit strange. > > But it seems to be working now. Thanks, though. :) > > Luk?? Dub?da > Director > [T] +420 602 444 164 > > duber studio(tm) > [M] info at duber.cz > [W] http://www.duber.cz > > [A] R.A.Dvorsk?ho 601, Praha 10 > [A] 10900, Czech Republic, Europe > > Luk?? Dub?da wrote: > > Hi there everyone. > > > > I'm having issues installing the IronPython Studio IDE. > > I've downloaded the VS 2008 Shell Isolated and successfully > > installed it. But the .msi of IronPython studio still > > refuses to install. Is there anything else I need to do > > in order to get it installed? The website doesn't > > say anything about anything else, but the VS prerequisite. > > > > Thanks a lot in advance, cheers, > > > > Luk?? Dub?da > > Director > > [T] +420 602 444 164 > > > > duber studio(tm) > > [M] info at duber.cz > > [W] http://www.duber.cz > > > > [A] R.A.Dvorsk?ho 601, Praha 10 > > [A] 10900, Czech Republic, Europe > > _______________________________________________ > > 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 vernondcole at gmail.com Wed Feb 24 21:30:22 2010 From: vernondcole at gmail.com (Vernon Cole) Date: Wed, 24 Feb 2010 13:30:22 -0700 Subject: [IronPython] So what is left for Django? In-Reply-To: References: Message-ID: Jeff: Is it time to copy the new adodbapi version into the bitbucket location yet? Is there anything else I should do first? -- Vernon Cole General Announcement:... There is a new, supposedly django compatible version of adodbapi in the Mercurial source tree at http://sourceforge.net/projects/adodbapi/develop. [Note: NOT the CVS tree.] The big new feature is that .paramstyle can be changed by the application programmer at run time. Early results were good, but I would appreciate some more alpha testers. -- Vernon On Wed, Feb 24, 2010 at 11:58 AM, Jeff Hardy wrote: > Hi Josh, > The main repo for this work is > http://bitbucket.org/jdhardy/django-ironpython/; there are > instructions there on running the test suite. The whole test suite > needs to pass, and it looks like 2.6.1 will go a long way to helping > that. That said, I don't think it will fix everything. I've basically > stopped testing until 2.6.1 RC2 is released (w/ the unicode fixes) and > then I'll start again. > > A list of things that are known to fail in the test suite is @ > http://bitbucket.org/jdhardy/django-ironpython/issues/. (there are > more that I haven't entered). > > The biggest issue is that not all of the tests are running: > > http://bitbucket.org/jdhardy/django-ironpython/issue/11/not-all-test-run-under-ironpython > . > > MSSQL support needs some work yet; both the adodbapi backend and the > django-mssql adapter need some changes to work with Django 1.2. I > intend to commit those changes back to both projects as soon as the > changes are stable. > > There also should be better IronPython sqlite support for dev/test, so > I'm working on that as well @ > http://bitbucket.org/jdhardy/ironpython.sqlite/. > > If you want to help out, the best way to start is by getting the test > suite running, picking failures, and opening issues - and fixing them, > if possible. > > Aside: does anyone object if this list is used for communication? It > should be fairly low volume. > > - Jeff > > On Wed, Feb 24, 2010 at 1:43 PM, Joshua Kramer > wrote: > > > > Hello, > > > > Supposing 2.6.1 RC1 (or whatever updates are currently in line for RC2) > > becomes 2.6.1 Final - is there a list of things that need to be done > AFTER > > 2.6.1 to get Django working under Ipy and MS-SQL? > > > > Cheers, > > -Josh > > > > _______________________________________________ > > 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 jdhardy at gmail.com Wed Feb 24 21:40:17 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 24 Feb 2010 13:40:17 -0700 Subject: [IronPython] So what is left for Django? In-Reply-To: References: Message-ID: On Wed, Feb 24, 2010 at 1:30 PM, Vernon Cole wrote: > Jeff: > ? Is it time to copy the new adodbapi version into the bitbucket location > yet?? Is there anything else I should do first? Not sure; I'll need to take a look at what changes you've made since the last time I pulled, but I probably won't get to it for a couple of days. (I assume by 'bitbucket location' you're referring to http://bitbucket.org/jdhardy/adodbapi/) - Jeff > -- > Vernon Cole > > General Announcement:... > ? There is a new, supposedly django compatible version of adodbapi in the > Mercurial? source tree at http://sourceforge.net/projects/adodbapi/develop. > [Note: NOT the CVS tree.] The big new feature is that .paramstyle can be > changed by the application programmer at run time. Early results were good, > but I would appreciate some more alpha testers. > -- > Vernon > From tcronin at asrclkrec.com Wed Feb 24 22:36:53 2010 From: tcronin at asrclkrec.com (Cronin, Ted) Date: Wed, 24 Feb 2010 13:36:53 -0800 Subject: [IronPython] IronPython Studio won't install, why? In-Reply-To: References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B85553E.3020301@duber.cz> <4B8556F0.2010708@duber.cz> <1A472770E042064698CB5ADC83A12ACD39392703@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: Access to this site: ipyteam at microsoft.com Diagnostic information for administrators: Generating server: mail126-va3-R.bigfish.com ipyteam at microsoft.com #< #5.0.0 X-Postfix; host winse-6216-mail2.customer.frontbridge.com[205.248.106.30] said: 550 5.1.1 User unknown (in reply to RCPT TO command)> #SMTP# Original message headers: Received: from mail126-va3 (localhost [127.0.0.1]) by mail126-va3-R.bigfish.com (Postfix) with ESMTP id 9C44219B014B for ; Wed, 24 Feb 2010 21:30:11 +0000 (UTC) X-SpamScore: -4 X-BigFish: ps-4(zzzz1202hz31iz186Mz2dh6bh67h) X-Spam-TCS-SCL: 6:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 63.237.190.191;Service: EHS Received: from mail126-va3 (localhost.localdomain [127.0.0.1]) by mail126-va3 (MessageSwitch) id 1267047011217413_18405; Wed, 24 Feb 2010 21:30:11 +0000 (UTC) Received: from VA3EHSMHS004.bigfish.com (unknown [10.7.14.236]) by mail126-va3.bigfish.com (Postfix) with ESMTP id 322EB4F0050 for ; Wed, 24 Feb 2010 21:30:11 +0000 (UTC) Received: from smtp02.co.riverside.ca.us (63.237.190.191) by VA3EHSMHS004.bigfish.com (10.7.99.14) with Microsoft SMTP Server (TLS) id 14.0.482.39; Wed, 24 Feb 2010 21:30:07 +0000 X-AuditID: ac1e0cbf-b7cb2ae0000005e5-7b-4b859a5e2fd0 Received: from exvs06.cor.rivcnty.lcl ( [10.22.24.26]) by smtp02.co.riverside.ca.us (Symantec Brightmail Gateway) with SMTP id 33.DF.01509.E5A958B4; Wed, 24 Feb 2010 13:30:06 -0800 (PST) Received: from acr-exca2.asrclkrec.org (10.21.56.139) by exvs06.cor.rivcnty.lcl (10.22.24.25) with Microsoft SMTP Server id 8.2.234.1; Wed, 24 Feb 2010 13:30:06 -0800 Received: from ACR-EXMB.asrclkrec.org ([10.21.56.133]) by acr-exca2.asrclkrec.org ([10.21.56.139]) with mapi; Wed, 24 Feb 2010 13:30:06 -0800 From: "Cronin, Ted" To: "'ipyteam at microsoft.com'" Date: Wed, 24 Feb 2010 13:30:06 -0800 Subject: test Thread-Topic: test Thread-Index: Acq1mIg1uq0fZ3ycQ7GOn36hr7sL3A== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_E56126D42FA9EC499965037DC3171ACE01330FF50338ACREXMBasrc_" MIME-Version: 1.0 X-Brightmail-Tracker: AAAAAA== X-Reverse-DNS: smtp02.co.riverside.ca.us -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Cronin, Ted Sent: Wednesday, February 24, 2010 11:53 AM To: 'Discussion of IronPython' Subject: Re: [IronPython] IronPython Studio won't install, why? Fantastic News, and definitely a plus for all of us who are trying to use it currently, Dino. Too bad we have to wait till April;) Ted Cronin County of Riverside ACR ValueGIS (951) 955 - 0487 -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, February 24, 2010 10:31 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Studio won't install, why? Hopefully you won't get too attached to IronPython Studio - in April we will be releasing IronPython Tools for Visual Studio which should generally be of higher quality, better supported, and will work w/ Visual Studio 2010 and IronPython 2.6. You can see what we're planning over in the PDFs that are available here: http://us.pycon.org/2010/conference/schedule/event/9/ > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Luk?? Dubeda > Sent: Wednesday, February 24, 2010 8:42 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Studio won't install, why? > > Oks, sorry. After some more Google search, I found out > I had to "double-install" the VS, which is a bit strange. > > But it seems to be working now. Thanks, though. :) > > Luk?? Dub?da > Director > [T] +420 602 444 164 > > duber studio(tm) > [M] info at duber.cz > [W] http://www.duber.cz > > [A] R.A.Dvorsk?ho 601, Praha 10 > [A] 10900, Czech Republic, Europe > > Luk?? Dub?da wrote: > > Hi there everyone. > > > > I'm having issues installing the IronPython Studio IDE. > > I've downloaded the VS 2008 Shell Isolated and successfully > > installed it. But the .msi of IronPython studio still > > refuses to install. Is there anything else I need to do > > in order to get it installed? The website doesn't > > say anything about anything else, but the VS prerequisite. > > > > Thanks a lot in advance, cheers, > > > > Luk?? Dub?da > > Director > > [T] +420 602 444 164 > > > > duber studio(tm) > > [M] info at duber.cz > > [W] http://www.duber.cz > > > > [A] R.A.Dvorsk?ho 601, Praha 10 > > [A] 10900, Czech Republic, Europe > > _______________________________________________ > > 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 loocas at duber.cz Wed Feb 24 22:37:50 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Wed, 24 Feb 2010 22:37:50 +0100 Subject: [IronPython] IronPython Studio won't install, why? In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39392703@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B85553E.3020301@duber.cz> <4B8556F0.2010708@duber.cz> <1A472770E042064698CB5ADC83A12ACD39392703@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <4B859C2E.1030204@duber.cz> Wow! Looking really good, Dino! Can't wait for April! :) Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe Dino Viehland wrote: > Hopefully you won't get too attached to IronPython Studio - in April we > will be releasing IronPython Tools for Visual Studio which should generally > be of higher quality, better supported, and will work w/ Visual Studio 2010 > and IronPython 2.6. > > You can see what we're planning over in the PDFs that are available > here: http://us.pycon.org/2010/conference/schedule/event/9/ > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Luk?? Dubeda >> Sent: Wednesday, February 24, 2010 8:42 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] IronPython Studio won't install, why? >> >> Oks, sorry. After some more Google search, I found out >> I had to "double-install" the VS, which is a bit strange. >> >> But it seems to be working now. Thanks, though. :) >> >> Luk?? Dub?da >> Director >> [T] +420 602 444 164 >> >> duber studio(tm) >> [M] info at duber.cz >> [W] http://www.duber.cz >> >> [A] R.A.Dvorsk?ho 601, Praha 10 >> [A] 10900, Czech Republic, Europe >> >> Luk?? Dub?da wrote: >>> Hi there everyone. >>> >>> I'm having issues installing the IronPython Studio IDE. >>> I've downloaded the VS 2008 Shell Isolated and successfully >>> installed it. But the .msi of IronPython studio still >>> refuses to install. Is there anything else I need to do >>> in order to get it installed? The website doesn't >>> say anything about anything else, but the VS prerequisite. >>> >>> Thanks a lot in advance, cheers, >>> >>> Luk?? Dub?da >>> Director >>> [T] +420 602 444 164 >>> >>> duber studio(tm) >>> [M] info at duber.cz >>> [W] http://www.duber.cz >>> >>> [A] R.A.Dvorsk?ho 601, Praha 10 >>> [A] 10900, Czech Republic, Europe >>> _______________________________________________ >>> 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 luismgz at gmail.com Wed Feb 24 22:51:14 2010 From: luismgz at gmail.com (Luis M. Gonzalez) Date: Wed, 24 Feb 2010 18:51:14 -0300 Subject: [IronPython] IronJs optimizations. Can this be done in IronPython? Message-ID: Hi there, I've been reading a fascinating blog post about IronJs, a new javascript implementation based on the DLR, and I'm excited to read that two optimization features of this implementation have resulted in speed ups comparable to those of Chrome's V8 and Firefox's Tracemonkey. This is the link: http://ugh.cc/ironjs-preview-benchmarks-of-the-new-compiler/ These features are: - Static analysis of variables to determine as many types as possible at compile-time - Per-function type-specializing runtime compilation The author warns that "this is a very very early and limited benchmark. This just test a small part of the runtime.", however, this looks promising since the language is being implemented on top of the DLR. I wonder if these techniques can be implemented in Ironpython, or if anything along these lines is already being implemented. Is there any chance to speedup Ironpython to V8's levels? Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From cjac at colliertech.org Wed Feb 24 00:08:23 2010 From: cjac at colliertech.org (C.J. Adams-Collier) Date: Tue, 23 Feb 2010 15:08:23 -0800 Subject: [IronPython] Running the IronPython tests (on Mono) In-Reply-To: <7CEEC335D70FFE4B957737DDE836F51B34857BC6@TK5EX14MBXC125.redmond.corp.microsoft.com> References: <1266821392.4977.3.camel@calcifer> <4B342496A3EFEB48839E10BB4BF5964C3DB72768@TK5EX14MBXC122.redmond.corp.microsoft.com> <1266862082.4977.7.camel@calcifer> <7CEEC335D70FFE4B957737DDE836F51B34857BC6@TK5EX14MBXC125.redmond.corp.microsoft.com> Message-ID: <1266966503.5756.3.camel@calcifer> I don't see a harness.py. Maybe the snapshot I'm working from is too old. 8/5/2009 On Mon, 2010-02-22 at 21:59 +0000, Dave Fugate wrote: > For IronPython, try running: > IronPython\Tests> ipy.exe harness.py > > I haven't tried running this recently, but it did work about a year ago... > > Dave > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of C.J. Adams-Collier > Sent: Monday, February 22, 2010 1:08 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Running the IronPython tests (on Mono) > > Thanks Tomas, > > I recall doing a bit of work on this with Ivan last year. I think we got most of them performing reasonably. I don't remember whether we re-wrote the batch files in ruby or bash or whatever... we should probably do that at some point... > > Cheers, > > C.J. > > > On Mon, 2010-02-22 at 17:19 +0000, Tomas Matousek wrote: > > To run IronRuby tests you can use Merlin\Main\Languages\Ruby\Scripts\irtests.rb. > > But it won't run on Linux as is due to dependencies on various batch files. We should replace all of them by Ruby scripts in future so that it runs on Linux as well. > > > > Tomas > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of C.J. > > Adams-Collier > > Sent: Sunday, February 21, 2010 10:50 PM > > To: users at lists.ironpython.com > > Subject: [IronPython] Running the IronPython tests (on Mono) > > > > Hey folks, > > > > I'm trying hard to shoehorn IronPython (and IronRuby) into Ubuntu Lucid, the next long-term stable release. They're asking if I can get the test suite to execute as part of the package build script. > > > > Can someone walk me through running the test suite? > > > > The one caveat is that this is a snapshot from git as of 08/05/2009. > > I've been working on this version since then in order to get it packaged up. It shouldn't take quite so long to get releases packaged up in the future. > > > > Let me know if you need a shell on ironruby.colliertech.org and when/if you can help me walk through getting the test suite going. > > > > Thanks in advance, > > > > C.J. > > > > _______________________________________________ > > 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 -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From tcronin at asrclkrec.com Wed Feb 24 23:09:47 2010 From: tcronin at asrclkrec.com (Cronin, Ted) Date: Wed, 24 Feb 2010 14:09:47 -0800 Subject: [IronPython] IronPython Tools In-Reply-To: References: Message-ID: So, that's cool, it appears you have gestalt inside of Ipy Tools, How do we add Reference, also when trying to add a new search path, VS crashes with an Unhandled Exception, duped in sl and wpf. Will there be an asp.net web form project? There are no online templates. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Feb 24 23:20:39 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 24 Feb 2010 22:20:39 +0000 Subject: [IronPython] IronJs optimizations. Can this be done in IronPython? In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD3939354D@TK5EX14MBXC118.redmond.corp.microsoft.com> We've spent a little bit of time looking at generating optimized code (with guards + inlined operations) but it hasn't yet yielded any benefits over our current polymorphic inlining caching strategy. But that's probably just because we haven't pushed on it hard enough. I've also looked at specializing loops over range/xrange as well - that yielded a huge (8x if I recall correctly) benefit in simple for loop performance. That's probably comparable to the benefit IronJS say between the old/new versions in your link. But w/o specializing the code in the loop body it didn't seem to be worth the extra complication yet. I plan to resurrect that work at some point. Static analysis might be interesting but I have my doubts of how well it'll work for Python. I think the best direction to go is the runtime type feedback route + guards instead. The problem here is that it's so easy to invalidate the static analysis that we'll need guards anyway. As far as V8 levels I'm not sure - Python sure does seem to be a lot more dynamic than JavaScript is but we certainly do want to continue to push on performance. I wouldn't want to commit to any specific goal yet :) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Luis M. Gonzalez Sent: Wednesday, February 24, 2010 1:51 PM To: Discussion of IronPython Subject: [IronPython] IronJs optimizations. Can this be done in IronPython? Hi there, I've been reading a fascinating blog post about IronJs, a new javascript implementation based on the DLR, and I'm excited to read that two optimization features of this implementation have resulted in speed ups comparable to those of Chrome's V8 and Firefox's Tracemonkey. This is the link: http://ugh.cc/ironjs-preview-benchmarks-of-the-new-compiler/ These features are: * Static analysis of variables to determine as many types as possible at compile-time * Per-function type-specializing runtime compilation The author warns that "this is a very very early and limited benchmark. This just test a small part of the runtime.", however, this looks promising since the language is being implemented on top of the DLR. I wonder if these techniques can be implemented in Ironpython, or if anything along these lines is already being implemented. Is there any chance to speedup Ironpython to V8's levels? Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Feb 24 23:23:23 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 24 Feb 2010 22:23:23 +0000 Subject: [IronPython] IronPython Tools In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD3939357D@TK5EX14MBXC118.redmond.corp.microsoft.com> Currently the best way to add a reference is to call clr.AddReference('assemblyname'). The analysis engine will pick up the call and include the assembly as being available in the list of imports. I'll take a look at the crashing bug. As for ASP.NET support we'll need to look into getting some templates and including our existing ASP.NET support in the overall package. There was also interest at PyCon about this so it seems likely we'll add this in (and it shouldn't be too much work to create a template). As for online templates we're likely to ship all of the templates we make w/ IpyTools. But I think you should be able to create on-line templates for other users to use. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Cronin, Ted Sent: Wednesday, February 24, 2010 2:10 PM To: 'Discussion of IronPython' Subject: [IronPython] IronPython Tools So, that's cool, it appears you have gestalt inside of Ipy Tools, How do we add Reference, also when trying to add a new search path, VS crashes with an Unhandled Exception, duped in sl and wpf. Will there be an asp.net web form project? There are no online templates. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcronin at asrclkrec.com Wed Feb 24 23:31:38 2010 From: tcronin at asrclkrec.com (Cronin, Ted) Date: Wed, 24 Feb 2010 14:31:38 -0800 Subject: [IronPython] IronPython Tools In-Reply-To: <1A472770E042064698CB5ADC83A12ACD3939357D@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD3939357D@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: Any word on the email address not connecting, also was just pointing out that AddReference was not accessible from References. Nice to have a graphical way to add references rather than just through code. By chance has the issue been resolved for adding references for our own assemblies from Gestalt. Do the tools work with 261, or does that really matter, or should we be testing with 26? So far this is really nice, in that we now have access to more than just winform capability, so thank you for doing this for the community. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, February 24, 2010 2:23 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Tools Currently the best way to add a reference is to call clr.AddReference('assemblyname'). The analysis engine will pick up the call and include the assembly as being available in the list of imports. I'll take a look at the crashing bug. As for ASP.NET support we'll need to look into getting some templates and including our existing ASP.NET support in the overall package. There was also interest at PyCon about this so it seems likely we'll add this in (and it shouldn't be too much work to create a template). As for online templates we're likely to ship all of the templates we make w/ IpyTools. But I think you should be able to create on-line templates for other users to use. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Cronin, Ted Sent: Wednesday, February 24, 2010 2:10 PM To: 'Discussion of IronPython' Subject: [IronPython] IronPython Tools So, that's cool, it appears you have gestalt inside of Ipy Tools, How do we add Reference, also when trying to add a new search path, VS crashes with an Unhandled Exception, duped in sl and wpf. Will there be an asp.net web form project? There are no online templates. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tristanz at gmail.com Wed Feb 24 23:31:58 2010 From: tristanz at gmail.com (Tristan Zajonc) Date: Wed, 24 Feb 2010 17:31:58 -0500 Subject: [IronPython] IronPython Studio won't install, why? In-Reply-To: <4B859C2E.1030204@duber.cz> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B85553E.3020301@duber.cz> <4B8556F0.2010708@duber.cz> <1A472770E042064698CB5ADC83A12ACD39392703@TK5EX14MBXC118.redmond.corp.microsoft.com> <4B859C2E.1030204@duber.cz> Message-ID: <94d1cdd21002241431n76048632l901e5981ff4f7120@mail.gmail.com> This is great news indeed. Is the plan to release IronPython Tools under MSPL? Tristan On Wed, Feb 24, 2010 at 4:37 PM, Luk?? Dub?da wrote: > Wow! Looking really good, Dino! > > Can't wait for April! :) > > > Luk?? Dub?da > Director > [T] +420 602 444 164 > > duber studio(tm) > [M] info at duber.cz > [W] http://www.duber.cz > > [A] R.A.Dvorsk?ho 601, Praha 10 > [A] 10900, Czech Republic, Europe > > Dino Viehland wrote: > >> Hopefully you won't get too attached to IronPython Studio - in April we >> will be releasing IronPython Tools for Visual Studio which should generally >> be of higher quality, better supported, and will work w/ Visual Studio 2010 >> and IronPython 2.6. >> >> You can see what we're planning over in the PDFs that are available >> here: http://us.pycon.org/2010/conference/schedule/event/9/ >> >> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> bounces at lists.ironpython.com] On Behalf Of Luk?? Dubeda >>> Sent: Wednesday, February 24, 2010 8:42 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] IronPython Studio won't install, why? >>> >>> Oks, sorry. After some more Google search, I found out >>> I had to "double-install" the VS, which is a bit strange. >>> >>> But it seems to be working now. Thanks, though. :) >>> >>> Luk?? Dub?da >>> Director >>> [T] +420 602 444 164 >>> >>> duber studio(tm) >>> [M] info at duber.cz >>> [W] http://www.duber.cz >>> >>> [A] R.A.Dvorsk?ho 601, Praha 10 >>> [A] 10900, Czech Republic, Europe >>> >>> Luk?? Dub?da wrote: >>> >>>> Hi there everyone. >>>> >>>> I'm having issues installing the IronPython Studio IDE. >>>> I've downloaded the VS 2008 Shell Isolated and successfully >>>> installed it. But the .msi of IronPython studio still >>>> refuses to install. Is there anything else I need to do >>>> in order to get it installed? The website doesn't >>>> say anything about anything else, but the VS prerequisite. >>>> >>>> Thanks a lot in advance, cheers, >>>> >>>> Luk?? Dub?da >>>> Director >>>> [T] +420 602 444 164 >>>> >>>> duber studio(tm) >>>> [M] info at duber.cz >>>> [W] http://www.duber.cz >>>> >>>> [A] R.A.Dvorsk?ho 601, Praha 10 >>>> [A] 10900, Czech Republic, Europe >>>> _______________________________________________ >>>> 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Feb 24 23:39:05 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 24 Feb 2010 22:39:05 +0000 Subject: [IronPython] IronPython Tools In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD3939357D@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD39393633@TK5EX14MBXC118.redmond.corp.microsoft.com> Hurm, I think I may have gone w/ the wrong alias. Try ironpy at microsoft.com instead. The problem w/ a graphical way to add references is that we start to get into a complex world where the .py files are not representing everything that your code needs and therefore running them from the command line is not identical to running them in VS. We could consider an add references dialog which pastes code into a .py file but I'm not sure how weird this would be. We could also even consider providing intellisense for when you're filling in the string for clr.AddReference(...). IronPython Tools includes 2.6.1 RC1 for .NET 4.0 as the version of IronPython it works against by default. Because it targets Visual Studio 2010 it'll always target primarily CLR4. You can configure what interpreter it runs against in project properties but that won't have any impact on the code analysis (or the REPL process) right now. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Cronin, Ted Sent: Wednesday, February 24, 2010 2:32 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] IronPython Tools Any word on the email address not connecting, also was just pointing out that AddReference was not accessible from References. Nice to have a graphical way to add references rather than just through code. By chance has the issue been resolved for adding references for our own assemblies from Gestalt. Do the tools work with 261, or does that really matter, or should we be testing with 26? So far this is really nice, in that we now have access to more than just winform capability, so thank you for doing this for the community. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, February 24, 2010 2:23 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Tools Currently the best way to add a reference is to call clr.AddReference('assemblyname'). The analysis engine will pick up the call and include the assembly as being available in the list of imports. I'll take a look at the crashing bug. As for ASP.NET support we'll need to look into getting some templates and including our existing ASP.NET support in the overall package. There was also interest at PyCon about this so it seems likely we'll add this in (and it shouldn't be too much work to create a template). As for online templates we're likely to ship all of the templates we make w/ IpyTools. But I think you should be able to create on-line templates for other users to use. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Cronin, Ted Sent: Wednesday, February 24, 2010 2:10 PM To: 'Discussion of IronPython' Subject: [IronPython] IronPython Tools So, that's cool, it appears you have gestalt inside of Ipy Tools, How do we add Reference, also when trying to add a new search path, VS crashes with an Unhandled Exception, duped in sl and wpf. Will there be an asp.net web form project? There are no online templates. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Feb 24 23:39:38 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 24 Feb 2010 22:39:38 +0000 Subject: [IronPython] IronPython Studio won't install, why? In-Reply-To: <94d1cdd21002241431n76048632l901e5981ff4f7120@mail.gmail.com> References: <4B8022CB.1070608@duber.cz> <4B802804.5050606@bakalari.cz> <4B85553E.3020301@duber.cz> <4B8556F0.2010708@duber.cz> <1A472770E042064698CB5ADC83A12ACD39392703@TK5EX14MBXC118.redmond.corp.microsoft.com> <4B859C2E.1030204@duber.cz> <94d1cdd21002241431n76048632l901e5981ff4f7120@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD39393650@TK5EX14MBXC118.redmond.corp.microsoft.com> We?re still working through how we?ll be releasing it. We expect to have that figured out by April when we have the 1st publicly downloadable release. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tristan Zajonc Sent: Wednesday, February 24, 2010 2:32 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Studio won't install, why? This is great news indeed. Is the plan to release IronPython Tools under MSPL? Tristan On Wed, Feb 24, 2010 at 4:37 PM, Luk?? Dub?da > wrote: Wow! Looking really good, Dino! Can't wait for April! :) Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe Dino Viehland wrote: Hopefully you won't get too attached to IronPython Studio - in April we will be releasing IronPython Tools for Visual Studio which should generally be of higher quality, better supported, and will work w/ Visual Studio 2010 and IronPython 2.6. You can see what we're planning over in the PDFs that are available here: http://us.pycon.org/2010/conference/schedule/event/9/ -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users- bounces at lists.ironpython.com] On Behalf Of Luk?? Dubeda Sent: Wednesday, February 24, 2010 8:42 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Studio won't install, why? Oks, sorry. After some more Google search, I found out I had to "double-install" the VS, which is a bit strange. But it seems to be working now. Thanks, though. :) Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe Luk?? Dub?da wrote: Hi there everyone. I'm having issues installing the IronPython Studio IDE. I've downloaded the VS 2008 Shell Isolated and successfully installed it. But the .msi of IronPython studio still refuses to install. Is there anything else I need to do in order to get it installed? The website doesn't say anything about anything else, but the VS prerequisite. Thanks a lot in advance, cheers, Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe _______________________________________________ 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu Feb 25 00:12:34 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 24 Feb 2010 23:12:34 +0000 Subject: [IronPython] IronPython Tools In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39393633@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD3939357D@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD39393633@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <1B42307CD4AADD438CDDA2FE1121CC920F614D50@TK5EX14MBXC134.redmond.corp.microsoft.com> >>> By chance has the issue been resolved for adding references for our own assemblies from Gestalt Not yet in a public build. =( The tools point to a build of IronPython from 2009-11-20, and that fix was only done a week or so ago, and we haven't pushed the release up to CDN. Though, I'm planning on doing it this week, along with documentation on the ironpython website. I'll let the mailing list know when it released. ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, February 24, 2010 2:39 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Tools Hurm, I think I may have gone w/ the wrong alias. Try ironpy at microsoft.com instead. The problem w/ a graphical way to add references is that we start to get into a complex world where the .py files are not representing everything that your code needs and therefore running them from the command line is not identical to running them in VS. We could consider an add references dialog which pastes code into a .py file but I'm not sure how weird this would be. We could also even consider providing intellisense for when you're filling in the string for clr.AddReference(...). IronPython Tools includes 2.6.1 RC1 for .NET 4.0 as the version of IronPython it works against by default. Because it targets Visual Studio 2010 it'll always target primarily CLR4. You can configure what interpreter it runs against in project properties but that won't have any impact on the code analysis (or the REPL process) right now. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Cronin, Ted Sent: Wednesday, February 24, 2010 2:32 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] IronPython Tools Any word on the email address not connecting, also was just pointing out that AddReference was not accessible from References. Nice to have a graphical way to add references rather than just through code. By chance has the issue been resolved for adding references for our own assemblies from Gestalt. Do the tools work with 261, or does that really matter, or should we be testing with 26? So far this is really nice, in that we now have access to more than just winform capability, so thank you for doing this for the community. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, February 24, 2010 2:23 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Tools Currently the best way to add a reference is to call clr.AddReference('assemblyname'). The analysis engine will pick up the call and include the assembly as being available in the list of imports. I'll take a look at the crashing bug. As for ASP.NET support we'll need to look into getting some templates and including our existing ASP.NET support in the overall package. There was also interest at PyCon about this so it seems likely we'll add this in (and it shouldn't be too much work to create a template). As for online templates we're likely to ship all of the templates we make w/ IpyTools. But I think you should be able to create on-line templates for other users to use. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Cronin, Ted Sent: Wednesday, February 24, 2010 2:10 PM To: 'Discussion of IronPython' Subject: [IronPython] IronPython Tools So, that's cool, it appears you have gestalt inside of Ipy Tools, How do we add Reference, also when trying to add a new search path, VS crashes with an Unhandled Exception, duped in sl and wpf. Will there be an asp.net web form project? There are no online templates. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcronin at asrclkrec.com Thu Feb 25 00:39:15 2010 From: tcronin at asrclkrec.com (Cronin, Ted) Date: Wed, 24 Feb 2010 15:39:15 -0800 Subject: [IronPython] IronPython Tools In-Reply-To: <1B42307CD4AADD438CDDA2FE1121CC920F614D50@TK5EX14MBXC134.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD3939357D@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD39393633@TK5EX14MBXC118.redmond.corp.microsoft.com> <1B42307CD4AADD438CDDA2FE1121CC920F614D50@TK5EX14MBXC134.redmond.corp.microsoft.com> Message-ID: Thank you Jimmy, that is more fantastic news. Ted County of Riverside ValueGIS 951-955-0487 From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Wednesday, February 24, 2010 3:13 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Tools >>> By chance has the issue been resolved for adding references for our own assemblies from Gestalt Not yet in a public build. =( The tools point to a build of IronPython from 2009-11-20, and that fix was only done a week or so ago, and we haven't pushed the release up to CDN. Though, I'm planning on doing it this week, along with documentation on the ironpython website. I'll let the mailing list know when it released. ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, February 24, 2010 2:39 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Tools Hurm, I think I may have gone w/ the wrong alias. Try ironpy at microsoft.com instead. The problem w/ a graphical way to add references is that we start to get into a complex world where the .py files are not representing everything that your code needs and therefore running them from the command line is not identical to running them in VS. We could consider an add references dialog which pastes code into a .py file but I'm not sure how weird this would be. We could also even consider providing intellisense for when you're filling in the string for clr.AddReference(...). IronPython Tools includes 2.6.1 RC1 for .NET 4.0 as the version of IronPython it works against by default. Because it targets Visual Studio 2010 it'll always target primarily CLR4. You can configure what interpreter it runs against in project properties but that won't have any impact on the code analysis (or the REPL process) right now. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Cronin, Ted Sent: Wednesday, February 24, 2010 2:32 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] IronPython Tools Any word on the email address not connecting, also was just pointing out that AddReference was not accessible from References. Nice to have a graphical way to add references rather than just through code. By chance has the issue been resolved for adding references for our own assemblies from Gestalt. Do the tools work with 261, or does that really matter, or should we be testing with 26? So far this is really nice, in that we now have access to more than just winform capability, so thank you for doing this for the community. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, February 24, 2010 2:23 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Tools Currently the best way to add a reference is to call clr.AddReference('assemblyname'). The analysis engine will pick up the call and include the assembly as being available in the list of imports. I'll take a look at the crashing bug. As for ASP.NET support we'll need to look into getting some templates and including our existing ASP.NET support in the overall package. There was also interest at PyCon about this so it seems likely we'll add this in (and it shouldn't be too much work to create a template). As for online templates we're likely to ship all of the templates we make w/ IpyTools. But I think you should be able to create on-line templates for other users to use. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Cronin, Ted Sent: Wednesday, February 24, 2010 2:10 PM To: 'Discussion of IronPython' Subject: [IronPython] IronPython Tools So, that's cool, it appears you have gestalt inside of Ipy Tools, How do we add Reference, also when trying to add a new search path, VS crashes with an Unhandled Exception, duped in sl and wpf. Will there be an asp.net web form project? There are no online templates. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.mcwright at usbfmi.com Thu Feb 25 03:16:42 2010 From: david.mcwright at usbfmi.com (David McWright) Date: Wed, 24 Feb 2010 18:16:42 -0800 (PST) Subject: [IronPython] Binding a Python class to a DataGridView Message-ID: <74b53c67-c65d-4eab-a85f-4bcfe30c7541@x1g2000prb.googlegroups.com> I'm working with DataGridView in IPY2.6.1 and I'm having trouble with a couple of things. I found a closed issue on the CodePlex here: http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=6332 and used it as a platform to experiment. I've attached the code to this post below. However, the changes I have made led me to a couple of issues: 1) If I set the DataSource of the DataGridView(DGV) to a BindingList containing instances of a custom class, then the DGV adds a column for both properties and instance variables. Obviously, the DGV doesn't discriminate, is there a way that I can make it add only properties? 2) The purpose of using the BindingList was to facilitate deletion, editing and adding new records to the DGV. Deletion and editing work fine, but trying to add a new record causes a run-time error "System.MissingMethodException: Constructor on type 'IronPython.NewTypes.System.Object_1$1' not found." Any ideas why this is? Is there a better way to bind a collection, list, etc to a DGV than using a BindingList, an idea I got from a C# book? import clr import System clr.AddReference('System.Windows.Forms') import System.Windows.Forms as SWF from System.ComponentModel import BindingList SAMPLE_DATA = [ ('Joe', 23), ('Bob', 8), ('Thomas', 32), ('Patrick', 41), ('Kathy', 19), ('Sue', 77), ] class Person(System.Object): def __init__(self): self._name = "" self._age = -1 def get_name(self): return self._name def set_name(self, value): self._name = value Name = property(get_name, set_name) def get_age(self): return self._age def set_age(self, value): self._age = value Age = property(get_age, set_age) class DBInterface: @staticmethod def GetPairs(): Pairs = BindingList[Person]() Pairs.AllowNew = True for name, age in SAMPLE_DATA: temp = Person() temp.Name = name temp.Age = age Pairs.Add(temp) return Pairs class Form(SWF.Form): def __init__(self): SWF.Form.__init__(self) grid = SWF.DataGridView() grid.AutoGenerateColumns = True grid.DataSource = DBInterface.GetPairs() grid.Dock = SWF.DockStyle.Fill self.Controls.Add(grid) SWF.Application.EnableVisualStyles() form = Form() SWF.Application.Run(form) Thanks, David From bruce.bromberek at gmail.com Thu Feb 25 05:53:20 2010 From: bruce.bromberek at gmail.com (Bruce Bromberek) Date: Wed, 24 Feb 2010 22:53:20 -0600 Subject: [IronPython] Can't start executable created with pyc.py In-Reply-To: References: Message-ID: <58ad4a111002242053w58d4a499lef833cd429a348bf@mail.gmail.com> There are differences between modules that the console (ipy.exe) loads versus what is loaded when you compile. When I build an exe I just go for the kill and reference everything. msscorlib, System, and System.Data are key. import sys import clr #Key IronPython References needed for final EXE when IronPython is not installed clr.AddReference('IronPython') clr.AddReference('IronPython.Modules') clr.AddReference('Microsoft.Dynamic') clr.AddReference('Microsoft.Scripting') clr.AddReference('Microsoft.Scripting.Core') clr.AddReference('Microsoft.Scripting.Debugging') clr.AddReference('Microsoft.Scripting.ExtensionAttribute') clr.AddReference('mscorlib') clr.AddReference('System') clr.AddReference('System.Data') #References to .NET Assemblies used by this program clr.AddReference("System.Xml.Linq") clr.AddReference("System.Xml") clr.AddReference("System.Windows.Forms") clr.AddReference("PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") clr.AddReference("PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") #References to created DLL of python modules clr.AddReference("StdLib") clr.AddReference("ReportLab") On Tue, Feb 23, 2010 at 6:17 AM, Neidhoo Xaphier wrote: > > Hello, > > I have a very simple python script I want to compile into an exe-File (with > IronPython 2.6). The script is named "GuiTest.py": > > ### BEGIN GuiTest.py ### > import clr > clr.AddReference("PresentationFramework") > clr.AddReference("PresentationCore") > > import System.Windows > import System.Windows.Controls > > window = System.Windows.Window() > window.Title = "GuiTest" > window.Height = 200 > window.Width = 450 > > stack = System.Windows.Controls.StackPanel() > stack.Margin = System.Windows.Thickness(15) > window.Content = stack > > button = System.Windows.Controls.Button() button.Content = "Push Me!" > > def onClick(sender, event): > print "Button pushed!" > > button.Click += onClick > > stack.Children.Add(button) > > app = System.Windows.Application() > app.Run(window) > ### END GuiTest.py ### > > By using "pyc.py" I created "GuiTest.exe" with the following command line: > > ipy "C:\Programme\IronPython 2.6\Tools\Scripts\pyc.py" /main:GuiTest.py > /target:exe > > Next I copied the following files into the same folder where GuiTest.exe is > stored: > > IronPython.dll > IronPython.Modules.dll > Microsoft.Scripting.ExtensionAttribute.dll > Microsoft.Dynamic.dll > Microsoft.Scripting.Core.dll > Microsoft.Scripting.Debugging.dll > Microsoft.Scripting.dll > > Unfortunatelly GuiTest.exe still doesn't work. If I try to execute it from > the command line I get the following error message: > > Unbehandelte Ausnahme: System.InvalidOperationException: Beim aufrufenden > Thread muss es sich um einen STA-Thread handeln, da dies f?r viele > Komponenten der Benutzeroberfl?che erforderlich ist. > bei > Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args, > Boolean& shouldOptimize) > bei > IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`6.Call5(Ca > llSite site, CodeContext context, TFuncType func, T0 arg0, T1 arg1, T2 arg2, > T3arg3, T4 arg4) > bei > System.Dynamic.UpdateDelegates.UpdateAndExecute7[T0,T1,T2,T3,T4,T5,T6,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) > bei IronPython.Runtime.Importer.Import(CodeContext context, String > fullName, PythonTuple from, Int32 level) > bei IronPython.Runtime.Operations.PythonOps.InitializeModule(Assembly > precompiled, String main, String[] references) > bei PythonMain.Main() > > Do you have any ideas how I can resolve this issue? > > Best regards, > Xaphier N. > > _______________________________________________ > 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 pablodalma93 at hotmail.com Thu Feb 25 16:40:13 2010 From: pablodalma93 at hotmail.com (Pablo Dalmazzo) Date: Thu, 25 Feb 2010 12:40:13 -0300 Subject: [IronPython] =?windows-1252?q?clr=2ECompileModules=28=85=29_=93co?= =?windows-1252?q?uldn=92t_find_member_CompileModules=94?= Message-ID: Hi there, Im getting the following error Visual Studio 2008 Professional SP1 installed, asp.net ironpython website import clr #ok clr.AddReference('System') #ok but clr.CompileModules(...) "couldn't find member CompileModules" Anyone got this once? _________________________________________________________________ ?Esperando en el cyber? Registrate GRATIS a SMS Messenger y chate? en tu celu. http://www.somosmessengersiempre.com/?ocid=TWLH -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablodalma93 at hotmail.com Thu Feb 25 16:41:19 2010 From: pablodalma93 at hotmail.com (Pablo Dalmazzo) Date: Thu, 25 Feb 2010 12:41:19 -0300 Subject: [IronPython] IronPython for asp.net integration with Visual Studio 2008 Message-ID: Hi there, I have Visual Studio 2008 Professional SP1 installed. I also have IronPython v. 2.6 installed. In the C:\Program files\IronPython folder there is an IronPython.dll file version 2.6.911.0. But when I create an asp.net website project in IronPython in Visual Studio, the IronPython.dll file created in the bin folder is listed as version 2.0.0.0 and in the web.config file as "IronPython, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" is this the last version VS2008 supports or is there any way to update VS to create the website with a 2.6.911.0 version instead? Greetings _________________________________________________________________ Ahora chate? desde la playa con tu celu. Registrate gratis a SMS Messenger. http://www.somosmessengersiempre.com/?ocid=TWLH -------------- next part -------------- An HTML attachment was scrubbed... URL: From cjac at colliertech.org Wed Feb 24 00:08:23 2010 From: cjac at colliertech.org (C.J. Adams-Collier) Date: Tue, 23 Feb 2010 15:08:23 -0800 Subject: [IronPython] Running the IronPython tests (on Mono) In-Reply-To: <7CEEC335D70FFE4B957737DDE836F51B34857BC6@TK5EX14MBXC125.redmond.corp.microsoft.com> References: <1266821392.4977.3.camel@calcifer> <4B342496A3EFEB48839E10BB4BF5964C3DB72768@TK5EX14MBXC122.redmond.corp.microsoft.com> <1266862082.4977.7.camel@calcifer> <7CEEC335D70FFE4B957737DDE836F51B34857BC6@TK5EX14MBXC125.redmond.corp.microsoft.com> Message-ID: <1266966503.5756.3.camel@calcifer> I don't see a harness.py. Maybe the snapshot I'm working from is too old. 8/5/2009 On Mon, 2010-02-22 at 21:59 +0000, Dave Fugate wrote: > For IronPython, try running: > IronPython\Tests> ipy.exe harness.py > > I haven't tried running this recently, but it did work about a year ago... > > Dave > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of C.J. Adams-Collier > Sent: Monday, February 22, 2010 1:08 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Running the IronPython tests (on Mono) > > Thanks Tomas, > > I recall doing a bit of work on this with Ivan last year. I think we got most of them performing reasonably. I don't remember whether we re-wrote the batch files in ruby or bash or whatever... we should probably do that at some point... > > Cheers, > > C.J. > > > On Mon, 2010-02-22 at 17:19 +0000, Tomas Matousek wrote: > > To run IronRuby tests you can use Merlin\Main\Languages\Ruby\Scripts\irtests.rb. > > But it won't run on Linux as is due to dependencies on various batch files. We should replace all of them by Ruby scripts in future so that it runs on Linux as well. > > > > Tomas > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of C.J. > > Adams-Collier > > Sent: Sunday, February 21, 2010 10:50 PM > > To: users at lists.ironpython.com > > Subject: [IronPython] Running the IronPython tests (on Mono) > > > > Hey folks, > > > > I'm trying hard to shoehorn IronPython (and IronRuby) into Ubuntu Lucid, the next long-term stable release. They're asking if I can get the test suite to execute as part of the package build script. > > > > Can someone walk me through running the test suite? > > > > The one caveat is that this is a snapshot from git as of 08/05/2009. > > I've been working on this version since then in order to get it packaged up. It shouldn't take quite so long to get releases packaged up in the future. > > > > Let me know if you need a shell on ironruby.colliertech.org and when/if you can help me walk through getting the test suite going. > > > > Thanks in advance, > > > > C.J. > > > > _______________________________________________ > > 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 -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: From dinov at microsoft.com Thu Feb 25 19:03:35 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 25 Feb 2010 18:03:35 +0000 Subject: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD39399B9A@TK5EX14MBXC118.redmond.corp.microsoft.com> I think this is just because it's an old version of IronPython - that's the same issue with your later issue as well. It might be possible to replace the older binaries w/ newer 2.6 binaries but my guess is that it'd break things in IronPython Studio it's self. This is one of the mail problems w/ IronPython Studio: it's not kept up to date :( From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pablo Dalmazzo Sent: Thursday, February 25, 2010 7:40 AM To: IronPython Mailing list Subject: [IronPython] clr.CompileModules(...) "couldn't find member CompileModules" Hi there, Im getting the following error Visual Studio 2008 Professional SP1 installed, asp.net ironpython website import clr #ok clr.AddReference('System') #ok but clr.CompileModules(...) "couldn't find member CompileModules" Anyone got this once? ________________________________ Windows Live Hotmail es m?s seguro con el control de suplantaci?n de identidad. M?s info aqu? -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablodalma93 at hotmail.com Thu Feb 25 19:52:43 2010 From: pablodalma93 at hotmail.com (Pablo Dalmazzo) Date: Thu, 25 Feb 2010 15:52:43 -0300 Subject: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39399B9A@TK5EX14MBXC118.redmond.corp.microsoft.com> References: , <1A472770E042064698CB5ADC83A12ACD39399B9A@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: Thank you Dino, did you mean IronPython Studio or Visual Studio? I'm using Visual Studio. I'm not sure, but I thought it wasnt possible to create an asp.net website in IronPython Studio (I think I've read that) and I've seen only Window applications and WPF projects in IronPython Studio From: dinov at microsoft.com To: users at lists.ironpython.com Date: Thu, 25 Feb 2010 18:03:35 +0000 Subject: Re: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" I think this is just because it?s an old version of IronPython ? that?s the same issue with your later issue as well. It might be possible to replace the older binaries w/ newer 2.6 binaries but my guess is that it?d break things in IronPython Studio it?s self. This is one of the mail problems w/ IronPython Studio: it?s not kept up to date L From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pablo Dalmazzo Sent: Thursday, February 25, 2010 7:40 AM To: IronPython Mailing list Subject: [IronPython] clr.CompileModules(?) ?couldn?t find member CompileModules? Hi there, Im getting the following error Visual Studio 2008 Professional SP1 installed, asp.net ironpython website import clr #ok clr.AddReference('System') #ok but clr.CompileModules(...) "couldn't find member CompileModules" Anyone got this once? Windows Live Hotmail es m?s seguro con el control de suplantaci?n de identidad. M?s info aqu? _________________________________________________________________ Hotmail en tu celu ?f?cil y sin descargas! Ingres? a mobile.live.com y env?a correos donde est?s http://www.windowsliveformobile.com/es/hotmail/default.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu Feb 25 20:09:08 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 25 Feb 2010 19:09:08 +0000 Subject: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" In-Reply-To: References: , <1A472770E042064698CB5ADC83A12ACD39399B9A@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD39399E9D@TK5EX14MBXC118.redmond.corp.microsoft.com> Oh, sorry, I was apparently confused. It looks like we still need to update the binaries for ASP.NET (see http://lists.ironpython.com/pipermail/users-ironpython.com/2010-February/012149.html). Jimmy, any idea on how this is progressing? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pablo Dalmazzo Sent: Thursday, February 25, 2010 10:53 AM To: IronPython Mailing list Subject: Re: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" Thank you Dino, did you mean IronPython Studio or Visual Studio? I'm using Visual Studio. I'm not sure, but I thought it wasnt possible to create an asp.net website in IronPython Studio (I think I've read that) and I've seen only Window applications and WPF projects in IronPython Studio ________________________________ From: dinov at microsoft.com To: users at lists.ironpython.com Date: Thu, 25 Feb 2010 18:03:35 +0000 Subject: Re: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" I think this is just because it's an old version of IronPython - that's the same issue with your later issue as well. It might be possible to replace the older binaries w/ newer 2.6 binaries but my guess is that it'd break things in IronPython Studio it's self. This is one of the mail problems w/ IronPython Studio: it's not kept up to date :( From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pablo Dalmazzo Sent: Thursday, February 25, 2010 7:40 AM To: IronPython Mailing list Subject: [IronPython] clr.CompileModules(...) "couldn't find member CompileModules" Hi there, Im getting the following error Visual Studio 2008 Professional SP1 installed, asp.net ironpython website import clr #ok clr.AddReference('System') #ok but clr.CompileModules(...) "couldn't find member CompileModules" Anyone got this once? ________________________________ Windows Live Hotmail es m?s seguro con el control de suplantaci?n de identidad. M?s info aqu? ________________________________ Internet Explorer 8 es m?s seguro -?Probalo gratis! Hac? clic aqu? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu Feb 25 20:32:10 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 25 Feb 2010 19:32:10 +0000 Subject: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39399E9D@TK5EX14MBXC118.redmond.corp.microsoft.com> References: , <1A472770E042064698CB5ADC83A12ACD39399B9A@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD39399E9D@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <1B42307CD4AADD438CDDA2FE1121CC920F6152A6@TK5EX14MBXC134.redmond.corp.microsoft.com> Pablo, to write ASP.NET apps in IronPython, download this: http://ironpython.net/download/aspnet-201001 It should be open-able from within IronPython Studio, since the binaries are in the project. Note: the IronPython binaries are 2.6 RTM; if you want to use 2.6.1 RC, just try replacing them in the above download. It will probably require some tweaking of version numbers in the web.config, but there weren't any breaking changes in the hosting APIs between versions, so the Microsoft.Web.Scripting.dll binary should still be good. Dino, that mail was about open-sourcing the ASP.NET integration, which has seen very little progress. But, it's something I've resumed pushing on, as I've taken over Harry's lawyer-interaction roles. ~js From: Dino Viehland Sent: Thursday, February 25, 2010 11:09 AM To: Discussion of IronPython; Jimmy Schementi Subject: RE: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" Oh, sorry, I was apparently confused. It looks like we still need to update the binaries for ASP.NET (see http://lists.ironpython.com/pipermail/users-ironpython.com/2010-February/012149.html). Jimmy, any idea on how this is progressing? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pablo Dalmazzo Sent: Thursday, February 25, 2010 10:53 AM To: IronPython Mailing list Subject: Re: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" Thank you Dino, did you mean IronPython Studio or Visual Studio? I'm using Visual Studio. I'm not sure, but I thought it wasnt possible to create an asp.net website in IronPython Studio (I think I've read that) and I've seen only Window applications and WPF projects in IronPython Studio ________________________________ From: dinov at microsoft.com To: users at lists.ironpython.com Date: Thu, 25 Feb 2010 18:03:35 +0000 Subject: Re: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" I think this is just because it's an old version of IronPython - that's the same issue with your later issue as well. It might be possible to replace the older binaries w/ newer 2.6 binaries but my guess is that it'd break things in IronPython Studio it's self. This is one of the mail problems w/ IronPython Studio: it's not kept up to date :( From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pablo Dalmazzo Sent: Thursday, February 25, 2010 7:40 AM To: IronPython Mailing list Subject: [IronPython] clr.CompileModules(...) "couldn't find member CompileModules" Hi there, Im getting the following error Visual Studio 2008 Professional SP1 installed, asp.net ironpython website import clr #ok clr.AddReference('System') #ok but clr.CompileModules(...) "couldn't find member CompileModules" Anyone got this once? ________________________________ Windows Live Hotmail es m?s seguro con el control de suplantaci?n de identidad. M?s info aqu? ________________________________ Internet Explorer 8 es m?s seguro -?Probalo gratis! Hac? clic aqu? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu Feb 25 23:39:08 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 25 Feb 2010 22:39:08 +0000 Subject: [IronPython] Bug fixes in Ipy 2.6.1 In-Reply-To: <1A472770E042064698CB5ADC83A12ACD393117F9@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <000601cab089$37569630$a603c290$@com> <1A472770E042064698CB5ADC83A12ACD393117F9@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD3939B76D@TK5EX14MBXC118.redmond.corp.microsoft.com> Actually this appears to be the correct behavior! There's another way to get at the frame and that's via sys.exc_info(). This modified version, which runs on both IronPython and CPython and prints the same thing, shows how you get back to the list: import sys def f(): def coroutine(): just_numbers = range(1,1000000) def inner_method(): return just_numbers yield None raise Exception("some exception") # comment out this line to make the test not work crt = coroutine() try: crt.next() crt.next() except: pass crt = None print len(sys.exc_info()[2].tb_next.tb_frame.f_locals['just_numbers']) f() From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, February 18, 2010 8:16 AM To: Discussion of IronPython Cc: Ronnie Maor; Avner Rosenan Subject: Re: [IronPython] Bug fixes in Ipy 2.6.1 This is interesting - there's a .NET exception object which is keeping a traceback frame alive which is keeping the just_numbers list alive. We should clear out the local .NET exception and the memory will then be eligible for collection. The good news is that as soon as this method is no longer on the stack the memory is reclaimable (so it's really just that we're not collecting soon enough - not that we're actually leaking the memory) but we should fix it anyway. I've opened this bug: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26244 From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Idan Zaltzberg Sent: Thursday, February 18, 2010 2:58 AM To: users at lists.ironpython.com Cc: Ronnie Maor; Avner Rosenan Subject: [IronPython] Bug fixes in Ipy 2.6.1 Hi, In Ipy 2.6 there some issues of memory leak when using generator methods. I downloaded Ipy 2.6.1 RC1 and indeed most of them were fixed. Still, one issue still remains the same but I'm not entirely sure this is a real bug: The following code shows that in some cases, some memory is not released even after GC, is that ok? def coroutine(): just_numbers = range(1,1000000) def inner_method(): return just_numbers yield None raise Exception("some exception") # comment out this line to make the test not work from System import GC def get_memory(): for _ in xrange(4): GC.Collect() GC.WaitForPendingFinalizers() return GC.GetTotalMemory(True)/1e6 before = get_memory() crt = coroutine() try: crt.next() crt.next() except: pass crt = None after = get_memory() self.assert_(after-before > 10,'There should be a memory leak in this case.before=%s after=%s' % (before,after)) -------------- next part -------------- An HTML attachment was scrubbed... URL: From cenovsky at bakalari.cz Fri Feb 26 09:54:54 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Fri, 26 Feb 2010 09:54:54 +0100 Subject: [IronPython] Compiling .py to .dll to use with Silverlight In-Reply-To: <1B42307CD4AADD438CDDA2FE1121CC920D6BA8@TK5EX14MBXC138.redmond.corp.microsoft.com> References: <4B09AC8D.4090207@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD04D2017F@TK5EX14MBXC118.redmond.corp.microsoft.com> <4B1420C7.8040403@voidspace.org.uk> <4B622333.5050809@bakalari.cz> <1B42307CD4AADD438CDDA2FE1121CC920D6BA8@TK5EX14MBXC138.redmond.corp.microsoft.com> Message-ID: <4B878C5E.70402@bakalari.cz> Hi Jimmy, PyCon's over, I checked your talk there (cool things!) but no mention about IronPython .dlls and Silverlight. Any progress on this issue? All who need speed up IronPython Silverlight applications please vote: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=25680 -- -- Luk?? Jimmy Schementi wrote: > No update yet, but I'm planning on looking at it for my PyCon talk ... > > ~Jimmy > > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Lukas Cenovsky >> Sent: Thursday, January 28, 2010 3:52 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Compiling .py to .dll to use with Silverlight >> >> Any update on this issue? I'd like to see it working as it is quite an issue >> for business apps. >> >> For others interested please vote: >> http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=25680 >> >> -- >> -- Luk?? >> >> >> Michael Foord wrote: >> >>> Dino Viehland wrote: >>> >>>> I'm not aware of any working example of this. In theory you can do >>>> it by hand by just taking the resulting DLL that gets compiled on the >>>> desktop and updating all of the assembly versions to be the >>>> Silverlight assembly versions. That can be done by sending it >>>> through ildasm/ilasm. You'd need to update all of the IronPython and >>>> DLR assemblies as well as mscorlib and System all of which have >>>> different versions on Silverlight vs the desktop CLR. >>>> >>>> >>> For the record I tried this and it didn't work for me. The resulting >>> assembly uses StrongBox (from memory) and possibly other features not >>> available in CoreCLR. >>> >>> I would also love to see a solution to this as import time is a big >>> factor in the startup of IronPython Silverlight apps and pre-compiled >>> assemblies would help a lot. >>> >>> All the best, >>> >>> Michael >>> >>> >>>> >>>>> -----Original Message----- >>>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>>> bounces at lists.ironpython.com] On Behalf Of Lukas Cenovsky >>>>> Sent: Sunday, November 22, 2009 1:27 PM >>>>> To: Discussion of IronPython >>>>> Subject: [IronPython] Compiling .py to .dll to use with Silverlight >>>>> >>>>> Hi, >>>>> I'd like to know status of the $subj. I have found some discussions >>>>> (e.g. Michael tried to use pyc or >>>>> http://sdlsdk.codeplex.com/Thread/View.aspx?ThreadId=52207&ANCHOR >>>>> ) >>>>> but >>>>> no working example - is there any? And if not will be any? :-) >>>>> Thanks. >>>>> >>>>> -- >>>>> -- Luk?? >>>>> >>>>> _______________________________________________ >>>>> 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 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablodalma93 at hotmail.com Fri Feb 26 14:19:05 2010 From: pablodalma93 at hotmail.com (Pablo Dalmazzo) Date: Fri, 26 Feb 2010 10:19:05 -0300 Subject: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" In-Reply-To: <1B42307CD4AADD438CDDA2FE1121CC920F6152A6@TK5EX14MBXC134.redmond.corp.microsoft.com> References: , , <1A472770E042064698CB5ADC83A12ACD39399B9A@TK5EX14MBXC118.redmond.corp.microsoft.com>, , <1A472770E042064698CB5ADC83A12ACD39399E9D@TK5EX14MBXC118.redmond.corp.microsoft.com>, <1B42307CD4AADD438CDDA2FE1121CC920F6152A6@TK5EX14MBXC134.redmond.corp.microsoft.com> Message-ID: Thanks Jimmy, the problem is, there is no "Open Website" option in IronPython Studio, and to be honest, I have no clue how to open it without it :) . Now I've found your blog and I've seen you explain how to do it in Visual Studio, and it seems to me you arent involved in the developing of IronPython Studio, but just in the case you know how to enable that, or opening the website without it, or to point me in some direction, please let me know :) Greetings, Pablo From: Jimmy.Schementi at microsoft.com To: dinov at microsoft.com; users at lists.ironpython.com Date: Thu, 25 Feb 2010 19:32:10 +0000 Subject: Re: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" Pablo, to write ASP.NET apps in IronPython, download this: http://ironpython.net/download/aspnet-201001 It should be open-able from within IronPython Studio, since the binaries are in the project. Note: the IronPython binaries are 2.6 RTM; if you want to use 2.6.1 RC, just try replacing them in the above download. It will probably require some tweaking of version numbers in the web.config, but there weren?t any breaking changes in the hosting APIs between versions, so the Microsoft.Web.Scripting.dll binary should still be good. Dino, that mail was about open-sourcing the ASP.NET integration, which has seen very little progress. But, it?s something I?ve resumed pushing on, as I?ve taken over Harry?s lawyer-interaction roles. ~js From: Dino Viehland Sent: Thursday, February 25, 2010 11:09 AM To: Discussion of IronPython; Jimmy Schementi Subject: RE: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" Oh, sorry, I was apparently confused. It looks like we still need to update the binaries for ASP.NET (see http://lists.ironpython.com/pipermail/users-ironpython.com/2010-February/012149.html). Jimmy, any idea on how this is progressing? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pablo Dalmazzo Sent: Thursday, February 25, 2010 10:53 AM To: IronPython Mailing list Subject: Re: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" Thank you Dino, did you mean IronPython Studio or Visual Studio? I'm using Visual Studio. I'm not sure, but I thought it wasnt possible to create an asp.net website in IronPython Studio (I think I've read that) and I've seen only Window applications and WPF projects in IronPython Studio From: dinov at microsoft.com To: users at lists.ironpython.com Date: Thu, 25 Feb 2010 18:03:35 +0000 Subject: Re: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules"I think this is just because it?s an old version of IronPython ? that?s the same issue with your later issue as well. It might be possible to replace the older binaries w/ newer 2.6 binaries but my guess is that it?d break things in IronPython Studio it?s self. This is one of the mail problems w/ IronPython Studio: it?s not kept up to date L From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pablo Dalmazzo Sent: Thursday, February 25, 2010 7:40 AM To: IronPython Mailing list Subject: [IronPython] clr.CompileModules(?) ?couldn?t find member CompileModules? Hi there, Im getting the following error Visual Studio 2008 Professional SP1 installed, asp.net ironpython websiteimport clr #ok clr.AddReference('System') #okbutclr.CompileModules(...)"couldn't find member CompileModules" Anyone got this once?Windows Live Hotmail es m?s seguro con el control de suplantaci?n de identidad. M?s info aqu? Internet Explorer 8 es m?s seguro -?Probalo gratis! Hac? clic aqu? _________________________________________________________________ Hotmail en tu celu ?f?cil y sin descargas! Ingres? a mobile.live.com y env?a correos donde est?s http://www.windowsliveformobile.com/es/hotmail/default.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From drken567 at gmail.com Fri Feb 26 17:46:41 2010 From: drken567 at gmail.com (Ken MacDonald) Date: Fri, 26 Feb 2010 11:46:41 -0500 Subject: [IronPython] IronPython startup time Message-ID: <3468cae11002260846w7db22691k626da174298759c2@mail.gmail.com> Hi, I have inherited an IP project. Customer is complaining that startup time with no apparent progress takes quite a while, and would like something to happen prior to the time that the login screen finally appears. I have a splash screen, and have set it to splash prior to the login screen, now something appears at about ~~ 12 sec. rather than ~~15 sec. for the login screen, but is still kind of a long wait. I've tried moving the splash screen earlier, but it dies of missing resources; not sure just what. I'm wondering if there is a way of defining a really minimal splash screen that requires next to nothing to start up, and getting it to pop up in maybe 3 or 4 sec.? Ken -------------- next part -------------- An HTML attachment was scrubbed... URL: From merllab at microsoft.com Fri Feb 26 17:53:05 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Fri, 26 Feb 2010 08:53:05 -0800 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/64203. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/ParameterMapping.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/OverloadResolver.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/ParameterWrapper.cs $/IronPython/IronPython_Main/Src/IronPythonTest/BindTest.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Tokenizer.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/TypeInferer.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/ReturnReferenceArgBuilder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Actions/Calls/ReferenceArgBuilder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Runtime/ScriptingRuntimeHelpers.cs $/IronPython/IronPython_Main/Src/Tests/test_methodbinder1.py $/IronPython/IronPython_Main/Src/Tests/test_methoddispatch.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1605388 Date: 2/24/2010 12:42:49 PM Fixes a parser bug related to multi-line strings w/ state. Currently when we hit a line like: ???foo\ We will report an error because of the EOF (we?re parsing one line at a time here) in the middle of the string. Now if we?re in verbatim mode we?ll return an IncompleteStringToken and set our state so we can resume parsing on the next line. This was exposed via IronPython Tools. (Shelveset: FixMultiLineParserBug;REDMOND\dinov | SNAP CheckinId: 10394) From fuzzyman at voidspace.org.uk Fri Feb 26 17:56:39 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 26 Feb 2010 16:56:39 +0000 Subject: [IronPython] IronPython startup time In-Reply-To: <3468cae11002260846w7db22691k626da174298759c2@mail.gmail.com> References: <3468cae11002260846w7db22691k626da174298759c2@mail.gmail.com> Message-ID: <4B87FD47.9020405@voidspace.org.uk> On 26/02/2010 16:46, Ken MacDonald wrote: > Hi, > I have inherited an IP project. Customer is complaining that startup > time with no apparent progress takes quite a while, and would like > something to happen prior to the time that the login screen finally > appears. I have a splash screen, and have set it to splash prior to > the login screen, now something appears at about ~~ 12 sec. rather > than ~~15 sec. for the login screen, but is still kind of a long wait. > I've tried moving the splash screen earlier, but it dies of missing > resources; not sure just what. I'm wondering if there is a way of > defining a really minimal splash screen that requires next to nothing > to start up, and getting it to pop up in maybe 3 or 4 sec.? We achieved this at Resolver Systems by embedding IronPython in a very simple C# executable (actually not so simple because it also does single instance remoting but that isn't relevant to this question). The exe displays the splash screen and then starts IronPython using the hosting API. Almost all the startup time (which has improved dramatically with recent releases) is Python imports - so we have a parallel import system that allows us to post updates to the progress bar as the imports complete. Kamil released this code as open source: http://github.com/luntain/ipy-parallel-import On the other hand, putting the splash screen first in your IronPython code (before significant imports) should enable it to be displayed in under 3 seconds - so if that is currently failing you should be able to make it work by debugging the issue. There is no reason this approach fundamentally can't work. All the best, Michael Foord > Ken > > > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cenovsky at bakalari.cz Fri Feb 26 17:59:43 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Fri, 26 Feb 2010 17:59:43 +0100 Subject: [IronPython] IronPython startup time In-Reply-To: <3468cae11002260846w7db22691k626da174298759c2@mail.gmail.com> References: <3468cae11002260846w7db22691k626da174298759c2@mail.gmail.com> Message-ID: <4B87FDFF.9000604@bakalari.cz> Ken MacDonald wrote: > Hi, > I have inherited an IP project. Customer is complaining that startup > time with no apparent progress takes quite a while, and would like > something to happen prior to the time that the login screen finally > appears. I have a splash screen, and have set it to splash prior to > the login screen, now something appears at about ~~ 12 sec. rather > than ~~15 sec. for the login screen, but is still kind of a long wait. > I've tried moving the splash screen earlier, but it dies of missing > resources; not sure just what. I'm wondering if there is a way of > defining a really minimal splash screen that requires next to nothing > to start up, and getting it to pop up in maybe 3 or 4 sec.? > Ken I think you have to create the splash in C# or VB to display it sooner. -- -- Luk?? From pablodalma93 at hotmail.com Sat Feb 27 12:32:10 2010 From: pablodalma93 at hotmail.com (Pablo Dalmazzo) Date: Sat, 27 Feb 2010 08:32:10 -0300 Subject: [IronPython] Clarification needed in the use of the bin folder in asp.net IronPython Message-ID: Hi there, I need someone to clarify me this, am I supposed to add a clr.addreference() line to my code before importing a module in an assembly in the bin folder, or should I be able to import the module directly like when I'm working with vb.net or c# compiled assemblies? Greetings _________________________________________________________________ Todo lo que quer?s saber sobre la TV y sus protagonistas en MSN http://msn.novebox.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablodalma93 at hotmail.com Sat Feb 27 12:45:44 2010 From: pablodalma93 at hotmail.com (Pablo Dalmazzo) Date: Sat, 27 Feb 2010 08:45:44 -0300 Subject: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" In-Reply-To: <1B42307CD4AADD438CDDA2FE1121CC920F6152A6@TK5EX14MBXC134.redmond.corp.microsoft.com> References: , , <1A472770E042064698CB5ADC83A12ACD39399B9A@TK5EX14MBXC118.redmond.corp.microsoft.com>, , <1A472770E042064698CB5ADC83A12ACD39399E9D@TK5EX14MBXC118.redmond.corp.microsoft.com>, <1B42307CD4AADD438CDDA2FE1121CC920F6152A6@TK5EX14MBXC134.redmond.corp.microsoft.com> Message-ID: Hi Jimmy/Dino, I wasnt supposed to open the files you gave me from Visual Studio 2008 Professional SP1 (but from IronPython Studio) but I opened from Visual Studio 2008 Professional SP1 to see if I canfigure out why I'm having some modules from py compiled assemblies being unable to be imported anywhere. I added a funciones.dll file to the bin folder of the album example. I added "import funciones" to the album.aspx.py codefile and I got this. "unhanddled exception of type 'System.StackOverflowException' in mscorlib.dll" and the disassembler stops in "System.Reflection.CustomAttribute.CreateCaObject" 00000040 mov edx,eax I simplified the code of "funciones.dll" to this to see if there was a problem with it, and Im still getting it. import clr clr.AddReference('System.Data') from System.Data import * clr.AddReference('System') import System clr.AddReference('System.Web') import System.Web def escribircontroles(objeto): pass Now I've read somewhere that you guys arent focused in enabling web technologies but focused in IronPython itself, but just in case you happen to know what this could be about. Greetings, Pablo From: Jimmy.Schementi at microsoft.com To: dinov at microsoft.com; users at lists.ironpython.com Date: Thu, 25 Feb 2010 19:32:10 +0000 Subject: Re: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" Pablo, to write ASP.NET apps in IronPython, download this: http://ironpython.net/download/aspnet-201001 It should be open-able from within IronPython Studio, since the binaries are in the project. Note: the IronPython binaries are 2.6 RTM; if you want to use 2.6.1 RC, just try replacing them in the above download. It will probably require some tweaking of version numbers in the web.config, but there weren?t any breaking changes in the hosting APIs between versions, so the Microsoft.Web.Scripting.dll binary should still be good. Dino, that mail was about open-sourcing the ASP.NET integration, which has seen very little progress. But, it?s something I?ve resumed pushing on, as I?ve taken over Harry?s lawyer-interaction roles. ~js From: Dino Viehland Sent: Thursday, February 25, 2010 11:09 AM To: Discussion of IronPython; Jimmy Schementi Subject: RE: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" Oh, sorry, I was apparently confused. It looks like we still need to update the binaries for ASP.NET (see http://lists.ironpython.com/pipermail/users-ironpython.com/2010-February/012149.html). Jimmy, any idea on how this is progressing? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pablo Dalmazzo Sent: Thursday, February 25, 2010 10:53 AM To: IronPython Mailing list Subject: Re: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules" Thank you Dino, did you mean IronPython Studio or Visual Studio? I'm using Visual Studio. I'm not sure, but I thought it wasnt possible to create an asp.net website in IronPython Studio (I think I've read that) and I've seen only Window applications and WPF projects in IronPython Studio From: dinov at microsoft.com To: users at lists.ironpython.com Date: Thu, 25 Feb 2010 18:03:35 +0000 Subject: Re: [IronPython] clr.CompileModules(.) "couldn't find member CompileModules"I think this is just because it?s an old version of IronPython ? that?s the same issue with your later issue as well. It might be possible to replace the older binaries w/ newer 2.6 binaries but my guess is that it?d break things in IronPython Studio it?s self. This is one of the mail problems w/ IronPython Studio: it?s not kept up to date L From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pablo Dalmazzo Sent: Thursday, February 25, 2010 7:40 AM To: IronPython Mailing list Subject: [IronPython] clr.CompileModules(?) ?couldn?t find member CompileModules? Hi there, Im getting the following error Visual Studio 2008 Professional SP1 installed, asp.net ironpython websiteimport clr #ok clr.AddReference('System') #okbutclr.CompileModules(...)"couldn't find member CompileModules" Anyone got this once?Windows Live Hotmail es m?s seguro con el control de suplantaci?n de identidad. M?s info aqu? Internet Explorer 8 es m?s seguro -?Probalo gratis! Hac? clic aqu? _________________________________________________________________ Ahora chate? desde la playa con tu celu. Registrate gratis a SMS Messenger. http://www.somosmessengersiempre.com/?ocid=TWLH -------------- next part -------------- An HTML attachment was scrubbed... URL: From donsaw at comcast.net Sat Feb 27 15:27:19 2010 From: donsaw at comcast.net (Don Sawatzky) Date: Sat, 27 Feb 2010 06:27:19 -0800 Subject: [IronPython] FlowDocument problem... Message-ID: <78972C4793B74893A9A475EB49FE2CE4@fivemile> I have a FlowDocument as a visual in a RichTextBox that I want to print. However, I want to print the visual with different page attributes. So, I tried the most IronPythonic way. printFlowDocument = FlowDocument(); etc..... printFlowDocument.Blocks = visualFlowDocument.Blocks # Won't work because Blocks is read-only attribute pDialog.PrintDocument(printFlowDocument.......) This way works fine: visualflowDoc = richTextBox.Document printFlowDoc.Blocks.Add(visualflowDoc.Blocks.LastBlock) # Visual disappears pDialog.PrintDocument(printFlowDoc......) visualFlowDoc.Blocks.Add(printFlowDoc.Blocks.LastBlock) # Visual reappears The Add method of Blocks, which is a Collection, acts as a "copy and delete", and I hoped it would act as a Python "list.append". I wonder if there is a more IronPythonic way to do this or if .Net Collection is not broadly wrapped by Python list. I know that getitem, setitem, and iteration work. donsaw at comcast.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sat Feb 27 18:00:40 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 27 Feb 2010 17:00:40 +0000 Subject: [IronPython] FlowDocument problem... In-Reply-To: <78972C4793B74893A9A475EB49FE2CE4@fivemile> References: <78972C4793B74893A9A475EB49FE2CE4@fivemile> Message-ID: <4B894FB8.6060009@voidspace.org.uk> On 27/02/2010 14:27, Don Sawatzky wrote: > I have a FlowDocument as a visual in a RichTextBox that I want to > print. However, I want to print the visual with different page > attributes. So, I tried the most IronPythonic way. > printFlowDocument = FlowDocument(); etc..... > printFlowDocument.Blocks = visualFlowDocument.Blocks # > Won't work because Blocks is read-only attribute > pDialog.PrintDocument(printFlowDocument.......) > This way works fine: > visualflowDoc = richTextBox.Document > printFlowDoc.Blocks.Add(visualflowDoc.Blocks.LastBlock) # > Visual disappears > pDialog.PrintDocument(printFlowDoc......) > visualFlowDoc.Blocks.Add(printFlowDoc.Blocks.LastBlock) # Visual reappears > The Add method of Blocks, which is a Collection, acts as a "copy and > delete", and I hoped it would act as a Python "list.append". I wonder > if there is a more IronPythonic way to do this or if .Net Collection > is not broadly wrapped by Python list. I know that getitem, setitem, > and iteration work. The problem is that FlowDocument is a visual element, so if you take bits of it and put them in another visual element then they aren't going to be shown in the other one. IronPython does a lot to make .NET collections behave as Python collections (you can use the in operator, the del operator etc), but it doesn't change their fundamental behavior. All the best, Michael Foord > donsaw at comcast.net > > > _______________________________________________ > 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 READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From loocas at duber.cz Sun Feb 28 00:04:01 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Sun, 28 Feb 2010 00:04:01 +0100 Subject: [IronPython] =?utf-8?b?Y2xyLkNvbXBpbGVNb2R1bGVzKOKApikg4oCcY291?= =?utf-8?q?ldn=E2=80=99t_find_member_CompileModules=E2=80=9D?= In-Reply-To: References: Message-ID: <4B89A4E1.8000201@duber.cz> Hi everybody, I have this following issue, if anyone could help, I'd much appretiate it! I have a class in C#: public class MyHelper { public object exec( string script, params object[] arguments ) { // .... } } and I'm sending it to IronPython, where I want to call: helper.exec( "someExternalFunction01()" ) helper.exec( "someExternalFunction02({0}, {1})", true, 15 ) However, unfortunately it throws an "syntax error": By methods, which don't have "params object[]" there isn't an issue. Does anybody know how to construct the "MyHelper" class so that the syntax would be the same in IPy as in C#? I've found: http://blogs.msdn.com/srivatsn/archive/2008/09/09/passing-keyword-args-to-c-methods-from-ironpython.aspx but it's not exactly what I need (or I don't know how to "bend" it). Thanks a lot in advance, cheers, Luk?? Dub?da Director [T] +420 602 444 164 duber studio(tm) [M] info at duber.cz [W] http://www.duber.cz [A] R.A.Dvorsk?ho 601, Praha 10 [A] 10900, Czech Republic, Europe Pablo Dalmazzo wrote: > Hi there, > > > Im getting the following error > > > > Visual Studio 2008 Professional SP1 installed, asp.net ironpython website > > |import clr #ok > clr.AddReference('System') #ok > | > > but > > |clr.CompileModules(...) > | > > "couldn't find member CompileModules" > > > > Anyone got this once? > > ------------------------------------------------------------------------ > Windows Live Hotmail es m?s seguro con el control de suplantaci?n de > identidad. M?s info aqu? > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From adamb at silverkeytech.com Sun Feb 28 01:03:13 2010 From: adamb at silverkeytech.com (Adam Brand) Date: Sat, 27 Feb 2010 16:03:13 -0800 Subject: [IronPython] Any update to open-sourcing IPY for ASP.Net? Message-ID: <02ba01cab809$6cd9ccf0$468d66d0$@com> I thought I sent a message on this a while back but I don't think it went through. Any update on getting the source code for IronPython for ASP.Net released? Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Sun Feb 28 02:54:04 2010 From: dinov at microsoft.com (Dino Viehland) Date: Sun, 28 Feb 2010 01:54:04 +0000 Subject: [IronPython] =?utf-8?b?Y2xyLkNvbXBpbGVNb2R1bGVzKOKApikg4oCcY291?= =?utf-8?q?ldn=E2=80=99t_find_member_CompileModules=E2=80=9D?= In-Reply-To: <4B89A4E1.8000201@duber.cz> References: <4B89A4E1.8000201@duber.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD393AFFAF@TK5EX14MBXC118.redmond.corp.microsoft.com> Luk?? wrote: > However, unfortunately it throws an "syntax error": Ahh, this is the detail that was missing from your stack overflow post - but it isn't strictly required, it just made it a lot more obvious. The problem here is that "exec" is a keyword in Python so you can't use that as your function name. You could use "exec_" or execute or something like that instead. Alternately you could write: getattr(helper, 'exec')(...) I also answered on stack overflow in case someone runs into this issue there.