From dinov at microsoft.com Sat May 1 00:10:02 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 30 Apr 2010 22:10:02 +0000 Subject: [IronPython] Dealing with exceptions in an extension module In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD395C0AAC@TK5EX14MBXC116.redmond.corp.microsoft.com> Jeff wrote: > I'm trying to fix up the exceptions for the _sqlite3 module I'm > implementing. The dbapi spec (PEP 249) requires a very specific > exception hierarchy, including exceptions derived from StandardError. > > My initial version just used C# Exception classes, but StandardError > is not a normal class, so that was insufficient. I looked into how the > existing modules did it (using PythonContext.EnsureModuleException) > and started to implement that but I've run up against a bit of a > roadblock: PythonExceptions.CreateThrowable is internal. It's not a > problem for anything in IronPython.Modules, of course, because of the > accursed InternalsVisibleToAttribute, but that doesn't help me much > :). > > Is there a public way to create and throw a Python exception (i.e. a > BaseException instance)? For now I'm just using reflection, but I > would like a better way. There's a public PythonOps.CreateThrowable. It just forwards the call to the internal PythonExceptions.CreateThrowable. > > On a related note, there's too much stuff that's used in > IronPython.Modules but is internal in IronPython - it makes it hard to > figure out the "proper" (public) way to do things. Yeah, maybe we should remove the internals visible to and make everything it relies on public. I think I'd be mostly alright with that but there might be a few places where we suffer (like not having access to our AddNoLock methods for appending to lists). From dinov at microsoft.com Sat May 1 00:19:23 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 30 Apr 2010 22:19:23 +0000 Subject: [IronPython] Writing a Python iterator in C#? In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD395C0B03@TK5EX14MBXC116.redmond.corp.microsoft.com> Jeff wrote: > I'm trying to implement a Python iterator in C# without also > implementing IEnumerator/IEnumerable (I'm also assuming it's even > possible, of course). When trying to use the class in a for loop (`cu` > is a Cursor instance): > > >>> for row in cu: > .... print cu > > TypeError: Unable to cast object of type 'Cursor' to type > 'IronPython.Runtime.Types.IPythonObject'. That's definitely a bug. We usually check for the interfaces first and we have a code path that's assuming we have a user-defined object when we're not an enumerable/enumerator but we have __iter__. It's easy enough to fix we're just trying to generate optimal code for getting the Python type of an object. Is there a reason you can't implement IEnumerator/IEnumerable? You can Always implement it explicitly like: IEnumerator IEnumerable.GetEnumerator() { } If having the public surface area is an issue. Or you could mark the methods w/ [PythonHidden] attribute. > > I've got the necessary methods on the class (__iter__() and next()) > and I've marked the class with [PythonType]; is there anything else > that needs to be done? From michael at voidspace.org.uk Sat May 1 00:20:38 2010 From: michael at voidspace.org.uk (Michael Foord) Date: Fri, 30 Apr 2010 23:20:38 +0100 Subject: [IronPython] Calling explicitly-implemented interface methods Message-ID: <4BDB57B6.8020608@voidspace.org.uk> Hey all, I'm porting the dotnet-integration document that comes with IronPython to Try Python. The following example doesn't work, because RegistryKey isn't available on Silverlight. Can anyone suggest a good alternative of an explicitly implemented interface method on a class in Silverlight? \.NET allows a method with a different name to override a base method implementation or interface method slot. This is useful if a type implements two interfaces with methods with the same name. This is known as `explicity implemented interface methods `_. For example, `Microsoft.Win32.RegistryKey` implements `System.IDisposable.Dispose` explicitly:: >>> from Microsoft.Win32 import RegistryKey >>> clr.GetClrType(RegistryKey).GetMethod("Flush") #doctest: +ELLIPSIS >>> clr.GetClrType(RegistryKey).GetMethod("Dispose") >>> In such cases, IronPython tries to expose the method using its simple name - if there is no ambiguity:: >>> from Microsoft.Win32 import Registry >>> rkey = Registry.CurrentUser.OpenSubKey("Software") >>> rkey.Dispose() However, it is possible that the type has another method with the same name. In that case, the explicitly implemented method is not accessible as an attribute. However, it can still be called by using the unbound class instance method syntax:: >>> rkey = Registry.CurrentUser.OpenSubKey("Software") >>> System.IDisposable.Dispose(rkey) All the best, Michael Foord -- 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 Sat May 1 00:31:04 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 30 Apr 2010 16:31:04 -0600 Subject: [IronPython] Writing a Python iterator in C#? In-Reply-To: <1A472770E042064698CB5ADC83A12ACD395C0B03@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD395C0B03@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Fri, Apr 30, 2010 at 4:19 PM, Dino Viehland wrote: > That's definitely a bug. ?We usually check for the interfaces first and > we have a code path that's assuming we have a user-defined object when > we're not an enumerable/enumerator but we have __iter__. ?It's easy > enough to fix we're just trying to generate optimal code for getting > the Python type of an object. I'll file an issue. > Is there a reason you can't implement IEnumerator/IEnumerable? I'd like to reuse my existing next() method to do that (it's really complicated), but it requires a CodeContext - which I can't pass to GetEnumerator(), AFAIK. - Jeff From dinov at microsoft.com Sat May 1 00:32:52 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 30 Apr 2010 22:32:52 +0000 Subject: [IronPython] Calling explicitly-implemented interface methods In-Reply-To: <4BDB57B6.8020608@voidspace.org.uk> References: <4BDB57B6.8020608@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD395C0CFE@TK5EX14MBXC116.redmond.corp.microsoft.com> Michael wrote: > Hey all, > > I'm porting the dotnet-integration document that comes with IronPython > to Try Python. The following example doesn't work, because RegistryKey > isn't available on Silverlight. Can anyone suggest a good alternative of > an explicitly implemented interface method on a class in Silverlight? One example might be Python file objects which also implement IDisposable. > > \.NET allows a method with a different name to override a base method > implementation or interface method slot. This is useful if a type implements > two interfaces with methods with the same name. This is known as > `explicity implemented interface methods > `_. > For example, `Microsoft.Win32.RegistryKey` > implements `System.IDisposable.Dispose` explicitly:: > > >>> from Microsoft.Win32 import RegistryKey > >>> clr.GetClrType(RegistryKey).GetMethod("Flush") #doctest: +ELLIPSIS > > >>> clr.GetClrType(RegistryKey).GetMethod("Dispose") > >>> > > In such cases, IronPython tries to expose the method using its simple name - > if there is no ambiguity:: > > >>> from Microsoft.Win32 import Registry > >>> rkey = Registry.CurrentUser.OpenSubKey("Software") > >>> rkey.Dispose() > > However, it is possible that the type has another method with the same name. > In that case, the explicitly implemented method is not accessible as an > attribute. > However, it can still be called by using the unbound class instance > method syntax:: > > >>> rkey = Registry.CurrentUser.OpenSubKey("Software") > >>> System.IDisposable.Dispose(rkey) > > > All the best, > > Michael Foord > > -- > 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 Sat May 1 00:34:37 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 30 Apr 2010 22:34:37 +0000 Subject: [IronPython] Writing a Python iterator in C#? In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD395C0B03@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD395C0D2F@TK5EX14MBXC116.redmond.corp.microsoft.com> Jeff wrote: > On Fri, Apr 30, 2010 at 4:19 PM, Dino Viehland wrote: > > That's definitely a bug. ?We usually check for the interfaces first and > > we have a code path that's assuming we have a user-defined object when > > we're not an enumerable/enumerator but we have __iter__. ?It's easy > > enough to fix we're just trying to generate optimal code for getting > > the Python type of an object. > > I'll file an issue. > > > Is there a reason you can't implement IEnumerator/IEnumerable? > > I'd like to reuse my existing next() method to do that (it's really > complicated), but it requires a CodeContext - which I can't pass to > GetEnumerator(), AFAIK. Oh, bummer... Can you have the instance hold onto the code context when it gets created? That might be a reasonable workaround for the time being. From fuzzyman at voidspace.org.uk Sat May 1 00:48:53 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 30 Apr 2010 23:48:53 +0100 Subject: [IronPython] Calling explicitly-implemented interface methods In-Reply-To: <1A472770E042064698CB5ADC83A12ACD395C0CFE@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4BDB57B6.8020608@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD395C0CFE@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4BDB5E55.6070005@voidspace.org.uk> On 30/04/2010 23:32, Dino Viehland wrote: > Michael wrote: > >> Hey all, >> >> I'm porting the dotnet-integration document that comes with IronPython >> to Try Python. The following example doesn't work, because RegistryKey >> isn't available on Silverlight. Can anyone suggest a good alternative of >> an explicitly implemented interface method on a class in Silverlight? >> > One example might be Python file objects which also implement IDisposable. > > That would be a really inconvenient example to pick, since in Try Python I patch __builtin__.file to be a custom type that reads / writes files to local storage. :-) Can you think of anything else? Michael >> \.NET allows a method with a different name to override a base method >> implementation or interface method slot. This is useful if a type implements >> two interfaces with methods with the same name. This is known as >> `explicity implemented interface methods >> `_. >> For example, `Microsoft.Win32.RegistryKey` >> implements `System.IDisposable.Dispose` explicitly:: >> >> >>> from Microsoft.Win32 import RegistryKey >> >>> clr.GetClrType(RegistryKey).GetMethod("Flush") #doctest: +ELLIPSIS >> >> >>> clr.GetClrType(RegistryKey).GetMethod("Dispose") >> >>> >> >> In such cases, IronPython tries to expose the method using its simple name - >> if there is no ambiguity:: >> >> >>> from Microsoft.Win32 import Registry >> >>> rkey = Registry.CurrentUser.OpenSubKey("Software") >> >>> rkey.Dispose() >> >> However, it is possible that the type has another method with the same name. >> In that case, the explicitly implemented method is not accessible as an >> attribute. >> However, it can still be called by using the unbound class instance >> method syntax:: >> >> >>> rkey = Registry.CurrentUser.OpenSubKey("Software") >> >>> System.IDisposable.Dispose(rkey) >> >> >> All the best, >> >> Michael Foord >> >> -- >> 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. From dinov at microsoft.com Sat May 1 00:58:01 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 30 Apr 2010 22:58:01 +0000 Subject: [IronPython] Calling explicitly-implemented interface methods In-Reply-To: <4BDB5E55.6070005@voidspace.org.uk> References: <4BDB57B6.8020608@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD395C0CFE@TK5EX14MBXC116.redmond.corp.microsoft.com> <4BDB5E55.6070005@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD395C0ECD@TK5EX14MBXC116.redmond.corp.microsoft.com> Michael wrote: > On 30/04/2010 23:32, Dino Viehland wrote: > > Michael wrote: > > > >> Hey all, > >> > >> I'm porting the dotnet-integration document that comes with IronPython > >> to Try Python. The following example doesn't work, because RegistryKey > >> isn't available on Silverlight. Can anyone suggest a good alternative of > >> an explicitly implemented interface method on a class in Silverlight? > >> > > One example might be Python file objects which also implement IDisposable. > > > > > > That would be a really inconvenient example to pick, since in Try Python > I patch __builtin__.file to be a custom type that reads / writes files > to local storage. :-) > > Can you think of anything else? It's kind of lame but Python lists explicitly implement IList.Remove. From fuzzyman at voidspace.org.uk Sat May 1 01:00:15 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 01 May 2010 00:00:15 +0100 Subject: [IronPython] Calling explicitly-implemented interface methods In-Reply-To: <1A472770E042064698CB5ADC83A12ACD395C0ECD@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4BDB57B6.8020608@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD395C0CFE@TK5EX14MBXC116.redmond.corp.microsoft.com> <4BDB5E55.6070005@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD395C0ECD@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4BDB60FF.10007@voidspace.org.uk> On 30/04/2010 23:58, Dino Viehland wrote: > Michael wrote: > >> On 30/04/2010 23:32, Dino Viehland wrote: >> >>> Michael wrote: >>> >>> >>>> Hey all, >>>> >>>> I'm porting the dotnet-integration document that comes with IronPython >>>> to Try Python. The following example doesn't work, because RegistryKey >>>> isn't available on Silverlight. Can anyone suggest a good alternative of >>>> an explicitly implemented interface method on a class in Silverlight? >>>> >>>> >>> One example might be Python file objects which also implement IDisposable. >>> >>> >>> >> That would be a really inconvenient example to pick, since in Try Python >> I patch __builtin__.file to be a custom type that reads / writes files >> to local storage. :-) >> >> Can you think of anything else? >> > It's kind of lame but Python lists explicitly implement IList.Remove. > Cool - that will do nicely. Thanks 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 fuzzyman at voidspace.org.uk Sat May 1 01:04:06 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 01 May 2010 00:04:06 +0100 Subject: [IronPython] Calling explicitly-implemented interface methods In-Reply-To: <1A472770E042064698CB5ADC83A12ACD395C0ECD@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4BDB57B6.8020608@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD395C0CFE@TK5EX14MBXC116.redmond.corp.microsoft.com> <4BDB5E55.6070005@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD395C0ECD@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4BDB61E6.7080102@voidspace.org.uk> On 30/04/2010 23:58, Dino Viehland wrote: > Michael wrote: > >> On 30/04/2010 23:32, Dino Viehland wrote: >> >>> Michael wrote: >>> >>> >>>> Hey all, >>>> >>>> I'm porting the dotnet-integration document that comes with IronPython >>>> to Try Python. The following example doesn't work, because RegistryKey >>>> isn't available on Silverlight. Can anyone suggest a good alternative of >>>> an explicitly implemented interface method on a class in Silverlight? >>>> >>>> >>> One example might be Python file objects which also implement IDisposable. >>> >>> >>> >> That would be a really inconvenient example to pick, since in Try Python >> I patch __builtin__.file to be a custom type that reads / writes files >> to local storage. :-) >> >> Can you think of anything else? >> > It's kind of lame but Python lists explicitly implement IList.Remove. > Hmm... although the following doesn't return None - meaning that it doesn't fit the pattern of the first example: clr.GetClrType(list).GetMethod("Remove") *dammit* :-) 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 Sat May 1 01:08:38 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 30 Apr 2010 17:08:38 -0600 Subject: [IronPython] Dealing with exceptions in an extension module In-Reply-To: <1A472770E042064698CB5ADC83A12ACD395C0AAC@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD395C0AAC@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Fri, Apr 30, 2010 at 4:10 PM, Dino Viehland wrote: > There's a public PythonOps.CreateThrowable. ?It just forwards the call > to the internal PythonExceptions.CreateThrowable. Ah, thank you. > Yeah, maybe we should remove the internals visible to and make everything > it relies on public. ?I think I'd be mostly alright with that but there > might be a few places where we suffer (like not having access to our AddNoLock > methods for appending to lists). IronPython.Modules is often the best resource for finding out how to do stuff; starting to implement a pattern used there only discover it uses internal APIs is a bit frustrating. I think it's a good idea, but I don't really have to deal with the consequences :). - Jeff From jdhardy at gmail.com Sat May 1 01:29:39 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 30 Apr 2010 17:29:39 -0600 Subject: [IronPython] Dealing with custom sequence/mapping types from C# Message-ID: Given the following types (from sqlite3's tests): class L(object): def __len__(self): return 1 def __getitem__(self, x): assert x == 0 return "foo" class D(dict): def __missing__(self, key): return "foo" Instances of these get passed in to a function implemented in C# and I need to able to treat them the same as built-in types. The built-in types happily implement either IList or IDictionary, so a cast will suffice, but that doesn't work for custom objects or subclasses like the above. Is there anything built-in that can handle this? I trawled through PythonOps looking for something but didn't find it. Something similar to PythonOps.CreatePythonEnumerable that returns IList/IDictionary and uses sequence/dictionary behaviour, I guess. - Jeff From dinov at microsoft.com Sat May 1 01:42:15 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 30 Apr 2010 23:42:15 +0000 Subject: [IronPython] Dealing with custom sequence/mapping types from C# In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD395C11D8@TK5EX14MBXC116.redmond.corp.microsoft.com> Jeff wrote: > Given the following types (from sqlite3's tests): > > class L(object): > def __len__(self): > return 1 > def __getitem__(self, x): > assert x == 0 > return "foo" > > class D(dict): > def __missing__(self, key): > return "foo" > > Instances of these get passed in to a function implemented in C# and I > need to able to treat them the same as built-in types. The built-in > types happily implement either IList or IDictionary, so a cast will > suffice, but that doesn't work for custom objects or subclasses like > the above. > > Is there anything built-in that can handle this? I trawled through > PythonOps looking for something but didn't find it. Something similar > to PythonOps.CreatePythonEnumerable that returns IList/IDictionary and > uses sequence/dictionary behaviour, I guess. Do you absolutely need indexing or can you get by w/ enumeration? Obviously with enumeration you could ultimately get indexing but it'll be slower :) My suggestion is to implement overloads like this: public static void X(IEnumerable foo) { Console.WriteLine(foo); } public static void X(IDictionary foo) { Console.WriteLine(foo); } The L instance will be wrapped into a IronPython.Runtime.ItemEnumerable object because it defines __getitem__. The D instance will select the IDictionary overload and you'll have a stronger API there. In general you want to keep the C# code as statically typed as possible (instead of taking an object) and let the overload resolver/conversion logic kick in and do its thing. The nice thing about that is that we'll get all of our call site caching going on and things will be nice and optimal. If necessary we could look at adding a conversion of user defined objects to IList as well but I don't think that one exists today. From dinov at microsoft.com Sat May 1 02:07:05 2010 From: dinov at microsoft.com (Dino Viehland) Date: Sat, 1 May 2010 00:07:05 +0000 Subject: [IronPython] Calling explicitly-implemented interface methods In-Reply-To: <4BDB61E6.7080102@voidspace.org.uk> References: <4BDB57B6.8020608@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD395C0CFE@TK5EX14MBXC116.redmond.corp.microsoft.com> <4BDB5E55.6070005@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD395C0ECD@TK5EX14MBXC116.redmond.corp.microsoft.com> <4BDB61E6.7080102@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD395C142C@TK5EX14MBXC116.redmond.corp.microsoft.com> Michael wrote: > On 30/04/2010 23:58, Dino Viehland wrote: > > Michael wrote: > > > >> On 30/04/2010 23:32, Dino Viehland wrote: > >> > >>> Michael wrote: > >>> > >>> > >>>> Hey all, > >>>> > >>>> I'm porting the dotnet-integration document that comes with IronPython > >>>> to Try Python. The following example doesn't work, because RegistryKey > >>>> isn't available on Silverlight. Can anyone suggest a good alternative of > >>>> an explicitly implemented interface method on a class in Silverlight? > >>>> > >>>> > >>> One example might be Python file objects which also implement IDisposable. > >>> > >>> > >>> > >> That would be a really inconvenient example to pick, since in Try Python > >> I patch __builtin__.file to be a custom type that reads / writes files > >> to local storage. :-) > >> > >> Can you think of anything else? > >> > > It's kind of lame but Python lists explicitly implement IList.Remove. > > > > Hmm... although the following doesn't return None - meaning that it > doesn't fit the pattern of the first example: > > clr.GetClrType(list).GetMethod("Remove") > > *dammit* :-) Yeah, I think there's a separate non-explicit one as well because it's both an IList and an IList. Is it Silverlight 4? You could use System.Tuple[int] and IStructuralEquatable. From dinov at microsoft.com Sat May 1 02:09:23 2010 From: dinov at microsoft.com (Dino Viehland) Date: Sat, 1 May 2010 00:09:23 +0000 Subject: [IronPython] Announcing IronPython Tools for Visual Studio Message-ID: <1A472770E042064698CB5ADC83A12ACD395C1450@TK5EX14MBXC116.redmond.corp.microsoft.com> Hello Python Community, We are happy to announce the first broadly available release of IronPython Tools for Visual Studio. IronPython Tools for Visual Studio (IPyTools) is a set of extensions available for Visual Studio 2010 which supports development of IronPython applications. This release is still an early Community Technical Preview (CTP) and builds upon the preview release that we gave exclusively to attendees of PyCon 2010. The release has been updated to run on the final version of Visual Studio 2010 and includes many bug fixes, performance improvements, and new features. This release includes support for Intellisense including member completion, signature help, find all references, and goto definition. It enables quick browsing of your code using the object browser and the editor navigation bar. It has an interactive (REPL) window that enables the development of applications in an interactive way. IPyTools supports lightweight development without a project as well as working with project files in the tradition of Visual Studio . Opening a .py file causes IronPython Tools to model the code in the containing directory as an implicit project for Intellisense features. There are project templates for console, WPF, WinForms, and Silverlight applications. WPF applications support drag-and-drop UI development. Debugging of Python applications works just like you debug other languages in Visual Studio. Changes in this release touch on all the major features of IpyTools. This includes updates to the interactive window, intellisense, the editor, and solutions and projects. We've also made other small tweaks to improve the development experience. The interactive window is one key focus of IpyTools. This release continues to flush out the feature set of the interactive window. We've added a new command to send a snippet of code from the editor into the file context containing the module's code. We've added options to control evaluation of partial expressions for live-object intellisense in the REPL. We've updated the key bindings to for explicitly navigating history in addition to the smart behavior of the arrow keys. Also, the interactive window now supports calls to raw_input() and input(). Finding text in the REPL works now,in addition to a number of other bugs fixed to improve the overall experience. This release also has many updates to intellisense. We've increased the customization options for intellisense so you can now commit completions using enter. There is an option to show the intersection or union of applicable members when multiple types can flow through the code where you are using completion. Related to this, None no longer is considered to be in the intersection of members. We've improved the analysis engine so that it now understands generators, yield expressions, calls to send on a generator, improved analysis of generic method calls, improved tracking of types through calls to list.append/pop/extend/insert, added support for * and ** args, improved analysis of imports, and significantly improved the performance of the analysis engine. We've also cleaned up the display of a number of tooltips including more consistent display of signature completion. We also better track calls on types vs. calls on instances. Finally reference tracking has been improved to include accessing methods (not just calls), tracking references to built-in functions, and added support for some protocol methods such as __getattr__. In addition to this a number of bugs have been fixed. We've also improved the editing experience in this latest release. This includes support for new commands such as comment/uncomment selection, goto matching brace, support for auto indentation, and highlighting matching braces based upon the current caret location. We've added finer control over the editor experience, adding support for disabling outlining on file open. And there are a number of small cleanups such as improving goto definition, making goto definition center the target line on the screen, and fixing method outlining which was improperly collapsing in some cases. Finally we've made some small improvements to the solution and project experience. This includes fixing basic issues such as double clicking on image files now opens them in the VS image editor, project and solutions no longer prompt for saving if they haven't been modified, and we now properly hide hidden files in the solution explorer. We've also improved the experience when invalid values are entered into project settings. For the Silverlight templates we've fixed the issue where Firefox would be launched when IE was the default browser, and we now search for an empty port when launching Chiron for web projects. Altogether this represents a significant improvement over the PyCon release in quality and functionality. But this is still an early preview and as such you may run into issues, and we are looking forward to your feedback both on issues you encounter and the overall feature set. Please see the spec doc for our current and planned features and feel free to comment on any of the contents. We are still working on our final licensing terms for IronPython Tools, and as such this release is licensed under a temporary limited use license. We hope to have nailed down the final licensing terms for the next CTP release. - The IronPython Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Sat May 1 02:35:11 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 30 Apr 2010 17:35:11 -0700 Subject: [IronPython] Dealing with custom sequence/mapping types from C# Message-ID: <-1492301666322602817@unknownmsgid> For the list case, I need the count - it would be nice to get it fast :) but I can work without it. For the dict case, will that handle __missing__? I thought I tried it and it didn't work, but I could have missed something. - Jeff Sent from my Windows? phone. -----Original Message----- From: Dino Viehland Sent: Friday, April 30, 2010 5:42 PM To: Discussion of IronPython Subject: Re: [IronPython] Dealing with custom sequence/mapping types from C# Jeff wrote: > Given the following types (from sqlite3's tests): > > class L(object): > def __len__(self): > return 1 > def __getitem__(self, x): > assert x == 0 > return "foo" > > class D(dict): > def __missing__(self, key): > return "foo" > > Instances of these get passed in to a function implemented in C# and I > need to able to treat them the same as built-in types. The built-in > types happily implement either IList or IDictionary, so a cast will > suffice, but that doesn't work for custom objects or subclasses like > the above. > > Is there anything built-in that can handle this? I trawled through > PythonOps looking for something but didn't find it. Something similar > to PythonOps.CreatePythonEnumerable that returns IList/IDictionary and > uses sequence/dictionary behaviour, I guess. Do you absolutely need indexing or can you get by w/ enumeration? Obviously with enumeration you could ultimately get indexing but it'll be slower :) My suggestion is to implement overloads like this: public static void X(IEnumerable foo) { Console.WriteLine(foo); } public static void X(IDictionary foo) { Console.WriteLine(foo); } The L instance will be wrapped into a IronPython.Runtime.ItemEnumerable object because it defines __getitem__. The D instance will select the IDictionary overload and you'll have a stronger API there. In general you want to keep the C# code as statically typed as possible (instead of taking an object) and let the overload resolver/conversion logic kick in and do its thing. The nice thing about that is that we'll get all of our call site caching going on and things will be nice and optimal. If necessary we could look at adding a conversion of user defined objects to IList as well but I don't think that one exists today. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Sat May 1 03:41:02 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Sat, 1 May 2010 01:41:02 +0000 Subject: [IronPython] IronPython Tools for Visual Studio In-Reply-To: References: <8C12A2BD8CFE894C891514267B55A2B511456D79@srv-sc-mail.symyx.com> <1A472770E042064698CB5ADC83A12ACD3950A8DB@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD395A8B00@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <013EA4BF-DEB4-4DDF-94E4-34B32835B491@microsoft.com> So can we close the connect bug now? :-P ~Jimmy On Apr 27, 2010, at 8:34 PM, "Hank Fay" > wrote: I've been getting everyone (relatives including kids, anyone, programming experience not necessary ) I can cajole into going to MS Connect to vote up Michael's issue on the IP IDE in VS. My latest effort is a LInkedIn group for IP, with a permanent discussion item pointing to the Connect issue: http://www.linkedin.com/groups?gid=2989051&trk=myg_ugrp_ovr Of course, I would imagine everyone here is one of the nearly 600 now who have voted it up. On Tue, Apr 27, 2010 at 11:17 PM, Dino Viehland <dinov at microsoft.com> wrote: Not yet ? We were trying to push through some internal processes for a more optimal release. We?ll release this week whether or not we can push through that part of the process. Sorry for the delay! From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Prasanna Jaganathan Sent: Tuesday, April 27, 2010 8:13 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Tools for Visual Studio Hi Is this available now? Two weeks are up! :-) Prasanna On Thu, Apr 8, 2010 at 11:29 PM, Dino Viehland <dinov at microsoft.com> wrote: It?s not yet publicly available ? the preview was given out exclusively to PyCon attendees on a CD. We?ll be putting out an updated version within a couple of weeks after VS 2010 launches which is April 12th. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Marty Nelson Sent: Thursday, April 08, 2010 10:45 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Tools for Visual Studio We offer extensive Iron Python extension points for our customers in our application and would be very interested in this technology as well. Marty Nelson Symyx Technologies. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Prasanna Jaganathan Sent: Thursday, April 08, 2010 10:36 AM To: users at lists.ironpython.com Subject: [IronPython] IronPython Tools for Visual Studio Hi I am trying to get a good IDE for working with Iron Python, I chanced upon this page and found about IronPython Tools for Visual Studio. http://us.pycon.org/media/2010/talkdata/PyCon2010/009/IronPython_Tools_for_Visual_Studio_Walkthrough.pdf I have installed Visual Studio 2010 beta and would like to install this plugin. Can you point me to a place where I can download this? Thank you very much! Regards Prasanna ======= Notice: This e-mail message, together with any attachments, contains information of Symyx Technologies, Inc. or any of its affiliates or subsidiaries that may be confidential, proprietary, copyrighted, privileged and/or protected work product, and is meant solely for the intended recipient. If you are not the intended recipient, and have received this message in error, please contact the sender immediately, permanently delete the original and any copies of this email and any attachments thereto. _______________________________________________ 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 cenovsky at bakalari.cz Sat May 1 07:43:32 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Sat, 01 May 2010 07:43:32 +0200 Subject: [IronPython] Dealing with exceptions in an extension module In-Reply-To: <1A472770E042064698CB5ADC83A12ACD395C0AAC@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD395C0AAC@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4BDBBF84.3050302@bakalari.cz> Dino Viehland wrote: > Jeff wrote: > >> I'm trying to fix up the exceptions for the _sqlite3 module I'm >> implementing. The dbapi spec (PEP 249) requires a very specific >> exception hierarchy, including exceptions derived from StandardError. >> >> My initial version just used C# Exception classes, but StandardError >> is not a normal class, so that was insufficient. I looked into how the >> existing modules did it (using PythonContext.EnsureModuleException) >> and started to implement that but I've run up against a bit of a >> roadblock: PythonExceptions.CreateThrowable is internal. It's not a >> problem for anything in IronPython.Modules, of course, because of the >> accursed InternalsVisibleToAttribute, but that doesn't help me much >> :). >> >> Is there a public way to create and throw a Python exception (i.e. a >> BaseException instance)? For now I'm just using reflection, but I >> would like a better way. >> > > There's a public PythonOps.CreateThrowable. It just forwards the call > to the internal PythonExceptions.CreateThrowable. Speaking about exceptions. Is there a way to convert the System.Exception to the Python exception when I know the System.Exception is a Python exception? I ran into this when I played with data binding and BindingValidationError event. This event is raised when a setter throws an exception. So I threw MyException. But in the event, the event.Error.Exception is System.Exception and I couldn't figured out how to access the Python properties in this "MyException". -- -- Luk?s( -------------- next part -------------- An HTML attachment was scrubbed... URL: From josesimas at gmail.com Sat May 1 10:42:47 2010 From: josesimas at gmail.com (jose simas) Date: Sat, 1 May 2010 09:42:47 +0100 Subject: [IronPython] IronPython Tools for Visual Studio In-Reply-To: <013EA4BF-DEB4-4DDF-94E4-34B32835B491@microsoft.com> References: <8C12A2BD8CFE894C891514267B55A2B511456D79@srv-sc-mail.symyx.com> <1A472770E042064698CB5ADC83A12ACD3950A8DB@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD395A8B00@TK5EX14MBXC116.redmond.corp.microsoft.com> <013EA4BF-DEB4-4DDF-94E4-34B32835B491@microsoft.com> Message-ID: Please do, you guys did a fantastic job! On 1 May 2010 02:41, Jimmy Schementi wrote: > So can we close the connect bug now? :-P > > ~Jimmy > > On Apr 27, 2010, at 8:34 PM, "Hank Fay" wrote: > > I've been getting everyone (relatives including kids, anyone, programming > experience not necessary ) I can cajole into going to MS Connect to vote > up Michael's issue on the IP IDE in VS. My latest effort is a LInkedIn > group for IP, with a permanent discussion item pointing to the Connect > issue: > http://www.linkedin.com/groups?gid=2989051&trk=myg_ugrp_ovr > > Of course, I would imagine everyone here is one of the nearly 600 now who > have voted it up. > > On Tue, Apr 27, 2010 at 11:17 PM, Dino Viehland < > dinov at microsoft.com> wrote: > >> Not yet L We were trying to push through some internal processes for a >> more optimal release. We?ll release this week whether or not we can push >> through that part of the process. Sorry for the delay! >> >> >> >> *From:* >> users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Prasanna Jaganathan >> *Sent:* Tuesday, April 27, 2010 8:13 PM >> >> *To:* Discussion of IronPython >> *Subject:* Re: [IronPython] IronPython Tools for Visual Studio >> >> >> >> Hi >> >> >> >> Is this available now? Two weeks are up! :-) >> >> >> >> Prasanna >> >> On Thu, Apr 8, 2010 at 11:29 PM, Dino Viehland < >> dinov at microsoft.com> wrote: >> >> It?s not yet publicly available ? the preview was given out exclusively to >> PyCon attendees on a CD. We?ll be putting out an updated version within a >> couple of weeks after VS 2010 launches which is April 12th. >> >> >> >> *From:* >> users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Marty Nelson >> *Sent:* Thursday, April 08, 2010 10:45 AM >> *To:* Discussion of IronPython >> *Subject:* Re: [IronPython] IronPython Tools for Visual Studio >> >> >> >> We offer extensive Iron Python extension points for our customers in our >> application and would be very interested in this technology as well. >> >> >> >> Marty Nelson >> >> Symyx Technologies. >> >> >> >> *From:* >> users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Prasanna Jaganathan >> *Sent:* Thursday, April 08, 2010 10:36 AM >> *To:* users at lists.ironpython.com >> *Subject:* [IronPython] IronPython Tools for Visual Studio >> >> >> >> Hi >> >> >> >> I am trying to get a good IDE for working with Iron Python, I chanced upon >> this page and found about IronPython Tools for Visual Studio. >> >> >> http://us.pycon.org/media/2010/talkdata/PyCon2010/009/IronPython_Tools_for_Visual_Studio_Walkthrough.pdf >> >> I have installed Visual Studio 2010 beta and would like to install this >> plugin. Can you point me to a place where I can download this? >> >> >> >> Thank you very much! >> >> >> >> Regards >> >> Prasanna >> >> ======= >> Notice: This e-mail message, together with any attachments, contains >> information of Symyx Technologies, Inc. or any of its affiliates or >> subsidiaries that may be confidential, proprietary, copyrighted, >> privileged and/or protected work product, and is meant solely for >> the intended recipient. If you are not the intended recipient, and >> have received this message in error, please contact the sender >> immediately, permanently delete the original and any copies of this >> email and any attachments thereto. >> >> >> >> >> _______________________________________________ >> 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 s.j.dower at gmail.com Sun May 2 06:45:49 2010 From: s.j.dower at gmail.com (Steve Dower) Date: Sun, 2 May 2010 14:45:49 +1000 Subject: [IronPython] IronPy Tools for VS - Projects Message-ID: So, love having IronPy Tools (download from www.ironpython.net/tools/ for those who missed it) and very keen to help make it the best Python IDE out there (and frankly, it's almost there already IMHO). My first issue is with the project setup. While I really like it automatically pulling in all my .py files/folders (since that is how Python is going to handle it) I'm not so keen on every other file coming in. I regularly run in CPython, which puts .pyc files everywhere and all of these appear in the Solution Explorer. I'm working out of a Subversion repository, and all my .svn folders also appear. It's a matter of clutter rather than a show-stopper, but from my experiences with MPFProj 9.0 it is just as easy to let code files be tracked by the project rather than the file system. I note that packages are given a different icon, so if the 'Show All Files' button is soon to be enabled (to hide everything that isn't a package) that is completely sufficient. Second, I have a suggestion for dealing with __init__.py files. I have not heard any definitive statement on whether to include code in __init__.py files or not, but I am aware that it is done and my current project has primary base classes for each package in the __init__.py files, resulting in having multiple such files open. My own 'Python tools' (for VS2008, never made it beyond private use) automatically adds the package name to the caption of __init__.py files (as shown in http://zooba.byteclub.net/files/2010/05/ipytool-initname.png) through a couple of overrides on the FileNode object. I am happy to provide this code if desired/appropriate. There also appears to be some interesting things going on with the outlining region tagger, but I'm sure these have been noted already. Great work, guys. Cheers, Steve From loocas at duber.cz Sun May 2 14:34:16 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Sun, 02 May 2010 14:34:16 +0200 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: References: <8C12A2BD8CFE894C891514267B55A2B511456D79@srv-sc-mail.symyx.com> <1A472770E042064698CB5ADC83A12ACD3950A8DB@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD395A8B00@TK5EX14MBXC116.redmond.corp.microsoft.com> <013EA4BF-DEB4-4DDF-94E4-34B32835B491@microsoft.com> Message-ID: <4BDD7148.4080804@duber.cz> Hi there everyone, first off, congratulations for pushing the IPy Tools out! KUDOS! Now, I have a problem installing it, unfortunately :( I'm sure I'm doing something wrong as I have almost zero experience with Visual Studio. I went to the MS site and downloaded what seemed to be an obvious choice a Visual Studio 2010 Express for C#, I installed it and downloaded the Iron Python extension. However, as soon as I "doble-click" on the IronPythonTools.vsix I get this message: "This extension is not installable on any currently installed products". Anyone knows why this is? Am I missing some additional piece of the package? I installed everything except for the MSQL server stuff from the vcs_web.exe package. Thanks a lot in advance for any tips and hints, 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 fuzzyman at voidspace.org.uk Sun May 2 14:43:31 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 02 May 2010 13:43:31 +0100 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: <4BDD7148.4080804@duber.cz> References: <8C12A2BD8CFE894C891514267B55A2B511456D79@srv-sc-mail.symyx.com> <1A472770E042064698CB5ADC83A12ACD3950A8DB@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD395A8B00@TK5EX14MBXC116.redmond.corp.microsoft.com> <013EA4BF-DEB4-4DDF-94E4-34B32835B491@microsoft.com> <4BDD7148.4080804@duber.cz> Message-ID: <4BDD7373.8030800@voidspace.org.uk> On 02/05/2010 13:34, Luk?? Dub?da wrote: > Hi there everyone, > > first off, congratulations for pushing the IPy Tools out! KUDOS! > > Now, I have a problem installing it, unfortunately :( I'm sure I'm > doing something wrong as I have almost zero experience with > Visual Studio. > > I went to the MS site and downloaded what seemed to be an obvious choice > a Visual Studio 2010 Express for C#, Visual Studio Express does not allow you to install extensions like IPy Tools. Fortunately IPy tools works with the Visual Studio Isolated Shell that can be installed "standalone", without a Visual Studio install. http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=dfba7ac4-5366-456e-abd6-0e3e6ba83b7c Michael > I installed it and downloaded the > Iron Python extension. However, as soon as I "doble-click" on the > IronPythonTools.vsix I get this message: > "This extension is not installable on any currently installed products". > > Anyone knows why this is? Am I missing some additional piece of the > package? I installed everything except for the MSQL server stuff > from the vcs_web.exe package. > > Thanks a lot in advance for any tips and hints, 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 -- 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 brian.curtin at gmail.com Sun May 2 15:31:09 2010 From: brian.curtin at gmail.com (Brian Curtin) Date: Sun, 2 May 2010 08:31:09 -0500 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: <4BDD7148.4080804@duber.cz> References: <8C12A2BD8CFE894C891514267B55A2B511456D79@srv-sc-mail.symyx.com> <1A472770E042064698CB5ADC83A12ACD3950A8DB@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD395A8B00@TK5EX14MBXC116.redmond.corp.microsoft.com> <013EA4BF-DEB4-4DDF-94E4-34B32835B491@microsoft.com> <4BDD7148.4080804@duber.cz> Message-ID: On Sun, May 2, 2010 at 07:34, Luk?? Dub?da wrote: > Hi there everyone, > > first off, congratulations for pushing the IPy Tools out! KUDOS! > > Now, I have a problem installing it, unfortunately :( I'm sure I'm > doing something wrong as I have almost zero experience with > Visual Studio. > > I went to the MS site and downloaded what seemed to be an obvious choice > a Visual Studio 2010 Express for C#, I installed it and downloaded the > Iron Python extension. However, as soon as I "doble-click" on the > IronPythonTools.vsix I get this message: > "This extension is not installable on any currently installed products". > > Anyone knows why this is? Am I missing some additional piece of the > package? I installed everything except for the MSQL server stuff > from the vcs_web.exe package. > > Thanks a lot in advance for any tips and hints, cheers, > http://ironpython.net/ironpython/tools/ should probably be updated to not link to the express version. -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian.curtin at gmail.com Sun May 2 15:58:20 2010 From: brian.curtin at gmail.com (Brian Curtin) Date: Sun, 2 May 2010 08:58:20 -0500 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: References: Message-ID: On Sat, May 1, 2010 at 23:45, Steve Dower wrote: > > My own 'Python tools' (for VS2008, never made it beyond private use) > automatically adds the package name to the caption of __init__.py > files (as shown in > http://zooba.byteclub.net/files/2010/05/ipytool-initname.png) through > a couple of overrides on the FileNode object. I am happy to provide > this code if desired/appropriate. > I'm not sure I understand the need for that, especially given that the way the file list gets sorted, that name should always be on the parent tree item directly above it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From loocas at duber.cz Sun May 2 17:02:17 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Sun, 02 May 2010 17:02:17 +0200 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: <4BDD7373.8030800@voidspace.org.uk> References: <8C12A2BD8CFE894C891514267B55A2B511456D79@srv-sc-mail.symyx.com> <1A472770E042064698CB5ADC83A12ACD3950A8DB@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD395A8B00@TK5EX14MBXC116.redmond.corp.microsoft.com> <013EA4BF-DEB4-4DDF-94E4-34B32835B491@microsoft.com> <4BDD7148.4080804@duber.cz> <4BDD7373.8030800@voidspace.org.uk> Message-ID: <4BDD93F9.6090501@duber.cz> Oh, ok, thanks for pointing that out Michael. Now, does the Isolated Shell (I don't really know the difference), provide a visual designer for Windows Forms and WPF? Thanks again, 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 Michael Foord wrote: > On 02/05/2010 13:34, Luk?? Dub?da wrote: >> Hi there everyone, >> >> first off, congratulations for pushing the IPy Tools out! KUDOS! >> >> Now, I have a problem installing it, unfortunately :( I'm sure I'm >> doing something wrong as I have almost zero experience with >> Visual Studio. >> >> I went to the MS site and downloaded what seemed to be an obvious choice >> a Visual Studio 2010 Express for C#, > > Visual Studio Express does not allow you to install extensions like IPy > Tools. Fortunately IPy tools works with the Visual Studio Isolated Shell > that can be installed "standalone", without a Visual Studio install. > > http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=dfba7ac4-5366-456e-abd6-0e3e6ba83b7c > > > Michael > >> I installed it and downloaded the >> Iron Python extension. However, as soon as I "doble-click" on the >> IronPythonTools.vsix I get this message: >> "This extension is not installable on any currently installed products". >> >> Anyone knows why this is? Am I missing some additional piece of the >> package? I installed everything except for the MSQL server stuff >> from the vcs_web.exe package. >> >> Thanks a lot in advance for any tips and hints, 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 loocas at duber.cz Sun May 2 18:04:48 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Sun, 02 May 2010 18:04:48 +0200 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: <4BDD93F9.6090501@duber.cz> References: <8C12A2BD8CFE894C891514267B55A2B511456D79@srv-sc-mail.symyx.com> <1A472770E042064698CB5ADC83A12ACD3950A8DB@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD395A8B00@TK5EX14MBXC116.redmond.corp.microsoft.com> <013EA4BF-DEB4-4DDF-94E4-34B32835B491@microsoft.com> <4BDD7148.4080804@duber.cz> <4BDD7373.8030800@voidspace.org.uk> <4BDD93F9.6090501@duber.cz> Message-ID: <4BDDA2A0.5060408@duber.cz> Ok, I'm a little lost here. I previously installed the C# Visual Studio Express version. Then I installed the Visual Studio Isolated Shell and since I have no previous experience with VS, how do I make the IPy tools extension to install via the Isolated Shell? And also, how the hell do I run the isolated shell if I installed VS previously? Thanks a lot for any help! 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: > Oh, ok, thanks for pointing that out Michael. > > Now, does the Isolated Shell (I don't really know the difference), > provide a visual designer for Windows Forms and WPF? > > Thanks again, 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 > > Michael Foord wrote: >> On 02/05/2010 13:34, Luk?? Dub?da wrote: >>> Hi there everyone, >>> >>> first off, congratulations for pushing the IPy Tools out! KUDOS! >>> >>> Now, I have a problem installing it, unfortunately :( I'm sure I'm >>> doing something wrong as I have almost zero experience with >>> Visual Studio. >>> >>> I went to the MS site and downloaded what seemed to be an obvious choice >>> a Visual Studio 2010 Express for C#, >> >> Visual Studio Express does not allow you to install extensions like >> IPy Tools. Fortunately IPy tools works with the Visual Studio Isolated >> Shell that can be installed "standalone", without a Visual Studio >> install. >> >> http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=dfba7ac4-5366-456e-abd6-0e3e6ba83b7c >> >> >> Michael >> >>> I installed it and downloaded the >>> Iron Python extension. However, as soon as I "doble-click" on the >>> IronPythonTools.vsix I get this message: >>> "This extension is not installable on any currently installed products". >>> >>> Anyone knows why this is? Am I missing some additional piece of the >>> package? I installed everything except for the MSQL server stuff >>> from the vcs_web.exe package. >>> >>> Thanks a lot in advance for any tips and hints, 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 dinov at microsoft.com Sun May 2 20:31:06 2010 From: dinov at microsoft.com (Dino Viehland) Date: Sun, 2 May 2010 18:31:06 +0000 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: <4BDD93F9.6090501@duber.cz> References: <8C12A2BD8CFE894C891514267B55A2B511456D79@srv-sc-mail.symyx.com> <1A472770E042064698CB5ADC83A12ACD3950A8DB@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD395A8B00@TK5EX14MBXC116.redmond.corp.microsoft.com> <013EA4BF-DEB4-4DDF-94E4-34B32835B491@microsoft.com> <4BDD7148.4080804@duber.cz> <4BDD7373.8030800@voidspace.org.uk> <4BDD93F9.6090501@duber.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD395CB506@TK5EX14MBXC116.redmond.corp.microsoft.com> Luk?? Dub?da wrote: > Oh, ok, thanks for pointing that out Michael. > > Now, does the Isolated Shell (I don't really know the difference), > provide a visual designer for Windows Forms and WPF? > It does include the drag and drop designers - only the WPF designer works w/ IronPython though (WinForms really requires a bunch of static type information which makes Python code look horrible). From dinov at microsoft.com Sun May 2 20:36:18 2010 From: dinov at microsoft.com (Dino Viehland) Date: Sun, 2 May 2010 18:36:18 +0000 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: <4BDDA2A0.5060408@duber.cz> References: <8C12A2BD8CFE894C891514267B55A2B511456D79@srv-sc-mail.symyx.com> <1A472770E042064698CB5ADC83A12ACD3950A8DB@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD395A8B00@TK5EX14MBXC116.redmond.corp.microsoft.com> <013EA4BF-DEB4-4DDF-94E4-34B32835B491@microsoft.com> <4BDD7148.4080804@duber.cz> <4BDD7373.8030800@voidspace.org.uk> <4BDD93F9.6090501@duber.cz> <4BDDA2A0.5060408@duber.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD395CB54E@TK5EX14MBXC116.redmond.corp.microsoft.com> Luk?? Dub?da wrote: > Ok, I'm a little lost here. > > I previously installed the C# Visual Studio Express > version. Then I installed the Visual Studio Isolated > Shell and since I have no previous experience with VS, > how do I make the IPy tools extension to install via > the Isolated Shell? And also, how the hell do I run the > isolated shell if I installed VS previously? > > Thanks a lot for any help! > I'm not sure the isolated shell is the best recommendation. The purpose of the isolated shell is to run w/ it's own set of packages which are isolated from the rest of your normal VS installation. The integrated shell on the other hand runs with all available VS packages. Our walkthrough file recommends the integrated shell and that download is here: http://www.microsoft.com/downloads/details.aspx?FamilyID=8e5aa7b6-8436-43f0-b778-00c3bca733d3&displaylang=en But either way when you click to install the VSIX it generally tells you what VS it's going to get installed to. You can also figure out where it got installed to after the fact by looking in look in %LOCALAPPDATA%\Microsoft\VisualStudio. There you'll see a set of directories which correspond to VS installations (e.g. 10.0 for the shared location and maybe there'll be one for the isolated shell there as well). Below there will be an Extensions\Microsoft\IronPython Tools for Visual Studio directory. From dinov at microsoft.com Sun May 2 20:43:26 2010 From: dinov at microsoft.com (Dino Viehland) Date: Sun, 2 May 2010 18:43:26 +0000 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD395CB7A3@TK5EX14MBXC116.redmond.corp.microsoft.com> Brian wrote: > On Sat, May 1, 2010 at 23:45, Steve Dower wrote: > > My own 'Python tools' (for VS2008, never made it beyond private use) > > automatically adds the package name to the caption of __init__.py > > files (as shown in > > http://zooba.byteclub.net/files/2010/05/ipytool-initname.png) through > > a couple of overrides on the FileNode object. I am happy to provide > > this code if desired/appropriate. > > I'm not sure I understand the need for that, especially given that the way the file list gets sorted, that name should always be on the parent tree item directly above it. I think the main benefit here is that it's displayed that way not only in solution explorer but also in the tabs in the editor. I think it's a good suggestion. From dinov at microsoft.com Sun May 2 20:46:43 2010 From: dinov at microsoft.com (Dino Viehland) Date: Sun, 2 May 2010 18:46:43 +0000 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD395CB7EF@TK5EX14MBXC116.redmond.corp.microsoft.com> Steve wrote: > So, love having IronPy Tools (download from www.ironpython.net/tools/ > for those who missed it) and very keen to help make it the best Python > IDE out there (and frankly, it's almost there already IMHO). > > My first issue is with the project setup. While I really like it > automatically pulling in all my .py files/folders (since that is how > Python is going to handle it) I'm not so keen on every other file > coming in. I regularly run in CPython, which puts .pyc files > everywhere and all of these appear in the Solution Explorer. I'm > working out of a Subversion repository, and all my .svn folders also > appear. > > It's a matter of clutter rather than a show-stopper, but from my > experiences with MPFProj 9.0 it is just as easy to let code files be > tracked by the project rather than the file system. I note that > packages are given a different icon, so if the 'Show All Files' button > is soon to be enabled (to hide everything that isn't a package) that > is completely sufficient. It's actually more work to let them be tracked by the file system as we have to do that ourselves :) The difficult problem here is that obviously you want all .py files but there are non-.py files that you might want to include as well. I'm thinking .txt files, image files which you can edit in VS, etc... We have a plan to add the ability to hide individual files. Maybe we need to have a set of wildcards which get excluded? We could even have them both as project-level options as well as a VS-level option. > > Second, I have a suggestion for dealing with __init__.py files. I have > not heard any definitive statement on whether to include code in > __init__.py files or not, but I am aware that it is done and my > current project has primary base classes for each package in the > __init__.py files, resulting in having multiple such files open. > > My own 'Python tools' (for VS2008, never made it beyond private use) > automatically adds the package name to the caption of __init__.py > files (as shown in > http://zooba.byteclub.net/files/2010/05/ipytool-initname.png) through > a couple of overrides on the FileNode object. I am happy to provide > this code if desired/appropriate. > > There also appears to be some interesting things going on with the > outlining region tagger, but I'm sure these have been noted already. There were some bugs here and I thought we fixed them all. Can you give a little more detail? From loocas at duber.cz Sun May 2 23:58:36 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Sun, 02 May 2010 23:58:36 +0200 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: <1A472770E042064698CB5ADC83A12ACD395CB54E@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <8C12A2BD8CFE894C891514267B55A2B511456D79@srv-sc-mail.symyx.com> <1A472770E042064698CB5ADC83A12ACD3950A8DB@TK5EX14MBXC118.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD395A8B00@TK5EX14MBXC116.redmond.corp.microsoft.com> <013EA4BF-DEB4-4DDF-94E4-34B32835B491@microsoft.com> <4BDD7148.4080804@duber.cz> <4BDD7373.8030800@voidspace.org.uk> <4BDD93F9.6090501@duber.cz> <4BDDA2A0.5060408@duber.cz> <1A472770E042064698CB5ADC83A12ACD395CB54E@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4BDDF58C.3070703@duber.cz> Now it seems to be working! Thank you very much, Dino, I appretiate your support. Keep the good work up, guys! Thanks again. 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: > Luk?? Dub?da wrote: >> Ok, I'm a little lost here. >> >> I previously installed the C# Visual Studio Express >> version. Then I installed the Visual Studio Isolated >> Shell and since I have no previous experience with VS, >> how do I make the IPy tools extension to install via >> the Isolated Shell? And also, how the hell do I run the >> isolated shell if I installed VS previously? >> >> Thanks a lot for any help! >> > > I'm not sure the isolated shell is the best recommendation. > The purpose of the isolated shell is to run w/ it's own set > of packages which are isolated from the rest of your normal > VS installation. The integrated shell on the other hand runs > with all available VS packages. Our walkthrough file recommends > the integrated shell and that download is here: > > http://www.microsoft.com/downloads/details.aspx?FamilyID=8e5aa7b6-8436-43f0-b778-00c3bca733d3&displaylang=en > > But either way when you click to install the VSIX it generally > tells you what VS it's going to get installed to. You can also > figure out where it got installed to after the fact by looking > in look in %LOCALAPPDATA%\Microsoft\VisualStudio. There you'll see > a set of directories which correspond to VS installations (e.g. > 10.0 for the shared location and maybe there'll be one for the > isolated shell there as well). Below there will be an > Extensions\Microsoft\IronPython Tools for Visual Studio > directory. > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From s.j.dower at gmail.com Mon May 3 00:06:13 2010 From: s.j.dower at gmail.com (Steve Dower) Date: Mon, 3 May 2010 08:06:13 +1000 Subject: [IronPython] IronPy Tools for VS - Projects Message-ID: > We have a plan to add the ability to hide individual files. Maybe we > need to have a set of wildcards which get excluded? We could even > have them both as project-level options as well as a VS-level option. Automatically including all (relevant) files seems redundant unless the files are being created outside of VS. For importing an existing project it's great, but maintaining a project will get messy. Hiding by file extension would go a long way to helping here, and can I also suggest respecting the 'Hidden' file attribute (on files and folders)? This in particular will/should help with most version control systems that include an extra folder. >> There also appears to be some interesting things going on with the >> outlining region tagger, but I'm sure these have been noted already. > > There were some bugs here and I thought we fixed them all. ?Can you > give a little more detail? It seems somewhat unpredictable. The outlining regions occasionally don't fully appear when either the start or the end of the region is not visible (maybe my functions are just too long...) and scrolling up and down causes many to disappear/reappear. Occasionally the following def is included with the previous function (seems to happen with more than one unindent at the end of the function) and # comments 'attached' to the following class/def are sometimes included in the previous region. (While I'm here, another 'nice-to-have' region would be top-level if blocks, eg. if __name__=='__main__':) I can make screenshots if you like, but I think there's enough info there to reproduce. Also, just noticed it then, quick info tooltips seem to think comments are tuples and """/''' strings are typeless (unless the line happens to start with "/', or has a comma in it). Cheers From Jimmy.Schementi at microsoft.com Mon May 3 09:15:00 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 3 May 2010 07:15:00 +0000 Subject: [IronPython] Can't install IronPython Tools for Visual Studio Message-ID: <89BA01A0-9219-420F-965C-86A44823CD90@microsoft.com> http://ironpython.net/ironpython/tools/ should probably be updated to not link to the express version. You're absolutely right; the "Visual Studio 2010" link on http://ironpython.net/tools/ now goes to the general VS2010 site (http://microsoft.com/visualstudio/), and http://ironpython.net/tools/download/ now has the installation instructions from the walkthrough, so that should clear up any confusion. ~Jimmy -------------- next part -------------- An HTML attachment was scrubbed... URL: From niki at vintech.bg Mon May 3 10:35:00 2010 From: niki at vintech.bg (niki) Date: Mon, 03 May 2010 11:35:00 +0300 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: <89BA01A0-9219-420F-965C-86A44823CD90@microsoft.com> References: <89BA01A0-9219-420F-965C-86A44823CD90@microsoft.com> Message-ID: <4BDE8AB4.6020806@vintech.bg> Jimmy Schementi wrote: > >> >> >> http://ironpython.net/ironpython/tools/ >> should probably be updated to not link to the express version. > > You're absolutely right; the "Visual Studio 2010" link on > http://ironpython.net/tools/ now goes to the general VS2010 site ( > http://microsoft.com/visualstudio/), > and > http://ironpython.net/tools/download/ now > has the installation instructions from the walkthrough, so that should > clear up any confusion. Is it Isolated shell or Integrated shell? Niki From vernondcole at gmail.com Mon May 3 11:37:32 2010 From: vernondcole at gmail.com (Vernon Cole) Date: Mon, 3 May 2010 03:37:32 -0600 Subject: [IronPython] adodbapi 2.3.0 (the django version) released Message-ID: Hello everyone. I have just uploaded the latest version of adodbapi. This version is highly refactored following the work of Adam Vandenberg, and also has all of the current user suggested patches. Both the Mercurial tree and the downloadable zip files are updated. (There is no fancy installer, just copy the folder in your site-packages folder.) This has been tested using CPython 2.3, CPython 2.6, IronPython 2.6 (.NET 2) and IronPython 2.6(.NET 4), accessing .mdb, MS-SQL and MySQL databases. There is a separate .zip for Python 3.1. ............ adodbapi A Python DB-API 2.0 module that makes it easy to use Microsoft ADO for connecting with databases and other data sources using either CPython or IronPython. Home page: Features: * 100% DB-API 2.0 compliant. * Includes pyunit testcases that describe how to use the module. * Fully implemented in Python. * Licensed under the LGPL license. * Supports eGenix mxDateTime, Python 2.3 datetime module and Python time module. * Supports multiple paramstyles: 'qmark' 'named' 'format' ............ Whats new in version 2.3.0 # note: breaking changes and default changes! This version is all about django support. There are two targets: A) MS SQL database connections for mainstream django. B) running django on IronPython Thanks to Adam Vandenberg for the django modifications. The changes are: 1. the ado constants are moved into their own module: ado_consts This may break some old code, but Adam did it on his version and I like the improvement in readability. Also, you get better documentation of some results, like convertion of MS data type codes to strings: >>> ado_consts.adTypeNames[202] 'adVarWChar' >>> ado_consts.adTypeNames[cursr.description[0][1]] 'adWChar' ** deprecation warning: access to these constants as adodbapi.ad* will be removed in the future ** 2. will now default to client-side cursors. To get the old default, use something like: adodbapi.adodbapi.defaultCursorLocation = ado_consts.adUseServer ** change in default warning ** 3. Added ability to change paramstyle on the connection or the cursor: (An extension to the db api) Possible values for paramstyle are: 'qmark', 'named', 'format'. The default remains 'qmark'. (SQL language in '%s' format or ':namedParameter' format will be converted to '?' internally.) when 'named' format is used, the parameters must be in a dict, rather than a sequence. >>>c = adodbapi.connect('someConnectionString',timeout=30) >>>c.paramstyle = 'spam' <<>> ** new extension feature ** 4. Added abality to change the default paramstyle for adodbapi: (for django) >>> import adodbapi as Database >>> Database.paramstyle = 'format' ** new extension feature ** Whats new in version 2.2.7 1. Does not automagically change to mx.DateTime when mx package is installed. (This by popular demand.) to get results in mx.DateTime format, use: adodbapi.adodbapi.dateconverter = adodbapi.adodbapi.mxDateTimeConverter 2. implements cursor.next() -------------- next part -------------- An HTML attachment was scrubbed... URL: From loocas at duber.cz Mon May 3 13:33:57 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Mon, 03 May 2010 13:33:57 +0200 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: <4BDE8AB4.6020806@vintech.bg> References: <89BA01A0-9219-420F-965C-86A44823CD90@microsoft.com> <4BDE8AB4.6020806@vintech.bg> Message-ID: <4BDEB4A5.8030508@duber.cz> Ok, I now risk being kicked out from this list for spamming :D but I have to take my chances. Btw: I'm still waiting for a bung of WPF books to arrive, so, please bear with me. Here's a primitive app I'm trying to build in VS2010 using IPy and, to me, the new WPF stuff. XAML and the Python Code attached. Now, when I try to build the app, I get an error: "Event addition expected callable object, got NoneType" Can anyone explain to me why I'm getting this error? As I said, I'm more used to WinForms and adding a function definition to a control this way has always worked. Even more so as I copied some of the code, incl. the even addition from this site: http://www.ironpython.info/index.php/XAML_GUI_Events_Example Thank you very much (again) in advance, I really do appretiate all your support. 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 niki wrote: > Jimmy Schementi wrote: >> >>> >>> >>> >>> http://ironpython.net/ironpython/tools/ >>> >>> should probably be updated to not link to the express version. >> >> You're absolutely right; the "Visual Studio 2010" link on >> http://ironpython.net/tools/ now goes to the general VS2010 site ( >> http://microsoft.com/visualstudio/), >> and >> http://ironpython.net/tools/download/ >> now has the installation instructions from the walkthrough, so that >> should clear up any confusion. > > Is it Isolated shell or Integrated shell? > > Niki > _______________________________________________ > 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: WPF_Test_01.xaml Type: application/xaml+xml Size: 1920 bytes Desc: not available URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: WPF_Test_01.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: WPF_Test_01.pyproj URL: From jonvspython at gmail.com Mon May 3 13:40:19 2010 From: jonvspython at gmail.com (jon vs. python) Date: Mon, 3 May 2010 13:40:19 +0200 Subject: [IronPython] Existing attribute raises a AttributeError: object has no attribute... Message-ID: Hi, Some times I get an AttributeError when the attribute does exist, see bellow. Why does this happen? Any clue? Thanks, Jon. >>> dir(mst) ['ReadBrokenFiber', 'ReadZoneTemperature', 'StartStop', '__class__', '__delattr_ _', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init __', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__seta ttr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'connect', ' disconnect', 'mst', 'reconnect', 'resp'] >>> mst.StartStop > >>> callable(mst.StartStop) True >>> mst.StartStop() Traceback (most recent call last): File "", line 1, in File "C:\Archivos de programa\IronPython 2.6\fl.py", line 40, in StartStop AttributeError: 'Master' object has no attribute 'StartStop' -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonvspython at gmail.com Mon May 3 14:36:04 2010 From: jonvspython at gmail.com (jon vs. python) Date: Mon, 3 May 2010 14:36:04 +0200 Subject: [IronPython] Existing attribute raises a AttributeError: object has no attribute... In-Reply-To: References: Message-ID: Sorry again. I guess it's monday. On Mon, May 3, 2010 at 1:40 PM, jon vs. python wrote: > Hi, > Some times I get an AttributeError when the attribute does exist, see > bellow. Why does this happen? Any clue? > Thanks, Jon. > > >>> dir(mst) > ['ReadBrokenFiber', 'ReadZoneTemperature', 'StartStop', '__class__', > '__delattr_ > _', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', > '__init > __', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', > '__seta > ttr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', > 'connect', ' > disconnect', 'mst', 'reconnect', 'resp'] > >>> mst.StartStop > 0x000000000000002B>> > >>> callable(mst.StartStop) > True > >>> mst.StartStop() > Traceback (most recent call last): > File "", line 1, in > File "C:\Archivos de programa\IronPython 2.6\fl.py", line 40, in > StartStop > AttributeError: 'Master' object has no attribute 'StartStop' > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Mon May 3 15:22:49 2010 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 3 May 2010 06:22:49 -0700 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: <4BDEB4A5.8030508@duber.cz> References: <89BA01A0-9219-420F-965C-86A44823CD90@microsoft.com> <4BDE8AB4.6020806@vintech.bg> <4BDEB4A5.8030508@duber.cz> Message-ID: The problem is this line: controls['Button']['btnCreate'].Click += printHello("HELLO WORLD") This executes the function printHello("HELLO WORLD") and tries to add the result -- None -- as an event handler. Something like the following should probably work: controls['Button']['btnCreate'].Click += lambda s, e: printHello("HELLO WORLD") On Mon, May 3, 2010 at 4:33 AM, Luk?? Dub?da wrote: > Ok, I now risk being kicked out from this list for > spamming :D but I have to take my chances. Btw: I'm > still waiting for a bung of WPF books to arrive, so, > please bear with me. > > Here's a primitive app I'm trying to build in VS2010 > using IPy and, to me, the new WPF stuff. > > XAML and the Python Code attached. > > Now, when I try to build the app, I get an error: > > "Event addition expected callable object, got NoneType" > > Can anyone explain to me why I'm getting this error? > As I said, I'm more used to WinForms and adding a function > definition to a control this way has always worked. Even > more so as I copied some of the code, incl. the even > addition from this site: > http://www.ironpython.info/index.php/XAML_GUI_Events_Example > > Thank you very much (again) in advance, I really do appretiate > all your support. > > 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 > > > niki wrote: > >> Jimmy Schementi wrote: >> >>> >>> >>>> >>>> >>>> http://ironpython.net/ironpython/tools/ >>>> should probably be updated to not link to the express version. >>>> >>> >>> You're absolutely right; the "Visual Studio 2010" link on >>> http://ironpython.net/tools/ now goes to the general VS2010 site ( < >>> http://microsoft.com/visualstudio/>http://microsoft.com/visualstudio/), >>> and >>> http://ironpython.net/tools/download/ now has the installation >>> instructions from the walkthrough, so that should clear up any confusion. >>> >> >> Is it Isolated shell or Integrated shell? >> >> Niki >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > import clr > clr.AddReference('PresentationFramework') > > from System.Windows.Markup import XamlReader > from System.Windows import Application > from System.IO import FileStream, FileMode > > XamlDef = XamlReader.Load(FileStream('WPF_Test_01.xaml', FileMode.Open)) > > def Waddle(c, d): > s = str(c.__class__) > if "System.Windows.Controls." in str(c) and hasattr(c,"Name") and > c.Name.Length>0: > ControlType = s[s.find("'")+1:s.rfind("'")] > if ControlType not in d: > d[ControlType] = {} > d[ControlType][c.Name] = c > if hasattr(c,"Children"): > for cc in c.Children: > Waddle(cc, d) > elif hasattr(c,"Child"): > Waddle(c.Child, d) > elif hasattr(c,"Content"): > Waddle(c.Content, d) > > def printToLabel(passedControl, passedInput): > passedControl.Content = passedInput > > def printHello(txt): > print txt > > controls = {} > Waddle(XamlDef, controls) > > #controls['Button']['btnCreate'].Click += > printToLabel(controls['Label']['lblOutput'], > controls['Button']['btnCreate'].Content) > > controls['Button']['btnCreate'].Click += printHello("HELLO WORLD") > > Application().Run(XamlDef) > > > > > Debug > 2.0 > {cab7a050-6da5-4796-8d39-1205d7984933} > . > WPF_Test_01.py > > > . > True > WPF_Test_01 > WPF_Test_01 > WPF_Test_01 > > > true > false > > > true > false > > > Include="D:\Scripts\Tests\WPF_Test\WPF_Test_01\WPF_Test_01\WPF_Test_01.py" > /> > Include="D:\Scripts\Tests\WPF_Test\WPF_Test_01\WPF_Test_01\WPF_Test_01.xaml" > /> > > > > > _______________________________________________ > 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 Mon May 3 17:52:33 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 3 May 2010 08:52:33 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/65936. ADDED SOURCES $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/mmap.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/SetStorage.cs $/IronPython/IronPython_Main/Languages/IronPython/Scripts/generate_set.py MODIFIED SOURCES $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/mmap.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Set.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/IronPython.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/IronPython.Modules.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/marshal.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/PythonDictionary.cs $/IronPython/IronPython_Main/Languages/IronPython/AssemblyVersion.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/re.cs $/IronPython/IronPython_Main/Hosts/Silverlight/Chiron/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/PythonFile.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/CommonDictionaryStorage.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/PythonExceptions.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/SetStorage.cs $/IronPython/IronPython_Main/Languages/IronPython/Scripts/generate_set.py $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Slice.cs $/IronPython/IronPython_Main/Languages/IronPython/Tests/test_set.py $/IronPython/IronPython_Main/Languages/IronPython/Tests/versions/python26.py $/IronPython/IronPython_Main/Languages/IronPython/Scripts/generate.py $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Types/NewTypeMaker.cs $/IronPython/IronPython_Main/Languages/IronPython/Scripts/test_cgcheck.py $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Debugging/AssemblyInfo.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Properties/ExtensionAssemblyInfo.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Tutorial/Tutorial.htm CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1759102 Date: 4/30/2010 3:50:41 PM Implements the mmap module. (CLR 4 only) (Shelveset: mmap;REDMOND\ddicato | SNAP CheckinId: 10702) -------------------------------------------------------------------------------- Changeset Id: 1758982 Date: 4/30/2010 2:29:14 PM Complete rewrite and optimization of our set implementation. Added SetStorage class, which is similar to CommonDictionaryStorage without Value fields in its buckets. Set operations are in SetStorage.cs rather than Set.cs for full access to private fields, enabling certain optimizations (e.g. not re-hashing elements). Set operations only iterate through the smaller set when possible. ISet interface is gone, and duplicated logic in set/frozenset is now generated. SetHelpers is gone, but several static helpers remain and have moved over to SetStorage. Frozen sets now share their underlying storage whenever possible. Removed sort from hashing function and instead combined elements? hashes in a commutative and associative manner. Three different methods of order-independent ?summation? (using ^, +, and *) are combined with set cardinality to attain desired hash effectiveness as tested by CPython. Other changes: ? Removed HasAnyValues from CommonDictionaryStorage in favor of checking (_count > 0). _count now represents number of values in bucket array, not including the null bucket. ? Fixed an issue in our code generator which failed when the generated code contained ?#endregion?. (Shelveset: SetOptimizations;REDMOND\ddicato | SNAP CheckinId: 10699) From Jimmy.Schementi at microsoft.com Mon May 3 19:17:04 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 3 May 2010 17:17:04 +0000 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: <4BDE8AB4.6020806@vintech.bg> References: <89BA01A0-9219-420F-965C-86A44823CD90@microsoft.com> <4BDE8AB4.6020806@vintech.bg> Message-ID: <6EAE274E-84D8-4E2A-816B-79776852F12D@microsoft.com> On May 3, 2010, at 1:35 AM, "niki" wrote: > Jimmy Schementi wrote: >>> >>> >>> http://ironpython.net/ironpython/tools/ >>> should probably be updated to not link to the express version. >> You're absolutely right; the "Visual Studio 2010" link on http://ironpython.net/tools/ now goes to the general VS2010 site ( http://microsoft.com/visualstudio/), and http://ironpython.net/tools/download/ now has the installation instructions from the walkthrough, so that should clear up any confusion. > > Is it Isolated shell or Integrated shell? > > Niki As both the download page and the walkthrough say, the integrated shell is recommended, though I'm not sure why it wouldn't also work in the isolated shell. From loocas at duber.cz Mon May 3 19:30:02 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Mon, 03 May 2010 19:30:02 +0200 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: References: <89BA01A0-9219-420F-965C-86A44823CD90@microsoft.com> <4BDE8AB4.6020806@vintech.bg> <4BDEB4A5.8030508@duber.cz> Message-ID: <4BDF081A.1070502@duber.cz> Thanks for pointing that out, Curt, now, for such a trivial function I can imagine substituting it with a Lambda, however, how would I use a more complex function? I found out exactly that when not passing any arguments the function works like this: def functName(self, sender): .... pass (XamlDef.FindName('btnCreate')).Click += functName This has worked flawlessly, as soon as I need to pass it an argument. I haven't found a way to do that. Thanks again, 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 Curt Hagenlocher wrote: > The problem is this line: > controls['Button']['btnCreate'].Click += printHello("HELLO WORLD") > > This executes the function printHello("HELLO WORLD") and tries to add > the result -- None -- as an event handler. Something like the following > should probably work: > > controls['Button']['btnCreate'].Click += lambda s, e: printHello("HELLO > WORLD") > > On Mon, May 3, 2010 at 4:33 AM, Luk?? Dub?da > wrote: > > Ok, I now risk being kicked out from this list for > spamming :D but I have to take my chances. Btw: I'm > still waiting for a bung of WPF books to arrive, so, > please bear with me. > > Here's a primitive app I'm trying to build in VS2010 > using IPy and, to me, the new WPF stuff. > > XAML and the Python Code attached. > > Now, when I try to build the app, I get an error: > > "Event addition expected callable object, got NoneType" > > Can anyone explain to me why I'm getting this error? > As I said, I'm more used to WinForms and adding a function > definition to a control this way has always worked. Even > more so as I copied some of the code, incl. the even > addition from this site: > http://www.ironpython.info/index.php/XAML_GUI_Events_Example > > Thank you very much (again) in advance, I really do appretiate > all your support. > > 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 > > > niki wrote: > > Jimmy Schementi wrote: > > > > > > http://ironpython.net/ironpython/tools/ > > should probably be updated to not link to the express > version. > > > You're absolutely right; the "Visual Studio 2010" link on > http://ironpython.net/tools/ now goes to the general VS2010 > site ( > http://microsoft.com/visualstudio/), > and > http://ironpython.net/tools/download/ > now has the installation instructions from the walkthrough, > so that should clear up any confusion. > > > Is it Isolated shell or Integrated shell? > > Niki > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > import clr > clr.AddReference('PresentationFramework') > > from System.Windows.Markup import XamlReader > from System.Windows import Application > from System.IO import FileStream, FileMode > > XamlDef = XamlReader.Load(FileStream('WPF_Test_01.xaml', FileMode.Open)) > > def Waddle(c, d): > s = str(c.__class__) > if "System.Windows.Controls." in str(c) and hasattr(c,"Name") and > c.Name.Length>0: > ControlType = s[s.find("'")+1:s.rfind("'")] > if ControlType not in d: > d[ControlType] = {} > d[ControlType][c.Name] = c > if hasattr(c,"Children"): > for cc in c.Children: > Waddle(cc, d) > elif hasattr(c,"Child"): > Waddle(c.Child, d) > elif hasattr(c,"Content"): > Waddle(c.Content, d) > > def printToLabel(passedControl, passedInput): > passedControl.Content = passedInput > > def printHello(txt): > print txt > > controls = {} > Waddle(XamlDef, controls) > > #controls['Button']['btnCreate'].Click += > printToLabel(controls['Label']['lblOutput'], > controls['Button']['btnCreate'].Content) > > controls['Button']['btnCreate'].Click += printHello("HELLO WORLD") > > Application().Run(XamlDef) > > > xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> > > Debug > 2.0 > {cab7a050-6da5-4796-8d39-1205d7984933} > . > WPF_Test_01.py > > > . > True > WPF_Test_01 > WPF_Test_01 > WPF_Test_01 > > > true > false > > > true > false > > > Include="D:\Scripts\Tests\WPF_Test\WPF_Test_01\WPF_Test_01\WPF_Test_01.py" > /> > Include="D:\Scripts\Tests\WPF_Test\WPF_Test_01\WPF_Test_01\WPF_Test_01.xaml" > /> > > > > > _______________________________________________ > 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 May 3 19:34:16 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 3 May 2010 17:34:16 +0000 Subject: [IronPython] Can't install IronPython Tools for Visual Studio In-Reply-To: <4BDF081A.1070502@duber.cz> References: <89BA01A0-9219-420F-965C-86A44823CD90@microsoft.com> <4BDE8AB4.6020806@vintech.bg> <4BDEB4A5.8030508@duber.cz> <4BDF081A.1070502@duber.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD395D261B@TK5EX14MBXC116.redmond.corp.microsoft.com> Luk?? Dub?da wrote: > Thanks for pointing that out, Curt, > > now, for such a trivial function I can imagine substituting > it with a Lambda, however, how would I use a more complex > function? > > I found out exactly that when not passing any arguments > the function works like this: > > def functName(self, sender): > .... > pass > > (XamlDef.FindName('btnCreate')).Click += functName > > > This has worked flawlessly, as soon as I need to pass it > an argument. I haven't found a way to do that. You can always just create a closure: def outer_lambda(...): foo = 42 def functName(self, sender): print foo (XamlDef.FindName('btnCreate')).Click += functName From ronnie.maor at gmail.com Mon May 3 21:25:03 2010 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Mon, 3 May 2010 22:25:03 +0300 Subject: [IronPython] adodbapi 2.3.0 (the django version) released In-Reply-To: References: Message-ID: I'd like to play with sqlalchemy with IPy 2.6 (currently 2.6.0) and talking to MS SQL database. will this package allow me to do this? (apologies if this is a silly question - I thought I'd save myself the learning curve for understanding if it's silly or not...) thanks Ronnie On Mon, May 3, 2010 at 12:37 PM, Vernon Cole wrote: > Hello everyone. > I have just uploaded the latest version of adodbapi. This version is > highly refactored following the work of Adam Vandenberg, and also has all of > the current user suggested patches. Both the Mercurial tree and the > downloadable zip files are updated. (There is no fancy installer, just copy > the folder in your site-packages folder.) This has been tested using CPython > 2.3, CPython 2.6, IronPython 2.6 (.NET 2) and IronPython 2.6(.NET 4), > accessing .mdb, MS-SQL and MySQL databases. There is a separate .zip for > Python 3.1. > ............ > adodbapi > > A Python DB-API 2.0 module that makes it easy to use Microsoft ADO > for connecting with databases and other data sources > using either CPython or IronPython. > > Home page: > > Features: > * 100% DB-API 2.0 compliant. > * Includes pyunit testcases that describe how to use the module. > * Fully implemented in Python. > * Licensed under the LGPL license. > * Supports eGenix mxDateTime, Python 2.3 datetime module and Python time > module. > * Supports multiple paramstyles: 'qmark' 'named' 'format' > ............ > Whats new in version 2.3.0 # note: breaking changes and default changes! > This version is all about django support. There are two targets: > A) MS SQL database connections for mainstream django. > B) running django on IronPython > Thanks to Adam Vandenberg for the django modifications. > The changes are: > > 1. the ado constants are moved into their own module: ado_consts > This may break some old code, but Adam did it on his version and I > like the improvement in readability. > Also, you get better documentation of some results, like convertion > of MS data type codes to strings: > >>> ado_consts.adTypeNames[202] > 'adVarWChar' > >>> ado_consts.adTypeNames[cursr.description[0][1]] > 'adWChar' > ** deprecation warning: access to these constants as adodbapi.ad* will > be removed in the future ** > > 2. will now default to client-side cursors. To get the old default, use > something like: > adodbapi.adodbapi.defaultCursorLocation = ado_consts.adUseServer > ** change in default warning ** > > 3. Added ability to change paramstyle on the connection or the cursor: (An > extension to the db api) > Possible values for paramstyle are: 'qmark', 'named', 'format'. The > default remains 'qmark'. > (SQL language in '%s' format or ':namedParameter' format will be > converted to '?' internally.) > when 'named' format is used, the parameters must be in a dict, rather > than a sequence. > >>>c = adodbapi.connect('someConnectionString',timeout=30) > >>>c.paramstyle = 'spam' > << not in:('qmark', 'named', 'format')>>> > ** new extension feature ** > > 4. Added abality to change the default paramstyle for adodbapi: (for > django) > >>> import adodbapi as Database > >>> Database.paramstyle = 'format' > ** new extension feature ** > > Whats new in version 2.2.7 > 1. Does not automagically change to mx.DateTime when mx package is > installed. (This by popular demand.) > to get results in mx.DateTime format, use: > adodbapi.adodbapi.dateconverter = > adodbapi.adodbapi.mxDateTimeConverter > 2. implements cursor.next() > > > _______________________________________________ > 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 May 3 21:58:11 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 3 May 2010 19:58:11 +0000 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD395D3339@TK5EX14MBXC116.redmond.corp.microsoft.com> Steve Dower wrote: > > There were some bugs here and I thought we fixed them all. ?Can you > > give a little more detail? > > It seems somewhat unpredictable. The outlining regions occasionally > don't fully appear when either the start or the end of the region is > not visible (maybe my functions are just too long...) and scrolling up > and down causes many to disappear/reappear. Occasionally the following > def is included with the previous function (seems to happen with more > than one unindent at the end of the function) and # comments > 'attached' to the following class/def are sometimes included in the > previous region. (While I'm here, another 'nice-to-have' region would > be top-level if blocks, eg. if __name__=='__main__':) I have a fix for the unpredictableness and scrolling - there were some issues w/ checking to see if 2 spans intersect. I can also repro the comments issue but it'll be tougher to fix (I need to update the IronPython parser). And I even added support for top-level if blocks being marked as collapsible regions. But I can't repro the functions collapsing into each other and I thought I had mostly fixed that problem. Can you send me a file that repros it? From vernondcole at gmail.com Mon May 3 22:35:32 2010 From: vernondcole at gmail.com (Vernon Cole) Date: Mon, 3 May 2010 14:35:32 -0600 Subject: [IronPython] adodbapi 2.3.0 (the django version) released In-Reply-To: References: Message-ID: Not silly at all. I just checked on their current documentation and adodbapi is still listed as an alternate engine for sqlalchemy for MS-SQL databases. It is listed as at "development" level for Python 2.0. I communicated with the sqlalchemy team ages (3 years?) ago and asked what facilites they needed to have added. They requested a reliable .rowcount number. That has been done as of this release -- the change to using a client-side cursor by default should be the last step in making that work. In other words, you have picked the perfect time to work on this project. Please make sure to report any problems you find or tweaks you may need. This code will be in flux for a while -- I'm trying to get the little ends tied up before jumping in to true .NET support -- so get any requests in soon rather than late. -- Vernon P.S.: I failed to thank JDHardy for patches to the alpha test version. Thanks! --------------------------- On Mon, May 3, 2010 at 1:25 PM, Ronnie Maor wrote: > I'd like to play with sqlalchemy with IPy 2.6 (currently 2.6.0) and talking > to MS SQL database. will this package allow me to do this? > > (apologies if this is a silly question - I thought I'd save myself the > learning curve for understanding if it's silly or not...) > > thanks > Ronnie > > On Mon, May 3, 2010 at 12:37 PM, Vernon Cole wrote: > >> Hello everyone. >> I have just uploaded the latest version of adodbapi. This version is >> highly refactored following the work of Adam Vandenberg, and also has all of >> the current user suggested patches. Both the Mercurial tree and the >> downloadable zip files are updated. (There is no fancy installer, just copy >> the folder in your site-packages folder.) This has been tested using CPython >> 2.3, CPython 2.6, IronPython 2.6 (.NET 2) and IronPython 2.6(.NET 4), >> accessing .mdb, MS-SQL and MySQL databases. There is a separate .zip for >> Python 3.1. >> ............ >> adodbapi >> >> A Python DB-API 2.0 module that makes it easy to use Microsoft ADO >> for connecting with databases and other data sources >> using either CPython or IronPython. >> >> Home page: >> >> Features: >> * 100% DB-API 2.0 compliant. >> * Includes pyunit testcases that describe how to use the module. >> * Fully implemented in Python. >> * Licensed under the LGPL license. >> * Supports eGenix mxDateTime, Python 2.3 datetime module and Python time >> module. >> * Supports multiple paramstyles: 'qmark' 'named' 'format' >> ............ >> Whats new in version 2.3.0 # note: breaking changes and default >> changes! >> This version is all about django support. There are two targets: >> A) MS SQL database connections for mainstream django. >> B) running django on IronPython >> Thanks to Adam Vandenberg for the django modifications. >> The changes are: >> >> 1. the ado constants are moved into their own module: ado_consts >> This may break some old code, but Adam did it on his version and I >> like the improvement in readability. >> Also, you get better documentation of some results, like convertion >> of MS data type codes to strings: >> >>> ado_consts.adTypeNames[202] >> 'adVarWChar' >> >>> ado_consts.adTypeNames[cursr.description[0][1]] >> 'adWChar' >> ** deprecation warning: access to these constants as adodbapi.ad* will >> be removed in the future ** >> >> 2. will now default to client-side cursors. To get the old default, use >> something like: >> adodbapi.adodbapi.defaultCursorLocation = ado_consts.adUseServer >> ** change in default warning ** >> >> 3. Added ability to change paramstyle on the connection or the cursor: >> (An extension to the db api) >> Possible values for paramstyle are: 'qmark', 'named', 'format'. The >> default remains 'qmark'. >> (SQL language in '%s' format or ':namedParameter' format will be >> converted to '?' internally.) >> when 'named' format is used, the parameters must be in a dict, rather >> than a sequence. >> >>>c = adodbapi.connect('someConnectionString',timeout=30) >> >>>c.paramstyle = 'spam' >> <<> paramstyle="spam" not in:('qmark', 'named', 'format')>>> >> ** new extension feature ** >> >> 4. Added abality to change the default paramstyle for adodbapi: (for >> django) >> >>> import adodbapi as Database >> >>> Database.paramstyle = 'format' >> ** new extension feature ** >> >> Whats new in version 2.2.7 >> 1. Does not automagically change to mx.DateTime when mx package is >> installed. (This by popular demand.) >> to get results in mx.DateTime format, use: >> adodbapi.adodbapi.dateconverter = >> adodbapi.adodbapi.mxDateTimeConverter >> 2. implements cursor.next() >> >> >> _______________________________________________ >> 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 ronnie.maor at gmail.com Mon May 3 22:51:35 2010 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Mon, 3 May 2010 23:51:35 +0300 Subject: [IronPython] adodbapi 2.3.0 (the django version) released In-Reply-To: References: Message-ID: I was hoping for a "sure - this type of setup has been working for 6 months now" :-) Anyway, I'll try and play with it and report bugs. thanks! On Mon, May 3, 2010 at 11:35 PM, Vernon Cole wrote: > Not silly at all. I just checked on their current documentation and > adodbapi is still listed as an alternate engine for sqlalchemy for MS-SQL > databases. It is listed as at "development" level for Python 2.0. I > communicated with the sqlalchemy team ages (3 years?) ago and asked what > facilites they needed to have added. They requested a reliable .rowcount > number. That has been done as of this release -- the change to using a > client-side cursor by default should be the last step in making that work. > > In other words, you have picked the perfect time to work on this project. > > Please make sure to report any problems you find or tweaks you may need. > This code will be in flux for a while -- I'm trying to get the little ends > tied up before jumping in to true .NET support -- so get any requests in > soon rather than late. > -- > Vernon > > P.S.: I failed to thank JDHardy for patches to the alpha test version. > Thanks! > --------------------------- > > > On Mon, May 3, 2010 at 1:25 PM, Ronnie Maor wrote: > >> I'd like to play with sqlalchemy with IPy 2.6 (currently 2.6.0) and >> talking to MS SQL database. will this package allow me to do this? >> >> (apologies if this is a silly question - I thought I'd save myself the >> learning curve for understanding if it's silly or not...) >> >> thanks >> Ronnie >> >> On Mon, May 3, 2010 at 12:37 PM, Vernon Cole wrote: >> >>> Hello everyone. >>> I have just uploaded the latest version of adodbapi. This version is >>> highly refactored following the work of Adam Vandenberg, and also has all of >>> the current user suggested patches. Both the Mercurial tree and the >>> downloadable zip files are updated. (There is no fancy installer, just copy >>> the folder in your site-packages folder.) This has been tested using CPython >>> 2.3, CPython 2.6, IronPython 2.6 (.NET 2) and IronPython 2.6(.NET 4), >>> accessing .mdb, MS-SQL and MySQL databases. There is a separate .zip for >>> Python 3.1. >>> ............ >>> adodbapi >>> >>> A Python DB-API 2.0 module that makes it easy to use Microsoft ADO >>> for connecting with databases and other data sources >>> using either CPython or IronPython. >>> >>> Home page: >>> >>> Features: >>> * 100% DB-API 2.0 compliant. >>> * Includes pyunit testcases that describe how to use the module. >>> * Fully implemented in Python. >>> * Licensed under the LGPL license. >>> * Supports eGenix mxDateTime, Python 2.3 datetime module and Python time >>> module. >>> * Supports multiple paramstyles: 'qmark' 'named' 'format' >>> ............ >>> Whats new in version 2.3.0 # note: breaking changes and default >>> changes! >>> This version is all about django support. There are two targets: >>> A) MS SQL database connections for mainstream django. >>> B) running django on IronPython >>> Thanks to Adam Vandenberg for the django modifications. >>> The changes are: >>> >>> 1. the ado constants are moved into their own module: ado_consts >>> This may break some old code, but Adam did it on his version and I >>> like the improvement in readability. >>> Also, you get better documentation of some results, like convertion >>> of MS data type codes to strings: >>> >>> ado_consts.adTypeNames[202] >>> 'adVarWChar' >>> >>> ado_consts.adTypeNames[cursr.description[0][1]] >>> 'adWChar' >>> ** deprecation warning: access to these constants as adodbapi.ad* will >>> be removed in the future ** >>> >>> 2. will now default to client-side cursors. To get the old default, use >>> something like: >>> adodbapi.adodbapi.defaultCursorLocation = ado_consts.adUseServer >>> ** change in default warning ** >>> >>> 3. Added ability to change paramstyle on the connection or the cursor: >>> (An extension to the db api) >>> Possible values for paramstyle are: 'qmark', 'named', 'format'. The >>> default remains 'qmark'. >>> (SQL language in '%s' format or ':namedParameter' format will be >>> converted to '?' internally.) >>> when 'named' format is used, the parameters must be in a dict, rather >>> than a sequence. >>> >>>c = adodbapi.connect('someConnectionString',timeout=30) >>> >>>c.paramstyle = 'spam' >>> <<>> paramstyle="spam" not in:('qmark', 'named', 'format')>>> >>> ** new extension feature ** >>> >>> 4. Added abality to change the default paramstyle for adodbapi: (for >>> django) >>> >>> import adodbapi as Database >>> >>> Database.paramstyle = 'format' >>> ** new extension feature ** >>> >>> Whats new in version 2.2.7 >>> 1. Does not automagically change to mx.DateTime when mx package is >>> installed. (This by popular demand.) >>> to get results in mx.DateTime format, use: >>> adodbapi.adodbapi.dateconverter = >>> adodbapi.adodbapi.mxDateTimeConverter >>> 2. implements cursor.next() >>> >>> >>> _______________________________________________ >>> 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 s.j.dower at gmail.com Mon May 3 23:57:45 2010 From: s.j.dower at gmail.com (Steve Dower) Date: Tue, 4 May 2010 07:57:45 +1000 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: <1A472770E042064698CB5ADC83A12ACD395D3339@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD395D3339@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: The code snippet below does it. The region for class A goes all the way to the next class/EOF (actually, 3 lines before EOF, unless there's whitespace on the third- or second-last lines), the region for funca goes from the def to the line 'def funcb(self):' inclusive and the region for funcb only includes the def and the pass (as expected). Interestingly, two unbound functions (remove class, unindent) have the correct regions class A: def funca(self): if True: pass def funcb(self): pass On Tue, May 4, 2010 at 05:58, Dino Viehland wrote: > Steve Dower wrote: >> > There were some bugs here and I thought we fixed them all. ?Can you >> > give a little more detail? >> >> It seems somewhat unpredictable. The outlining regions occasionally >> don't fully appear when either the start or the end of the region is >> not visible (maybe my functions are just too long...) and scrolling up >> and down causes many to disappear/reappear. Occasionally the following >> def is included with the previous function (seems to happen with more >> than one unindent at the end of the function) and # comments >> 'attached' to the following class/def are sometimes included in the >> previous region. (While I'm here, another 'nice-to-have' region would >> be top-level if blocks, eg. if __name__=='__main__':) > > I have a fix for the unpredictableness and scrolling - there were some > issues w/ checking to see if 2 spans intersect. ? I can also repro the > comments issue but it'll be tougher to fix (I need to update the > IronPython parser). ? And I even added support for top-level if blocks > being marked as collapsible regions. ?But I can't repro the functions > collapsing into each other and I thought I had mostly fixed that problem. > Can you send me a file that repros it? > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From dinov at microsoft.com Tue May 4 01:11:25 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 3 May 2010 23:11:25 +0000 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD395D3339@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD395D5602@TK5EX14MBXC116.redmond.corp.microsoft.com> Steve wrote: > The code snippet below does it. The region for class A goes all the > way to the next class/EOF (actually, 3 lines before EOF, unless > there's whitespace on the third- or second-last lines), the region for > funca goes from the def to the line 'def funcb(self):' inclusive and > the region for funcb only includes the def and the pass (as expected). > > Interestingly, two unbound functions (remove class, unindent) have the > correct regions > > class A: > def funca(self): > if True: > pass > > def funcb(self): > pass Thanks, I have a fix for this as well now. It was simply the white space on the last line that was throwing us off. From merllab at microsoft.com Tue May 4 17:52:24 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 4 May 2010 08:52:24 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <4b27cbd9-12f4-4702-9d91-3bb1f662743d@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/65949. MODIFIED SOURCES $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/_codecs.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Operations/ArrayOps.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/MetaPythonType.Calls.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/List.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/PythonTuple.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Types/PythonType.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Operations/InstanceOps.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/PythonFile.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Types/PythonType.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/Tests/test_tuple.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1760502 Date: 5/3/2010 2:40:28 PM 26499 ? Need to track whether a type inherits from ABCMeta and check all abstracts are overridden Added flags to PythonType, one that is set when __abstractmethods__ is defined, and another when it is set to be a non-empty iterator of strings. Changed instantiation behavior to check these flags and raise an exception if any abstract methods exist on the type. 20279 ? Optimization: (2,3,4)[0:] should return same instance Fixed, test added. 23663 ? Trivial: Perf: potential perf optimizations Most of these refer to BigInteger, which is being phased out in favor of .NET 4.0, or files/comments that otherwise no longer exist. Two issues in this bug still seem to be an issue today ? the locking behavior of PythonFile and the magic number 20 for list initialization. Changed list initialization value from magic number to const int, although our choice of 20 is still arbitrary and might be better off as a lower number. Changed PythonFile operations that take/release locks more than once to take/release a single lock when possible. 23725 ? Trivial: "typeerror "was not raised as expected in test_coercion.py when eval(3.0*(2,)) in 32bit vista Already fixed, enabled test 23701 ? Trivial: remove sys.getrefcount Already fixed, enabled remaining test (test_socket) 23746 ? Trivial: IndexError: Index was outside the bounds of the array Fixed original error. Remaining failure is dupe of 23750 24754 ? test_handlers in test_codecs is failing Original error was already fixed. Remaining failure is dupe of 23750 25419 ? test_container_iterator in test_dict.py disabled Made required test changes in test_dict and test_deque, and re-enabled tests (Shelveset: 262Bugs01;REDMOND\ddicato | SNAP CheckinId: 10712) From loocas at duber.cz Tue May 4 18:27:50 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Tue, 04 May 2010 18:27:50 +0200 Subject: [IronPython] WPF Window vs. Application In-Reply-To: <4b27cbd9-12f4-4702-9d91-3bb1f662743d@tk5-exsmh-c101.redmond.corp.microsoft.com> References: <4b27cbd9-12f4-4702-9d91-3bb1f662743d@tk5-exsmh-c101.redmond.corp.microsoft.com> Message-ID: <4BE04B06.2020807@duber.cz> Hi there everybody. I have yet another question. This time, since I'm trying to strictly use WPF for my GUI etc... and what I do here is I host IronPython within another application that calls it and IPy serves the GUI and program logic, I bumped into a problem when calling the Application().Run(LoadedXaml) The problem seems to be that the app runs in its own thread separately from the host app and thus doesn't communicate with the host app, until I close the Application (then it performs the last task I wanted it to). So, I was thinking, since I already have most of the gory Application stuff already up and running, courtesy of the host app, is there a way to actually only use WPF to display the GUI and have the program logic taken care of by IPy? Such as WinForms provides using the Window.Show() method. A friend of mine suggested if I could change the Data Type of the XamlReader.Load... object to a Window object. I don't know C#, but he suggested this: Window myWindow; object result = XamlReader.Load( source ); myWindow = (Window)result; myWindow.Show(); Is this somehow achieveable via IPy scripting or directly in the Xaml? Or somehow else? Thank you very much 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 Tue May 4 19:10:37 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Tue, 04 May 2010 19:10:37 +0200 Subject: [IronPython] WPF Window vs. Application In-Reply-To: <4BE04B06.2020807@duber.cz> References: <4b27cbd9-12f4-4702-9d91-3bb1f662743d@tk5-exsmh-c101.redmond.corp.microsoft.com> <4BE04B06.2020807@duber.cz> Message-ID: <4BE0550D.6020706@bakalari.cz> Luk?? Dub?da wrote: > Hi there everybody. > > I have yet another question. > > This time, since I'm trying to strictly use WPF for my GUI > etc... and what I do here is I host IronPython within another > application that calls it and IPy serves the GUI and > program logic, I bumped into a problem when calling the > > Application().Run(LoadedXaml) > > The problem seems to be that the app runs in its own thread > separately from the host app and thus doesn't communicate > with the host app, until I close the Application (then > it performs the last task I wanted it to). > > So, I was thinking, since I already have most of the gory > Application stuff already up and running, courtesy of the > host app, is there a way to actually only use WPF to > display the GUI and have the program logic taken care of by > IPy? Such as WinForms provides using the Window.Show() > method. > > A friend of mine suggested if I could change the Data Type > of the XamlReader.Load... object to a Window object. I don't > know C#, but he suggested this: > > Window myWindow; > object result = XamlReader.Load( source ); > myWindow = (Window)result; > myWindow.Show(); > > Is this somehow achieveable via IPy scripting or directly in > the Xaml? Or somehow else? I doubt this would work - WinForms Window is not the same as WPF Window. I think you have to run you WPF app in background STA thread to be able to control in from the main thread. -- -- Luk?? From loocas at duber.cz Tue May 4 19:13:46 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Tue, 04 May 2010 19:13:46 +0200 Subject: [IronPython] WPF Window vs. Application In-Reply-To: <4BE0550D.6020706@bakalari.cz> References: <4b27cbd9-12f4-4702-9d91-3bb1f662743d@tk5-exsmh-c101.redmond.corp.microsoft.com> <4BE04B06.2020807@duber.cz> <4BE0550D.6020706@bakalari.cz> Message-ID: <4BE055CA.1030309@duber.cz> Hmm, that's what I'm afraid of. Never done any threaded app so far. Could you, please, give me a hint as to how to set this up so that the Application() runs from within the host app without problems, i.e. as if it was just a host app's Window. Thanks a lot, I appretiate it. 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 everybody. >> >> I have yet another question. >> >> This time, since I'm trying to strictly use WPF for my GUI >> etc... and what I do here is I host IronPython within another >> application that calls it and IPy serves the GUI and >> program logic, I bumped into a problem when calling the >> >> Application().Run(LoadedXaml) >> >> The problem seems to be that the app runs in its own thread >> separately from the host app and thus doesn't communicate >> with the host app, until I close the Application (then >> it performs the last task I wanted it to). >> >> So, I was thinking, since I already have most of the gory >> Application stuff already up and running, courtesy of the >> host app, is there a way to actually only use WPF to >> display the GUI and have the program logic taken care of by >> IPy? Such as WinForms provides using the Window.Show() >> method. >> >> A friend of mine suggested if I could change the Data Type >> of the XamlReader.Load... object to a Window object. I don't >> know C#, but he suggested this: >> >> Window myWindow; >> object result = XamlReader.Load( source ); >> myWindow = (Window)result; >> myWindow.Show(); >> >> Is this somehow achieveable via IPy scripting or directly in >> the Xaml? Or somehow else? > > I doubt this would work - WinForms Window is not the same as WPF Window. > I think you have to run you WPF app in background STA thread to be able > to control in from the main thread. > > -- > -- Luk?? > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From cenovsky at bakalari.cz Tue May 4 20:49:07 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Tue, 04 May 2010 20:49:07 +0200 Subject: [IronPython] WPF Window vs. Application In-Reply-To: <4BE055CA.1030309@duber.cz> References: <4b27cbd9-12f4-4702-9d91-3bb1f662743d@tk5-exsmh-c101.redmond.corp.microsoft.com> <4BE04B06.2020807@duber.cz> <4BE0550D.6020706@bakalari.cz> <4BE055CA.1030309@duber.cz> Message-ID: <4BE06C23.8030409@bakalari.cz> Check IronPython-2.6\Tutorial\avalon.py. -- -- Luk?? Luk?? Dub?da wrote: > Hmm, that's what I'm afraid of. Never done any threaded app > so far. > > Could you, please, give me a hint as to how to set this up > so that the Application() runs from within the host app > without problems, i.e. as if it was just a host app's Window. > > Thanks a lot, I appretiate it. > > 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 everybody. >>> >>> I have yet another question. >>> >>> This time, since I'm trying to strictly use WPF for my GUI >>> etc... and what I do here is I host IronPython within another >>> application that calls it and IPy serves the GUI and >>> program logic, I bumped into a problem when calling the >>> >>> Application().Run(LoadedXaml) >>> >>> The problem seems to be that the app runs in its own thread >>> separately from the host app and thus doesn't communicate >>> with the host app, until I close the Application (then >>> it performs the last task I wanted it to). >>> >>> So, I was thinking, since I already have most of the gory >>> Application stuff already up and running, courtesy of the >>> host app, is there a way to actually only use WPF to >>> display the GUI and have the program logic taken care of by >>> IPy? Such as WinForms provides using the Window.Show() >>> method. >>> >>> A friend of mine suggested if I could change the Data Type >>> of the XamlReader.Load... object to a Window object. I don't >>> know C#, but he suggested this: >>> >>> Window myWindow; >>> object result = XamlReader.Load( source ); >>> myWindow = (Window)result; >>> myWindow.Show(); >>> >>> Is this somehow achieveable via IPy scripting or directly in >>> the Xaml? Or somehow else? >> >> I doubt this would work - WinForms Window is not the same as WPF >> Window. I think you have to run you WPF app in background STA thread >> to be able to control in from the main thread. >> >> -- >> -- 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 loocas at duber.cz Tue May 4 23:22:33 2010 From: loocas at duber.cz (=?UTF-8?B?THVrw6HFoSBEdWLEm2Rh?=) Date: Tue, 04 May 2010 23:22:33 +0200 Subject: [IronPython] WPF Window vs. Application In-Reply-To: <4BE06C23.8030409@bakalari.cz> References: <4b27cbd9-12f4-4702-9d91-3bb1f662743d@tk5-exsmh-c101.redmond.corp.microsoft.com> <4BE04B06.2020807@duber.cz> <4BE0550D.6020706@bakalari.cz> <4BE055CA.1030309@duber.cz> <4BE06C23.8030409@bakalari.cz> Message-ID: <4BE09019.6030909@duber.cz> Thank you very much! I'll dig into this and see if I can make it work in my scenario. Thanks again, 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: > Check IronPython-2.6\Tutorial\avalon.py. > > -- > -- Luk?? > > > Luk?? Dub?da wrote: >> Hmm, that's what I'm afraid of. Never done any threaded app >> so far. >> >> Could you, please, give me a hint as to how to set this up >> so that the Application() runs from within the host app >> without problems, i.e. as if it was just a host app's Window. >> >> Thanks a lot, I appretiate it. >> >> 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 everybody. >>>> >>>> I have yet another question. >>>> >>>> This time, since I'm trying to strictly use WPF for my GUI >>>> etc... and what I do here is I host IronPython within another >>>> application that calls it and IPy serves the GUI and >>>> program logic, I bumped into a problem when calling the >>>> >>>> Application().Run(LoadedXaml) >>>> >>>> The problem seems to be that the app runs in its own thread >>>> separately from the host app and thus doesn't communicate >>>> with the host app, until I close the Application (then >>>> it performs the last task I wanted it to). >>>> >>>> So, I was thinking, since I already have most of the gory >>>> Application stuff already up and running, courtesy of the >>>> host app, is there a way to actually only use WPF to >>>> display the GUI and have the program logic taken care of by >>>> IPy? Such as WinForms provides using the Window.Show() >>>> method. >>>> >>>> A friend of mine suggested if I could change the Data Type >>>> of the XamlReader.Load... object to a Window object. I don't >>>> know C#, but he suggested this: >>>> >>>> Window myWindow; >>>> object result = XamlReader.Load( source ); >>>> myWindow = (Window)result; >>>> myWindow.Show(); >>>> >>>> Is this somehow achieveable via IPy scripting or directly in >>>> the Xaml? Or somehow else? >>> >>> I doubt this would work - WinForms Window is not the same as WPF >>> Window. I think you have to run you WPF app in background STA thread >>> to be able to control in from the main thread. >>> >>> -- >>> -- 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 From hank at prosysplus.com Wed May 5 04:08:34 2010 From: hank at prosysplus.com (Hank Fay) Date: Tue, 4 May 2010 22:08:34 -0400 Subject: [IronPython] XAML attribute edit = Unhandled Exception Message-ID: Maybe this is already known? In IPyTools CTP2: Create new WPF IPY app; add a button; in Button XAML, add MouseEnter="" Result: a good chance at this point the unhandled exception will have occurred. If not, this is a 100% occurrence at the next step: enter text between the empty double-quotes after MouseEnter= Pressing the Click here to reload the designer link refreshes the designer OK Here's the stack trace: Server stack trace: at MS.Internal.Providers.VSAssemblyReferenceProvider.AddReference(AssemblyName newReference) at MS.Internal.Host.Isolation.Adapters.ContextToProtocolAdapter.MS.Internal.Host.Isolation.Protocols.IAssemblyReferenceProtocol.AddReference(AssemblyName name) at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at MS.Internal.Host.Isolation.Protocols.IAssemblyReferenceProtocol.AddReference(AssemblyName name) at MS.Internal.Host.Isolation.Adapters.ToAssemblyReferenceAdapter.AddReference(AssemblyName newReference) at MS.Internal.Host.PersistenceSubsystem.ReconcileReferences(AssemblyReferences references) at MS.Internal.Host.PersistenceSubsystem.b__8(AssemblyReferences newReferences) at Microsoft.Windows.Design.ContextItemManager.SubscribeProxy`1.SubscribeContext(ContextItem item) at Microsoft.Windows.Design.SubscribeContextCallback.Invoke(ContextItem item) at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.OnItemChanged(ContextItem item) at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.SetValue(ContextItem value) at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.EnsureAssemblyReference(IAssemblyMetadata assembly) at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.ReferenceUpdater.EnsureReferences(IEnumerable`1 types) at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.ReferenceUpdater.Microsoft.Windows.Design.DocumentModel.IDocumentTreeConsumer.HandleMessage(DocumentTreeCoordinator sender, MessageKey key, MessageArguments args) at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.CancelableDocumentTreeCoordinator.RouteMessage[T](IDocumentTreeConsumer consumer, MessageKey`1 key, T args) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T](MessageKey`1 key, T args, Boolean isPrivateMessage) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T](MessageKey`1 key, T args) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.ReportDamage(IDocumentTreeProducer tree, Damage damage) at Microsoft.Windows.Design.DocumentModel.MarkupProducer.Update() at Microsoft.Windows.Design.DocumentModel.MarkupProducer.HandleMessage(DocumentTreeCoordinator sender, MessageKey key, MessageArguments args) at Microsoft.Windows.Design.DocumentModel.MarkupProducer.Microsoft.Windows.Design.DocumentModel.IDocumentTreeConsumer.HandleMessage(DocumentTreeCoordinator sender, MessageKey key, MessageArguments args) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T](MessageKey`1 key, T args, Boolean isPrivateMessage) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.QueuedMessage`1.Microsoft.Windows.Design.DocumentModel.IQueuedMessage.Invoke() at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.ProcessQueuedMessages(Object state) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) -------------- next part -------------- An HTML attachment was scrubbed... URL: From hank at prosysplus.com Wed May 5 04:15:36 2010 From: hank at prosysplus.com (Hank Fay) Date: Tue, 4 May 2010 22:15:36 -0400 Subject: [IronPython] Events button? Message-ID: Not being WPF-fluent in VS, I went to read the very useful WPF Designer for Windows Forms Developers at http://msdn.microsoft.com/en-us/library/cc165605(v=VS.100).aspx. It mentions using the Events button in the Properties page for the object selected in the designer. Which would be fine except that there isn't one. Nor does right-clicking on the eventhandler name in the XAML lead to a dropdown with a Navigate to Eventhandler etc. option. I assume these are on the development list, but thought I'd check: 40 years ago we partied for an extra week during an ice storm in Atlanta because no one told the power company that our apartment complex was out. thanks, Hank Fay -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.j.dower at gmail.com Wed May 5 05:26:18 2010 From: s.j.dower at gmail.com (Steve Dower) Date: Wed, 5 May 2010 13:26:18 +1000 Subject: [IronPython] IronPy Tools for VS - Bugs Message-ID: I've been collating some little things into a single email rather than spamming the list. These are roughly organised in order of annoyance, and none are show-stoppers by any measure. When completion auto-commits (Ctrl+Space --> word is completed, no dropdown) Enter cannot be pressed until another completion is started and ended. Characters '(', ')', ',', ':', '.' should commit completions (if there is a match, otherwise keep whatever was typed). Completions should not start within strings (single-line strings aren't recognised as strings until the closing quote is added). Tooltip for first parameter doesn't always disappear when moving to the next parameter (ie. typing ','). Keyword tooltips only parse from the character hovered over to the end (ie. hover over 'r' in print shows "rint", over 'e' in def shows "ef", etc.). Whitespace immediately before a real number shows tooltip for the integer part. Tooltip for an equals sign immediately followed by a number shows '=: tuple' (I raise these mainly in case the underlying parser is at fault and having effects elsewhere.) Overlapping spans for tooltips when trigger point is the closing bracket of a function (the span applies to whole function call - moving the mouse within this span also triggers tooltips for arguments). From merllab at microsoft.com Wed May 5 17:52:16 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 5 May 2010 08:52:16 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/65964. MODIFIED SOURCES $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/ConstantDictionaryStorage.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/EmptyDictionaryStorage.cs CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1762315 Date: 5/4/2010 10:58:00 AM Fix perf regression related to keyword dictionary calls w/ constant and empty dictionary storages. Forwards Clone/HasNonStringAttributes for CommonDictionaryStorage, returns appropriate constants for EmptyDictionaryStorage. (Shelveset: FixKwCallRegression2;REDMOND\dinov | SNAP CheckinId: 10720) From dinov at microsoft.com Wed May 5 19:48:01 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 5 May 2010 17:48:01 +0000 Subject: [IronPython] Events button? In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD395E3F64@TK5EX14MBXC116.redmond.corp.microsoft.com> We still definitely have a lot of work to do on the designer integration - right now the current level of support is that you can use the XAML designer and load the XAML. We already have intellisense support on the todo list but we'll add these suggestions as well. Thanks! From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Hank Fay Sent: Tuesday, May 04, 2010 7:16 PM To: Discussion of IronPython Subject: [IronPython] Events button? Not being WPF-fluent in VS, I went to read the very useful WPF Designer for Windows Forms Developers at http://msdn.microsoft.com/en-us/library/cc165605(v=VS.100).aspx. It mentions using the Events button in the Properties page for the object selected in the designer. Which would be fine except that there isn't one. Nor does right-clicking on the eventhandler name in the XAML lead to a dropdown with a Navigate to Eventhandler etc. option. I assume these are on the development list, but thought I'd check: 40 years ago we partied for an extra week during an ice storm in Atlanta because no one told the power company that our apartment complex was out. thanks, Hank Fay -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed May 5 19:48:49 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 5 May 2010 17:48:49 +0000 Subject: [IronPython] XAML attribute edit = Unhandled Exception In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD395E3F93@TK5EX14MBXC116.redmond.corp.microsoft.com> Thanks for reporting this. This repros for me as well - I'm not sure what's going on here yet but I'm trying to figure out it now. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Hank Fay Sent: Tuesday, May 04, 2010 7:09 PM To: Discussion of IronPython Subject: [IronPython] XAML attribute edit = Unhandled Exception Maybe this is already known? In IPyTools CTP2: Create new WPF IPY app; add a button; in Button XAML, add MouseEnter="" Result: a good chance at this point the unhandled exception will have occurred. If not, this is a 100% occurrence at the next step: enter text between the empty double-quotes after MouseEnter= Pressing the Click here to reload the designer link refreshes the designer OK Here's the stack trace: Server stack trace: at MS.Internal.Providers.VSAssemblyReferenceProvider.AddReference(AssemblyName newReference) at MS.Internal.Host.Isolation.Adapters.ContextToProtocolAdapter.MS.Internal.Host.Isolation.Protocols.IAssemblyReferenceProtocol.AddReference(AssemblyName name) at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at MS.Internal.Host.Isolation.Protocols.IAssemblyReferenceProtocol.AddReference(AssemblyName name) at MS.Internal.Host.Isolation.Adapters.ToAssemblyReferenceAdapter.AddReference(AssemblyName newReference) at MS.Internal.Host.PersistenceSubsystem.ReconcileReferences(AssemblyReferences references) at MS.Internal.Host.PersistenceSubsystem.b__8(AssemblyReferences newReferences) at Microsoft.Windows.Design.ContextItemManager.SubscribeProxy`1.SubscribeContext(ContextItem item) at Microsoft.Windows.Design.SubscribeContextCallback.Invoke(ContextItem item) at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.OnItemChanged(ContextItem item) at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.SetValue(ContextItem value) at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.EnsureAssemblyReference(IAssemblyMetadata assembly) at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.ReferenceUpdater.EnsureReferences(IEnumerable`1 types) at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.ReferenceUpdater.Microsoft.Windows.Design.DocumentModel.IDocumentTreeConsumer.HandleMessage(DocumentTreeCoordinator sender, MessageKey key, MessageArguments args) at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.CancelableDocumentTreeCoordinator.RouteMessage[T](IDocumentTreeConsumer consumer, MessageKey`1 key, T args) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T](MessageKey`1 key, T args, Boolean isPrivateMessage) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T](MessageKey`1 key, T args) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.ReportDamage(IDocumentTreeProducer tree, Damage damage) at Microsoft.Windows.Design.DocumentModel.MarkupProducer.Update() at Microsoft.Windows.Design.DocumentModel.MarkupProducer.HandleMessage(DocumentTreeCoordinator sender, MessageKey key, MessageArguments args) at Microsoft.Windows.Design.DocumentModel.MarkupProducer.Microsoft.Windows.Design.DocumentModel.IDocumentTreeConsumer.HandleMessage(DocumentTreeCoordinator sender, MessageKey key, MessageArguments args) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T](MessageKey`1 key, T args, Boolean isPrivateMessage) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.QueuedMessage`1.Microsoft.Windows.Design.DocumentModel.IQueuedMessage.Invoke() at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.ProcessQueuedMessages(Object state) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed May 5 23:24:01 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 5 May 2010 21:24:01 +0000 Subject: [IronPython] XAML attribute edit = Unhandled Exception In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD395E528F@TK5EX14MBXC116.redmond.corp.microsoft.com> I've got a fix for this and so it'll be in the next release. Earlier during the investigation I was thinking you might be able to work around it by getting the right set of MSBuild includes in our .pyproj files - but I ran into a later bug in MPFProj (http://mpfproj10.codeplex.com/WorkItem/View.aspx?WorkItemId=8257) which prevents this from working further down the line anyway :( From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Hank Fay Sent: Tuesday, May 04, 2010 7:09 PM To: Discussion of IronPython Subject: [IronPython] XAML attribute edit = Unhandled Exception Maybe this is already known? In IPyTools CTP2: Create new WPF IPY app; add a button; in Button XAML, add MouseEnter="" Result: a good chance at this point the unhandled exception will have occurred. If not, this is a 100% occurrence at the next step: enter text between the empty double-quotes after MouseEnter= Pressing the Click here to reload the designer link refreshes the designer OK Here's the stack trace: Server stack trace: at MS.Internal.Providers.VSAssemblyReferenceProvider.AddReference(AssemblyName newReference) at MS.Internal.Host.Isolation.Adapters.ContextToProtocolAdapter.MS.Internal.Host.Isolation.Protocols.IAssemblyReferenceProtocol.AddReference(AssemblyName name) at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at MS.Internal.Host.Isolation.Protocols.IAssemblyReferenceProtocol.AddReference(AssemblyName name) at MS.Internal.Host.Isolation.Adapters.ToAssemblyReferenceAdapter.AddReference(AssemblyName newReference) at MS.Internal.Host.PersistenceSubsystem.ReconcileReferences(AssemblyReferences references) at MS.Internal.Host.PersistenceSubsystem.b__8(AssemblyReferences newReferences) at Microsoft.Windows.Design.ContextItemManager.SubscribeProxy`1.SubscribeContext(ContextItem item) at Microsoft.Windows.Design.SubscribeContextCallback.Invoke(ContextItem item) at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.OnItemChanged(ContextItem item) at Microsoft.Windows.Design.EditingContext.DefaultContextItemManager.SetValue(ContextItem value) at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.EnsureAssemblyReference(IAssemblyMetadata assembly) at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.ReferenceUpdater.EnsureReferences(IEnumerable`1 types) at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.ReferenceUpdater.Microsoft.Windows.Design.DocumentModel.IDocumentTreeConsumer.HandleMessage(DocumentTreeCoordinator sender, MessageKey key, MessageArguments args) at Microsoft.Windows.Design.DocumentModel.MarkupDocumentManagerBase.CancelableDocumentTreeCoordinator.RouteMessage[T](IDocumentTreeConsumer consumer, MessageKey`1 key, T args) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T](MessageKey`1 key, T args, Boolean isPrivateMessage) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T](MessageKey`1 key, T args) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.ReportDamage(IDocumentTreeProducer tree, Damage damage) at Microsoft.Windows.Design.DocumentModel.MarkupProducer.Update() at Microsoft.Windows.Design.DocumentModel.MarkupProducer.HandleMessage(DocumentTreeCoordinator sender, MessageKey key, MessageArguments args) at Microsoft.Windows.Design.DocumentModel.MarkupProducer.Microsoft.Windows.Design.DocumentModel.IDocumentTreeConsumer.HandleMessage(DocumentTreeCoordinator sender, MessageKey key, MessageArguments args) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T](MessageKey`1 key, T args, Boolean isPrivateMessage) at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.QueuedMessage`1.Microsoft.Windows.Design.DocumentModel.IQueuedMessage.Invoke() at Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.ProcessQueuedMessages(Object state) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu May 6 00:56:07 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 5 May 2010 22:56:07 +0000 Subject: [IronPython] IronPy Tools for VS - Bugs In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD395E5B20@TK5EX14MBXC116.redmond.corp.microsoft.com> Steve wrote: > I've been collating some little things into a single email rather than > spamming the list. These are roughly organised in order of annoyance, > and none are show-stoppers by any measure. Bulk is nice and thanks for the reports! > > When completion auto-commits (Ctrl+Space --> word is completed, no > dropdown) Enter cannot be pressed until another completion is started > and ended. I've got a fix for this. > > Characters '(', ')', ',', ':', '.' should commit completions (if there > is a match, otherwise keep whatever was typed). I think we really want a "Committed by typing the following characters:" option like C# has. I would also propose that maybe the default should be: {}[]().,:;+-*/%&|^~=<>#'"\ That's effectively what C# has minus a couple of things which aren't very applicable to Python. I've got this implemented now so it'll be in the next release. > > Completions should not start within strings (single-line strings > aren't recognised as strings until the closing quote is added). Can you give an example of exactly what you type to make this happen? I can't currently repro it. > > Tooltip for first parameter doesn't always disappear when moving to > the next parameter (ie. typing ','). Do you know what sort of callable this was on? E.g. a built-in function or a Python function or something else? > > Keyword tooltips only parse from the character hovered over to the end > (ie. hover over 'r' in print shows "rint", over 'e' in def shows "ef", > etc.). > Whitespace immediately before a real number shows tooltip for the integer > part. > Tooltip for an equals sign immediately followed by a number shows > '=: tuple' These 3 are actually all the same basic issue - to provide the tooltip we need to parse backwards and when we fail to recognize any expression we are currently returning the starting span. I've made it so we won't display a tooltip in any of these cases. > (I raise these mainly in case the underlying parser is at fault and > having effects elsewhere.) > > Overlapping spans for tooltips when trigger point is the closing > bracket of a function (the span applies to whole function call - > moving the mouse within this span also triggers tooltips for > arguments). I've changed this so that we'll no longer provide a tool tip here if we are at the end of a function definition. What's really going on here is that we're recognizing this as a call to the function and we're providing the full call expression as the tooltip. I think this also cleans up some other behaviors with us providing completions while you're entering a new function definition. From s.j.dower at gmail.com Thu May 6 01:39:47 2010 From: s.j.dower at gmail.com (Steve Dower) Date: Thu, 6 May 2010 09:39:47 +1000 Subject: [IronPython] IronPy Tools for VS - Bugs In-Reply-To: <1A472770E042064698CB5ADC83A12ACD395E5B20@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD395E5B20@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Thu, May 6, 2010 at 08:56, Dino Viehland wrote: > > > > Completions should not start within strings (single-line strings > > aren't recognised as strings until the closing quote is added). > > Can you give an example of exactly what you type to make this happen? ?I > can't currently repro it. > Judging from the text colour, strings aren't recognised until there is both an opening and closing quote. I am not in the habit of putting both quotes immediately and then typing within them (I put the first one, type the string and then close it) and so until I reach the end of the string everything I type is interpreted as an error (unexpected token 'NEWLINE in single-quoted string') and every time I press space the completion dropdown appears. Once the string is terminated everything works fine. Triple-quoted strings work fine, even though an unexpected EOF causes the entire block to be an error, but the text changes to string colour regardless. This is the behaviour I would expect for single/double quoted strings as well - consider everything up the the EOL a string and include some "unterminated" error. > > > > Tooltip for first parameter doesn't always disappear when moving to > > the next parameter (ie. typing ','). > > Do you know what sort of callable this was on? ? E.g. a built-in function > or a Python function or something else? > I don't recall what the original one was, but I was able to reproduce this using str on a line by itself using these steps: 1. Type "str(" (parameter information "1 of 13 str()" appears) 2. Press space (completion dropdown appears) 3. Either commit or abort completion (it doesn't matter which) 4. Type "," (parameter information "1 of 13 str()" appears a second time) 5. Repeat steps 2-4 to get lots of tooltips. I also noticed that the left and right arrow keys don't affect the current parameter. Not having coded this myself before I'm not sure how one would go about adding that, but C# does it so I'm guessing it's just something in the command filter. > > > > Keyword tooltips only parse from the character hovered over to the end > > (ie. hover over 'r' in print shows "rint", over 'e' in def shows "ef", > > etc.). > > Whitespace immediately before a real number shows tooltip for the integer > > part. > > Tooltip for an equals sign immediately followed by a number shows > > '=: tuple' > > These 3 are actually all the same basic issue... I suspected as much, which is why I put them all together. From Jimmy.Schementi at microsoft.com Thu May 6 04:31:23 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 6 May 2010 02:31:23 +0000 Subject: [IronPython] Strange IPY / WPF behavior on a ListBox In-Reply-To: References: Message-ID: <1B42307CD4AADD438CDDA2FE1121CC9217383371@TK5EX14MBXC138.redmond.corp.microsoft.com> Have you tried ListBox.ScrollIntoView(object)? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ken MacDonald Sent: Friday, April 30, 2010 12:44 PM To: Discussion of IronPython Subject: Re: [IronPython] Strange IPY / WPF behavior on a ListBox Failing being able to get this working, is there a way in IPY/WPF to manually scroll a ListBox? I could theoretically do something like this pseudo-code: while True: if my_selected_item.IsHitTestVisible(): break else: my_selected.item.ScrollDown <===== anything like this? On Fri, Apr 30, 2010 at 3:08 PM, Ken MacDonald > wrote: I'm seeing some weirdness - I had a small popup dialog working in WPF/IPY where I had a ListBox with way too many elements to display, say about 30 or so where the available space would hold 4 or 5. I selected one of the elements (a ListBoxItem in the single selection ListBox), and executed BringIntoView() on the ListBoxItem. Worked great, the selected item showed up. Now, I've had to add more stuff to the dialog (an on-screen touch keyboard) and made the whole dialog modal; now I can't get the BringIntoView() to work. I have handlers on several events to try and get the BringIntoView() to happen, considering it has to be fired while it is Visible, and the handlers are getting fired, but I never see the selected item get scrolled into view. I've even attached handlers to some unrelated events like TextBox.TextChanged that I *know* are happening well after the whole dialog is rendered. Still no luck. Everything else in the ListBox works just as it did before, but now I can no longer show the 'default' item when the dialog starts. Anyone have any interesting clues? I've been at this most of the day trying different handlers, etc. and it's making no sense whatsoever. Thanks, Ken -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu May 6 05:24:09 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 6 May 2010 03:24:09 +0000 Subject: [IronPython] AddReference to Silverlight toolkit assemblies In-Reply-To: <4BD8348D.9060007@bakalari.cz> References: <4BA95FC7.4040607@bakalari.cz> <1B42307CD4AADD438CDDA2FE1121CC921731311E@TK5EX14MBXC136.redmond.corp.microsoft.com> <4BD8348D.9060007@bakalari.cz> Message-ID: <1B42307CD4AADD438CDDA2FE1121CC9217383565@TK5EX14MBXC138.redmond.corp.microsoft.com> Ah *duh*, though Microsoft.Scripting.Silverlight.dll calls ScriptRuntime.LoadAssembly on each AssemblyPart in the AppManifest.xaml, it does *not* do the same thing for DLLs in zip files referenced by ExtensionPart, since Silverlight only gives us a way of getting files out of a zip, not enumerating its contents. So, to correct myself, if you're using ExtensionParts, you'll have to call clr.AddReference for each DLL you want loaded. The reason why you don't see the expected types is because IronPython doesn't know about them. We could require that those zip files have a AppManifest.xaml, which would list the DLLs, and then we could parse that and load the DLLs. Though asking Silverlight to implement ZIP contents enumeration is probably the best =) ~js From: Lukas Cenovsky [mailto:cenovsky at bakalari.cz] Sent: Wednesday, April 28, 2010 6:14 AM To: Discussion of IronPython; Jimmy Schementi Subject: Re: [IronPython] AddReference to Silverlight toolkit assemblies Well, I was wrong when I said it worked. Here is the scenario: I have necessary .dlls in separate file called SLToolkit.zip which I reference in AppManifest.xaml: There are the following files in SLToolkit.zip: System.ComponentModel.DataAnnotations.dll System.Windows.Controls.dll System.Windows.Controls.Data.dll System.Windows.Controls.Data.Input.dll System.Windows.Data.dll I want to use ChildWindow control. It works when I use it in XAML and load the XAML with XamlReader. But it does not work when I want to load it from code. If fails on importing because ChildWindow is not in System.Windows.Controls namespace. I put System.Windows.Controls.dll into .xap file and test the following in Silverlight REPL: py> import System.Windows.Controls => None py> dir(System.Windows.Controls) => ['Border', 'Button', 'Canvas', 'CheckBox', 'CleanUpVirtualizedItemEventArgs', ...] py> clr.AddReferenceToFile('System.Windows.Controls.dll') => None py> dir(System.Windows.Controls) => ['Border', 'Button', 'Calendar', 'CalendarBlackoutDatesCollection', 'CalendarDateChangedEventArgs', 'CalendarDateRange', 'CalendarMode', 'CalendarModeChangedEventArgs', 'CalendarSelectionMode', 'Canvas', 'CheckBox', 'ChildWindow', 'CleanUpVirtualizedItemEventArgs', ...] It looks like the controls from System.Windows.Controls.dll are not merged into System.Windows.Controls namespace. Is it bug or do I do something wrong? -- -- Luk?? Jimmy Schementi wrote: Lukas, When you use ExtensionPart, it calls Assembly.Load on each file in the zip file referenced, so you don't need to do clr.Addreference. System.Windows.Data.dll and System.Windows.Controls.Data.dll are not DLLs in Silverlight; they are in the Silverlight SDK. So you'll have to package them up into a separate zip file which you include in your AppManfest, just like you did with the SLToolkit.zip. ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lukas Cenovsky Sent: Tuesday, March 23, 2010 5:42 PM To: users at lists.ironpython.com Subject: [IronPython] AddReference to Silverlight toolkit assemblies Hi all, I use Silverlight toolkit in my IronPython Silverlight app. To lower bandwidth, I put all necessary Silverlight toolkit .dlls into separate file called SLToolkit.zip which I reference in AppManifest.xaml: This works nicely if I don't need to reference assembly already existing in Silverlight - e.g. I do clr.AddReference('System.Windows.Controls.Data') and use DataGrid. Unfortunately, when I need to reference PagedCollectionView from System.Windows.Data, this approach does not work. Trying from System.Windows.Data import PagedCollectionView fails on ImportError: Cannot import name PagedCollectionView. Doing import System.Windows.Data System.Windows.Data.PagedCollectionView(some_data) fails with AttributeError: attribute 'PagedCollectionView' of 'namespace#' object is read-only. When I try to add clr.AddReference('System.Windows.Data') if fails with: IOError: [Errno 2] could not find assembly: System.Windows.Data (check the Web server). The only way how to make this work is to put System.Windows.Data.dll into .xap file and reference it with clr.AddReferenceToFile('System.Windows.Data.dll') from System.Windows.Data import PagedCollectionView Is there a way to make it work when System.Windows.Data.dll is in the separate file? Or should I use another approach? Thanks, -- -- 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 hank at prosysplus.com Thu May 6 05:58:15 2010 From: hank at prosysplus.com (Hank Fay) Date: Wed, 5 May 2010 23:58:15 -0400 Subject: [IronPython] Eventhandling in the IDE: Who is the audience? Message-ID: In VB, eventhandling can be done by switching to the "partial class", selecting the object in the left dropdown at the top of the editor, and then selecting the event in the right dropdown. The function gets created, and of course in VB uses Handles in order to connect the event-handler. This is a style of working with events that is familiar with at least a hundred thousand VFP programmers who have been stranded by MS, and are looking for a way into .Net. And I believe it's familiar with the million plus VB programmers who have not made the switch to .Net (the last figure I read was over 2 million, but that was nearly 2 years ago). I would make the argument that this way of working is straight-forward, involves less typing, and allows clearer thinking: the same kinds of arguments made for Py in general and IPy in particular. I can create a framework that makes working with data, and the IDE, easy for users, and straight-forward in a way that will be familiar to VFP developers -- and am doing so (open source fwiw), hence my special interest in making the rest of the development experience as familiar as possible. So, this is a request. I'll have others, but much of what I need is already in the plan (working with VSX in Python is huge, btw, so thanks in advance for that one). thanks, Hank Fay -------------- next part -------------- An HTML attachment was scrubbed... URL: From elettrika2000 at libero.it Thu May 6 08:34:57 2010 From: elettrika2000 at libero.it (elettrika2000 at libero.it) Date: Thu, 6 May 2010 08:34:57 +0200 (CEST) Subject: [IronPython] list submission Message-ID: <23977013.2039191273127697627.JavaMail.defaultUser@defaultHost> godd morning my name's walter i would like to submit to this forum but after some days pratically nothing occours . The first time , afeter registration , i send a confirm by mail What i have to do ? thanks and regards walter From Jimmy.Schementi at microsoft.com Thu May 6 08:50:23 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 6 May 2010 06:50:23 +0000 Subject: [IronPython] list submission In-Reply-To: <23977013.2039191273127697627.JavaMail.defaultUser@defaultHost> References: <23977013.2039191273127697627.JavaMail.defaultUser@defaultHost> Message-ID: Looks like your all signed up, as this email went to the whole list. ~Jimmy On May 5, 2010, at 11:36 PM, "elettrika2000 at libero.it" wrote: > godd morning > my name's walter > i would like to submit to this forum but after some days pratically nothing > occours . > The first time , afeter registration , i send a confirm by mail > What i have to do ? > thanks and regards > walter > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From merllab at microsoft.com Thu May 6 17:52:47 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Thu, 6 May 2010 08:52:47 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <781d0a1f-7c74-46a4-b273-dc88439c5abe@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/65998. ADDED SOURCES $/IronPython/IronPython_Main/Hosts/Silverlight/Chiron/Zip.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/SetExpression.cs DELETED SOURCES $/IronPython/IronPython_Main/Hosts/Silverlight/Chiron/LCA_RESTRICTED MODIFIED SOURCES $/IronPython/IronPython_Main/Hosts/Silverlight/Chiron/Zip.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/mmap.cs $/IronPython/IronPython_Main/Hosts/Silverlight/Microsoft.Scripting.SilverLight/ErrorFormatter.cs $/IronPython/IronPython_Main/Hosts/Silverlight/Chiron/HttpServer.cs $/IronPython/IronPython_Main/Hosts/Silverlight/Chiron/Chiron.csproj $/IronPython/IronPython_Main/Hosts/Silverlight/Chiron/HttpSocket.cs $/IronPython/IronPython_Main/Hosts/Silverlight/Chiron/Chiron.cs $/IronPython/IronPython_Main/Hosts/Silverlight/Microsoft.Scripting.SilverLight/Settings.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/re.cs $/IronPython/IronPython_Main/Hosts/Silverlight/Chiron/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/SetExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Parser.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/IronPython.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/PythonWalker.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/List.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/AstMethods.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/CommonDictionaryStorage.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/SetStorage.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Set.cs $/IronPython/IronPython_Main/Languages/IronPython/Tests/hosting/editor_svcs/errorlistener.py $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Types/ReflectedProperty.cs $/IronPython/IronPython_Main/Languages/IronPython/Tests/test_set.py $/IronPython/IronPython_Main/Tutorial/Tutorial.htm CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1765233 Date: 5/5/2010 5:14:23 PM Some targeted perf improvements for set operations. One major speed improvement came from pre-computing which eqFunc to use when operating on 2 sets, rather than checking _itemType and calling GetType() on each element. Also added fast paths for creating lists out of sets and frozensets. Additionally, fixed a bug in which the underlying storage is not duplicated when frozensets are constructed from sets, allowing users to create a mutable frozenset. Added regression test. (Shelveset: SetOptimizations2;REDMOND\ddicato | SNAP CheckinId: 10735) -------------------------------------------------------------------------------- Changeset Id: 1764257 Date: 5/5/2010 10:21:21 AM Adds set literals and support for multiple context managers in a with statement. Also switches exec code to being interpreted (currently there?s a ??? where we return the wrong value). Also fixes a perf problem w/ static properties not switching to an optimized fast path. (Shelveset: 27FeaturesFinal3;REDMOND\dinov | SNAP CheckinId: 10731) From tggagne at gmail.com Thu May 6 17:58:50 2010 From: tggagne at gmail.com (Thomas Gagne) Date: Thu, 06 May 2010 11:58:50 -0400 Subject: [IronPython] How can I exit from Python Script File? In-Reply-To: <294f1ba41002151354k42155624med8ba3d713767a3b@mail.gmail.com> References: <294f1ba41002151354k42155624med8ba3d713767a3b@mail.gmail.com> Message-ID: <4BE2E73A.509@gmail.com> My question is simpler, how do I exit a regular script? If ARGV.length != 1 puts "usage:...." Process.exit end I get an error calling Process.exit (private member) Process.Exit (method does not exist) sys.Exit (undefined method 'sys' for main:Object) How do I quit my script? From brian.curtin at gmail.com Thu May 6 18:02:42 2010 From: brian.curtin at gmail.com (Brian Curtin) Date: Thu, 6 May 2010 11:02:42 -0500 Subject: [IronPython] How can I exit from Python Script File? In-Reply-To: <4BE2E73A.509@gmail.com> References: <294f1ba41002151354k42155624med8ba3d713767a3b@mail.gmail.com> <4BE2E73A.509@gmail.com> Message-ID: On Thu, May 6, 2010 at 10:58, Thomas Gagne wrote: > My question is simpler, how do I exit a regular script? > > If ARGV.length != 1 > puts "usage:...." > Process.exit > end > > I get an error calling Process.exit (private member) > Process.Exit (method does not exist) > sys.Exit (undefined method 'sys' for main:Object) > > How do I quit my script? > That looks like Ruby to me, but in IronPython you can just call exit() to exit. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfugate at microsoft.com Thu May 6 18:03:13 2010 From: dfugate at microsoft.com (Dave Fugate) Date: Thu, 6 May 2010 16:03:13 +0000 Subject: [IronPython] How can I exit from Python Script File? In-Reply-To: <4BE2E73A.509@gmail.com> References: <294f1ba41002151354k42155624med8ba3d713767a3b@mail.gmail.com> <4BE2E73A.509@gmail.com> Message-ID: <32707103E022E74FA2BF41530F385A7C0DD8CFBF@TK5EX14MBXC127.redmond.corp.microsoft.com> The snippet below isn't Python... For Python you'd call: import sys sys.exit(0) replacing "0" with whatever exit code you want to use. Dave -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Thomas Gagne Sent: Thursday, May 06, 2010 8:59 AM To: Discussion of IronPython Subject: Re: [IronPython] How can I exit from Python Script File? My question is simpler, how do I exit a regular script? If ARGV.length != 1 puts "usage:...." Process.exit end I get an error calling Process.exit (private member) Process.Exit (method does not exist) sys.Exit (undefined method 'sys' for main:Object) How do I quit my script? _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From tggagne at gmail.com Thu May 6 18:04:58 2010 From: tggagne at gmail.com (Thomas Gagne) Date: Thu, 06 May 2010 12:04:58 -0400 Subject: [IronPython] How can I exit from Python Script File? In-Reply-To: <32707103E022E74FA2BF41530F385A7C0DD8CFBF@TK5EX14MBXC127.redmond.corp.microsoft.com> References: <294f1ba41002151354k42155624med8ba3d713767a3b@mail.gmail.com> <4BE2E73A.509@gmail.com> <32707103E022E74FA2BF41530F385A7C0DD8CFBF@TK5EX14MBXC127.redmond.corp.microsoft.com> Message-ID: <4BE2E8AA.6030901@gmail.com> That's what happens when you try learning too many languages at once... It was IronRuby, and I meant to ask it in an IronRuby list. Whoops! From dinov at microsoft.com Thu May 6 23:20:16 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 6 May 2010 21:20:16 +0000 Subject: [IronPython] IronPy Tools for VS - Bugs In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD395E5B20@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD395ECA11@TK5EX14MBXC116.redmond.corp.microsoft.com> Steve wrote: > Judging from the text colour, strings aren't recognised until there is > both an opening and closing quote. I am not in the habit of putting > both quotes immediately and then typing within them (I put the first > one, type the string and then close it) and so until I reach the end > of the string everything I type is interpreted as an error (unexpected > token 'NEWLINE in single-quoted string') and every time I press space > the completion dropdown appears. Once the string is terminated > everything works fine. > > Triple-quoted strings work fine, even though an unexpected EOF causes > the entire block to be an error, but the text changes to string colour > regardless. This is the behaviour I would expect for single/double > quoted strings as well - consider everything up the the EOL a string > and include some "unterminated" error. Thanks, I was able to repro it, I was typing on the list line where it seems to work fine before :) There's a few interesting things going on here - I'm going to increase the delay before we report errors (currently 300ms, going to move it up to 1 sec). That should help with the red squiggles. I'm no longer getting the completions in the string due to another change and I'll need to make some changes to the Ipy parser to fix the string not showing up as a literal. > > Do you know what sort of callable this was on? ? E.g. a built-in > function > > or a Python function or something else? > > > > I don't recall what the original one was, but I was able to reproduce > this using str on a line by itself using these steps: > > 1. Type "str(" (parameter information "1 of 13 str()" appears) > 2. Press space (completion dropdown appears) > 3. Either commit or abort completion (it doesn't matter which) > 4. Type "," (parameter information "1 of 13 str()" appears a second > time) > 5. Repeat steps 2-4 to get lots of tooltips. > > I also noticed that the left and right arrow keys don't affect the > current parameter. Not having coded this myself before I'm not sure > how one would go about adding that, but C# does it so I'm guessing > it's just something in the command filter. I've got this fixed. There's still a bunch more to do here related to looking at types and dealing w/ params and keyword arguments though. From cenovsky at bakalari.cz Fri May 7 18:47:08 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Fri, 07 May 2010 18:47:08 +0200 Subject: [IronPython] Formating Decimal numbers / re.match bug Message-ID: <4BE4440C.6020103@bakalari.cz> Hi all, formating Decimals does not work in IronPython: IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.4927 Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import Decimal >>> '{0:3.6f}'.format(Decimal('3.5')) Traceback (most recent call last): File "", line unknown, in File "C:\src\python\decimal.py", line 3486, in __format__ File "C:\src\python\decimal.py", line 5416, in _parse_format_specifier ValueError: Invalid format specifier: 3.6f It works in CPython: Python 2.6.5 (r265:79096, Mar 19 2010, 18:02:59) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import Decimal >>> '{0:3.6f}'.format(Decimal('3.5')) '3.500000' It looks more like re bug because _parse_format_specifier_regex.match(format_spec) returns None in IronPython. -- -- Luk?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Matt.funke at vishaypg.com Fri May 7 19:11:08 2010 From: Matt.funke at vishaypg.com (Funke, Matt) Date: Fri, 7 May 2010 17:11:08 +0000 Subject: [IronPython] Newbie question about importing from System.Windows Message-ID: <2C5C90D76B65DC47A65001FD937014B20117BA83@WSWD43.VishayPG.com> I'm running IronPython 2.6.1 for .NET 4.0, and have installed Visual Studio 2010 and Silverlight 4SP2. I tried to import System.Windows.Controls, but got an error that "Windows" does not exist. Trying to run ipy from the command line and running this: >>> import System >>> dir(System) ... confirms that there is no "Windows" entry. Could another "System" be taking precedence? How can I find out? Thanks in advance for any help you can lend. -- Matt Funke From dinov at microsoft.com Fri May 7 20:14:12 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 7 May 2010 18:14:12 +0000 Subject: [IronPython] Newbie question about importing from System.Windows In-Reply-To: <2C5C90D76B65DC47A65001FD937014B20117BA83@WSWD43.VishayPG.com> References: <2C5C90D76B65DC47A65001FD937014B20117BA83@WSWD43.VishayPG.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD395F315F@TK5EX14MBXC116.redmond.corp.microsoft.com> Matt wrote: > I'm running IronPython 2.6.1 for .NET 4.0, and have installed Visual Studio > 2010 and Silverlight 4SP2. I tried to import System.Windows.Controls, but got > an error that "Windows" does not exist. Trying to run ipy from the command > line and running this: > > >>> import System > >>> dir(System) > > ... confirms that there is no "Windows" entry. Could another "System" be > taking precedence? How can I find out? > > Thanks in advance for any help you can lend. You'll need to do a clr.AddReference('PresentationCore') call before you can access types related to WPF. IronPython includes an avalon.py in the Tutorial directory which will do this as well as adding references to PresentationFramework and WindowsBase which are other assemblies that make up WPF. From Matt.funke at vishaypg.com Fri May 7 20:43:53 2010 From: Matt.funke at vishaypg.com (Funke, Matt) Date: Fri, 7 May 2010 18:43:53 +0000 Subject: [IronPython] Newbie question about importing from System.Windows In-Reply-To: <2C5C90D76B65DC47A65001FD937014B20117BA83@WSWD43.VishayPG.com> References: <2C5C90D76B65DC47A65001FD937014B20117BA83@WSWD43.VishayPG.com> Message-ID: <2C5C90D76B65DC47A65001FD937014B20117BAAF@WSWD43.VishayPG.com> Thanks, but UI found my answer; I needed to import clr and load the .NET libraries. I feel a little sheepish. Thanks for your time. -- Matt Funke > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Funke, Matt > Sent: Friday, May 07, 2010 1:11 PM > To: users at lists.ironpython.com > Subject: [IronPython] Newbie question about importing from > System.Windows > > I'm running IronPython 2.6.1 for .NET 4.0, and have installed Visual > Studio 2010 and Silverlight 4SP2. I tried to import > System.Windows.Controls, but got an error that "Windows" does not > exist. Trying to run ipy from the command line and running this: > > >>> import System > >>> dir(System) > > ... confirms that there is no "Windows" entry. Could another "System" > be taking precedence? How can I find out? > > Thanks in advance for any help you can lend. > > -- Matt Funke > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Fri May 7 20:45:03 2010 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 7 May 2010 18:45:03 +0000 Subject: [IronPython] Formating Decimal numbers / re.match bug In-Reply-To: <4BE4440C.6020103@bakalari.cz> References: <4BE4440C.6020103@bakalari.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD395F34B8@TK5EX14MBXC116.redmond.corp.microsoft.com> Thanks for the report - I think I have a fix for this, we're simply not recognizing \A as meaning match at the start of input (which both Python and .NET recognize so it's just a matter of letting us pass it through). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lukas Cenovsky Sent: Friday, May 07, 2010 9:47 AM To: users at lists.ironpython.com Subject: [IronPython] Formating Decimal numbers / re.match bug Hi all, formating Decimals does not work in IronPython: IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.4927 Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import Decimal >>> '{0:3.6f}'.format(Decimal('3.5')) Traceback (most recent call last): File "", line unknown, in File "C:\src\python\decimal.py", line 3486, in __format__ File "C:\src\python\decimal.py", line 5416, in _parse_format_specifier ValueError: Invalid format specifier: 3.6f It works in CPython: Python 2.6.5 (r265:79096, Mar 19 2010, 18:02:59) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from decimal import Decimal >>> '{0:3.6f}'.format(Decimal('3.5')) '3.500000' It looks more like re bug because _parse_format_specifier_regex.match(format_spec) returns None in IronPython. -- -- Luk?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Matt.funke at vishaypg.com Fri May 7 20:46:25 2010 From: Matt.funke at vishaypg.com (Funke, Matt) Date: Fri, 7 May 2010 18:46:25 +0000 Subject: [IronPython] Newbie question about importing from System.Windows In-Reply-To: <1A472770E042064698CB5ADC83A12ACD395F315F@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <2C5C90D76B65DC47A65001FD937014B20117BA83@WSWD43.VishayPG.com> <1A472770E042064698CB5ADC83A12ACD395F315F@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <2C5C90D76B65DC47A65001FD937014B20117BAC7@WSWD43.VishayPG.com> Many thanks -- I found the answer just before receiving this, exactly by stumbling across avalon.py. Sorry to take up your time. -- Matt Funke > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Friday, May 07, 2010 2:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Newbie question about importing from > System.Windows > > Matt wrote: > > I'm running IronPython 2.6.1 for .NET 4.0, and have installed Visual > Studio > > 2010 and Silverlight 4SP2. I tried to import > System.Windows.Controls, but got > > an error that "Windows" does not exist. Trying to run ipy from the > command > > line and running this: > > > > >>> import System > > >>> dir(System) > > > > ... confirms that there is no "Windows" entry. Could another > "System" be > > taking precedence? How can I find out? > > > > Thanks in advance for any help you can lend. > > > You'll need to do a clr.AddReference('PresentationCore') call before > you can > access types related to WPF. IronPython includes an avalon.py in the > Tutorial directory which will do this as well as adding references to > PresentationFramework and WindowsBase which are other assemblies that > make > up WPF. > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jdhardy at gmail.com Sun May 9 17:15:13 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Sun, 9 May 2010 09:15:13 -0600 Subject: [IronPython] Writing a Python iterator in C#? In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD395C0B03@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Fri, Apr 30, 2010 at 4:31 PM, Jeff Hardy wrote: > On Fri, Apr 30, 2010 at 4:19 PM, Dino Viehland wrote: >> That's definitely a bug. ?We usually check for the interfaces first and >> we have a code path that's assuming we have a user-defined object when >> we're not an enumerable/enumerator but we have __iter__. ?It's easy >> enough to fix we're just trying to generate optimal code for getting >> the Python type of an object. > > I'll file an issue. CodePlex #27004 - http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=27004 - Jeff From s.j.dower at gmail.com Mon May 10 01:05:33 2010 From: s.j.dower at gmail.com (Steve Dower) Date: Mon, 10 May 2010 09:05:33 +1000 Subject: [IronPython] IronPy Tools for VS - Bugs #2 Message-ID: Another set, this time with some slightly more helpful repro steps (I hope). An exception is added to the devenv log file when triggering a completion on an 3rd-level import (ie. import moduleA.moduleB. or from moduleA.moduleB import ): System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.PyAnalysis.Values.Namespace.AddReference(Node node, AnalysisUnit unit) at Microsoft.PyAnalysis.Values.ModuleInfo.GetMember(Node node, AnalysisUnit unit, String name) at Microsoft.PyAnalysis.Values.NamespaceSetExtensions.GetMember(ISet`1 self, Node node, AnalysisUnit unit, String name) at Microsoft.PyAnalysis.ProjectState.GetModuleMembers(String[] names, Boolean bottom) at Microsoft.IronPythonTools.Intellisense.CompletionList.GetModules(IGlyphService glyphService, String text) at Microsoft.IronPythonTools.Intellisense.FromImportCompletionList.GetCompletions(IGlyphService glyphService) at Microsoft.IronPythonTools.Intellisense.CompletionSource.AugmentCompletionSession(ICompletionSession session, IList`1 completionSets) at Microsoft.VisualStudio.Language.Intellisense.Implementation.CompletionSession.Start() at Microsoft.VisualStudio.Language.Intellisense.Implementation.CompletionBroker.TriggerCompletion(ITextView textView) at Microsoft.IronPythonTools.Intellisense.IntellisenseController.TriggerCompletionSession(Boolean completeWord) at Microsoft.IronPythonTools.Intellisense.IntellisenseController.OnPreprocessKeyDown(Object sender, TextCompositionEventArgs e) at Microsoft.IronPythonTools.Intellisense.IntellisensePreKeyProcessor.FireTextInput(TextCompositionEventArgs args) at Microsoft.IronPythonTools.Intellisense.IntellisensePreKeyProcessor.TextInput(TextCompositionEventArgs args) at Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.b__0(KeyProcessor p, TextCompositionEventArgs args) at Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.<>c__DisplayClass1e`1.b__1a() at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call) Completion displays only items matching characters already typed but does not remember those characters if you continue to type: Repro steps: 1. Type 's' within a method where 'self' and at least one other variable starting with 's' are available 2. Press Ctrl+Space/Ctrl+J (completion dropdown appears) 3. Type 'elf' (the item 'self' does not become highlighted) 4. Delete 'elf', type 'self' (the item 'self' becomes highlighted, but the line reads 'sself') 5. Commit the completion, 'sself' is replaced by 'self' Typing '.' as part of an incremental search triggers completion Only the first completion set for imports includes project packages (after the first dot it falls back on members of the package specified so far). Sometimes (can't reliably reproduce) completion cannot be committed by keyboard (can be by mouse, and can be aborted by keyboard) Auto-indent keeps adding indentation for every new blank line. From merllab at microsoft.com Mon May 10 17:53:01 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 10 May 2010 08:53:01 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <72052324-0084-4a94-a897-1b422f739e13@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/66057. ADDED SOURCES $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/IronPython.Modules.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPython/IronPython.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPythonConsole/IronPythonConsole.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPythonConsoleAny/IronPythonConsoleAny.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPythonWindow/IronPythonWindow.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPythonWindowAny/IronPythonWindowAny.ruleset $/IronPython/IronPython_Main/Languages/IronPython/MSSharedLibKey.snk $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Migrated rules for Microsoft.Scripting.Core.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Migrated rules for Microsoft.Scripting.ExtensionAttribute.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Microsoft.Scripting.ruleset DELETED SOURCES $/IronPython/IronPython_Main/Solutions/MSSharedLibDelaySigned.snk MODIFIED SOURCES $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/IronPython.Modules.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPython/IronPython.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPythonConsole/IronPythonConsole.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPythonConsoleAny/IronPythonConsoleAny.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPythonWindow/IronPythonWindow.ruleset $/IronPython/IronPython_Main/Hosts/Silverlight/Microsoft.Scripting.SilverLight/Microsoft.Scripting.Silverlight.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPython/IronPython.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/IronPython.Modules.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPythonConsoleAny/IronPythonConsoleAny.csproj $/IronPython/IronPython_Main/Hosts/Silverlight/Chiron/Chiron.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPythonWindow/IronPythonWindow.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPythonConsole/IronPythonConsole.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPythonTest/IronPythonTest.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPythonWindowAny/IronPythonWindowAny.ruleset $/IronPython/IronPython_Main/Languages/IronPython/MSSharedLibKey.snk $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Migrated rules for Microsoft.Scripting.Core.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.Core.csproj $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPythonWindowAny/IronPythonWindowAny.csproj $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.ExtensionAttribute.csproj $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Migrated rules for Microsoft.Scripting.ExtensionAttribute.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Microsoft.Scripting.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Microsoft.Scripting.csproj $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Debugging/Microsoft.Scripting.Debugging.csproj $/IronPython/IronPython_Main/Test/ClrAssembly/ClrAssembly.csproj CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1769739 Date: 5/7/2010 1:03:11 PM - Upgraded Dlr.sln to VS 2010 format - "V4 Debug", "V4 Release", "Silverlight Release 4", and "Silverlight Debug 4" configs to everything Dlr.sln knows about. These still need to be adjusted somewhat, but it's a start for now - Runtime/Samples/sympl/examples/test.bat: believe it or not VS 2010 has a hard time dealing with quotes inside the arguments list of GenericTests. As a result I've moved one quoted argument out of the GenericTest(s) involved with this test, and ended up creating a separate batch test runner, test_python.bat, for the IronPython sympl test. Similarly, I disabled slt_test_querystring_py_Default.GenericTest outright (filed as http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26997) - HostingTest *had* to be upgraded to .NET 4.0 to get it to run under mstest 2010. - HostingTest\ObjectOperationsTest.cs: Engine.Operations.GetDocumentation *might* be broken under .NET 4.0 or perhaps the doc strings have simply changed. Filed as CodePlex 6701 - HostingTest\ScriptRuntimeTest.cs: partial trust scenario was broken under .NET 4.0 due to CAS change. Fixed - we now pickup mstest 2010 from RunTests.py instead of forcing 2008 - added IR.Rack into Dlr.sln, but this does *not* build under the V4 configs => any dependencies upon MS.Scripting.Core and ExtensionAttribute need to be dropped for the V4 configs - dropped Dlr4.sln and BuildRowan4.cmd (Shelveset: NEW_SLN08;REDMOND\dfugate | SNAP CheckinId: 10750) -------------------------------------------------------------------------------- Changeset Id: 1769739 Date: 5/7/2010 1:03:11 PM - Upgraded Dlr.sln to VS 2010 format - "V4 Debug", "V4 Release", "Silverlight Release 4", and "Silverlight Debug 4" configs to everything Dlr.sln knows about. These still need to be adjusted somewhat, but it's a start for now - Runtime/Samples/sympl/examples/test.bat: believe it or not VS 2010 has a hard time dealing with quotes inside the arguments list of GenericTests. As a result I've moved one quoted argument out of the GenericTest(s) involved with this test, and ended up creating a separate batch test runner, test_python.bat, for the IronPython sympl test. Similarly, I disabled slt_test_querystring_py_Default.GenericTest outright (filed as http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26997) - HostingTest *had* to be upgraded to .NET 4.0 to get it to run under mstest 2010. - HostingTest\ObjectOperationsTest.cs: Engine.Operations.GetDocumentation *might* be broken under .NET 4.0 or perhaps the doc strings have simply changed. Filed as CodePlex 6701 - HostingTest\ScriptRuntimeTest.cs: partial trust scenario was broken under .NET 4.0 due to CAS change. Fixed - we now pickup mstest 2010 from RunTests.py instead of forcing 2008 - added IR.Rack into Dlr.sln, but this does *not* build under the V4 configs => any dependencies upon MS.Scripting.Core and ExtensionAttribute need to be dropped for the V4 configs - dropped Dlr4.sln and BuildRowan4.cmd (Shelveset: NEW_SLN08;REDMOND\dfugate | SNAP CheckinId: 10750) From cgencer at gmail.com Tue May 11 12:32:26 2010 From: cgencer at gmail.com (Can Gencer) Date: Tue, 11 May 2010 12:32:26 +0200 Subject: [IronPython] IronPython 2.6 CodePlex Source Update In-Reply-To: <72052324-0084-4a94-a897-1b422f739e13@tk5-exsmh-c101.redmond.corp.microsoft.com> References: <72052324-0084-4a94-a897-1b422f739e13@tk5-exsmh-c101.redmond.corp.microsoft.com> Message-ID: Hello, I am having some problems with the unichr() built in function in IronPython. It only seems to support unicode characters up to 2 bytes, not the extended unicode characters. You can simply try a command like unichr(66363) and it will give a ValueError, saying that the value is not in range. However 66363 is a valid unicode character. Is there a way to configure IronPython to support wide unicode characters? I am using IronPython 2.6. Regards, Can From cgencer at gmail.com Tue May 11 12:44:53 2010 From: cgencer at gmail.com (Can Gencer) Date: Tue, 11 May 2010 12:44:53 +0200 Subject: [IronPython] IronPython unichr() problem with values greater than 65536 Message-ID: Hello, I am having some problems with the unichr() built in function in IronPython. It only seems to support unicode characters up to 2 bytes, not the extended unicode characters. You can simply try a command like unichr(66363) and it will give a ValueError, saying that the value is not in range. However 66363 is a valid unicode character. Is there a way to configure IronPython to support wide unicode characters? I am using IronPython 2.6. Regards, Can From dinov at microsoft.com Tue May 11 17:22:36 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 11 May 2010 15:22:36 +0000 Subject: [IronPython] IronPython unichr() problem with values greater than 65536 In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD3961072F@TK5EX14MBXC116.redmond.corp.microsoft.com> Can Gencer wrote: > I am having some problems with the unichr() built in function in > IronPython. It only seems to support unicode characters up to 2 bytes, > not the extended unicode characters. You can simply try a command like > unichr(66363) and it will give a ValueError, saying that the value is > not in range. However 66363 is a valid unicode character. Is there a > way to configure IronPython to support wide unicode characters? I am > using IronPython 2.6. There's no way to get 32-bit Unicode support. IronPython builds on the Unicode support from .NET which is only UTF16. Of course you can always use surrogate characters to represent the full range of characters. From merllab at microsoft.com Tue May 11 17:54:14 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 11 May 2010 08:54:14 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/66068. MODIFIED SOURCES $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Token.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/re.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Tokenizer.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Importer.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/LiteralParser.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/CommonDictionaryStorage.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/NewStringFormatter.cs $/IronPython/IronPython_Main/Languages/IronPython/Tests/hosting/editor_svcs/tokencategorizer.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1773679 Date: 5/11/2010 2:44:26 AM Adds CPython 2.7's standard lib to the repository - one original copy and one that is merged with our changes to the 2.6 tests. Also adds auto-numbering support of field names in format strings to enable test_support.py to work. (Shelveset: 27Lib;REDMOND\ddicato | SNAP CheckinId: 10771) -------------------------------------------------------------------------------- Changeset Id: 1773536 Date: 5/11/2010 1:04:10 AM Re-order some checks in our dictionary implementation so when a key matches we?ll notice is sooner and avoid some if-checks. Add a missing optimization to the importer ? we should publish a null indirection entry when a nested import fails so that we don?t attempt to import it over and over again. This results in a 5x improvement on the Django Unladen Swallow benchmark. Also some small optimizations to avoid creating unnecessary garbage while importing. (Shelveset: dictandimporttweaks2;REDMOND\dinov | SNAP CheckinId: 10769) From Matt.funke at vishaypg.com Tue May 11 21:10:24 2010 From: Matt.funke at vishaypg.com (Funke, Matt) Date: Tue, 11 May 2010 19:10:24 +0000 Subject: [IronPython] Some More Newbie Questions In-Reply-To: References: Message-ID: <2C5C90D76B65DC47A65001FD937014B20117C356@WSWD43.VishayPG.com> In IronPython Tools for Visual Studio 2010, how do you make it clear where the location of a file to be included is? I have this line that trips up the execution: from avalon import * ... even though avalon.py is in the same directory, and that directory is pointed to by the Search Path. It throws an ImportError, insisting that there is "No module named avalon". Is there some other thing I need to point at this that I'm missing? Thanks in advance for your time and consideration. -- Matt Funke From dinov at microsoft.com Tue May 11 22:50:46 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 11 May 2010 20:50:46 +0000 Subject: [IronPython] Some More Newbie Questions In-Reply-To: <2C5C90D76B65DC47A65001FD937014B20117C356@WSWD43.VishayPG.com> References: <2C5C90D76B65DC47A65001FD937014B20117C356@WSWD43.VishayPG.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD39611BBD@TK5EX14MBXC116.redmond.corp.microsoft.com> Matt Funke: > In IronPython Tools for Visual Studio 2010, how do you make it clear > where the location of a file to be included is? I have this line that > trips up the execution: > > from avalon import * > > ... even though avalon.py is in the same directory, and that directory > is pointed to by the Search Path. It throws an ImportError, insisting > that there is "No module named avalon". Is there some other thing I > need to point at this that I'm missing? How are you launching the app? Is it via the interactive window or are you doing a start w/ or w/o debugger? It looks like we don't set the path in the interactive window but we do otherwise. Of course being in the same directory (as the start file) should mean that it's available for import anyway. If you could do: import System import sys print System.Environment.CurrentDirectory, sys.path and see if those values are the correct dir for your project and include the directories you've setup in the search path. I'm also not sure how I feel about setting the search path via the UI in general. I'm a little concerned that it'll make it too easy to create scripts that work when launched in VS but not outside of VS. So if anyone has any feedback on how this should be handled I'd love to hear it. From cenovsky at bakalari.cz Wed May 12 11:11:51 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Wed, 12 May 2010 11:11:51 +0200 Subject: [IronPython] Silverlight validation with IronPython Message-ID: <4BEA70D7.7010806@bakalari.cz> Hi all, does anybody know why Silverlight validation does not work with IronPython? The component is not switched into invalid visual state when exception occurs in setter. I have not tried it in C# app but I assume it works there. As a workaround, I switch the component into invalid visual state manually. See details on my blog: http://gui-at.blogspot.com/2010/05/silverlight-validation-in-ironpython.html -- -- Luk?? From Matt.funke at vishaypg.com Wed May 12 15:24:24 2010 From: Matt.funke at vishaypg.com (Funke, Matt) Date: Wed, 12 May 2010 13:24:24 +0000 Subject: [IronPython] Some More Newbie Questions In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39611BBD@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <2C5C90D76B65DC47A65001FD937014B20117C356@WSWD43.VishayPG.com> <1A472770E042064698CB5ADC83A12ACD39611BBD@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <2C5C90D76B65DC47A65001FD937014B20117C423@WSWD43.VishayPG.com> Dino Viehland: > How are you launching the app? Is it via the interactive window or are > you > doing a start w/ or w/o debugger? It looks like we don't set the path > in > the interactive window but we do otherwise. I was using the debugger. On the other hand, I was trying to construct a Silverlight app, and other discussion in here makes me wonder if there's something deeper going on. Thanks for your insight, though. I'll try reconstructing things as a WPF application and see how far I get. -- Matt Funke From wsadkin at ParlanceCorp.com Wed May 12 20:19:50 2010 From: wsadkin at ParlanceCorp.com (Will Sadkin) Date: Wed, 12 May 2010 14:19:50 -0400 Subject: [IronPython] Pywin32 porting woes... Message-ID: Hi list, I am not sure who to go to with this... We have a large legacy CPython library set that makes extensive use of the pywin32 extensions Mark Hammond wrote. I would like to use IronPython to build a RESTful service around the use of this code, but have discovered that this will be problematic at best, and impossible at worst. I saw through some net searching that William Reade managed to get some portions of win32api to work last year using ironclad (http://www.mail-archive.com/users at lists.ironpython.com/msg08921.html) So I thought I'd try to see how far I could get with some of the win32 stuff... I managed to get win32api to import with a zillion warnings, but when I tried to import pythoncom, I got errors nesting down to a problem with the import of pywintypes. Looking into the code, it assumes that sys.platform startswith("win32") must be True if it's windows; this isn't the case with ipy; instead it's "cli". Ok, easy to modify, to get to the next issue in the onion, which I'm stumped on... 'import pythoncom' fails. I've worked through the code enough to track down the source of this to problems importing from the pywintypes dll. It turns out that in cpython: C:\> c:\Python26\python.exe Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 >>> import imp >>> imp.load_dynamic('pywintypes', r'C:\Windows\system32\pywintypes26.dll') That is, imp.load_dynamic() returns a module object for this. In ipy : C:\> C:\Program Files (x86)\IronPython 2.6\ipy.exe IronPython 2.6 (2.6.10920.0) on .NET 2.0.50727.4062 >>> import sys >>> sys.path.append(r'c:\ironclad-v2.6.0rc1-bin') >>> import ironclad >>> import imp >>> imp.load_dynamic('pywintypes', r'C:\Windows\system32\pywintypes26.dll') >>> That is, in ipy, the imp.load_dynamic() *doesn't* return a module, and raises no exception or anything that would indicate why this was the case. Which leads to the following questions: 1) Can anyone tell me why this is? 2) Is this an ironclad issue, an ipy bug, an incompatible change in imp's behavior in ipy, or something else? 3) Is this a path worth pursuing? 4) If not, can anyone give me any recommendations for what to use instead of ipy? 5) Also, as an aside, will ironpython ever support .pth files to augment the module search path? Thanks, /Will Sadkin From cenovsky at bakalari.cz Wed May 12 21:29:48 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Wed, 12 May 2010 21:29:48 +0200 Subject: [IronPython] Pywin32 porting woes... In-Reply-To: References: Message-ID: <4BEB01AC.9010004@bakalari.cz> Trying to work with CPython win32api is not a good idea. You should use win32 api directly via clrtype.py and pinvokes. Download (Sample) ClrType.zip from http://ironpython.codeplex.com/releases/view/36280 and check how for example MessageBox function is imported from user32.dll. The same way use for all functions you need from win32 api (replace pywin32 module with your proxy module). -- -- Luk?s( Will Sadkin wrote: > Hi list, > > I am not sure who to go to with this... > > We have a large legacy CPython library set that makes extensive use of > the pywin32 extensions Mark Hammond wrote. I would like to use > IronPython to build a RESTful service around the use of this code, but > have discovered that this will be problematic at best, and impossible at > worst. > > I saw through some net searching that William Reade managed to get some > portions of win32api to work last year using ironclad > (http://www.mail-archive.com/users at lists.ironpython.com/msg08921.html) > > So I thought I'd try to see how far I could get with some of the win32 > stuff... I managed to get win32api to import with a zillion warnings, > but when I tried to import pythoncom, I got errors nesting down to a > problem with the import of pywintypes. > > Looking into the code, it assumes that sys.platform startswith("win32") > must be True if it's windows; this isn't the case with ipy; instead it's > "cli". > > Ok, easy to modify, to get to the next issue in the onion, which I'm > stumped on... > > 'import pythoncom' fails. I've worked through the code enough to track > down the source of this to problems importing from the pywintypes dll. > > It turns out that in cpython: > C:\> c:\Python26\python.exe > Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit > (Intel)] on > win32 > >>>> import imp >>>> imp.load_dynamic('pywintypes', >>>> > r'C:\Windows\system32\pywintypes26.dll') > > > That is, imp.load_dynamic() returns a module object for this. > > In ipy : > C:\> C:\Program Files (x86)\IronPython 2.6\ipy.exe > IronPython 2.6 (2.6.10920.0) on .NET 2.0.50727.4062 > >>>> import sys >>>> sys.path.append(r'c:\ironclad-v2.6.0rc1-bin') >>>> import ironclad >>>> import imp >>>> imp.load_dynamic('pywintypes', >>>> > r'C:\Windows\system32\pywintypes26.dll') > > > That is, in ipy, the imp.load_dynamic() *doesn't* return a module, and > raises no exception or anything that would indicate why this was the > case. > > Which leads to the following questions: > 1) Can anyone tell me why this is? > 2) Is this an ironclad issue, an ipy bug, an incompatible change in > imp's behavior in ipy, or something else? > 3) Is this a path worth pursuing? > 4) If not, can anyone give me any recommendations for what to use > instead of ipy? > 5) Also, as an aside, will ironpython ever support .pth files to augment > the module search path? > > Thanks, > /Will Sadkin > _______________________________________________ > 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 May 12 21:58:41 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 12 May 2010 19:58:41 +0000 Subject: [IronPython] Eventhandling in the IDE: Who is the audience? In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD39619AAF@TK5EX14MBXC116.redmond.corp.microsoft.com> This is great feedback and I've added it to a designer TODO list. I'll spend some time in the (hopefully near) future going through and improving the designer experience. If you have any other thoughts on things we should do in that space (or shouldn't do :)) I'd love to hear it and I'll add it to the list. Thanks! From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Hank Fay Sent: Wednesday, May 05, 2010 8:58 PM To: Discussion of IronPython Subject: [IronPython] Eventhandling in the IDE: Who is the audience? In VB, eventhandling can be done by switching to the "partial class", selecting the object in the left dropdown at the top of the editor, and then selecting the event in the right dropdown. The function gets created, and of course in VB uses Handles in order to connect the event-handler. This is a style of working with events that is familiar with at least a hundred thousand VFP programmers who have been stranded by MS, and are looking for a way into .Net. And I believe it's familiar with the million plus VB programmers who have not made the switch to .Net (the last figure I read was over 2 million, but that was nearly 2 years ago). I would make the argument that this way of working is straight-forward, involves less typing, and allows clearer thinking: the same kinds of arguments made for Py in general and IPy in particular. I can create a framework that makes working with data, and the IDE, easy for users, and straight-forward in a way that will be familiar to VFP developers -- and am doing so (open source fwiw), hence my special interest in making the rest of the development experience as familiar as possible. So, this is a request. I'll have others, but much of what I need is already in the plan (working with VSX in Python is huge, btw, so thanks in advance for that one). thanks, Hank Fay -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed May 12 23:21:05 2010 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 12 May 2010 21:21:05 +0000 Subject: [IronPython] IronPy Tools for VS - Bugs #2 In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD3961A4B5@TK5EX14MBXC116.redmond.corp.microsoft.com> Thanks for reporting these and sorry for the delay in the response - it's been a busy week so far! I now have fixes for all of these except for the completion cannot be committed issue checked in so they'll be in the next release. I'll keep an eye out for the completion not committing issue as well. Keep the issues coming if you can! :) > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Steve Dower > Sent: Sunday, May 09, 2010 4:06 PM > To: Discussion of IronPython > Subject: [IronPython] IronPy Tools for VS - Bugs #2 > > Another set, this time with some slightly more helpful repro steps (I hope). > > An exception is added to the devenv log file when triggering a > completion on an 3rd-level import (ie. import > moduleA.moduleB. or from moduleA.moduleB import > ): > > System.NullReferenceException: Object reference not set to an instance > of an object. at > Microsoft.PyAnalysis.Values.Namespace.AddReference(Node node, > AnalysisUnit unit) at > Microsoft.PyAnalysis.Values.ModuleInfo.GetMember(Node node, > AnalysisUnit unit, String name) at > Microsoft.PyAnalysis.Values.NamespaceSetExtensions.GetMember(ISet`1 > self, Node node, AnalysisUnit unit, String name) at > Microsoft.PyAnalysis.ProjectState.GetModuleMembers(String[] names, > Boolean bottom) at > Microsoft.IronPythonTools.Intellisense.CompletionList.GetModules(IGlyphService > glyphService, String text) at > Microsoft.IronPythonTools.Intellisense.FromImportCompletionList.GetCompletions > (IGlyphService > glyphService) at > Microsoft.IronPythonTools.Intellisense.CompletionSource.AugmentCompletionSessi > on(ICompletionSession > session, IList`1 completionSets) at > Microsoft.VisualStudio.Language.Intellisense.Implementation.CompletionSession. > Start() > at > Microsoft.VisualStudio.Language.Intellisense.Implementation.CompletionBroker.T > riggerCompletion(ITextView > textView) at > Microsoft.IronPythonTools.Intellisense.IntellisenseController.TriggerCompletio > nSession(Boolean > completeWord) at > Microsoft.IronPythonTools.Intellisense.IntellisenseController.OnPreprocessKeyD > own(Object > sender, TextCompositionEventArgs e) at > Microsoft.IronPythonTools.Intellisense.IntellisensePreKeyProcessor.FireTextInp > ut(TextCompositionEventArgs > args) at > Microsoft.IronPythonTools.Intellisense.IntellisensePreKeyProcessor.TextInput(T > extCompositionEventArgs > args) at > Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher. atchTextInputEvents>b__0(KeyProcessor > p, TextCompositionEventArgs args) at > Microsoft.VisualStudio.Text.Editor.Implementation.KeyProcessorDispatcher.<>c__ > DisplayClass1e`1.b__1a() > at > Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Obj > ect > errorSource, Action call) > > > Completion displays only items matching characters already typed but > does not remember those characters if you continue to type: > Repro steps: > 1. Type 's' within a method where 'self' and at least one other > variable starting with 's' are available > 2. Press Ctrl+Space/Ctrl+J (completion dropdown appears) > 3. Type 'elf' (the item 'self' does not become highlighted) > 4. Delete 'elf', type 'self' (the item 'self' becomes highlighted, but > the line reads 'sself') > 5. Commit the completion, 'sself' is replaced by 'self' > > Typing '.' as part of an incremental search triggers completion > > Only the first completion set for imports includes project packages > (after the first dot it falls back on members of the package specified > so far). > > Sometimes (can't reliably reproduce) completion cannot be committed by > keyboard (can be by mouse, and can be aborted by keyboard) > > Auto-indent keeps adding indentation for every new blank line. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From hank at prosysplus.com Wed May 12 23:27:28 2010 From: hank at prosysplus.com (Hank Fay) Date: Wed, 12 May 2010 17:27:28 -0400 Subject: [IronPython] Eventhandling in the IDE: Who is the audience? In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39619AAF@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD39619AAF@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: The best suggestion I can give is this: have someone show you the VFP9 IDE. There are things it doesn't have (code folding e.g.), but things it does have -- e.g., each method of an object can have it's own editing window, so you can see 2 or more methods at once. There's something like it now in VS2010 from a demo I saw, but it's nowhere as easy to use. The biggest lack in VS2010 I hope will be addressed when you get to programming the IDE in IPy. In VFP, to get the active object in the designer, as an object, it's a single function: aselobj(), which returns the object (or objects if multiple selections) in an array. Those objects can then be programmed against, adding or setting properties, reading or inserting code into methods. It makes creating builders to do scut work really easy. Saves on carpal tunnel too. I hope you have something like that as a design goal. I know it can be done: a friend of mine wrote a version of aselobj() in VS in 2005 (I had been told by certain VFP/VSX team members that it was impossible, and Frank loves nothing better than a good challenge, although it took him 2 weeks rather than his customary 2 to 6 hours for significant new features). The intellisense in VFP was very good, and easily extensible. It worked against live objects in the debugger of course, but also against entries the developer could add, e.g., all the few hundred library routines we created. These additional entries are contained where data should be stored, of course, in a real table , but I guess XML would do, although it's slow compared to a seek on an indexed table. So when I type in update_file_ftp( all the parameters show up, even though there has not been any mention of the routine in the program, etc. It's a huge help. Parenthetically, what we do is scan all the relevant libraries in a project as startup to see if there are entries to change or add: that's a trival task when the timestamp has been kept in the table with the intellisense entry. Thanks for listening. I haven't had this experience since the early (1992-3) Fox days. Hank On Wed, May 12, 2010 at 3:58 PM, Dino Viehland wrote: > This is great feedback and I?ve added it to a designer TODO list. I?ll > spend some time in the (hopefully near) future going through and improving > the designer experience. If you have any other thoughts on things we should > do in that space (or shouldn?t do J) I?d love to hear it and I?ll add it > to the list. Thanks! > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Hank Fay > *Sent:* Wednesday, May 05, 2010 8:58 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] Eventhandling in the IDE: Who is the audience? > > > > In VB, eventhandling can be done by switching to the "partial class", > selecting the object in the left dropdown at the top of the editor, and then > selecting the event in the right dropdown. The function gets created, and > of course in VB uses Handles in order to connect the event-handler. > > > > This is a style of working with events that is familiar with at least a > hundred thousand VFP programmers who have been stranded by MS, and are > looking for a way into .Net. And I believe it's familiar with the million > plus VB programmers who have not made the switch to .Net (the last figure I > read was over 2 million, but that was nearly 2 years ago). > > > > I would make the argument that this way of working is straight-forward, > involves less typing, and allows clearer thinking: the same kinds of > arguments made for Py in general and IPy in particular. I can create a > framework that makes working with data, and the IDE, easy for users, and > straight-forward in a way that will be familiar to VFP developers -- and am > doing so (open source fwiw), hence my special interest in making the rest of > the development experience as familiar as possible. > > > > So, this is a request. I'll have others, but much of what I need is > already in the plan (working with VSX in Python is huge, btw, so thanks in > advance for that one). > > > > thanks, > > > > Hank Fay > > _______________________________________________ > 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 cenovsky at bakalari.cz Fri May 14 00:04:13 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Fri, 14 May 2010 00:04:13 +0200 Subject: [IronPython] WPF DataGrid bug Message-ID: <4BEC775D.7020900@bakalari.cz> Hi all, when working with DataGrid in WPF application, I have found two bugs. I am not sure they are IronPython bugs but I don't know how to investigate more - I am not so fluent in WinDbg :-) The first (more severe) bug is the /Object reference not set to an instance of an object/ error. The attached sample consists of DataGrid with some items and property /sel_item/ that is bound to DataGrid.SelectedItem. When you try to disable the whole DataGrid (click the button), the /Object reference not set to an instance of an object/ appears: Traceback (most recent call last): File "C:\IronPython-2.6.1\wpf.grid.py", line 109, in File "C:\IronPython-2.6.1\wpf.grid.py", line 103, in btnClick SystemError: Object reference not set to an instance of an object.>>> It only appears when you use binding to DataGrid.SelectedItem. If you remove the binding (lines 21-22; in xaml), no error appears. The second error appears when you initialize /sel_item/ to None (change line 73 to: self.sel_item = None). The DataGrid has initially no selected row. When you click on any, the binding error appears: TypeConverter cannot convert from DataItem. I guess this is more likely to be correct behavior because the Binding is initialized with None instead of the row type so it has no way to find out the right conversion. I use IronPython 2.6.1 and WFP Toolkit from February 2010. It would be nice if somebody could check these bugs. Thanks. -- -- Luk?? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: wpf.grid.py URL: From s.j.dower at gmail.com Fri May 14 06:26:16 2010 From: s.j.dower at gmail.com (Steve Dower) Date: Fri, 14 May 2010 14:26:16 +1000 Subject: [IronPython] IronPy Tools for VS - QuickInfo exception Message-ID: I don't believe I did anything to cause these exceptions (taken from the /log file), but apparently it happened from a mouse-over event. I couldn't figure out what I moused over, but I have included the two exception messages. The second appears in the log 0.062 seconds after the first one (only one message box appeared in VS). Good luck... System.ArgumentNullException: Value cannot be null. Parameter name: parameters at Microsoft.Scripting.Utils.ContractUtils.RequiresNotNullItems[T](IList`1 array, String arrayName) at IronPython.Compiler.Ast.FunctionDefinition..ctor(String name, Parameter[] parameters, Statement body) at IronPython.Compiler.Parser.ParseLambdaHelperStart(String name) at IronPython.Compiler.Parser.FinishLambdef() at IronPython.Compiler.Parser.ParseExpression() at IronPython.Compiler.Parser.ParseExpressionList(Boolean& trailingComma) at IronPython.Compiler.Parser.ParseTestListAsExpr(Boolean allowEmptyExpr) at IronPython.Compiler.Parser.ParseTestListAsExpression() at IronPython.Compiler.Parser.ParseTopExpression() at Microsoft.PyAnalysis.ModuleAnalysis.GetExpressionFromText(String exprText) at Microsoft.PyAnalysis.ModuleAnalysis.d__0.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at Microsoft.IronPythonTools.Intellisense.QuickInfoSource.AugmentQuickInfoSession(IQuickInfoSession session, IList`1 quickInfoContent, ITrackingSpan& applicableToSpan) at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Recalculate() at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Start() at Microsoft.VisualStudio.Language.Intellisense.Implementation.DefaultQuickInfoController.OnTextView_MouseHover(Object sender, MouseHoverEventArgs e) at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.RaiseHoverEvents() System.ArgumentNullException: Value cannot be null. Parameter name: parameters at Microsoft.Scripting.Utils.ContractUtils.RequiresNotNullItems[T](IList`1 array, String arrayName) at IronPython.Compiler.Ast.FunctionDefinition..ctor(String name, Parameter[] parameters, Statement body) at IronPython.Compiler.Parser.ParseLambdaHelperStart(String name) at IronPython.Compiler.Parser.FinishLambdef() at IronPython.Compiler.Parser.ParseExpression() at IronPython.Compiler.Parser.ParseExpressionList(Boolean& trailingComma) at IronPython.Compiler.Parser.ParseTestListAsExpr(Boolean allowEmptyExpr) at IronPython.Compiler.Parser.ParseTestListAsExpression() at IronPython.Compiler.Parser.ParseTopExpression() at Microsoft.PyAnalysis.ModuleAnalysis.GetExpressionFromText(String exprText) at Microsoft.PyAnalysis.ModuleAnalysis.d__0.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at Microsoft.IronPythonTools.Intellisense.QuickInfoSource.AugmentQuickInfoSession(IQuickInfoSession session, IList`1 quickInfoContent, ITrackingSpan& applicableToSpan) at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Recalculate() at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoSession.Start() at Microsoft.VisualStudio.Language.Intellisense.Implementation.QuickInfoBroker.TriggerQuickInfo(ITextView textView, ITrackingPoint triggerPoint, Boolean trackMouse) at Microsoft.IronPythonTools.Intellisense.IntellisenseController.TextViewMouseHover(Object sender, MouseHoverEventArgs e) at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.RaiseHoverEvents() From s.j.dower at gmail.com Sat May 15 12:55:51 2010 From: s.j.dower at gmail.com (Steve Dower) Date: Sat, 15 May 2010 20:55:51 +1000 Subject: [IronPython] IronPy Tools for VS - Projects Message-ID: Just thought I'd put out some more thoughts on the automatic project hierarchy that IronPy Tools has (for now?) in the Solution Explorer. (I'll put out there right away that I would rather see it removed and have the traditional project management instead. Everything else I write should be read in that context.) Apart from importing an existing project into VS, there are very few other times when you want all the files at once. For imports, it's great, but for a new project it is unnecessary since there are no relevant files at that point. Any new .py files will probably be created through VS, rather than being created externally in such quantity as to make dragging and dropping from Explorer painful (and the Add Existing Item dialog supports multiple files as well). Add to this that Solution Explorer has for quite some time had a "Show All Files" button and there is no reason to have it exposed all the time. Next is the clutter that comes with having all files visible. Run your project with CPython (compatibility testing or for whatever reason) and you get .pyc files appear everywhere. Run with -O and you'll get .pyo files as well. Every one of these appears in Solution Explorer, making the tree three times as long as it needs to be. Version control related files or folders (such as .svn or .hg) are also visible. (I know I've already raised this and a solution is coming, but the necessity of another solution is still a point against.) Third, automatically generated files are common and can get very messy. The obvious destination for pydoc or epydoc documentation is within the project folder. VS automatically expands folders when new files appear, so updating documentation turns Solution Explorer into a list of html files. Worse, search "Current Project" for something and all of these files are searched as well (and for some reason, are left open even if the text is not found...). Fourth is not something that has affected me, but I'm not entirely sure how source control that is integrated into VS behaves with this. I believe that it was associated with the service providing the project nodes, but I haven't looked into VS2010 in this area yet. Either way, automatically including every file into source control is probably not appropriate (and certainly is not appropriate in *every* case). Finally, bugs. I haven't been able to reproduce every one I've come across, but most relate to changing the project files via Explorer while VS is open. Since I'm using SVN with TortoiseSVN I can't use VS exclusively for file management, and occasionally renaming, creating or deleting a file will cause VS to crash hard ("send error report"), crash soft ("run with /log") or display multiple/repeated files in Solution Explorer. In summary, I'd rather have the traditional style projects in IronPy Tools (as in C#/C++/VB) because: - I very rarely need to import an existing tree - most project changes are adding code files, best done through VS - there is a 'Show All Files' option for those who want it - there are many files I don't want to see in VS - integrated source control may(?) misbehave - there will always be edge-cases with regards to synchronisation that cause crashes I hope this is taken in the right spirit - I'm trying to be constructive, not to criticise from the sidelines. (After spending a while working on my own equivalent project, I'm keen to see this one succeed.) Cheers, Steve From cenovsky at bakalari.cz Sun May 16 12:55:57 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Sun, 16 May 2010 12:55:57 +0200 Subject: [IronPython] clr.AddReferenceToFile bug? Message-ID: <4BEFCF3D.2010707@bakalari.cz> Hi all, I thought clr.AddReferenceToFile should behave similarly to clr.AddReferenceToFileAndPath when I adjust sys.path manually first. But it seems they don't. Is it a bug or feature? This works: import clr import sys clr.AddReferenceToFileAndPath('..\\PythonModules.dll') This does not work: import clr import sys sys.path.insert(0, '..\\') clr.AddReferenceToFile('PythonModules.dll') Traceback (most recent call last): File "C:\tests\addrefbug.py", line 8, in IOError: System.IO.IOException: Could not add reference to assembly PythonModules.dll at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args, Boolean& shouldOptimize) at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(CallSite site, CodeContext context, TFuncType func, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at __main__$2.__main__(FunctionCode $functionCode) in C:\Klasifikace\Klasifikace\tests\db\addrefbug.py:line 10 at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String fileName)>>> -- -- Luk?? From cenovsky at bakalari.cz Sun May 16 17:20:24 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Sun, 16 May 2010 17:20:24 +0200 Subject: [IronPython] AddReference to Silverlight toolkit assemblies In-Reply-To: <1B42307CD4AADD438CDDA2FE1121CC9217383565@TK5EX14MBXC138.redmond.corp.microsoft.com> References: <4BA95FC7.4040607@bakalari.cz> <1B42307CD4AADD438CDDA2FE1121CC921731311E@TK5EX14MBXC136.redmond.corp.microsoft.com> <4BD8348D.9060007@bakalari.cz> <1B42307CD4AADD438CDDA2FE1121CC9217383565@TK5EX14MBXC138.redmond.corp.microsoft.com> Message-ID: <4BF00D38.9000708@bakalari.cz> Thanks Jimmy, it really works now. I have written a small howto for those interested: http://gui-at.blogspot.com/2010/05/distributing-silverlight-application.html -- -- Luk?? Jimmy Schementi wrote: > > Ah **duh**, though Microsoft.Scripting.Silverlight.dll calls > ScriptRuntime.LoadAssembly on each AssemblyPart in the > AppManifest.xaml, it does **not** do the same thing for DLLs in zip > files referenced by ExtensionPart, since Silverlight only gives us a > way of getting files out of a zip, not enumerating its contents. > > > > So, to correct myself, if you're using ExtensionParts, you'll have to > call clr.AddReference for each DLL you want loaded. The reason why you > don't see the expected types is because IronPython doesn't know about > them. > > > > We /could/ require that those zip files have a AppManifest.xaml, which > would list the DLLs, and then we could parse that and load the DLLs. > Though asking Silverlight to implement ZIP contents enumeration is > probably the best =) > > > > ~js > > > > *From:* Lukas Cenovsky [mailto:cenovsky at bakalari.cz] > *Sent:* Wednesday, April 28, 2010 6:14 AM > *To:* Discussion of IronPython; Jimmy Schementi > *Subject:* Re: [IronPython] AddReference to Silverlight toolkit assemblies > > > > Well, I was wrong when I said it worked. Here is the scenario: > > I have necessary .dlls in separate file called /SLToolkit.zip/ which I > reference in AppManifest.xaml: > > > > > > > There are the following files in /SLToolkit.zip/: > > System.ComponentModel.DataAnnotations.dll > System.Windows.Controls.dll > System.Windows.Controls.Data.dll > System.Windows.Controls.Data.Input.dll > System.Windows.Data.dll > > > I want to use /ChildWindow/ control. It works when I use it in XAML > and load the XAML with XamlReader. But it does not work when I want to > load it from code. If fails on importing because /ChildWindow/ is not > in /System.Windows.Controls/ namespace. > > I put System.Windows.Controls.dll into .xap file and test the > following in Silverlight REPL: > > py> import System.Windows.Controls > => None > py> dir(System.Windows.Controls) > => ['Border', 'Button', 'Canvas', 'CheckBox', 'CleanUpVirtualizedItemEventArgs', ...] > py> clr.AddReferenceToFile('System.Windows.Controls.dll') > => None > py> dir(System.Windows.Controls) > => ['Border', 'Button', 'Calendar', 'CalendarBlackoutDatesCollection', > 'CalendarDateChangedEventArgs', 'CalendarDateRange', 'CalendarMode', > 'CalendarModeChangedEventArgs', 'CalendarSelectionMode', 'Canvas', > 'CheckBox', 'ChildWindow', 'CleanUpVirtualizedItemEventArgs', ...] > > > It looks like the controls from System.Windows.Controls.dll are not > merged into /System.Windows.Controls/ namespace. > > Is it bug or do I do something wrong? > > -- > -- Luk?? > > > Jimmy Schementi wrote: > > Lukas, > > > > When you use ExtensionPart, it calls Assembly.Load on each file in the > zip file referenced, so you don't need to do clr.Addreference. > > > > System.Windows.Data.dll and System.Windows.Controls.Data.dll are not > DLLs in Silverlight; they are in the Silverlight SDK. So you'll have > to package them up into a separate zip file which you include in your > AppManfest, just like you did with the SLToolkit.zip. > > > > ~js > > > > *From:* users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Lukas Cenovsky > *Sent:* Tuesday, March 23, 2010 5:42 PM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] AddReference to Silverlight toolkit assemblies > > > > Hi all, > I use Silverlight toolkit in my IronPython Silverlight app. To lower > bandwidth, I put all necessary Silverlight toolkit .dlls into separate > file called /SLToolkit.zip/ which I reference in AppManifest.xaml: > > > > > > > This works nicely if I don't need to reference assembly already > existing in Silverlight - e.g. I do > > clr.AddReference('System.Windows.Controls.Data') > > and use /DataGrid/. Unfortunately, when I need to reference > /PagedCollectionView /from System.Windows.Data, this approach does not > work. Trying > > from System.Windows.Data import PagedCollectionView > > fails on /ImportError: Cannot import name PagedCollectionView/. Doing > > import System.Windows.Data > System.Windows.Data.PagedCollectionView(some_data) > > fails with /AttributeError: attribute 'PagedCollectionView' of > 'namespace#' object is read-only/. When I try to add > > clr.AddReference('System.Windows.Data') > > if fails with: /IOError: [Errno 2] could not find assembly: > System.Windows.Data (check the Web server)/. > > The only way how to make this work is to put System.Windows.Data.dll > into .xap file and reference it with > > clr.AddReferenceToFile('System.Windows.Data.dll') > from System.Windows.Data import PagedCollectionView > > > Is there a way to make it work when System.Windows.Data.dll is in the > separate file? Or should I use another approach? > > Thanks, > > -- > -- 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 Matt.funke at vishaypg.com Mon May 17 14:59:05 2010 From: Matt.funke at vishaypg.com (Funke, Matt) Date: Mon, 17 May 2010 12:59:05 +0000 Subject: [IronPython] Missing Framework Libraries In-Reply-To: <4BF00D38.9000708@bakalari.cz> References: <4BA95FC7.4040607@bakalari.cz> <1B42307CD4AADD438CDDA2FE1121CC921731311E@TK5EX14MBXC136.redmond.corp.microsoft.com> <4BD8348D.9060007@bakalari.cz> <1B42307CD4AADD438CDDA2FE1121CC9217383565@TK5EX14MBXC138.redmond.corp.microsoft.com> <4BF00D38.9000708@bakalari.cz> Message-ID: <2C5C90D76B65DC47A65001FD937014B20118596A@WSWD43.VishayPG.com> Once again, it's a rank newbie question, I'm afraid. I've been trying to duplicate some of Re.Mark's work(*) to get at some Visual Studio functionality. Regrettably, though, my installation of VS 2010 doesn't seem to recognize the System.Windows namespace; moreover, when I try to look for it under Project -> Add Reference..., it doesn't show up (though some of its sub-namespaces do). Can someone point me at a resource to find out where one can go to get missing namespaces, and how to integrate them into VS 2010? Thanks again for any help you can offer. -- Matt Funke (*) Look at this C# sample that he uses as a code base: http://remark.wordpress.com/2009/01/27/an-introduction-to-wpf-with-ironpython/ From Matt.funke at vishaypg.com Mon May 17 15:31:42 2010 From: Matt.funke at vishaypg.com (Funke, Matt) Date: Mon, 17 May 2010 13:31:42 +0000 Subject: [IronPython] Missing Framework Libraries In-Reply-To: <2C5C90D76B65DC47A65001FD937014B20118596A@WSWD43.VishayPG.com> References: <4BA95FC7.4040607@bakalari.cz> <1B42307CD4AADD438CDDA2FE1121CC921731311E@TK5EX14MBXC136.redmond.corp.microsoft.com> <4BD8348D.9060007@bakalari.cz> <1B42307CD4AADD438CDDA2FE1121CC9217383565@TK5EX14MBXC138.redmond.corp.microsoft.com> <4BF00D38.9000708@bakalari.cz> <2C5C90D76B65DC47A65001FD937014B20118596A@WSWD43.VishayPG.com> Message-ID: <2C5C90D76B65DC47A65001FD937014B201185994@WSWD43.VishayPG.com> Perhaps more generally, so that I don't keep bothering people with annoying questions like these: is there a place where the locations of various assemblies is documented, so that if I need a particular assembly I can go to the correct library to find it? Thank you for your time and patience. -- Matt Funke > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Funke, Matt > Sent: Monday, May 17, 2010 8:59 AM > To: Discussion of IronPython > Subject: [IronPython] Missing Framework Libraries > > Once again, it's a rank newbie question, I'm afraid. > > I've been trying to duplicate some of Re.Mark's work(*) to get at some > Visual Studio functionality. Regrettably, though, my installation of > VS 2010 doesn't seem to recognize the System.Windows namespace; > moreover, when I try to look for it under Project -> Add Reference..., > it doesn't show up (though some of its sub-namespaces do). Can someone > point me at a resource to find out where one can go to get missing > namespaces, and how to integrate them into VS 2010? > > Thanks again for any help you can offer. > > -- Matt Funke > > (*) Look at this C# sample that he uses as a code base: > http://remark.wordpress.com/2009/01/27/an-introduction-to-wpf-with- > ironpython/ > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Mon May 17 15:40:47 2010 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 17 May 2010 06:40:47 -0700 Subject: [IronPython] Missing Framework Libraries In-Reply-To: <2C5C90D76B65DC47A65001FD937014B201185994@WSWD43.VishayPG.com> References: <4BA95FC7.4040607@bakalari.cz> <1B42307CD4AADD438CDDA2FE1121CC921731311E@TK5EX14MBXC136.redmond.corp.microsoft.com> <4BD8348D.9060007@bakalari.cz> <1B42307CD4AADD438CDDA2FE1121CC9217383565@TK5EX14MBXC138.redmond.corp.microsoft.com> <4BF00D38.9000708@bakalari.cz> <2C5C90D76B65DC47A65001FD937014B20118596A@WSWD43.VishayPG.com> <2C5C90D76B65DC47A65001FD937014B201185994@WSWD43.VishayPG.com> Message-ID: First, some clarification about terminology: Assemblies are DLLs. The "built-in" ones that come with .NET are typically stored in a special location known as the "GAC" or "Global Assembly Cache". As such, you don't need to specify where they are exactly, because that's a standard place where IronPython or C# knows to look. System.Windows is a namespace. Any given namespace may have members in multiple assemblies. In part, that's because there isn't really a namespace "object" in .NET; it's merely a naming convention for types that we've all agreed to follow. So the fundamental unit that you're probably concerned with is a type. Types are indeed located in assemblies, and you need to reference the appropriate assembly in order to use the types contained therein. Probably the easiest way to find which assembly a particular type is located in is to search MSDN -- both Google and Bing do a good at this. Let's say I want to find which assembly contains the type FrameworkElement. I simply search for "FrameworkElement site:microsoft.com" and the first hit will generally be the one I want. Near the very top of that page, it tells me "Assembly: PresentationFramework (in PresentationFramework.dll)". So if I want to use FrameworkElement, that's the assembly I need to reference. Is this the information you're looking for? On Mon, May 17, 2010 at 6:31 AM, Funke, Matt wrote: > Perhaps more generally, so that I don't keep bothering people with annoying > questions like these: is there a place where the locations of various > assemblies is documented, so that if I need a particular assembly I can go > to the correct library to find it? > > Thank you for your time and patience. > > -- Matt Funke > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of Funke, Matt > > Sent: Monday, May 17, 2010 8:59 AM > > To: Discussion of IronPython > > Subject: [IronPython] Missing Framework Libraries > > > > Once again, it's a rank newbie question, I'm afraid. > > > > I've been trying to duplicate some of Re.Mark's work(*) to get at some > > Visual Studio functionality. Regrettably, though, my installation of > > VS 2010 doesn't seem to recognize the System.Windows namespace; > > moreover, when I try to look for it under Project -> Add Reference..., > > it doesn't show up (though some of its sub-namespaces do). Can someone > > point me at a resource to find out where one can go to get missing > > namespaces, and how to integrate them into VS 2010? > > > > Thanks again for any help you can offer. > > > > -- Matt Funke > > > > (*) Look at this C# sample that he uses as a code base: > > http://remark.wordpress.com/2009/01/27/an-introduction-to-wpf-with- > > ironpython/ > > _______________________________________________ > > 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 Matt.funke at vishaypg.com Mon May 17 15:42:51 2010 From: Matt.funke at vishaypg.com (Funke, Matt) Date: Mon, 17 May 2010 13:42:51 +0000 Subject: [IronPython] Missing Framework Libraries In-Reply-To: References: <4BA95FC7.4040607@bakalari.cz> <1B42307CD4AADD438CDDA2FE1121CC921731311E@TK5EX14MBXC136.redmond.corp.microsoft.com> <4BD8348D.9060007@bakalari.cz> <1B42307CD4AADD438CDDA2FE1121CC9217383565@TK5EX14MBXC138.redmond.corp.microsoft.com> <4BF00D38.9000708@bakalari.cz> <2C5C90D76B65DC47A65001FD937014B20118596A@WSWD43.VishayPG.com> <2C5C90D76B65DC47A65001FD937014B201185994@WSWD43.VishayPG.com> Message-ID: <2C5C90D76B65DC47A65001FD937014B2011859B1@WSWD43.VishayPG.com> Yes. Yes, it is. Thank you very much for making that so much clearer than it was in my head. -- Matt Funke From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Monday, May 17, 2010 9:41 AM To: Discussion of IronPython Subject: Re: [IronPython] Missing Framework Libraries First, some clarification about terminology: Assemblies are DLLs. The "built-in" ones that come with .NET are typically stored in a special location known as the "GAC" or "Global Assembly Cache". As such, you don't need to specify where they are exactly, because that's a standard place where IronPython or C# knows to look. System.Windows is a namespace. Any given namespace may have members in multiple assemblies. In part, that's because there isn't really a namespace "object" in .NET; it's merely a naming convention for types that we've all agreed to follow. So the fundamental unit that you're probably concerned with is a type. Types are indeed located in assemblies, and you need to reference the appropriate assembly in order to use the types contained therein. Probably the easiest way to find which assembly a particular type is located in is to search MSDN -- both Google and Bing do a good at this. Let's say I want to find which assembly contains the type FrameworkElement. I simply search for "FrameworkElement site:microsoft.com" and the first hit will generally be the one I want. Near the very top of that page, it tells me "Assembly: PresentationFramework (in PresentationFramework.dll)". So if I want to use FrameworkElement, that's the assembly I need to reference. Is this the information you're looking for? On Mon, May 17, 2010 at 6:31 AM, Funke, Matt > wrote: Perhaps more generally, so that I don't keep bothering people with annoying questions like these: is there a place where the locations of various assemblies is documented, so that if I need a particular assembly I can go to the correct library to find it? Thank you for your time and patience. -- Matt Funke > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Funke, Matt > Sent: Monday, May 17, 2010 8:59 AM > To: Discussion of IronPython > Subject: [IronPython] Missing Framework Libraries > > Once again, it's a rank newbie question, I'm afraid. > > I've been trying to duplicate some of Re.Mark's work(*) to get at some > Visual Studio functionality. Regrettably, though, my installation of > VS 2010 doesn't seem to recognize the System.Windows namespace; > moreover, when I try to look for it under Project -> Add Reference..., > it doesn't show up (though some of its sub-namespaces do). Can someone > point me at a resource to find out where one can go to get missing > namespaces, and how to integrate them into VS 2010? > > Thanks again for any help you can offer. > > -- Matt Funke > > (*) Look at this C# sample that he uses as a code base: > http://remark.wordpress.com/2009/01/27/an-introduction-to-wpf-with- > ironpython/ > _______________________________________________ > 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 okko.willeboordse at gmail.com Mon May 17 18:36:25 2010 From: okko.willeboordse at gmail.com (Okko Willeboordse) Date: Mon, 17 May 2010 18:36:25 +0200 Subject: [IronPython] Problems with 'unbound-class-instance' method Message-ID: Hello, I have some problems accessing an object. This object is instantiated by another object. This other object holds a reference to the object. This reference is of type MarshalByRefObject Obviously I cannot access the object through MarshalByRefObject. This must be done using the 'unbound-class-instance' method (please correct me if I am wrong) For this method you need to instantiate the interface type object. However the interface is abstract! How to cope with this. Please find sample code below; import traceback import clr clr.AddReference("Bosch.Vms.SDK") import Bosch.Vms.SDK # RemoteServerApi constructor instantiates an object implementing a Bosch.Vms.SDK.IEventManager # interface RemoteServerApi = Bosch.Vms.SDK.RemoteServerApi("xxxx", "xxxx", "xxxx") # RemoteServerApi holds a reference to the object implementing a Bosch.Vms.SDK.IEventManager # interface. This reference is of type MarshalByRefObject. print type(RemoteServerApi.EventManager) # How to call a method of EventManager through MarshalByRefObject? print Bosch.Vms.SDK.IEventManager.GetAllEventTypes try: # Try the naive approach. RemoteServerApi.EventManager.GetAllEventTypes() except: # Obviously fails because MarshalByRefObject instances do not support reflection. # AttributeError: 'MarshalByRefObject' object has no attribute 'GetAllEventTypes' print traceback.format_exc() try: # Try the 'unbound-class-instance' method Bosch.Vms.SDK.IEventManager.GetAllEventTypes(RemoteServerApi.EventManager) except: # TypeError: expected IEventManager, got MarshalByRefObject print traceback.format_exc() try: # Okay I need an IEventManager instance Bosch.Vms.SDK.IEventManager(RemoteServerApi.EventManager) except: # TypeError: Cannot create instances of IEventManager because it is abstract print traceback.format_exc() Okko Willeboordse -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon May 17 22:03:36 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 17 May 2010 20:03:36 +0000 Subject: [IronPython] Problems with 'unbound-class-instance' method In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD39674207@TK5EX14MBXC116.redmond.corp.microsoft.com> Can you try the typedproxy class which is on this bug: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=470 ? It should work to wrap the object and let you access the various attributes that you want to by calling through the type (in this case the interface type - you'd pass IEventManager for the 2nd argument to the typedproxy). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Okko Willeboordse Sent: Monday, May 17, 2010 9:36 AM To: users at lists.ironpython.com Subject: [IronPython] Problems with 'unbound-class-instance' method Hello, I have some problems accessing an object. This object is instantiated by another object. This other object holds a reference to the object. This reference is of type MarshalByRefObject Obviously I cannot access the object through MarshalByRefObject. This must be done using the 'unbound-class-instance' method (please correct me if I am wrong) For this method you need to instantiate the interface type object. However the interface is abstract! How to cope with this. Please find sample code below; import traceback import clr clr.AddReference("Bosch.Vms.SDK") import Bosch.Vms.SDK # RemoteServerApi constructor instantiates an object implementing a Bosch.Vms.SDK.IEventManager # interface RemoteServerApi = Bosch.Vms.SDK.RemoteServerApi("xxxx", "xxxx", "xxxx") # RemoteServerApi holds a reference to the object implementing a Bosch.Vms.SDK.IEventManager # interface. This reference is of type MarshalByRefObject. print type(RemoteServerApi.EventManager) # How to call a method of EventManager through MarshalByRefObject? print Bosch.Vms.SDK.IEventManager.GetAllEventTypes try: # Try the naive approach. RemoteServerApi.EventManager.GetAllEventTypes() except: # Obviously fails because MarshalByRefObject instances do not support reflection. # AttributeError: 'MarshalByRefObject' object has no attribute 'GetAllEventTypes' print traceback.format_exc() try: # Try the 'unbound-class-instance' method Bosch.Vms.SDK.IEventManager.GetAllEventTypes(RemoteServerApi.EventManager) except: # TypeError: expected IEventManager, got MarshalByRefObject print traceback.format_exc() try: # Okay I need an IEventManager instance Bosch.Vms.SDK.IEventManager(RemoteServerApi.EventManager) except: # TypeError: Cannot create instances of IEventManager because it is abstract print traceback.format_exc() Okko Willeboordse -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon May 17 22:09:33 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 17 May 2010 20:09:33 +0000 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD39674231@TK5EX14MBXC116.redmond.corp.microsoft.com> Here's my simple summary: tl;dr: I don't think the directory based projects are useful, they might even not work correctly in a bunch of places, and they'll probably be a bug farm. I actually think the only thing I really disagree about is that there will always be lingering crashing bugs. We can certainly be evil and wrap our file change notifications in a big try/catch and swallow all the exceptions. Obviously we'd rather know what issues can happen and work on handling them now. Other than that though you do bring up some good problems with the directory based projects. In addition to swimming against the stream of VS we are also swimming against MPFProj - there we need to create an MSBuild item for each project entry - and currently we end up leaving some files in the .pyproj file even though they have no significant effect. And we even need additional code to deal with not endlessly expanding the project files! So I guess what I'm saying is there are more issues than you've enumerated. Another one is that we don't support File->New->Project from Existing Code which also helps eliminate the need for directory based projects. I actually don't have a huge attachment to this feature - we thought that it would be a more comfortable fit for Python programmers. But if there's a feeling that the feature isn't working then I'd be alright with going w/ the more traditional VS model. We still would want to have a support for a projectless model but maybe our efforts are betters spent making that robust and accepting the normal VS experience. So if anyone thinks the directory based projects are totally awesome I'd love to hear their counter-points. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Steve Dower > Sent: Saturday, May 15, 2010 3:56 AM > To: Discussion of IronPython > Subject: [IronPython] IronPy Tools for VS - Projects > > Just thought I'd put out some more thoughts on the automatic project > hierarchy that IronPy Tools has (for now?) in the Solution Explorer. > (I'll put out there right away that I would rather see it removed and > have the traditional project management instead. Everything else I > write should be read in that context.) > > Apart from importing an existing project into VS, there are very few > other times when you want all the files at once. For imports, it's > great, but for a new project it is unnecessary since there are no > relevant files at that point. Any new .py files will probably be > created through VS, rather than being created externally in such > quantity as to make dragging and dropping from Explorer painful (and > the Add Existing Item dialog supports multiple files as well). Add to > this that Solution Explorer has for quite some time had a "Show All > Files" button and there is no reason to have it exposed all the time. > > Next is the clutter that comes with having all files visible. Run your > project with CPython (compatibility testing or for whatever reason) > and you get .pyc files appear everywhere. Run with -O and you'll get > .pyo files as well. Every one of these appears in Solution Explorer, > making the tree three times as long as it needs to be. Version control > related files or folders (such as .svn or .hg) are also visible. (I > know I've already raised this and a solution is coming, but the > necessity of another solution is still a point against.) > > Third, automatically generated files are common and can get very > messy. The obvious destination for pydoc or epydoc documentation is > within the project folder. VS automatically expands folders when new > files appear, so updating documentation turns Solution Explorer into a > list of html files. Worse, search "Current Project" for something and > all of these files are searched as well (and for some reason, are left > open even if the text is not found...). > > Fourth is not something that has affected me, but I'm not entirely > sure how source control that is integrated into VS behaves with this. > I believe that it was associated with the service providing the > project nodes, but I haven't looked into VS2010 in this area yet. > Either way, automatically including every file into source control is > probably not appropriate (and certainly is not appropriate in *every* > case). > > Finally, bugs. I haven't been able to reproduce every one I've come > across, but most relate to changing the project files via Explorer > while VS is open. Since I'm using SVN with TortoiseSVN I can't use VS > exclusively for file management, and occasionally renaming, creating > or deleting a file will cause VS to crash hard ("send error report"), > crash soft ("run with /log") or display multiple/repeated files in > Solution Explorer. > > In summary, I'd rather have the traditional style projects in IronPy > Tools (as in C#/C++/VB) because: > - I very rarely need to import an existing tree > - most project changes are adding code files, best done through VS > - there is a 'Show All Files' option for those who want it > - there are many files I don't want to see in VS > - integrated source control may(?) misbehave > - there will always be edge-cases with regards to synchronisation that > cause crashes > > I hope this is taken in the right spirit - I'm trying to be > constructive, not to criticise from the sidelines. (After spending a > while working on my own equivalent project, I'm keen to see this one > succeed.) > > Cheers, > > Steve > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jdhardy at gmail.com Mon May 17 22:28:17 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 17 May 2010 14:28:17 -0600 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39674231@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD39674231@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Mon, May 17, 2010 at 2:09 PM, Dino Viehland wrote: > So if anyone thinks the directory based projects are totally awesome I'd love > to hear their counter-points. The only thing I'd hate to lose is the ability to point VS at a folder full of Python code and have it open and allow me to start hacking on it. For the foreseeable future, most Python projects are not going to include .pyproj files to make it easy. It doesn't matter how that's accomplished, as long as that use case is still supported. Simple creating a pyproj containing everything would be easiest (maybe excluding .pyc/.pyo). Or, it might be interesting to parse setup.cfg, if it exists. - Jeff From jdhardy at gmail.com Mon May 17 22:54:57 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 17 May 2010 14:54:57 -0600 Subject: [IronPython] Cannot import module from .dll directly Message-ID: When CPython is searching for modules to import, it will check all the folders in sys.path for .py, .pyc/.pyo, and .pyd/.dll files that match the requested import. For IronPython, .py is obviously supported, .pyc/.pyo are obviously(?) not, and neither are .pyd/.dll. Is there any particular reason that IronPython does not try to find .dll files when importing? There are many Python libraries that work this way (PIL was the one that prompted this, but PyCrypto works in a similar way) and it's easier than having to clr.AddReference assemblies. To be clear, I'm taking about a layout like this: foo +-- __init__.py +-- _foo.dll where __init__.py contains: from _foo import * and _foo.dll is an IronPython module similar to: [assembly: IronPython.Runtime.PythonModule("_foo", typeof(IronPython.Foo.Foo))] namespace IronPython.Foo { public class Foo { public int Frob(int x) { return x + 42; } } } Currently, running this on IRonPython results in: >>> import foo Traceback (most recent call last): File "", line 1, in File "...\foo\__init__.py", line 1, in ImportError: No module named _foo Supporting this would make it much easier to port libraries that require a native component; in many cases, the Python code could be used as-is and only the "native" code swapped out. - Jeff From s.j.dower at gmail.com Mon May 17 23:40:03 2010 From: s.j.dower at gmail.com (Steve Dower) Date: Tue, 18 May 2010 07:40:03 +1000 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD39674231@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: Is it possible to have the directory based projects 'implied' when a single file is opened (TextMate http://macromates.com/ style)? Because I agree with Jeff here that loading existing projects is dead simple when you can just add a pyproj. Though the '...from existing code' option would be plenty IMHO. On Tue, May 18, 2010 at 06:28, Jeff Hardy wrote: > On Mon, May 17, 2010 at 2:09 PM, Dino Viehland wrote: >> So if anyone thinks the directory based projects are totally awesome I'd love >> to hear their counter-points. > > The only thing I'd hate to lose is the ability to point VS at a folder > full of Python code and have it open and allow me to start hacking on > it. For the foreseeable future, most Python projects are not going to > include .pyproj files to make it easy. > > It doesn't matter how that's accomplished, as long as that use case is > still supported. Simple creating a pyproj containing everything would > be easiest (maybe excluding .pyc/.pyo). Or, it might be interesting to > parse setup.cfg, if it exists. > > - Jeff > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From dinov at microsoft.com Tue May 18 01:17:24 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 17 May 2010 23:17:24 +0000 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD39674231@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD39674AC9@TK5EX14MBXC116.redmond.corp.microsoft.com> Jeff wrote: > The only thing I'd hate to lose is the ability to point VS at a folder > full of Python code and have it open and allow me to start hacking on > it. For the foreseeable future, most Python projects are not going to > include .pyproj files to make it easy. > > It doesn't matter how that's accomplished, as long as that use case is > still supported. Simple creating a pyproj containing everything would > be easiest (maybe excluding .pyc/.pyo). Or, it might be interesting to > parse setup.cfg, if it exists. Does File->New->Project from Existing code address this for you (if it worked?) Or do you want something lighter weight than that? From dinov at microsoft.com Tue May 18 01:19:15 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 17 May 2010 23:19:15 +0000 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD39674231@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD39674AF0@TK5EX14MBXC116.redmond.corp.microsoft.com> Steve wrote: > Is it possible to have the directory based projects 'implied' when a > single file is opened (TextMate http://macromates.com/ style)? Because > I agree with Jeff here that loading existing projects is dead simple > when you can just add a pyproj. Though the '...from existing code' > option would be plenty IMHO. So we do intend on having an implied project feature and it's already part way there. Today if you open code w/o any solution or project we'll do the analysis over all the files and packages in that directory. We've discussed creating a temporary solution / project which is not saved to disk as well but we haven't implemented that part yet (and I'm not yet sure how to go about implementing it as well - but I think it's probably possible). Of course once it's in solution explorer it may have some of the same issues as the directory based project. But we could also keep it more static (e.g. not track changes on disk) and presumably it just wouldn't support source control so it is simplified and easier to get right. From jdhardy at gmail.com Tue May 18 04:50:34 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 17 May 2010 20:50:34 -0600 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39674AC9@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD39674231@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD39674AC9@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Mon, May 17, 2010 at 5:17 PM, Dino Viehland wrote: > Does File->New->Project from Existing code address this for you (if it > worked?) ? Or do you want something lighter weight than that? Well, both, actually :) There are times when I'll be looking at another library for a while (say, Django) and will want a permanent pyproj file; there are times when I'm evaluating a small library and want to open it up and browse but may never look at it again. The implicit project stuff you mentioned to Steve sounds like a perfect fit for the latter case, and New Project from Existing Code would work fine for the former. Also, the implicit project support could have a "Create pyproj" option that would create the pyproj file (in case I change my mind from "brief look" to "interesting") from the currently open implicit project. - Jeff From hank at prosysplus.com Tue May 18 06:08:46 2010 From: hank at prosysplus.com (Hank Fay) Date: Tue, 18 May 2010 00:08:46 -0400 Subject: [IronPython] .Net assembly expects array object, sees list Message-ID: I don't know whether this is a bug or a feature. I'm using the Advantage ado.net data provider. On the AdsExtendedReader object is a method to Seek a value. The first parameter is supposed to be an array object, .Net type. Here's my code: _myArray = ["dProd"] _ok = loReader.Seek(_myArray,AdsExtendedReader.SeekType.HardSeek) and here is the result (in 2.6.1003.1), run in SharpDevelop: Microsoft.Scripting.ArgumentTypeException: expected Array[object], got list at Caller.Call at BuiltinFunctionCaller.Call5 at System.Dynamic.UpdateDelegates.UpdateAndExecute7 at IronPython.Runtime.Importer.Import at IronPython.Runtime.Operations.PythonOps.InitializeModule at PythonMain.Main TIA, Hank Fay -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Tue May 18 06:14:14 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 18 May 2010 04:14:14 +0000 Subject: [IronPython] .Net assembly expects array object, sees list In-Reply-To: References: Message-ID: <1B42307CD4AADD438CDDA2FE1121CC92173958DD@TK5EX14MBXC138.redmond.corp.microsoft.com> It's a feature; the IronPython .Net integration docs show how to go between Python lists and .NET arrays (http://ironpython.net/documentation/dotnet/dotnet.html#net-arrays): System.Array[int]([1, 2, 3]) Basically you have to be very explicit about providing actual .NET types when they are expected. ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Hank Fay Sent: Monday, May 17, 2010 9:09 PM To: Discussion of IronPython Subject: [IronPython] .Net assembly expects array object, sees list I don't know whether this is a bug or a feature. I'm using the Advantage ado.net data provider. On the AdsExtendedReader object is a method to Seek a value. The first parameter is supposed to be an array object, .Net type. Here's my code: _myArray = ["dProd"] _ok = loReader.Seek(_myArray,AdsExtendedReader.SeekType.HardSeek) and here is the result (in 2.6.1003.1), run in SharpDevelop: Microsoft.Scripting.ArgumentTypeException: expected Array[object], got list at Caller.Call at BuiltinFunctionCaller.Call5 at System.Dynamic.UpdateDelegates.UpdateAndExecute7 at IronPython.Runtime.Importer.Import at IronPython.Runtime.Operations.PythonOps.InitializeModule at PythonMain.Main TIA, Hank Fay -------------- next part -------------- An HTML attachment was scrubbed... URL: From okko.willeboordse at gmail.com Tue May 18 09:42:35 2010 From: okko.willeboordse at gmail.com (Okko Willeboordse) Date: Tue, 18 May 2010 09:42:35 +0200 Subject: [IronPython] Problems with 'unbound-class-instance' method In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39674207@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD39674207@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: Thanks, I tried the typedproxy but failed. Maybe I got it wrong; I do; EventManager = typedproxy(RemoteServerApi.EventManager, Bosch.Vms.SDK.IEventManager) Then; EventManager.GetAllEventTypes() This results in exact the same error as; Bosch.Vms.SDK.IEventManager.GetAllEventTypes(RemoteServerApi.EventManager) Namely; TypeError: expected IEventManager, got MarshalByRefObject Se below Kind regards, import traceback import clr clr.AddReference("Bosch.Vms.SDK") import Bosch.Vms.SDK class typedproxy(object): __slots__ = ['obj', 'proxyType'] def __init__(self, obj, proxyType): self.obj = obj self.proxyType = proxyType def __getattribute__(self, attr): proxyType = object.__getattribute__(self, 'proxyType') obj = object.__getattribute__(self, 'obj') return getattr(proxyType, attr).__get__(obj, proxyType) # RemoteServerApi constructor instantiates an object implementing a Bosch.Vms.SDK.IEventManager # interface RemoteServerApi = Bosch.Vms.SDK.RemoteServerApi("10.119.33.241:5390", "Admin", "") # RemoteServerApi holds a reference to the object implementing a Bosch.Vms.SDK.IEventManager # interface. This reference is of type MarshalByRefObject. print type(RemoteServerApi.EventManager) # How to call a method of EventManager through MarshalByRefObject? print Bosch.Vms.SDK.IEventManager.GetAllEventTypes try: # Try the naive approach. RemoteServerApi.EventManager.GetAllEventTypes() except: # Obviously fails because MarshalByRefObject instances do not support reflection. # AttributeError: 'MarshalByRefObject' object has no attribute 'GetAllEventTypes' print traceback.format_exc() try: # Try the 'unbound-class-instance' method Bosch.Vms.SDK.IEventManager.GetAllEventTypes(RemoteServerApi.EventManager) except: # TypeError: expected IEventManager, got MarshalByRefObject print traceback.format_exc() try: # Okay I need a IEventManager instance Bosch.Vms.SDK.IEventManager(RemoteServerApi.EventManager) except: # TypeError: Cannot create instances of IEventManager because it is abstract print traceback.format_exc() EventManager = typedproxy(RemoteServerApi.EventManager, Bosch.Vms.SDK.IEventManager) try: print EventManager.GetAllEventTypes() except: print traceback.format_exc() # Traceback (most recent call last): # File "bvms.py", line 50, in # print EventManager.GetAllEventTypes() # File "bvms.py", line 15, in __getattribute__ # return getattr(proxyType, attr).__get__(obj, proxyType) # TypeError: expected IEventManager, got MarshalByRefObject On Mon, May 17, 2010 at 10:03 PM, Dino Viehland wrote: > Can you try the typedproxy class which is on this bug: > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=470 ? > > > > It should work to wrap the object and let you access the various attributes > that you want to by calling through the type (in this case the interface > type ? you?d pass IEventManager for the 2nd argument to the typedproxy). > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Okko Willeboordse > *Sent:* Monday, May 17, 2010 9:36 AM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] Problems with 'unbound-class-instance' method > > > > Hello, > > I have some problems accessing an object. > > This object is instantiated by another object. > > This other object holds a reference to the object. > > This reference is of type MarshalByRefObject > > Obviously I cannot access the object through MarshalByRefObject. > > This must be done using the 'unbound-class-instance' method (please correct > me if I am wrong) > > For this method you need to instantiate the interface type object. > > However the interface is abstract! > > How to cope with this. > > > Please find sample code below; > > > import traceback > import clr > clr.AddReference("Bosch.Vms.SDK") > > import Bosch.Vms.SDK > > # RemoteServerApi constructor instantiates an object implementing a > Bosch.Vms.SDK.IEventManager > # interface > RemoteServerApi = Bosch.Vms.SDK.RemoteServerApi("xxxx", "xxxx", "xxxx") > # RemoteServerApi holds a reference to the object implementing a > Bosch.Vms.SDK.IEventManager > # interface. This reference is of type MarshalByRefObject. > print type(RemoteServerApi.EventManager) > # How to call a method of EventManager through MarshalByRefObject? > print Bosch.Vms.SDK.IEventManager.GetAllEventTypes > > try: > # Try the naive approach. > RemoteServerApi.EventManager.GetAllEventTypes() > except: > # Obviously fails because MarshalByRefObject instances do not support > reflection. > # AttributeError: 'MarshalByRefObject' object has no attribute > 'GetAllEventTypes' > print traceback.format_exc() > > try: > # Try the 'unbound-class-instance' method > > Bosch.Vms.SDK.IEventManager.GetAllEventTypes(RemoteServerApi.EventManager) > except: > # TypeError: expected IEventManager, got MarshalByRefObject > print traceback.format_exc() > > try: > # Okay I need an IEventManager instance > Bosch.Vms.SDK.IEventManager(RemoteServerApi.EventManager) > except: > # TypeError: Cannot create instances of IEventManager because it is > abstract > print traceback.format_exc() > > Okko Willeboordse > > _______________________________________________ > 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 hank at prosysplus.com Tue May 18 17:48:26 2010 From: hank at prosysplus.com (Hank Fay) Date: Tue, 18 May 2010 11:48:26 -0400 Subject: [IronPython] .Net assembly expects array object, sees list In-Reply-To: <1B42307CD4AADD438CDDA2FE1121CC92173958DD@TK5EX14MBXC138.redmond.corp.microsoft.com> References: <1B42307CD4AADD438CDDA2FE1121CC92173958DD@TK5EX14MBXC138.redmond.corp.microsoft.com> Message-ID: Super! Thanks. Works. Hank On Tue, May 18, 2010 at 12:14 AM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > It?s a feature; the IronPython .Net integration docs show how to go between > Python lists and .NET arrays ( > http://ironpython.net/documentation/dotnet/dotnet.html#net-arrays): > > > > System.Array[int]([1, 2, 3]) > > > > Basically you have to be very explicit about providing actual .NET types > when they are expected. > > > > ~js > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Hank Fay > *Sent:* Monday, May 17, 2010 9:09 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] .Net assembly expects array object, sees list > > > > I don't know whether this is a bug or a feature. > > > > I'm using the Advantage ado.net data provider. On the AdsExtendedReader > object is a method to Seek a value. The first parameter is supposed to be > an array object, .Net type. > > > > Here's my code: > > > > _myArray = ["dProd"] > > _ok = loReader.Seek(_myArray,AdsExtendedReader.SeekType.HardSeek) > > > > and here is the result (in 2.6.1003.1), run in SharpDevelop: > > > > Microsoft.Scripting.ArgumentTypeException: expected Array[object], got list > > at Caller.Call > > at > BuiltinFunctionCaller.Call5 > > at System.Dynamic.UpdateDelegates.UpdateAndExecute7 > > at IronPython.Runtime.Importer.Import > > at IronPython.Runtime.Operations.PythonOps.InitializeModule > > at PythonMain.Main > > > > TIA, > > > > Hank Fay > > _______________________________________________ > 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 hank at prosysplus.com Tue May 18 20:10:59 2010 From: hank at prosysplus.com (Hank Fay) Date: Tue, 18 May 2010 14:10:59 -0400 Subject: [IronPython] .Net attributes/decorators Message-ID: In reviewing the discussion of .Net decorators in the list (thank you Google Groups), I did not come across a discussion of what I saw as the central issue: is IronPython to be a Superset of Python (every Python program will run in IronPython, not every IronPython program will run in Python), or is IronPython to be an equivalent set (every Python program will run in IPy, and every IPy will run in Python). Has there been a discernment on this issue? For me, coming from a non-Python world, it makes sense to view IPy as a superset of Python. This perspective would, e.g., allow the use of .Net decorators on classes (which in turn would facilitate returning .Net objects). I've read about the ways of using __clrtype__ to do this in a Pythonic manner. My interest is in simplicity and clarity in my programs, rather than maintaining two-way compatibility (which I could not port to Python, in any case, for a .Net program using .Net features). thanks, Hank Fay -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.p.lepisto at intel.com Tue May 18 21:28:01 2010 From: stephen.p.lepisto at intel.com (Lepisto, Stephen P) Date: Tue, 18 May 2010 12:28:01 -0700 Subject: [IronPython] .Net attributes/decorators In-Reply-To: References: Message-ID: <6AF28EB9F93A354894F2F3916DF6F96E0CA9879C61@orsmsx510.amr.corp.intel.com> Personally, I consider python (CPython) and IronPython as different flavors of the same language. Python has a near ubiquitous presence on all platforms and has access to an enormous library of add-ons. IronPython makes accessing the .Net world seamless and opens up access to the enormous .Net Framework libraries and third-party assemblies. I can take my pythonic skills from one environment to the other, much the same way I can take my C or C++ skills from one compiler/OS to another. The python.net plug-in for CPython provides much of the access to .Net but it is not as seamless as IronPython and definitely not as fast. But it is a useful tool for writing python code that must run in CPython and IronPython while still providing access to .Net assemblies. IronPython is growing in functionality all the time and it won't be long before it can seamlessly support third-party DLLs of compiled code. So the two worlds of CPython and IronPython are converging, building on the common ground that is the python language. Is one better than the other? Like any choice of language, it all depends on what you need to accomplish. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Hank Fay Sent: Tuesday, May 18, 2010 11:11 AM To: Discussion of IronPython Subject: [IronPython] .Net attributes/decorators In reviewing the discussion of .Net decorators in the list (thank you Google Groups), I did not come across a discussion of what I saw as the central issue: is IronPython to be a Superset of Python (every Python program will run in IronPython, not every IronPython program will run in Python), or is IronPython to be an equivalent set (every Python program will run in IPy, and every IPy will run in Python). Has there been a discernment on this issue? For me, coming from a non-Python world, it makes sense to view IPy as a superset of Python. This perspective would, e.g., allow the use of .Net decorators on classes (which in turn would facilitate returning .Net objects). I've read about the ways of using __clrtype__ to do this in a Pythonic manner. My interest is in simplicity and clarity in my programs, rather than maintaining two-way compatibility (which I could not port to Python, in any case, for a .Net program using .Net features). thanks, Hank Fay -------------- next part -------------- An HTML attachment was scrubbed... URL: From vga1232 at yahoo.com Tue May 18 22:06:07 2010 From: vga1232 at yahoo.com (vga vga) Date: Tue, 18 May 2010 13:06:07 -0700 (PDT) Subject: [IronPython] Trying to get started with IronPython Message-ID: <738007.67904.qm@web58103.mail.re3.yahoo.com> Hello, I'm trying to get started with web developing, I have Apache 2.2 installed on an XP virtual machine and working for basic html. I have latest IronPython installed and NET4. I've dropped the dlr-20100305.js , the xap and the 2 slvx files in my htdocs, and my index.html contains : On my page I see the button but also : TypeError: unsupported operand type(s) for +=: 'NoneType' and 'function' for the last line. Important : I haven't configured Apache to recognize python code. I guess I need to declare a mime type or something ? From dinov at microsoft.com Tue May 18 22:50:38 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 18 May 2010 20:50:38 +0000 Subject: [IronPython] .Net attributes/decorators In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD3967A577@TK5EX14MBXC116.redmond.corp.microsoft.com> The answer is kind of both. When it comes to the core language grammar we are (and I believe will always be) an equivalent set. That's rather important in that any code which is .NET specific can still be parsed by other Python implementations and therefore you can do various if I'm running on IronPython do this else if I'm on Jython do that or if I'm on CPython do something else - which is a fairly common pattern and even shows up in the standard library. When it comes to the various builtin types we intend to be a superset but that superset is only available after the user has specifically opted in to IronPython. So let's look at some examples how this has played out. To add generic support we used Python's existing indexing support rather than adding parsing support for something like Dictionary which would have matched C#. But at the same time we don't want to modify the core objects too much - for example a future version of CPython could choose to add indexing support to built-in functions to add some new feature of their own. Therefore our built-in functions which are generic are actually a subtype of the normal built-in function type and add indexing. Our normal built-in functions don't support indexing (types/generic types actually still need this treatment of not having indexing by default but I haven't gotten around to fixing that one yet). And of course we try and make sure that all of the extensions that we do offer are only available on an opt-in basis and that opt-in basis is per-module rather than tainting all code in the interpreter. That enables some code to be Python specific and other code to be Ipy specific. That's done via "import clr" (or importing any other .NET namespace actually) which makes any additional attributes that we've added to types available (for example __clrtype__ is not visible until you do an import clr). That enables us to expose things which are .NET specific but still allows pure Python code to run without seeing anything change - so for example if some code as doing dir() it's not going to freak out because there's some unexpected attributes. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Hank Fay Sent: Tuesday, May 18, 2010 11:11 AM To: Discussion of IronPython Subject: [IronPython] .Net attributes/decorators In reviewing the discussion of .Net decorators in the list (thank you Google Groups), I did not come across a discussion of what I saw as the central issue: is IronPython to be a Superset of Python (every Python program will run in IronPython, not every IronPython program will run in Python), or is IronPython to be an equivalent set (every Python program will run in IPy, and every IPy will run in Python). Has there been a discernment on this issue? For me, coming from a non-Python world, it makes sense to view IPy as a superset of Python. This perspective would, e.g., allow the use of .Net decorators on classes (which in turn would facilitate returning .Net objects). I've read about the ways of using __clrtype__ to do this in a Pythonic manner. My interest is in simplicity and clarity in my programs, rather than maintaining two-way compatibility (which I could not port to Python, in any case, for a .Net program using .Net features). thanks, Hank Fay -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Tue May 18 23:29:21 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 18 May 2010 21:29:21 +0000 Subject: [IronPython] Problems with 'unbound-class-instance' method In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD39674207@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD3967A7F8@TK5EX14MBXC116.redmond.corp.microsoft.com> Is the .NET type of the EventManager property/field strongly typed to an IEventManager interface or is it strongly typed to MarshalByRefObject or something else? I would assume it is but can't find any documentation on the web for these APIs. Do you have an example of consuming them from C# or VB.NET? You could also try import clr; clr.Convert(RemoteServerApi.EventManager, IEventManager)but I'd be a little surprised if that worked - it might though if there was some implicit/explicit conversion to the interface type. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Okko Willeboordse Sent: Tuesday, May 18, 2010 12:43 AM To: Discussion of IronPython Subject: Re: [IronPython] Problems with 'unbound-class-instance' method Thanks, I tried the typedproxy but failed. Maybe I got it wrong; I do; EventManager = typedproxy(RemoteServerApi.EventManager, Bosch.Vms.SDK.IEventManager) Then; EventManager.GetAllEventTypes() This results in exact the same error as; Bosch.Vms.SDK.IEventManager.GetAllEventTypes(RemoteServerApi.EventManager) Namely; TypeError: expected IEventManager, got MarshalByRefObject Se below Kind regards, import traceback import clr clr.AddReference("Bosch.Vms.SDK") import Bosch.Vms.SDK class typedproxy(object): __slots__ = ['obj', 'proxyType'] def __init__(self, obj, proxyType): self.obj = obj self.proxyType = proxyType def __getattribute__(self, attr): proxyType = object.__getattribute__(self, 'proxyType') obj = object.__getattribute__(self, 'obj') return getattr(proxyType, attr).__get__(obj, proxyType) # RemoteServerApi constructor instantiates an object implementing a Bosch.Vms.SDK.IEventManager # interface RemoteServerApi = Bosch.Vms.SDK.RemoteServerApi("10.119.33.241:5390", "Admin", "") # RemoteServerApi holds a reference to the object implementing a Bosch.Vms.SDK.IEventManager # interface. This reference is of type MarshalByRefObject. print type(RemoteServerApi.EventManager) # How to call a method of EventManager through MarshalByRefObject? print Bosch.Vms.SDK.IEventManager.GetAllEventTypes try: # Try the naive approach. RemoteServerApi.EventManager.GetAllEventTypes() except: # Obviously fails because MarshalByRefObject instances do not support reflection. # AttributeError: 'MarshalByRefObject' object has no attribute 'GetAllEventTypes' print traceback.format_exc() try: # Try the 'unbound-class-instance' method Bosch.Vms.SDK.IEventManager.GetAllEventTypes(RemoteServerApi.EventManager) except: # TypeError: expected IEventManager, got MarshalByRefObject print traceback.format_exc() try: # Okay I need a IEventManager instance Bosch.Vms.SDK.IEventManager(RemoteServerApi.EventManager) except: # TypeError: Cannot create instances of IEventManager because it is abstract print traceback.format_exc() EventManager = typedproxy(RemoteServerApi.EventManager, Bosch.Vms.SDK.IEventManager) try: print EventManager.GetAllEventTypes() except: print traceback.format_exc() # Traceback (most recent call last): # File "bvms.py", line 50, in # print EventManager.GetAllEventTypes() # File "bvms.py", line 15, in __getattribute__ # return getattr(proxyType, attr).__get__(obj, proxyType) # TypeError: expected IEventManager, got MarshalByRefObject On Mon, May 17, 2010 at 10:03 PM, Dino Viehland > wrote: Can you try the typedproxy class which is on this bug: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=470 ? It should work to wrap the object and let you access the various attributes that you want to by calling through the type (in this case the interface type - you'd pass IEventManager for the 2nd argument to the typedproxy). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Okko Willeboordse Sent: Monday, May 17, 2010 9:36 AM To: users at lists.ironpython.com Subject: [IronPython] Problems with 'unbound-class-instance' method Hello, I have some problems accessing an object. This object is instantiated by another object. This other object holds a reference to the object. This reference is of type MarshalByRefObject Obviously I cannot access the object through MarshalByRefObject. This must be done using the 'unbound-class-instance' method (please correct me if I am wrong) For this method you need to instantiate the interface type object. However the interface is abstract! How to cope with this. Please find sample code below; import traceback import clr clr.AddReference("Bosch.Vms.SDK") import Bosch.Vms.SDK # RemoteServerApi constructor instantiates an object implementing a Bosch.Vms.SDK.IEventManager # interface RemoteServerApi = Bosch.Vms.SDK.RemoteServerApi("xxxx", "xxxx", "xxxx") # RemoteServerApi holds a reference to the object implementing a Bosch.Vms.SDK.IEventManager # interface. This reference is of type MarshalByRefObject. print type(RemoteServerApi.EventManager) # How to call a method of EventManager through MarshalByRefObject? print Bosch.Vms.SDK.IEventManager.GetAllEventTypes try: # Try the naive approach. RemoteServerApi.EventManager.GetAllEventTypes() except: # Obviously fails because MarshalByRefObject instances do not support reflection. # AttributeError: 'MarshalByRefObject' object has no attribute 'GetAllEventTypes' print traceback.format_exc() try: # Try the 'unbound-class-instance' method Bosch.Vms.SDK.IEventManager.GetAllEventTypes(RemoteServerApi.EventManager) except: # TypeError: expected IEventManager, got MarshalByRefObject print traceback.format_exc() try: # Okay I need an IEventManager instance Bosch.Vms.SDK.IEventManager(RemoteServerApi.EventManager) except: # TypeError: Cannot create instances of IEventManager because it is abstract print traceback.format_exc() Okko Willeboordse _______________________________________________ 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 May 18 23:40:59 2010 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 18 May 2010 21:40:59 +0000 Subject: [IronPython] Trying to get started with IronPython In-Reply-To: <738007.67904.qm@web58103.mail.re3.yahoo.com> References: <738007.67904.qm@web58103.mail.re3.yahoo.com> Message-ID: <1B42307CD4AADD438CDDA2FE1121CC92173968C2@TK5EX14MBXC138.redmond.corp.microsoft.com> document.button.onclick tried to access a property on the "button" object, which returns None. You need to do "document.button.events.onclick += button_onclick" (see http://ironpython.net/browser/docs.html#event-handling-from-code). ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of vga vga > Sent: Tuesday, May 18, 2010 1:06 PM > To: users at lists.ironpython.com > Subject: [IronPython] Trying to get started with IronPython > > Hello, I'm trying to get started with web developing, I have Apache 2.2 > installed on an XP virtual machine and working for basic html. I have latest > IronPython installed and NET4. > > I've dropped the dlr-20100305.js , the xap and the 2 slvx files in my htdocs, > and my index.html contains : > > > > > > > On my page I see the button but also : TypeError: unsupported operand > type(s) for +=: 'NoneType' and 'function' for the last line. > > Important : I haven't configured Apache to recognize python code. I guess I > need to declare a mime type or something ? > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at microsoft.com Wed May 19 01:31:15 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 18 May 2010 23:31:15 +0000 Subject: [IronPython] Cannot import module from .dll directly In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD3967B0D8@TK5EX14MBXC116.redmond.corp.microsoft.com> Jeff wrote: > When CPython is searching for modules to import, it will check all the > folders in sys.path for .py, .pyc/.pyo, and .pyd/.dll files that match > the requested import. For IronPython, .py is obviously supported, > .pyc/.pyo are obviously(?) not, and neither are .pyd/.dll. Is there > any particular reason that IronPython does not try to find .dll files > when importing? There are many Python libraries that work this way > (PIL was the one that prompted this, but PyCrypto works in a similar > way) and it's easier than having to clr.AddReference assemblies. > > To be clear, I'm taking about a layout like this: > > foo > +-- __init__.py > +-- _foo.dll > > where __init__.py contains: > from _foo import * > > and _foo.dll is an IronPython module similar to: > > [assembly: IronPython.Runtime.PythonModule("_foo", > typeof(IronPython.Foo.Foo))] > > namespace IronPython.Foo > { > public class Foo > { > public int Frob(int x) { return x + 42; } > } > } > > Currently, running this on IRonPython results in: > > >>> import foo > Traceback (most recent call last): > File "", line 1, in > File "...\foo\__init__.py", line 1, in > ImportError: No module named _foo > > Supporting this would make it much easier to port libraries that > require a native component; in many cases, the Python code could be > used as-is and only the "native" code swapped out. What if we required the extension to be named "_foo.ipyd" or "_foo.ipe" or something along those lines which would be similar to CPython's .pyd extension? That way we wouldn't be querying random DLLs that might or might not load and might have unexpected side effects. From dinov at microsoft.com Wed May 19 01:33:26 2010 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 18 May 2010 23:33:26 +0000 Subject: [IronPython] IronPy Tools for VS - Projects In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD39674231@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD3967B0F3@TK5EX14MBXC116.redmond.corp.microsoft.com> Steve wrote: > Is it possible to have the directory based projects 'implied' when a > single file is opened (TextMate http://macromates.com/ style)? Because > I agree with Jeff here that loading existing projects is dead simple > when you can just add a pyproj. Though the '...from existing code' > option would be plenty IMHO. Ok, we discussed internally and we're going to drop the directory based project system. Our plan is to have a normal project system like VS has, support File->New->Project from Existing Code, and continue to iterate on the implicit project system that we already have. That will change in that it'll have UI in solution explorer (this has always been the plan but it needs to be implemented). The implicit project also won't automatically detect new/deleted files that come from external sources but we'll support using the refresh button to bring it up to date. As always if anyone has feedback on the new plan we'd love to hear it! From hank at prosysplus.com Wed May 19 06:11:31 2010 From: hank at prosysplus.com (Hank Fay) Date: Wed, 19 May 2010 00:11:31 -0400 Subject: [IronPython] .Net attributes/decorators In-Reply-To: <1A472770E042064698CB5ADC83A12ACD3967A577@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD3967A577@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: Thanks for the explanation. I like the "opt in" idea -- taken to its fullest, that could allow .Net-style decorators on an opt-in module basis, could it not? And I see the point about the "many platforms in one codebase" approach you describe as a way of enabling the larger Python community. By pursuing both approaches, the many-in-one and the opt-in to the fullest, I think IPy can continue to fulfill what I understand now to have been the original goal, of serving the Python community, while also providing an enticing alternative to static .Net languages for non-Pythonistas looking for a more comfortable home. In the meantime, I know where to go when I get stuck on how to use ClrType.py to use .Net attributes. You probably know where I can go, too, but we're probably thinking of different places. thanks again, Hank On Tue, May 18, 2010 at 4:50 PM, Dino Viehland wrote: > The answer is kind of both. When it comes to the core language grammar > we are (and I believe will always be) an equivalent set. That?s rather > important in that any code which is .NET specific can still be parsed by > other Python implementations and therefore you can do various if I?m running > on IronPython do this else if I?m on Jython do that or if I?m on CPython do > something else ? which is a fairly common pattern and even shows up in the > standard library. When it comes to the various builtin types we intend to > be a superset but that superset is only available after the user has > specifically opted in to IronPython. > > > > So let?s look at some examples how this has played out. To add generic > support we used Python?s existing indexing support rather than adding > parsing support for something like Dictionary which would have > matched C#. But at the same time we don?t want to modify the core objects > too much ? for example a future version of CPython could choose to add > indexing support to built-in functions to add some new feature of their > own. Therefore our built-in functions which are generic are actually a > subtype of the normal built-in function type and add indexing. Our normal > built-in functions don?t support indexing (types/generic types actually > still need this treatment of not having indexing by default but I haven?t > gotten around to fixing that one yet). > > > > And of course we try and make sure that all of the extensions that we do > offer are only available on an opt-in basis and that opt-in basis is > per-module rather than tainting all code in the interpreter. That enables > some code to be Python specific and other code to be Ipy specific. That?s > done via ?import clr? (or importing any other .NET namespace actually) which > makes any additional attributes that we?ve added to types available (for > example __clrtype__ is not visible until you do an import clr). That > enables us to expose things which are .NET specific but still allows pure > Python code to run without seeing anything change ? so for example if some > code as doing dir() it?s not going to freak out because there?s some > unexpected attributes. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Hank Fay > *Sent:* Tuesday, May 18, 2010 11:11 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] .Net attributes/decorators > > > > In reviewing the discussion of .Net decorators in the list (thank you > Google Groups), I did not come across a discussion of what I saw as the > central issue: is IronPython to be a Superset of Python (every Python > program will run in IronPython, not every IronPython program will run in > Python), or is IronPython to be an equivalent set (every Python program will > run in IPy, and every IPy will run in Python). > > > > Has there been a discernment on this issue? > > > > For me, coming from a non-Python world, it makes sense to view IPy as a > superset of Python. This perspective would, e.g., allow the use of .Net > decorators on classes (which in turn would facilitate returning .Net > objects). I've read about the ways of using __clrtype__ to do this in a > Pythonic manner. My interest is in simplicity and clarity in my > programs, rather than maintaining two-way compatibility (which I could not > port to Python, in any case, for a .Net program using .Net features). > > > > thanks, > > > > Hank Fay > > _______________________________________________ > 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 okko.willeboordse at gmail.com Wed May 19 11:54:02 2010 From: okko.willeboordse at gmail.com (Okko Willeboordse) Date: Wed, 19 May 2010 02:54:02 -0700 (PDT) Subject: [IronPython] Problems with 'unbound-class-instance' method In-Reply-To: <1A472770E042064698CB5ADC83A12ACD3967A7F8@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD39674207@TK5EX14MBXC116.redmond.corp.microsoft.com> <1A472770E042064698CB5ADC83A12ACD3967A7F8@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: Today I have no access to the system so I can't check clr.Convert(RemoteServerApi.EventManager, IEventManager) I have no access to the sources; The .NET client app does; RemoteServerApi sApi; sApi = new RemoteServerApi(); IEnumerable DevList = sApi.EventManager.GetAllEventTypes(); When I ask VS to 'Go To Definition' I get; public class RemoteServerApi : IServerApi { ... public IDeviceManager DeviceManager { get; } public virtual IEventManager EventManager { get; } ... } public interface IEventManager { IEnumerable GetAllEventTypes(); ... From jdhardy at gmail.com Wed May 19 16:38:43 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Wed, 19 May 2010 08:38:43 -0600 Subject: [IronPython] Cannot import module from .dll directly In-Reply-To: <1A472770E042064698CB5ADC83A12ACD3967B0D8@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD3967B0D8@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: On Tue, May 18, 2010 at 5:31 PM, Dino Viehland wrote: > What if we required the extension to be named "_foo.ipyd" or "_foo.ipe" > or something along those lines which would be similar to CPython's > .pyd extension? ?That way we wouldn't be querying random DLLs that > might or might not load and might have unexpected side effects. Apparently CPython will only load .pyd and not .dll as of 2.5 (which I just discovered), so it sounds like that is the way to go. I vote for .ipyd. Unfortunately there doesn't seem to be any way to change the extension of a class library from .dll (other than a post-build step), so you should go bug the VS team about that :) - Jeff From fuzzyman at voidspace.org.uk Wed May 19 20:08:29 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 19 May 2010 19:08:29 +0100 Subject: [IronPython] Some More Newbie Questions In-Reply-To: <1A472770E042064698CB5ADC83A12ACD39611BBD@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <2C5C90D76B65DC47A65001FD937014B20117C356@WSWD43.VishayPG.com> <1A472770E042064698CB5ADC83A12ACD39611BBD@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4BF4291D.5070304@voidspace.org.uk> On 11/05/2010 21:50, Dino Viehland wrote: > Matt Funke: > >> In IronPython Tools for Visual Studio 2010, how do you make it clear >> where the location of a file to be included is? I have this line that >> trips up the execution: >> >> from avalon import * >> >> ... even though avalon.py is in the same directory, and that directory >> is pointed to by the Search Path. It throws an ImportError, insisting >> that there is "No module named avalon". Is there some other thing I >> need to point at this that I'm missing? >> > How are you launching the app? Is it via the interactive window or are you > doing a start w/ or w/o debugger? It looks like we don't set the path in > the interactive window but we do otherwise. > > Of course being in the same directory (as the start file) should mean > that it's available for import anyway. If you could do: > > import System > import sys > print System.Environment.CurrentDirectory, sys.path > > and see if those values are the correct dir for your project and include > the directories you've setup in the search path. > > I'm also not sure how I feel about setting the search path via the UI > in general. I'm a little concerned that it'll make it too easy to create > scripts that work when launched in VS but not outside of VS. So if anyone > has any feedback on how this should be handled I'd love to hear it. > > Hmm... Wing lets you set the search paths for the IDE so that it can correctly find modules / packages for intellisense (etc). It *doesn't* automatically add these path entries to sys.path when you run under debugging though. 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 zachc at microsoft.com Wed May 19 22:05:26 2010 From: zachc at microsoft.com (Zach Crowell) Date: Wed, 19 May 2010 20:05:26 +0000 Subject: [IronPython] Cannot import module from .dll directly In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD3967B0D8@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <96E729AD36208D4DA2A5909C89A1C367138FE784@TK5EX14MBXW601.wingroup.windeploy.ntdev.microsoft.com> > Unfortunately there doesn't seem to be any way to change the extension of > a class library from .dll (other than a post-build step), so you should go bug > the VS team about that :) The property controls this in the C# build system, so you can put something like ".ipyd" in the .csproj file. The support for this isn't perfect (no exposure in the VS UI), but it should work. From tcronin at asrclkrec.com Wed May 19 22:38:06 2010 From: tcronin at asrclkrec.com (Cronin, Ted) Date: Wed, 19 May 2010 13:38:06 -0700 Subject: [IronPython] WPF Controls with Ipy In-Reply-To: <96E729AD36208D4DA2A5909C89A1C367138FE784@TK5EX14MBXW601.wingroup.windeploy.ntdev.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD3967B0D8@TK5EX14MBXC116.redmond.corp.microsoft.com> <96E729AD36208D4DA2A5909C89A1C367138FE784@TK5EX14MBXW601.wingroup.windeploy.ntdev.microsoft.com> Message-ID: Trying to use third party controls with VS Tools for Ipy with WPF is not working as expected. I can add a third party control if the language is c#, but when I try and do the same thing using IronPython with WPF, the third party controls do not get added to the designer as I expect. The VS interface grays out for a second, and then it goes back to normal with nothing being added. Ted Cronin ACR ValueGIS (951) 955 - 0487 From simon.segal at bigpond.com Thu May 20 07:08:26 2010 From: simon.segal at bigpond.com (Simon Segal) Date: Thu, 20 May 2010 15:08:26 +1000 Subject: [IronPython] WPF Controls with Ipy In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD3967B0D8@TK5EX14MBXC116.redmond.corp.microsoft.com> <96E729AD36208D4DA2A5909C89A1C367138FE784@TK5EX14MBXW601.wingroup.windeploy.ntdev.microsoft.com> Message-ID: I'm currently using Blend to do all my layout work for IP / WPF apps. I synchronize the xaml from one project to another, it's a pretty ugly hack but I hate doing long winded layout design in VS anyway. http://www.simonsegal.net/blog/2010/05/09/ironpython-tools-for-visual-studio-with-expression-blend/ HIH Simon On Thu, May 20, 2010 at 6:38 AM, Cronin, Ted wrote: > Trying to use third party controls with VS Tools for Ipy with WPF is not > working as expected. I can add a third party control if the language is c#, > but when I try and do the same thing using IronPython with WPF, the third > party controls do not get added to the designer as I expect. The VS > interface grays out for a second, and then it goes back to normal with > nothing being added. > > Ted Cronin > ACR ValueGIS > (951) 955 - 0487 > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Regards, Simon Segal MCSD, MCDBA, MCSE, MCTS - Biztalk Mobile: 0414854913 Email: simon.segal at simonsegal.net Web Site: http://www.simonsegal.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From cenovsky at bakalari.cz Thu May 20 09:37:19 2010 From: cenovsky at bakalari.cz (cenovsky at bakalari.cz) Date: Thu, 20 May 2010 09:37:19 +0200 Subject: [IronPython] Add reference to .dll located in above directory Message-ID: <20100520093719.1080755fqpch24z4@webmail.active24.cz> Hi all, I have the following directory structure: root |-- PythonModules.dll |-- module |-- foo.py I want to add reference to PythonModules.dll from foo.py. I have the compiled Python libraries there I need to use in foo.py. I have not successfully make this work with sys.path: import clr import sys sys.path.append('root') # this is full path to root clr.AddReference('PythonModules') Traceback (most recent call last): File "C:\test\modul\t.py", line 4, in IOError: System.IO.IOException: Could not add reference to assembly PythonModules at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args, Boolean& shouldOptimize) at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(CallSite site, CodeContext context, TFuncType func, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at __main__$1.__main__(FunctionCode $functionCode) in C:\test\modul\t.py:line 14 at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String fileName)>>> I get the same error when I use clr.AddReferenceToFile('PythonModules.dll'). The only way how could I make this work is the following: import clr import sys clr.AddReferenceToFileAndPath('..\\PythonModules') This is not suitable for me as I want to run foo.py from different directories. Is it a bug? Or do I something wrong? -- -- Luk?? From merllab at microsoft.com Thu May 20 17:52:55 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Thu, 20 May 2010 08:52:55 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <5a639caa-62c4-47b2-9d4d-ac5ed684f922@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/66213. MODIFIED SOURCES $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Ast/Expression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Ast/IndexExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Actions/CallSite.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Ast/ExpressionStringBuilder.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Ast/GotoExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Ast/UnaryExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Ast/NewArrayExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Ast/MethodCallExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Utils/CollectionExtensions.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs From dinov at microsoft.com Thu May 20 19:38:39 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 20 May 2010 17:38:39 +0000 Subject: [IronPython] Add reference to .dll located in above directory In-Reply-To: <20100520093719.1080755fqpch24z4@webmail.active24.cz> References: <20100520093719.1080755fqpch24z4@webmail.active24.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD48917229@TK5EX14MBXC118.redmond.corp.microsoft.com> Instead of sys.path.append('root') can you append the full path to sys.path? That seems to work for me, I have: Directory of F:\Product\1\Dlr\x 05/20/2010 10:34 AM . 05/20/2010 10:34 AM .. 05/20/2010 10:30 AM module 05/20/2010 10:30 AM 64 PythonModules.cs 05/20/2010 10:34 AM 3,072 PythonModules.dll 2 File(s) 3,136 bytes Directory of F:\Product\1\Dlr\x\module 05/20/2010 10:30 AM . 05/20/2010 10:30 AM .. 05/20/2010 10:36 AM 97 foo.py 1 File(s) 97 bytes Foo.py contains: import clr import sys sys.path.append(r'F:\Product\1\Dlr\x') clr.AddReference('PythonModules') and both of these work: 10:37:08.72 F:\Product\1\Dlr > ipy x\module\foo.py 10:37:48.96 F:\Product\1\Dlr > cd x 10:37:50.11 F:\Product\1\Dlr\x > ipy module\foo.py Also you could calculate the path using __file__ from foo.py. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of cenovsky at bakalari.cz > Sent: Thursday, May 20, 2010 12:37 AM > To: Discussion of IronPython > Subject: [IronPython] Add reference to .dll located in above directory > > Hi all, > I have the following directory structure: > > root > |-- PythonModules.dll > |-- module > |-- foo.py > > I want to add reference to PythonModules.dll from foo.py. I have the > compiled Python libraries there I need to use in foo.py. > > I have not successfully make this work with sys.path: > > import clr > import sys > sys.path.append('root') # this is full path to root > clr.AddReference('PythonModules') > > Traceback (most recent call last): > File "C:\test\modul\t.py", line 4, in > IOError: System.IO.IOException: Could not add reference to assembly > PythonModules > at > Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] > args, Boolean& shouldOptimize) > at > IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(CallSit > e site, CodeContext context, TFuncType func, T0 > arg0) > at > System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, > T0 arg0, T1 arg1, T2 arg2) > at __main__$1.__main__(FunctionCode $functionCode) in > C:\test\modul\t.py:line 14 > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) > at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) > at IronPython.Hosting.PythonCommandLine.RunFile(String fileName)>>> > > I get the same error when I use clr.AddReferenceToFile('PythonModules.dll'). > > The only way how could I make this work is the following: > > import clr > import sys > clr.AddReferenceToFileAndPath('..\\PythonModules') > > This is not suitable for me as I want to run foo.py from different > directories. > > Is it a bug? Or do I something wrong? > > -- > -- Luk?? > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From cenovsky at bakalari.cz Thu May 20 20:53:48 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Thu, 20 May 2010 20:53:48 +0200 Subject: [IronPython] Add reference to .dll located in above directory In-Reply-To: <1A472770E042064698CB5ADC83A12ACD48917229@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <20100520093719.1080755fqpch24z4@webmail.active24.cz> <1A472770E042064698CB5ADC83A12ACD48917229@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <4BF5853C.8090002@bakalari.cz> Dino Viehland wrote: > Instead of sys.path.append('root') can you append the full path to sys.path? > > That seems to work for me, I have: > > Directory of F:\Product\1\Dlr\x > > 05/20/2010 10:34 AM . > 05/20/2010 10:34 AM .. > 05/20/2010 10:30 AM module > 05/20/2010 10:30 AM 64 PythonModules.cs > 05/20/2010 10:34 AM 3,072 PythonModules.dll > 2 File(s) 3,136 bytes > > Directory of F:\Product\1\Dlr\x\module > > 05/20/2010 10:30 AM . > 05/20/2010 10:30 AM .. > 05/20/2010 10:36 AM 97 foo.py > 1 File(s) 97 bytes > > Foo.py contains: > > import clr > import sys > sys.path.append(r'F:\Product\1\Dlr\x') > clr.AddReference('PythonModules') > > and both of these work: > > 10:37:08.72 > F:\Product\1\Dlr > ipy x\module\foo.py > > 10:37:48.96 > F:\Product\1\Dlr > cd x > > 10:37:50.11 > F:\Product\1\Dlr\x > ipy module\foo.py > Yes, the above works for me too, but the following one does not: F:\Product\1\Dlr\x\module > ipy foo.py -- -- Luk?? > Also you could calculate the path using __file__ from foo.py. > > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of cenovsky at bakalari.cz >> Sent: Thursday, May 20, 2010 12:37 AM >> To: Discussion of IronPython >> Subject: [IronPython] Add reference to .dll located in above directory >> >> Hi all, >> I have the following directory structure: >> >> root >> |-- PythonModules.dll >> |-- module >> |-- foo.py >> >> I want to add reference to PythonModules.dll from foo.py. I have the >> compiled Python libraries there I need to use in foo.py. >> >> I have not successfully make this work with sys.path: >> >> import clr >> import sys >> sys.path.append('root') # this is full path to root >> clr.AddReference('PythonModules') >> >> Traceback (most recent call last): >> File "C:\test\modul\t.py", line 4, in >> IOError: System.IO.IOException: Could not add reference to assembly >> PythonModules >> at >> Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] >> args, Boolean& shouldOptimize) >> at >> IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(CallSit >> e site, CodeContext context, TFuncType func, T0 >> arg0) >> at >> System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, >> T0 arg0, T1 arg1, T2 arg2) >> at __main__$1.__main__(FunctionCode $functionCode) in >> C:\test\modul\t.py:line 14 >> at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) >> at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) >> at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) >> at IronPython.Hosting.PythonCommandLine.RunFile(String fileName)>>> >> >> I get the same error when I use clr.AddReferenceToFile('PythonModules.dll'). >> >> The only way how could I make this work is the following: >> >> import clr >> import sys >> clr.AddReferenceToFileAndPath('..\\PythonModules') >> >> This is not suitable for me as I want to run foo.py from different >> directories. >> >> Is it a bug? Or do I something wrong? >> >> -- >> -- 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 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu May 20 21:03:45 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 20 May 2010 19:03:45 +0000 Subject: [IronPython] Add reference to .dll located in above directory In-Reply-To: <4BF5853C.8090002@bakalari.cz> References: <20100520093719.1080755fqpch24z4@webmail.active24.cz> <1A472770E042064698CB5ADC83A12ACD48917229@TK5EX14MBXC118.redmond.corp.microsoft.com> <4BF5853C.8090002@bakalari.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD4891897B@TK5EX14MBXC118.redmond.corp.microsoft.com> Luk?? wrote: > Yes, the above works for me too, but the following one does not: > > F:\Product\1\Dlr\x\module > ipy foo.py Even with the full path added to sys.path instead of the relative path? Because this one works for me as well. From cenovsky at bakalari.cz Thu May 20 21:38:41 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Thu, 20 May 2010 21:38:41 +0200 Subject: [IronPython] Add reference to .dll located in above directory In-Reply-To: <1A472770E042064698CB5ADC83A12ACD4891897B@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <20100520093719.1080755fqpch24z4@webmail.active24.cz> <1A472770E042064698CB5ADC83A12ACD48917229@TK5EX14MBXC118.redmond.corp.microsoft.com> <4BF5853C.8090002@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD4891897B@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <4BF58FC1.8020707@bakalari.cz> Dino Viehland wrote: > Luk?? wrote: > >> Yes, the above works for me too, but the following one does not: >> >> F:\Product\1\Dlr\x\module > ipy foo.py >> > > Even with the full path added to sys.path instead of the relative > path? Because this one works for me as well. > This is strange. It does not work for me even with the full path. I run it on IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.4927 on Win7 64-bit Directory of M:\root 20.05.2010 21:29 . 20.05.2010 21:29 .. 19.03.2010 11:15 34 648 ipy.exe 19.03.2010 11:15 1 496 920 IronPython.dll 19.03.2010 11:15 464 728 IronPython.Modules.dll 19.03.2010 11:15 956 248 Microsoft.Dynamic.dll 19.03.2010 11:15 403 288 Microsoft.Scripting.Core.dll 19.03.2010 11:15 58 200 Microsoft.Scripting.Debugging.dll 19.03.2010 11:15 178 008 Microsoft.Scripting.dll 19.03.2010 11:15 11 096 Microsoft.Scripting.ExtensionAttribute.dll 20.05.2010 21:29 test 8 File(s) 3 603 136 bytes Directory of M:\root\test 20.05.2010 21:29 . 20.05.2010 21:29 .. 20.05.2010 21:20 4 608 bar.dll 20.05.2010 21:29 module 1 File(s) 4 608 bytes Directory of M:\root\test\module 20.05.2010 21:29 . 20.05.2010 21:29 .. 20.05.2010 21:21 128 foo.py 1 File(s) 128 bytes foo.py contains: import clr import sys sys.path.append(r'M:\root\test\bar.dll') clr.AddReference('bar') import bar print 'oki' bar.py contains: print 'from bar' M:\root\test>M:\root\ipy.exe module\foo.py from bar oki M:\root\test\module>M:\root\ipy.exe foo.py Traceback (most recent call last): File "foo.py", line 4, in IOError: System.IO.IOException: Could not add reference to assembly bar at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args, Boolean& shouldOptimize) at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(CallSite site, CodeContext context, TFuncType func, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at IronPython.Runtime.Types.BuiltinFunction.BuiltinMethodCaller`2.Call1(CallSite site, CodeContext context, TFuncType func, T0 arg0) at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) -- -- Luk?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Thu May 20 21:52:17 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 20 May 2010 19:52:17 +0000 Subject: [IronPython] Add reference to .dll located in above directory In-Reply-To: <4BF58FC1.8020707@bakalari.cz> References: <20100520093719.1080755fqpch24z4@webmail.active24.cz> <1A472770E042064698CB5ADC83A12ACD48917229@TK5EX14MBXC118.redmond.corp.microsoft.com> <4BF5853C.8090002@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD4891897B@TK5EX14MBXC118.redmond.corp.microsoft.com> <4BF58FC1.8020707@bakalari.cz> Message-ID: <1A472770E042064698CB5ADC83A12ACD48918D97@TK5EX14MBXC118.redmond.corp.microsoft.com> Ahh, you need to drop the "\bar.dll" from the path - it should just be the directory where bar.dll lives. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lukas Cenovsky Sent: Thursday, May 20, 2010 12:39 PM To: Discussion of IronPython Subject: Re: [IronPython] Add reference to .dll located in above directory Dino Viehland wrote: Luk?? wrote: Yes, the above works for me too, but the following one does not: F:\Product\1\Dlr\x\module > ipy foo.py Even with the full path added to sys.path instead of the relative path? Because this one works for me as well. This is strange. It does not work for me even with the full path. I run it on IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.4927 on Win7 64-bit Directory of M:\root 20.05.2010 21:29 . 20.05.2010 21:29 .. 19.03.2010 11:15 34 648 ipy.exe 19.03.2010 11:15 1 496 920 IronPython.dll 19.03.2010 11:15 464 728 IronPython.Modules.dll 19.03.2010 11:15 956 248 Microsoft.Dynamic.dll 19.03.2010 11:15 403 288 Microsoft.Scripting.Core.dll 19.03.2010 11:15 58 200 Microsoft.Scripting.Debugging.dll 19.03.2010 11:15 178 008 Microsoft.Scripting.dll 19.03.2010 11:15 11 096 Microsoft.Scripting.ExtensionAttribute.dll 20.05.2010 21:29 test 8 File(s) 3 603 136 bytes Directory of M:\root\test 20.05.2010 21:29 . 20.05.2010 21:29 .. 20.05.2010 21:20 4 608 bar.dll 20.05.2010 21:29 module 1 File(s) 4 608 bytes Directory of M:\root\test\module 20.05.2010 21:29 . 20.05.2010 21:29 .. 20.05.2010 21:21 128 foo.py 1 File(s) 128 bytes foo.py contains: import clr import sys sys.path.append(r'M:\root\test\bar.dll') clr.AddReference('bar') import bar print 'oki' bar.py contains: print 'from bar' M:\root\test>M:\root\ipy.exe module\foo.py from bar oki M:\root\test\module>M:\root\ipy.exe foo.py Traceback (most recent call last): File "foo.py", line 4, in IOError: System.IO.IOException: Could not add reference to assembly bar at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] args, Boolean& shouldOptimize) at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(CallSite site, CodeContext context, TFuncType func, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at IronPython.Runtime.Types.BuiltinFunction.BuiltinMethodCaller`2.Call1(CallSite site, CodeContext context, TFuncType func, T0 arg0) at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0) at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) -- -- Luk?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cenovsky at bakalari.cz Thu May 20 22:10:04 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Thu, 20 May 2010 22:10:04 +0200 Subject: [IronPython] Add reference to .dll located in above directory In-Reply-To: <1A472770E042064698CB5ADC83A12ACD48918D97@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <20100520093719.1080755fqpch24z4@webmail.active24.cz> <1A472770E042064698CB5ADC83A12ACD48917229@TK5EX14MBXC118.redmond.corp.microsoft.com> <4BF5853C.8090002@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD4891897B@TK5EX14MBXC118.redmond.corp.microsoft.com> <4BF58FC1.8020707@bakalari.cz> <1A472770E042064698CB5ADC83A12ACD48918D97@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <4BF5971C.30804@bakalari.cz> Oh! Such a stupid mistake... Thanks Dino! -- -- Luk?? Dino Viehland wrote: > > Ahh, you need to drop the "\bar.dll" from the path -- it should just > be the directory where bar.dll lives. > > > > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Lukas Cenovsky > *Sent:* Thursday, May 20, 2010 12:39 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Add reference to .dll located in above > directory > > > > Dino Viehland wrote: > > Luk?? wrote: > > > Yes, the above works for me too, but the following one does not: > > > > F:\Product\1\Dlr\x\module > ipy foo.py > > > > > Even with the full path added to sys.path instead of the relative > path? Because this one works for me as well. > > > > This is strange. It does not work for me even with the full path. > I run it on IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.4927 on > Win7 64-bit > > Directory of M:\root > > 20.05.2010 21:29 . > 20.05.2010 21:29 .. > 19.03.2010 11:15 34 648 ipy.exe > 19.03.2010 11:15 1 496 920 IronPython.dll > 19.03.2010 11:15 464 728 IronPython.Modules.dll > 19.03.2010 11:15 956 248 Microsoft.Dynamic.dll > 19.03.2010 11:15 403 288 Microsoft.Scripting.Core.dll > 19.03.2010 11:15 58 200 Microsoft.Scripting.Debugging.dll > 19.03.2010 11:15 178 008 Microsoft.Scripting.dll > 19.03.2010 11:15 11 096 > Microsoft.Scripting.ExtensionAttribute.dll > 20.05.2010 21:29 test > 8 File(s) 3 603 136 bytes > > Directory of M:\root\test > > 20.05.2010 21:29 . > 20.05.2010 21:29 .. > 20.05.2010 21:20 4 608 bar.dll > 20.05.2010 21:29 module > 1 File(s) 4 608 bytes > > Directory of M:\root\test\module > > 20.05.2010 21:29 . > 20.05.2010 21:29 .. > 20.05.2010 21:21 128 foo.py > 1 File(s) 128 bytes > > foo.py contains: > > import clr > import sys > sys.path.append(r'M:\root\test\bar.dll') > clr.AddReference('bar') > import bar > print 'oki' > > bar.py contains: > > print 'from bar' > > > M:\root\test>M:\root\ipy.exe module\foo.py > from bar > oki > > M:\root\test\module>M:\root\ipy.exe foo.py > Traceback (most recent call last): > File "foo.py", line 4, in > IOError: System.IO.IOException: Could not add reference to assembly bar > at > Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] > args, Boolean& shouldOptimize) > at > IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(CallSite > site, CodeContext context, TFuncType func, T0 arg0) > at > System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2) > at > IronPython.Runtime.Types.BuiltinFunction.BuiltinMethodCaller`2.Call1(CallSite > site, CodeContext context, TFuncType func, T0 arg0) > at > IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame > frame) > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame) > at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0) > at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) > at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) > at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) > at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) > > -- > -- 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 rohit.aggarwal at gmail.com Fri May 21 13:05:39 2010 From: rohit.aggarwal at gmail.com (Rohit Aggarwal) Date: Fri, 21 May 2010 12:05:39 +0100 Subject: [IronPython] Difference in pickle between IronPython 2.6 and CPython 2.6 Message-ID: Hello, The following program 'True' in IronPython and 'False' in CPython. -- import pickle data = {"msg":"Hello world"} print isinstance(pickle.dumps(data), unicode) -- Is that the intended behaviour? Thanks Rohit Aggarwal -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Fri May 21 13:11:33 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 21 May 2010 12:11:33 +0100 Subject: [IronPython] Difference in pickle between IronPython 2.6 and CPython 2.6 In-Reply-To: References: Message-ID: <4BF66A65.8070407@voidspace.org.uk> On 21/05/2010 12:05, Rohit Aggarwal wrote: > Hello, > The following program 'True' in IronPython and 'False' in CPython. > > -- > import pickle > > data = {"msg":"Hello world"} > print isinstance(pickle.dumps(data), unicode) > -- > > Is that the intended behaviour? > Yes. pickle.dumps returns a string and in IronPython strings are unicode. Michael > Thanks > Rohit Aggarwal > > > _______________________________________________ > 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 rohit.aggarwal at gmail.com Fri May 21 13:16:33 2010 From: rohit.aggarwal at gmail.com (Rohit Aggarwal) Date: Fri, 21 May 2010 12:16:33 +0100 Subject: [IronPython] Difference in pickle between IronPython 2.6 and CPython 2.6 In-Reply-To: <4BF66A65.8070407@voidspace.org.uk> References: <4BF66A65.8070407@voidspace.org.uk> Message-ID: Thanks Michael! On Fri, May 21, 2010 at 12:11 PM, Michael Foord wrote: > On 21/05/2010 12:05, Rohit Aggarwal wrote: > > Hello, > The following program 'True' in IronPython and 'False' in CPython. > > -- > import pickle > > data = {"msg":"Hello world"} > print isinstance(pickle.dumps(data), unicode) > -- > > Is that the intended behaviour? > > > Yes. pickle.dumps returns a string and in IronPython strings are unicode. > > Michael > > Thanks > Rohit Aggarwal > > > _______________________________________________ > Users mailing listUsers 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 tristanz at gmail.com Sun May 23 23:42:58 2010 From: tristanz at gmail.com (Tristan Zajonc) Date: Sun, 23 May 2010 17:42:58 -0400 Subject: [IronPython] IronPython Tools and standard library Message-ID: Hi, Two questions about using the Python26 libraries: 1. How do I enable intellisense for the Python standard library? Intellisense doesn't pick up C:\Python26\Lib if I add it to sys.path or the project Search Path. 2. How do I add C:\Python26\Lib\site-packages? I can add to sys.path manually, but adding site-packages to the project search path doesn't seem to work. I'm looking forward to the next iteration of IronPython Tools. Thanks, Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From vkhaskel at hotmail.com Mon May 24 06:08:49 2010 From: vkhaskel at hotmail.com (Vadim Khaskel) Date: Mon, 24 May 2010 04:08:49 +0000 Subject: [IronPython] adding event handler Message-ID: Hello everybody, I installed MS Visual Studio 2010 Shell and IronPython tools 1.0. I try to add event handler in WPF app and double click the UI component to get to the event handler template... nothing happens I'd appreciate if somebody could share with the fix / workaround / explanation. Best, Vadim _________________________________________________________________ The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4 -------------- next part -------------- An HTML attachment was scrubbed... URL: From merllab at microsoft.com Mon May 24 17:54:24 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 24 May 2010 08:54:24 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <94f1722d-b615-4b9d-b626-fc078c3b5059@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/66283. ADDED SOURCES $/IronPython/IronPython_Main/Languages/IronPython/IronPythonTest/LightExceptionTests.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/PythonException.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/TypeErrorException.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/AttributeErrorException.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/SysModuleDictionaryStorage.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Win32Native.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Utils/HybridReferenceDictionary.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/LightCheckAndThrowExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/LightExceptionRewriter.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/ILightExceptionAwareExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/LightExceptionConvertingExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/LightThrowExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/LightLambdaExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Actions/ILightExceptionBinder.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Runtime/LightExceptions.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Runtime/LightThrowingAttribute.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.Core.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.ExtensionAttribute.ruleset DELETED SOURCES $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Types/BuiltinFunction.Generated.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Migrated rules for Microsoft.Scripting.Core.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Migrated rules for Microsoft.Scripting.ExtensionAttribute.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Runtime/Operators.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Languages/IronPython/IronPythonTest/LightExceptionTests.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/PythonException.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/TypeErrorException.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/AttributeErrorException.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/SysModuleDictionaryStorage.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Win32Native.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/IronPython.Modules.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPython/IronPython.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPythonConsole/IronPythonConsole.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPythonWindow/IronPythonWindow.ruleset $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/mmap.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Modules/sys.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/ListComprehensionFor.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/DynamicGetMemberExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/ReducableDynamicExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Parser.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/OnDiskScriptCode.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/BytesWarningException.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/UnicodeException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/OSException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/PythonFunction.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/_ctypes/CFuncPtr.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/nt.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/SerializedScopeStatement.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/SyntaxWarningException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/MetaPythonType.Members.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/PythonSavableScriptCode.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/BufferException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/PythonExceptions.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/PythonBinaryOperationBinder.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/ConversionBinder.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/PythonGetMemberBinder.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/FunctionCode.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/IronPython.csproj $/IronPython/IronPython_Main/Languages/IronPython/Scripts/generate_dynamic_instructions.py $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/ForStatement.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/CallExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/TryStatement.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/LookupException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/FutureWarningException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/BindingWarnings.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Importer.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/PythonDynamicStackFrame.cs $/IronPython/IronPython_Main/Languages/IronPython/Scripts/generate_exceptions.py $/IronPython/IronPython_Main/Languages/IronPython/Scripts/generate_calls.py $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/IronPython.Modules.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPythonConsoleAny/IronPythonConsoleAny.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/ConstantExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/GeneratorRewriter.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Types/PythonType.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/EnvironmentException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/ObjectException.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/ParenthesisExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/cPickle.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/CollectableCompilationMode.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/ClassDefinition.cs $/IronPython/IronPython_Main/Hosts/Silverlight/Chiron/DetailsForm.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/BinaryExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython.Modules/socket.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/Node.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/CompilationMode.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/DynamicConvertExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/ScopeStatement.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/ImportStatement.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/AstMethods.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/LookupCompilationMode.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/PythonAst.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/PythonNameBinder.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/FunctionDefinition.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Utils/HybridReferenceDictionary.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/LightCheckAndThrowExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/LightExceptionRewriter.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/ILightExceptionAwareExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/LightExceptionConvertingExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/LightThrowExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/LightLambdaExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Actions/ILightExceptionBinder.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Runtime/LightExceptions.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Runtime/LightThrowingAttribute.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/SiteLocalStorageBuilder.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/MetaBuiltinMethodDescriptor.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/MetaBuiltinFunction.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/NewStringFormatter.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/PythonScriptCode.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/UncollectableCompilationMode.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/StopIterationException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/RuntimeException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/PendingDeprecationWarningException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/ContextArgBuilder.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/MetaPythonType.Calls.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/MetaUserObject.Members.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/PythonFunction.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Generator.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/PythonInvokeBinder.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/PythonDynamicExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/UnicodeTranslateException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/RuntimeWarningException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/IndentationException.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Types/BuiltinFunction.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/ImportWarningException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPythonWindow/IronPythonWindow.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/WarningInfo.cs $/IronPython/IronPython_Main/Languages/IronPython/Tests/regressions.py $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/UserWarningException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/UnicodeWarningException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Operations/StringOps.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/DeprecationWarningException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPythonConsole/IronPythonConsole.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/ClrModule.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/ReferenceException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/MetaPythonFunction.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Modules/Builtin.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/PythonBinder.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/FloatingPointException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/PythonProtocol.Operations.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPythonTest/EngineTest.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/BindingHelpers.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Profiler.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/ImportException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPythonTest/IronPythonTest.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/UncollectableCompilationMode.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPythonWindowAny/IronPythonWindowAny.csproj $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/PythonGlobal.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/RunnableScriptCode.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/ModuleOptions.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/CommonDictionaryStorage.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/ToDiskCompilationMode.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/AssertionException.Generated.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Exceptions/PythonExceptions.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/PythonProtocol.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/PythonGlobalVariableExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/RuntimeScriptCode.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Types/ReflectedEvent.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.Core.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Actions/Calls/KeywordArgBuilder.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Actions/Calls/ParamsArgBuilder.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Generation/CompilerHelpers.cs $/IronPython/IronPython_Main/Languages/IronPython/Tests/test_builtinfunc.py $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/LightDynamicExpression.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Interpreter/Instructions/InstructionList.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Interpreter/BranchLabel.cs $/IronPython/IronPython_Main/Languages/IronPython/Tests/Tools/baselines/sys.log $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.Core.csproj $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Actions/Calls/MethodCandidate.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Interpreter/Interpreter.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Interpreter/LightCompiler.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/FlowControlRewriter.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Ast/GeneratorRewriter.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Actions/Calls/ParamsDictArgBuilder.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Actions/Calls/DefaultArgBuilder.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Interpreter/LoopCompiler.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Actions/Calls/ArgBuilder.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Runtime/ScriptingRuntimeHelpers.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Hosting/Shell/Remote/RemoteCommandDispatcher.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/ComInterop/IDispatchComObject.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Actions/Calls/ReferenceArgBuilder.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/SourceFileContentProvider.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Interpreter/Instructions/LabelInfo.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Actions/DefaultBinder.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.csproj $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Interpreter/InterpretedFrame.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Actions/Calls/SimpleArgBuilder.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Utils/DynamicUtils.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Interpreter/LightDelegateCreator.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.ExtensionAttribute.ruleset $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/TokenCategorizer.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Interpreter/LightLambda.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Interpreter/LocalVariables.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Interpreter/Instructions/ControlFlowInstructions.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/ScriptHost.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.ExtensionAttribute.csproj $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Actions/Calls/BindingTarget.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Dynamic/Runtime/AmbiguousFileNameException.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/ScriptSource.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/SyntaxErrorException.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/ScriptScope.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/PlatformAdaptationLayer.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/ScriptIO.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/ErrorListener.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/SourceCodeReader.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting.Debugging/Microsoft.Scripting.Debugging.csproj $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/SymbolId.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/ObjectOperations.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/DocumentationOperations.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/SourceFileContentProvider.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/CompiledCode.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/ExceptionOperations.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/ScriptEngine.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Microsoft.Scripting.csproj $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/ScriptRuntime.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Microsoft.Scripting.ruleset CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1827690 Date: 5/22/2010 1:30:23 PM Removes the BindDelegate paths for calling built-in functions and instead uses the interpreter. Adds a new InterpretedBinder class for doing these bindings, invalidating the interpreted binding, and promoting to a compiled binding. Fixes an issue w/ the interpreter where we cannot interpret a method which is an instance call on a value type (because the call doesn?t properly mutate the value type). (Shelveset: interpetedbuiltinfunctionsfinal2;REDMOND\dinov | SNAP CheckinId: 10822) -------------------------------------------------------------------------------- Changeset Id: 1827425 Date: 5/21/2010 10:08:25 PM This is a pretty big change (and there?s more to be done to plumb the feature through)? It includes both the new light exception feature, some changes to IronPython exception handling to make it more efficient, and some other interpreter tweaks to make that more efficient as well, along with other fixes to support things we didn?t properly handle before. Overall we are now pretty competitive with CPython (we used to be about the same speed but something may have regressed as the finishing touches came in ? we?re now about 25% slower). Let?s start with the various DLR changes. First fixing things which were broken: FlowControlRewriter doesn?t properly handle cross block jumps. I?ve added a hack so that we can specifically handle the one sort of cross block jump we need to support now. GeneratorRewriter wasn?t properly handling assignments where the rhs is a label expression. We now get support for properly re-writing these. This also shows up over in the IronPython GeneratorRewriter as well. Fix a bug where CompileAsVoid wasn?t tracking our current label block Fix an issue in GenerateSystemCoreCsproj which was introduced when we changed from Merlin to DLR Fix an issue in run_host.cmd where our path is wrong preventing ipt from working Interpreter Efficiency changes: Added HybridReferenceDictionary for when we have a small number of label targets and parameters. Rather than hashing we store them in an array and spin through the array checking for pointer equality. When we get too many we spill over into a dictionary. Removed InterpreterFrame.FaultingInstruction ? it?s no longer used Removed LightCompiler?s special handling for MethodBase.GetCurrentMethod ? it?s no longer used Added singleton of empty locals so we don?t create empty arrays every time we enter a block w/o variables. Added support for LightLambdaExpression ? these don?t have all the validation of a normal lambda and can be light compiled w/o creating a LambdaExpression. As part of this we now flow lambda names around rather than holding onto the entire LambdaExpression. Removed SkipInterpretExpression and the ParameterVisitor ?these are no longer used. LightDynamicExpressions get a VisitChildren implementation which prevents them from getting reduced when they?re visited. They also get a virtual Rewrite method so that subclasses can customize re-writing and pass on any additional information they need. LightLambda: added code path for creating fast ctor?s, improved the general code path so that we cache Delegate.CreateDelegate calls instead of going through what was MakeRunMethodOrFastCtor every time. Made OffsetInstruction.Fixup non-virtual Added EmitDynamic overloads Other interpreter changes: Added some additional public surface area for people consuming the interpreter directly. Ok, onto the feature at hand? We add a new LightExceptions class which is the entry point for everything light exception related. It includes functions to re-write ASTs, to throw and check for light exceptions, and for producing helpers such as an expression which performs a call to a light-throwing method and wraps it in a check if it?s not consumed in a light throwing area. We introduce a bunch of new types and interfaces as well: ILightExceptionAwareExpression ? this is an expression which can be reduced in a way which enables it to support light exceptions. For example we have LightThrowingCallExpression which implements this. When this expression is normally reduced we reduce it to the method call plus a check and .NET throw. When it?s reduced in the light aware it?s reduced to check and light throw (which turns into a return or a branch to exception handling code). ILightExceptionBinder ? this represents a call site binder which either supports calling with light exceptions or can be turned into a binder which does. When we re-write an AST we check for dynamic nodes which contain this type of binder. If we find them we get the light aware binder, re-write the dynamic node, and add a check and light throw. LightThrowingCallExpression ? this is a public type which represents a method call to an API which will throw light exceptions. It implements ILightExceptionAwareExpression so that it gets properly reduced. There?s a bunch of new internal types as well: LightCheckAndThrowExpression: This is an expression which is used at the boundaries of light code. It checks to see if the expression is a light exception and if it is throws it. LightExceptionRewriteExpression: This class is an expression which reduces and lazily re-writes its contents so they?re light exception aware. This makes it cheap for us to mark the node as needing a re-write when producing the AST but not have the re-write occur until the node is reduced. It?s also ILightExceptionAwareExpression so that if it?s outer body gets re-written for light exceptions it?ll combine together with the inner body w/o throwing a real exception. LightExceptionRewriter: this is the core of the light exception system. It re-writes a non-light exception aware AST to one that is aware of light exceptions. There are two significant re-writes which happen here. The first is for an expression which may produce a light exception. Here we wrap this in a LightExceptionCheckExpression which does: If((_lastValue = expr), IsLightException(_lastValue)) { goto returnOrCurrentHandler(_lastValue); } else { _lastValue; } As we re-write the tree we keep track if we?re in a try block or not. As we do so the goto either goes to the outer label for the entire expression or it goes to the handler for the exception. We then re-write try blocks like this: goto tryDone( try { if (LightExceptions.IsLightException(_lastValue = someCall)) { goto ehLabel; } else { _lastValue } } catch(Exception e) { handler; } ) ehLabel: if ((e = GetLightException(_lastValue) as Exception)) != null) { handler; } else { // unhandled exception, propagate up, either: goto _returnValue(_lastValue); // if we weren't in a nested exception handler or if we were: goto _ehLabelOuter; } tryDone: // yields either the value of the try block or the real catch block // from the goto tryDone or it gets it's default value from ehLabel // which is branched to when an exception is detected. All of this combines together in the following way. We are creating segments of the call stack in which light exceptions are passed through rather than thrown. We do this via AST rewriting and using binders which are aware if they support light exceptions or not. We start by re-writing code which is likely to handle exceptions ? currently all Python code in a try body is considered likely to handle exceptions. Also if a piece of code sees over 20 exceptions then we?ll also re-write it. So we re-write one piece of code and it now all of its binders are marked as being light exception aware. So when we call to another python function we can use the light delegate target instead of the normal delegate target. And it can all chain together nicely. If a light exception reaches the outer boundary then it?s turned into a real exception. Finally all of the light exception support has interpreter support via instruction providers as well. This enables us to efficiently go from the produced AST to the interpreter without creating a bunch of intermediary DLR ASTs. So with that let?s go onto the Python changes. Of course Python is updated to use all of this stuff. That includes a few choice location where we implement light throwing methods (nt.stat, import, and making eval use light exception aware code as well), global variable access. FunctionCode gains a new delegate for light throwing exceptions. We also no longer register exec/eval code in our list of function codes (it?s going to go away immediately so there?s no chance it can be re-executes w/ a change to tracing) All binders are updated to throw an exception via a helper which checks to see if the binder is light exception aware and if so throws a light exception. Calls to built-in functions now check for LightThrowingAttribute and if it?s defined will add the check and re-throw if they?re not light throwing aware calls. Exceptions see a lot of changes. It turns out accessing the Data property of an exception is quite expensive. So now we have derived exceptions for all frequently thrown exception types. These exceptions implement IPythonAwareException which lets us store the data we need on the exception object w/o accessing the Data dictionary. This includes the exception frames and the trace back object. We also lose our PythonExceptions.ToClrHelper in favor of a field added to PythonType which gives us a delegate to convert exceptions. Going from .NET to Python uses IPythonAwareException if it?s available. This greatly speeds up the translation between Python and .NET. There?s also a bunch of simplification to our frame unification in PythonExceptions ? most of this code seems to be redundant w/ other frame unification code we have. Efficiency changes: We now use LightLambdaExpression rather than LambdaExpression. This saves us all of the validation. I?ve also switched the delegate type over to a non generic delegate type which is faster to create and faster to create the LambdaExpression from as well. We now use PythonDynamicExpression?s in more places and the virtuals for changing this on compilation mode are now ReduceDynamic instead of Reduce. Reduce now returns the light version if the args can handle it. Added IInstructionProvider implementation to ConstantExpression Simplified calls to UpdateStackTrace (removed method name, file name, and MethodBase ? these can all be derived from the function code object) Added fast access for sys.exc_type, sys.exc_traceback, and sys.exc_value so these aren?t really expensive as we handle exceptions (can be removed in IronPython 3k), add a SysModuleDictionaryStorage which specializes these. Simplified the error reporting for binary operations ? I believe this code was optimized for when we had auto-templating support in the DLR. Now that that is gone we may as well format the string before producing the rule. Small fixes: Getfilesystemencoding() now matches CPython and returns mbcs Fix a potential stack overflow for subclasses of CommonDictionaryStorage which calculate Count based on a call to GetItems() Fix an issue w/ returning the null value from CommonDictionaryStorage Fix an issue where we?re not re-calculating a function?s cached compatibility after updating it?s function code. (Shelveset: LightEhFinal3;REDMOND\dinov | SNAP CheckinId: 10820) From peter.masiar at gmail.com Mon May 24 18:34:20 2010 From: peter.masiar at gmail.com (Peter Masiar) Date: Mon, 24 May 2010 12:34:20 -0400 Subject: [IronPython] example of using IronPython with MS Access database (.mdb)? Message-ID: Gurus, I am trying to wrap my mind about how I can access MS Access database from IronPython. My apologies - I bet this was asked about zillion times, but of course "Access" is impossible to google. I believe that it is same thing as Jet engine, Access 2003 uses .mdb as file extension. I found http://www.ironpython.info/index.php/Databases_with_Odbc but AFAICT it uses MS SQL server. IronPython in Action book uses PostgreSQL. There are plenty of MySQL and SQLite examples, but I am stuck with Access (and want to get out - IronPython should be first step). I would also prefer stock IronPython install - I expect there should be a way to work with Access databases, right? Unless some other library provides much better functionality. Should be something trivial but I am confused. Any links to simple examples? Thank you -- ----- Peter From tenaciousb at gmail.com Mon May 24 18:41:06 2010 From: tenaciousb at gmail.com (Bill Fellows) Date: Mon, 24 May 2010 11:41:06 -0500 Subject: [IronPython] example of using IronPython with MS Access database (.mdb)? In-Reply-To: References: Message-ID: You should be able to use a standard OLE DB connection like what's described in http://www.ironpython.info/index.php/Oracle_&_OleDb and substitute the connection string pattern defined in http://www.connectionstrings.com/access /bill -- Carthago delenda est From cenovsky at bakalari.cz Mon May 24 18:49:15 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Mon, 24 May 2010 18:49:15 +0200 Subject: [IronPython] example of using IronPython with MS Access database (.mdb)? In-Reply-To: References: Message-ID: <4BFAAE0B.5080808@bakalari.cz> Peter Masiar wrote: > Gurus, > > I am trying to wrap my mind about how I can access MS Access database > from IronPython. My apologies - I bet this was asked about zillion > times, but of course "Access" is impossible to google. I believe that > it is same thing as Jet engine, Access 2003 uses .mdb as file > extension. > > I found http://www.ironpython.info/index.php/Databases_with_Odbc but > AFAICT it uses MS SQL server. > IronPython in Action book uses PostgreSQL. There are plenty of MySQL > and SQLite examples, but I am stuck with Access (and want to get out - > IronPython should be first step). > > I would also prefer stock IronPython install - I expect there should > be a way to work with Access databases, right? Unless some other > library provides much better functionality. > > Should be something trivial but I am confused. Any links to simple examples? > > Thank you I would check System.Data.OleDb namespace. I use it for working with FoxPro .dbf files (via vfpoledb.dll) and I think there must be driver for Access too. -- -- Luk?s( -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.masiar at gmail.com Mon May 24 19:07:27 2010 From: peter.masiar at gmail.com (Peter Masiar) Date: Mon, 24 May 2010 13:07:27 -0400 Subject: [IronPython] example of using IronPython with MS Access database (.mdb)? In-Reply-To: <4BFAAE0B.5080808@bakalari.cz> References: <4BFAAE0B.5080808@bakalari.cz> Message-ID: Thank you. The three lines from Oracle example made the difference: import clr import System clr.AddReference("System.Data") Of course they are obvious for you gurus but to help a confused learner like me, it would be nice to add them to main ODBC example at http://www.ironpython.info/index.php/Databases_with_Odbc "helping the next guy" (TM) On Mon, May 24, 2010 at 12:49 PM, Lukas Cenovsky wrote: > Peter Masiar wrote: > > Gurus, > > I am trying to wrap my mind about how I can access MS Access database > from IronPython. My apologies - I bet this was asked about zillion > times, but of course "Access" is impossible to google. I believe that > it is same thing as Jet engine, Access 2003 uses .mdb as file > extension. > > I found http://www.ironpython.info/index.php/Databases_with_Odbc but > AFAICT it uses MS SQL server. > IronPython in Action book uses PostgreSQL. There are plenty of MySQL > and SQLite examples, but I am stuck with Access (and want to get out - > IronPython should be first step). > > I would also prefer stock IronPython install - I expect there should > be a way to work with Access databases, right? Unless some other > library provides much better functionality. > > Should be something trivial but I am confused. Any links to simple examples? > > Thank you > > I would check System.Data.OleDb namespace. I use it for working with FoxPro > .dbf files (via vfpoledb.dll) and I think there must be driver for Access > too. > > -- > -- Luk?? > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- ----- Peter Masiar From vernondcole at gmail.com Mon May 24 19:16:11 2010 From: vernondcole at gmail.com (Vernon Cole) Date: Mon, 24 May 2010 11:16:11 -0600 Subject: [IronPython] example of using IronPython with MS Access database (.mdb)? In-Reply-To: References: <4BFAAE0B.5080808@bakalari.cz> Message-ID: Or, if you wish to use the standard python PEP249 api for your JET data (thus making your program portable), you get a copy of http://sourceforge.net/projects/adodbapi and use a connection string like the sample in the .tests folder. If you tried this in the last two weeks (version 2.3.0), and got a dismal failure, its because I messed up the latest distribution .zip file. That was corrected on Friday. -- Vernon Cole On Mon, May 24, 2010 at 11:07 AM, Peter Masiar wrote: > Thank you. The three lines from Oracle example made the difference: > > import clr > import System > clr.AddReference("System.Data") > > Of course they are obvious for you gurus but to help a confused > learner like me, it would be nice to add them to main ODBC example at > http://www.ironpython.info/index.php/Databases_with_Odbc > > "helping the next guy" (TM) > > On Mon, May 24, 2010 at 12:49 PM, Lukas Cenovsky > wrote: > > Peter Masiar wrote: > > > > Gurus, > > > > I am trying to wrap my mind about how I can access MS Access database > > from IronPython. My apologies - I bet this was asked about zillion > > times, but of course "Access" is impossible to google. I believe that > > it is same thing as Jet engine, Access 2003 uses .mdb as file > > extension. > > > > I found http://www.ironpython.info/index.php/Databases_with_Odbc but > > AFAICT it uses MS SQL server. > > IronPython in Action book uses PostgreSQL. There are plenty of MySQL > > and SQLite examples, but I am stuck with Access (and want to get out - > > IronPython should be first step). > > > > I would also prefer stock IronPython install - I expect there should > > be a way to work with Access databases, right? Unless some other > > library provides much better functionality. > > > > Should be something trivial but I am confused. Any links to simple > examples? > > > > Thank you > > > > I would check System.Data.OleDb namespace. I use it for working with > FoxPro > > .dbf files (via vfpoledb.dll) and I think there must be driver for Access > > too. > > > > -- > > -- Luk?? > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > -- > ----- > Peter Masiar > _______________________________________________ > 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 peter.masiar at gmail.com Mon May 24 19:17:05 2010 From: peter.masiar at gmail.com (Peter Masiar) Date: Mon, 24 May 2010 13:17:05 -0400 Subject: [IronPython] example of using IronPython with MS Access database (.mdb)? In-Reply-To: References: <4BFAAE0B.5080808@bakalari.cz> Message-ID: I found that it is a wiki and I can fix it myself - so I did. http://www.ironpython.info/index.php/Databases_with_Odbc "helping the next guy" (TM) Thanks again. From dinov at microsoft.com Mon May 24 19:55:30 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 24 May 2010 17:55:30 +0000 Subject: [IronPython] IronPython Tools and standard library In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD4893454B@TK5EX14MBXC118.redmond.corp.microsoft.com> I don't think there's a way to do this right now other than copying the standard library (or site-packages) into your project :( I'll add it to the list of bugs and try and come up with a fix. And ultimately we also want some form of caching of the intellisense data so we don't need to re-scan the standard library each time you open a project. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tristan Zajonc Sent: Sunday, May 23, 2010 2:43 PM To: Discussion of IronPython Subject: [IronPython] IronPython Tools and standard library Hi, Two questions about using the Python26 libraries: 1. How do I enable intellisense for the Python standard library? Intellisense doesn't pick up C:\Python26\Lib if I add it to sys.path or the project Search Path. 2. How do I add C:\Python26\Lib\site-packages? I can add to sys.path manually, but adding site-packages to the project search path doesn't seem to work. I'm looking forward to the next iteration of IronPython Tools. Thanks, Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.masiar at gmail.com Mon May 24 21:55:59 2010 From: peter.masiar at gmail.com (Peter Masiar) Date: Mon, 24 May 2010 15:55:59 -0400 Subject: [IronPython] Calling a query from .MDB (Access stored procedure) by name: Message-ID: So I can connect to my little database now, thanks. I have a "query" in Access - I believe it's an Access term for a stored procedure. I'd like to call that stored procedure by name from my IronPython code. SQL text is huge (it inserts data from a Sharepoint "list", linked as access table, to real Access table for processing), ugly and hairy... I found command.ExecuteNonQuery(), but it checks for a valid SQL statement, and is unhappy with me providing just a "query" name. It says: Expected DELETE, INSERT, PROCEDURE, SELECT or UPDATE. I found also docs http://msdn.microsoft.com/en-us/library/yy6y35y8%28VS.71%29.aspx and OleDbCommand.CommandType but I am not sure how to set CommandType to Stored procedure. Any suggestions? Is there a way to execute Access "query" by name? Last resort would be copy-pasting the whole SQL enchilada from my "query" to IronPython as text SQL command. Thanks again -- ----- Peter Masiar From vernondcole at gmail.com Mon May 24 22:42:55 2010 From: vernondcole at gmail.com (Vernon Cole) Date: Mon, 24 May 2010 14:42:55 -0600 Subject: [IronPython] Fwd: example of using IronPython with MS Access database (.mdb)? In-Reply-To: References: <4BFAAE0B.5080808@bakalari.cz> Message-ID: (A copy for the group. Peter did not wish to possibly embarrass me, for which I thank him.) -- Vernon ---------- Forwarded message ---------- From: Vernon Cole Date: Mon, May 24, 2010 at 2:29 PM Subject: Re: [IronPython] example of using IronPython with MS Access database (.mdb)? To: Peter Masiar Peter: The _code_ of adodbapi is stable and mature. It has been used for several years in the management of slot machines in several large Nevada casinos where I used to work. Unfortunately, I made a clumsy error on the last _release_ of the code (I seem to have erased adodbapi.py along with adodbapi.pyc when I created the zip file after testing.) Now, having made that claim of maturity, the latest version has undergone some pretty extensive refactoring, so I'ld really appreciate it if you DO find something wrong, please let me know. The API is not so much _better_ as it is _standardized_. You state that portability is not important to you. Therefore, any benefit you would see from adodbapi would be in ease of use. It does a lot of work to automatically convert system data into pythonic types, for example. Also the extensions often make things pretty nice. In the last release, I added NAMED parameters, so you don't need to count question marks in a complex query or worry about parameter order. You can use the cursor as a Python iterator to read multiple rows, etc. You are also correct about the installation instructions not being easy to find. The IronPython distribution is a bit of an afterthought, I am afraid. Most users are in the CPython camp, so they get adodbapi installed "for free" as part of pywin32. I was using adodbapi extensively in my work, but corporate headquarters preferred IronPython to CPython, so I made the port to keep them happy. With some effort, I managed to do it in the source tree, rather than branch the code, so the IPy version stays up to date with changes. That's the reason for the seeming light treatment of IronPython users. Adodbapi is the only part of pywin32 which is intended to also run in IronPython. Pywin32 has its own installer. Perhaps I should write a small setup.py and add it to the zip. The IronPython installation instructions are: 1) Unzip the file. 2) Create a site-packages folder under the Lib folder in your Python distribution (or provide some other entry on the Python search path if you wish and know how) 3) Copy the contents of the zip file there. On my computer, I have: 'c:\\program files\\IronPython 2.6 for .NET 4.0\\lib\\site-packages\\adodbapi' On Mon, May 24, 2010 at 11:51 AM, Peter Masiar wrote: > Vernon, > > I found adodbapi during my search, but was not sure how stable it is > for production. > And your email did not helped to disperse my worries :-) so I posted > my reply in private, not to the whole list.... > > Is new API so much better and improved that it is worth the risk? Is > there some comparison? > Because the portability is not too important to me. My data are more > important that cool features. > > BTW I did not find some prominently placed note how to install > adodbapi into stock install of IronPython (and if it is even possible) > - download looks like a zip file with no instruction for clueless > people like me - maybe for a reason? ;-) > > On Mon, May 24, 2010 at 1:16 PM, Vernon Cole > wrote: > > Or, if you wish to use the standard python PEP249 api for your JET data > > (thus making your program portable), you get a copy of > > http://sourceforge.net/projects/adodbapi and use a connection string > like > > the sample in the .tests folder. > > > > If you tried this in the last two weeks (version 2.3.0), and got a dismal > > failure, its because I messed up the latest distribution .zip file. That > was > > corrected on Friday. > > -- > > Vernon Cole > > > > > -- > ----- > Peter Masiar > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daftspaniel at gmail.com Tue May 25 08:49:04 2010 From: daftspaniel at gmail.com (Davy Mitchell) Date: Tue, 25 May 2010 07:49:04 +0100 Subject: [IronPython] Calling a query from .MDB (Access stored procedure) by name: In-Reply-To: References: Message-ID: Just a guess but could try 'select * from queryname'? Davy On Mon, May 24, 2010 at 8:55 PM, Peter Masiar wrote: > So I can connect to my little database now, thanks. > > I have a "query" in Access - I believe it's an Access term for a > stored procedure. > I'd like to call that stored procedure by name from my IronPython > code. SQL text is huge (it inserts data from a Sharepoint "list", > linked as access table, to real Access table for processing), ugly and > hairy... > > I found command.ExecuteNonQuery(), but it checks for a valid SQL > statement, and is unhappy with me providing just a "query" name. It > says: Expected DELETE, INSERT, PROCEDURE, SELECT or UPDATE. > > I found also docs > http://msdn.microsoft.com/en-us/library/yy6y35y8%28VS.71%29.aspx and > OleDbCommand.CommandType but I am not sure how to set CommandType to > Stored procedure. Any suggestions? > > Is there a way to execute Access "query" by name? Last resort would be > copy-pasting the whole SQL enchilada from my "query" to IronPython as > text SQL command. > > Thanks again > > -- > ----- > Peter Masiar > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- -- Davy Stuff - http://daftspaniel.blogspot.com Geeky Stuff - http://daftpython.blogspot.com Davy's Ironpython Editor - http://code.google.com/p/davysironpythoneditor/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Tue May 25 17:33:09 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 25 May 2010 09:33:09 -0600 Subject: [IronPython] Calling a query from .MDB (Access stored procedure) by name: In-Reply-To: References: Message-ID: On Mon, May 24, 2010 at 1:55 PM, Peter Masiar wrote: > I found also docs > http://msdn.microsoft.com/en-us/library/yy6y35y8%28VS.71%29.aspx and > OleDbCommand.CommandType but I am not sure how to set CommandType to > Stored procedure. Any suggestions? I'm not sure about access, but for calling SPs from SQL server you'd use: from System.Data import CommandType cmd.CommandType = CommandType.StoredProcedure - Jeff From merllab at microsoft.com Tue May 25 17:52:48 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 25 May 2010 08:52:48 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <8796a197-333c-4ae5-9014-ee74fbd457e1@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/66296. ADDED SOURCES $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/IndexSpan.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/OrExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/ListComprehensionFor.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/SuiteStatement.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/SerializedScopeStatement.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/ForStatement.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/IfStatementTest.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/ClassDefinition.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/BinaryExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/AndExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/Node.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/IfStatement.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/PythonAst.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/PythonNameBinder.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/FunctionDefinition.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/WithStatement.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Parser.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/FunctionCode.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/TryStatement.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Tokenizer.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Token.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/UnaryExpression.cs $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Compiler/Ast/WhileStatement.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/IndexSpan.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Microsoft.Scripting.csproj $/IronPython/IronPython_Main/Languages/IronPython/Tests/hosting/editor_svcs/tokencategorizer.py $/IronPython/IronPython_Main/Languages/IronPython/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/Runtime/TokenInfo.cs $/IronPython/IronPython_Main/Runtime/Microsoft.Scripting/SourceUnit.cs CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 1829946 Date: 5/24/2010 4:29:18 PM Reduces memory usage of AST nodes. This replaces our current storing of index, line, column with just storing an index. To resolve the line and column we store the line start information in the PythonAst which we can access via the parent chain. Lots of places are touched but it?s a pretty straight forward transformation. The interesting changes are: We no longer use TokenizerBuffer, it?s purpose was to track the line information We now need to construct the PythonAst before constructing the child nodes. This is because we need to assign some parent node as we set the indexes otherwise you can?t access line information from unbound trees. We need to accommodate updating the line mapping information. We currently just do a pass at the end of parsing to transform all of the line info. For error reporting we use Tokenizer?s IndexToLocation which also goes to the source unit for line updates. Adds IndexSpan to the DLR and also adds HasLineMapping to source unit. (Shelveset: AstMemoryFinal5;REDMOND\dinov | SNAP CheckinId: 10826) From bakalarmh at mail.nih.gov Wed May 26 20:33:41 2010 From: bakalarmh at mail.nih.gov (Bakalar, Matthew (NIH/CIT) [C]) Date: Wed, 26 May 2010 14:33:41 -0400 Subject: [IronPython] Internal Assembly Dependency Message-ID: <69A3D9C1907FEF4388A1365AA59A9C7314044A0D4B@NIHMLBX05.nih.gov> Hello All, I am new to IronPython, relatively new to C#, and new to this list. I have a C# assembly that I am attempting to access from IronPython. I am able to load the assembly using: clr.AddReferenceToFileAndPath(mypath) without any problems. I can then import the classes that reside within my assembly as well, create instances of these classes, and call certain methods on these instances. There are methods within this assembly that rely on a reference to another assembly (MathNet.Iridium). When I attempt to call these methods from my IronPython script, I receive the following error: IOError: [Errno 2] Could not load file or assembly 'MathNet.Iridium, Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f' or one of its dependencies. The system cannot find the file specified. Now, I never added a reference to MathNet.Iridium in my script. However, I assumed that the C# assembly that I am calling directly was compiled with a reference to this other assembly, and that I would not have to explicitly add a reference. When I create a test assembly entirely in C# that calls the assembly I am attempting to call, and do not include a reference to the MathNet.Iridium assembly, I am able to execute the code without problems. Do I need to add a reference to the MathNet.Iridium assembly from within my IronPython script even though I don't intend to access it directly? Thanks Matthew Bakalar -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter.masiar at gmail.com Wed May 26 22:05:45 2010 From: peter.masiar at gmail.com (Peter Masiar) Date: Wed, 26 May 2010 16:05:45 -0400 Subject: [IronPython] Calling a query from .MDB (Access stored procedure) by name: In-Reply-To: References: Message-ID: Thank you for all help. Jeff, your suggestion worked. I created a wiki page with "lessons learned": http://www.ironpython.info/index.php/Access_(MDB) I also took a liberty to add link to list of all pages (http://www.ironpython.info/index.php/Special:AllPages) to Content page, because I took me a long time to find it out. I may try to add also ADODB example, I see it is missing too. Time permitting... :-) -- ----- Peter Masiar From robinsiebler at 321.net Wed May 26 23:40:14 2010 From: robinsiebler at 321.net (robinsiebler) Date: Wed, 26 May 2010 14:40:14 -0700 (PDT) Subject: [IronPython] App stops responding, form won't refresh Message-ID: <28685133.post@talk.nabble.com> This is my 1st IronPython/.NET app. It is really simple, all it does is zip all the files in a folder into an archive, 1 file per zip. The problem is that when it is zipping large files 200MB+ the app stops responding. It is still zipping files, but the UI doesn't update. I don't know how to fix this. The project is here - http://cid-0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip I think I need to add a thread to update the form, but all of my attempts have failed. Any help in this regard would be greatly appreciated. -- View this message in context: http://old.nabble.com/App-stops-responding%2C-form-won%27t-refresh-tp28685133p28685133.html Sent from the IronPython mailing list archive at Nabble.com. From fuzzyman at voidspace.org.uk Wed May 26 23:44:19 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 26 May 2010 22:44:19 +0100 Subject: [IronPython] App stops responding, form won't refresh In-Reply-To: <28685133.post@talk.nabble.com> References: <28685133.post@talk.nabble.com> Message-ID: <4BFD9633.1070501@voidspace.org.uk> On 26/05/2010 22:40, robinsiebler wrote: > This is my 1st IronPython/.NET app. It is really simple, all it does is zip > all the files in a folder into an archive, 1 file per zip. > > The problem is that when it is zipping large files 200MB+ the app stops > responding. It is still zipping files, but the UI doesn't update. I don't > know how to fix this. > If you create a form and perform any activity on the same thread that created the form then you will block until that activity is completed. Instead you can create a background thread and post updates to the ui from that thread by "invoking". If you are using Windows Forms then you might find this example of invoking onto the gui thread useful: http://www.ironpython.info/index.php/Invoking_onto_the_GUI_%28Control%29_Thread There is also an example of basic threading here: http://www.voidspace.org.uk/ironpython/threading.shtml All the best, Michael Foord > The project is here - > http://cid-0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip > > I think I need to add a thread to update the form, but all of my attempts > have failed. Any help in this regard would be greatly appreciated. > -- 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 robinsiebler at 321.net Thu May 27 00:46:44 2010 From: robinsiebler at 321.net (robinsiebler) Date: Wed, 26 May 2010 15:46:44 -0700 (PDT) Subject: [IronPython] App stops responding, form won't refresh In-Reply-To: <4BFD9633.1070501@voidspace.org.uk> References: <28685133.post@talk.nabble.com> <4BFD9633.1070501@voidspace.org.uk> Message-ID: <28687473.post@talk.nabble.com> I've looked at both of them before I posted this, but I'm just failing to understand it I guess. Michael Foord-5 wrote: > > On 26/05/2010 22:40, robinsiebler wrote: >> This is my 1st IronPython/.NET app. It is really simple, all it does is >> zip >> all the files in a folder into an archive, 1 file per zip. >> >> The problem is that when it is zipping large files 200MB+ the app stops >> responding. It is still zipping files, but the UI doesn't update. I don't >> know how to fix this. >> > > If you create a form and perform any activity on the same thread that > created the form then you will block until that activity is completed. > Instead you can create a background thread and post updates to the ui > from that thread by "invoking". > > If you are using Windows Forms then you might find this example of > invoking onto the gui thread useful: > > http://www.ironpython.info/index.php/Invoking_onto_the_GUI_%28Control%29_Thread > > There is also an example of basic threading here: > > http://www.voidspace.org.uk/ironpython/threading.shtml > > All the best, > > Michael Foord > >> The project is here - >> http://cid-0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip >> >> I think I need to add a thread to update the form, but all of my attempts >> have failed. Any help in this regard would be greatly appreciated. >> > > > -- > 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 > > -- View this message in context: http://old.nabble.com/App-stops-responding%2C-form-won%27t-refresh-tp28685133p28687473.html Sent from the IronPython mailing list archive at Nabble.com. From fuzzyman at voidspace.org.uk Thu May 27 00:48:23 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 26 May 2010 23:48:23 +0100 Subject: [IronPython] App stops responding, form won't refresh In-Reply-To: <28687473.post@talk.nabble.com> References: <28685133.post@talk.nabble.com> <4BFD9633.1070501@voidspace.org.uk> <28687473.post@talk.nabble.com> Message-ID: <4BFDA537.6070906@voidspace.org.uk> On 26/05/2010 23:46, robinsiebler wrote: > I've looked at both of them before I posted this, but I'm just failing to > understand it I guess. > > Perhaps this example would be better - it shows updating a progress bar from a calculation being run in a background thread: http://www.ironpython.info/index.php/Progress_Bar All the best, Michael > Michael Foord-5 wrote: > >> On 26/05/2010 22:40, robinsiebler wrote: >> >>> This is my 1st IronPython/.NET app. It is really simple, all it does is >>> zip >>> all the files in a folder into an archive, 1 file per zip. >>> >>> The problem is that when it is zipping large files 200MB+ the app stops >>> responding. It is still zipping files, but the UI doesn't update. I don't >>> know how to fix this. >>> >>> >> If you create a form and perform any activity on the same thread that >> created the form then you will block until that activity is completed. >> Instead you can create a background thread and post updates to the ui >> from that thread by "invoking". >> >> If you are using Windows Forms then you might find this example of >> invoking onto the gui thread useful: >> >> http://www.ironpython.info/index.php/Invoking_onto_the_GUI_%28Control%29_Thread >> >> There is also an example of basic threading here: >> >> http://www.voidspace.org.uk/ironpython/threading.shtml >> >> All the best, >> >> Michael Foord >> >> >>> The project is here - >>> http://cid-0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip >>> >>> I think I need to add a thread to update the form, but all of my attempts >>> have failed. Any help in this regard would be greatly appreciated. >>> >>> >> >> -- >> 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. From robinsiebler at 321.net Thu May 27 01:59:25 2010 From: robinsiebler at 321.net (robinsiebler) Date: Wed, 26 May 2010 16:59:25 -0700 (PDT) Subject: [IronPython] App stops responding, form won't refresh In-Reply-To: <4BFDA537.6070906@voidspace.org.uk> References: <28685133.post@talk.nabble.com> <4BFD9633.1070501@voidspace.org.uk> <28687473.post@talk.nabble.com> <4BFDA537.6070906@voidspace.org.uk> Message-ID: <28687999.post@talk.nabble.com> I've looked at a bunch of examples, but I haven't been able to use them in a way that works. I don't understand what I am missing. I was hoping someone would take a few minutes, look at my app and tell me the right way to do it so I can understand it. Michael Foord-5 wrote: > > On 26/05/2010 23:46, robinsiebler wrote: >> I've looked at both of them before I posted this, but I'm just failing to >> understand it I guess. >> >> > > Perhaps this example would be better - it shows updating a progress bar > from a calculation being run in a background thread: > > http://www.ironpython.info/index.php/Progress_Bar > > All the best, > > Michael > >> Michael Foord-5 wrote: >> >>> On 26/05/2010 22:40, robinsiebler wrote: >>> >>>> This is my 1st IronPython/.NET app. It is really simple, all it does is >>>> zip >>>> all the files in a folder into an archive, 1 file per zip. >>>> >>>> The problem is that when it is zipping large files 200MB+ the app stops >>>> responding. It is still zipping files, but the UI doesn't update. I >>>> don't >>>> know how to fix this. >>>> >>>> >>> If you create a form and perform any activity on the same thread that >>> created the form then you will block until that activity is completed. >>> Instead you can create a background thread and post updates to the ui >>> from that thread by "invoking". >>> >>> If you are using Windows Forms then you might find this example of >>> invoking onto the gui thread useful: >>> >>> http://www.ironpython.info/index.php/Invoking_onto_the_GUI_%28Control%29_Thread >>> >>> There is also an example of basic threading here: >>> >>> http://www.voidspace.org.uk/ironpython/threading.shtml >>> >>> All the best, >>> >>> Michael Foord >>> >>> >>>> The project is here - >>>> http://cid-0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip >>>> >>>> I think I need to add a thread to update the form, but all of my >>>> attempts >>>> have failed. Any help in this regard would be greatly appreciated. >>>> >>>> >>> >>> -- >>> 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 > > -- View this message in context: http://old.nabble.com/App-stops-responding%2C-form-won%27t-refresh-tp28685133p28687999.html Sent from the IronPython mailing list archive at Nabble.com. From davidescobar1976 at gmail.com Thu May 27 07:23:13 2010 From: davidescobar1976 at gmail.com (David Escobar) Date: Wed, 26 May 2010 22:23:13 -0700 Subject: [IronPython] Internal Assembly Dependency In-Reply-To: <69A3D9C1907FEF4388A1365AA59A9C7314044A0D4B@NIHMLBX05.nih.gov> References: <69A3D9C1907FEF4388A1365AA59A9C7314044A0D4B@NIHMLBX05.nih.gov> Message-ID: I had a similar problem when using ctypes to access a Windows .dll. Before calling the method that relies on the MathNet.Iridium assembly, try setting the current working directory to the folder containing your 1st assembly (the one you reference directly). clr.AddReferenceToFileAndPath(mypath) import os os.chdir(os.path.dirname(mypath)) ...then try calling the methods in question. On Wed, May 26, 2010 at 11:33 AM, Bakalar, Matthew (NIH/CIT) [C] < bakalarmh at mail.nih.gov> wrote: > Hello All, > > I am new to IronPython, relatively new to C#, and new to this list. I have > a C# assembly that I am attempting to access from IronPython. I am able to > load the assembly using: > > clr.AddReferenceToFileAndPath(mypath) > > without any problems. I can then import the classes that reside within my > assembly as well, create instances of these classes, and call certain > methods on these instances. There are methods within this assembly that rely > on a reference to another assembly (MathNet.Iridium). When I attempt to call > these methods from my IronPython script, I receive the following error: > > IOError: [Errno 2] Could not load file or assembly 'MathNet.Iridium, > Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f' or > one of its dependencies. The system cannot find the file specified. > > Now, I never added a reference to MathNet.Iridium in my script. However, I > assumed that the C# assembly that I am calling directly was compiled with a > reference to this other assembly, and that I would not have to explicitly > add a reference. When I create a test assembly entirely in C# that calls the > assembly I am attempting to call, and do not include a reference to the > MathNet.Iridium assembly, I am able to execute the code without problems. Do > I need to add a reference to the MathNet.Iridium assembly from within my > IronPython script even though I don't intend to access it directly? > > Thanks > > Matthew Bakalar > > > > _______________________________________________ > 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 cenovsky at bakalari.cz Thu May 27 08:47:43 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Thu, 27 May 2010 08:47:43 +0200 Subject: [IronPython] Internal Assembly Dependency In-Reply-To: <69A3D9C1907FEF4388A1365AA59A9C7314044A0D4B@NIHMLBX05.nih.gov> References: <69A3D9C1907FEF4388A1365AA59A9C7314044A0D4B@NIHMLBX05.nih.gov> Message-ID: <4BFE158F.20600@bakalari.cz> Bakalar, Matthew (NIH/CIT) [C] wrote: > > Hello All, > > I am new to IronPython, relatively new to C#, and new to this list. I > have a C# assembly that I am attempting to access from IronPython. I > am able to load the assembly using: > > clr.AddReferenceToFileAndPath(mypath) > > without any problems. I can then import the classes that reside within > my assembly as well, create instances of these classes, and call > certain methods on these instances. There are methods within this > assembly that rely on a reference to another assembly > (MathNet.Iridium). When I attempt to call these methods from my > IronPython script, I receive the following error: > > IOError: [Errno 2] Could not load file or assembly 'MathNet.Iridium, > Version=2008.8.16.470, Culture=neutral, > PublicKeyToken=c061a3ec32cc0c6f' or one of its dependencies. The > system cannot find the file specified. > > Now, I never added a reference to MathNet.Iridium in my script. > However, I assumed that the C# assembly that I am calling directly was > compiled with a reference to this other assembly, and that I would not > have to explicitly add a reference. When I create a test assembly > entirely in C# that calls the assembly I am attempting to call, and do > not include a reference to the MathNet.Iridium assembly, I am able to > execute the code without problems. Do I need to add a reference to the > MathNet.Iridium assembly from within my IronPython script even though > I don't intend to access it directly? > > Thanks > > Matthew Bakalar > First, try to copy all necessary assemblies to the folder with your script and use AddReference for all of them. If that works, you can experiment with assemblies in different folders. Note, the path in AddReferenceToFileAndPath should be full path. -- -- Luk?s( -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at tplus1.com Thu May 27 16:54:18 2010 From: matt at tplus1.com (Matthew Wilson) Date: Thu, 27 May 2010 14:54:18 +0000 (UTC) Subject: [IronPython] How to connect to SQL Server 2008? Message-ID: I want to connect with IronPython to SQLServer 2008. I found some SAS code (SAS is another programming language) that uses OLEDB and I have a connection string with the server name and credentials. In IronPython in Action, there's an example of how to connect to a Postgresql database, and that example has this section: >>> import clr >>> clr.AddReference('Npgsql') >>> import Npgsql as pgsql >>> connection = pgsql.NpgsqlConnection('....') What do I need to use for my clr.AddReference and my import? Thanks in advance. Matt From daftspaniel at gmail.com Thu May 27 17:09:15 2010 From: daftspaniel at gmail.com (Davy Mitchell) Date: Thu, 27 May 2010 16:09:15 +0100 Subject: [IronPython] How to connect to SQL Server 2008? In-Reply-To: References: Message-ID: >From http://www.ironpython.info/index.php/Accessing_SQL_Server import clr clr.AddReference('System.Data') from System.Data import * TheConnection = SqlClient.SqlConnection("server=yourserver;database=News;uid=sa;password=password") TheConnection.Open() MyAction = SqlClient.SqlCommand("Select Headline from News", TheConnection) MyReader = MyAction.ExecuteReader() while MyReader.Read(): print MyReader[0] MyReader.Close() TheConnection.Close() Davy On Thu, May 27, 2010 at 3:54 PM, Matthew Wilson wrote: > I want to connect with IronPython to SQLServer 2008. I found some SAS > code (SAS is another programming language) that uses OLEDB and I have a > connection string with the server name and credentials. > > In IronPython in Action, there's an example of how to connect to a > Postgresql database, and that example has this section: > > >>> import clr > >>> clr.AddReference('Npgsql') > >>> import Npgsql as pgsql > >>> connection = pgsql.NpgsqlConnection('....') > > What do I need to use for my clr.AddReference and my import? > > Thanks in advance. > > Matt > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- -- Davy Stuff - http://daftspaniel.blogspot.com Geeky Stuff - http://daftpython.blogspot.com Davy's Ironpython Editor - http://code.google.com/p/davysironpythoneditor/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From merllab at microsoft.com Thu May 27 17:53:19 2010 From: merllab at microsoft.com (merllab at microsoft.com) Date: Thu, 27 May 2010 08:53:19 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/66311. MODIFIED SOURCES $/IronPython/IronPython_Main/Languages/IronPython/Tests/compat/common.py $/IronPython/IronPython_Main/Languages/IronPython/Scripts/ipcom.ps1 $/IronPython/IronPython_Main/Languages/IronPython/Tests/run_transformed.bat $/IronPython/IronPython_Main/Languages/IronPython/Tests/Modes/ConsoleFlags.ps1 $/IronPython/IronPython_Main/Languages/IronPython/Tests/modules/io_related/re_test.py $/IronPython/IronPython_Main/Languages/IronPython/Tests/pyc/test_pyc.ps1 $/IronPython/IronPython_Main/Languages/IronPython/Tests/RunAgainstCpy.py $/IronPython/IronPython_Main/Languages/IronPython/Tests/specialcontext/Consoleless.ps1 From michael at voidspace.org.uk Thu May 27 18:41:28 2010 From: michael at voidspace.org.uk (Michael Foord) Date: Thu, 27 May 2010 17:41:28 +0100 Subject: [IronPython] Performance str.replace in Silverlight Message-ID: <4BFEA0B8.1080400@voidspace.org.uk> Hey guys, I just tracked down a really nasty performance bug in our Silverlight application. It turned out that doing a simple string replace in a 400 character string was taking 700ms. As we actually do two replaces and the text is usually substantially longer this was a real problem. I fixed the problem by switching to explicitly calling the .NET String.Replace instead of str.replace, so it looks like an IronPython issue. It doesn't happen with *all* text, but it looks like non-ascii exacerbates the problem. The particular text that triggered it was: Die Neuanlage einer Welle muss auch zu Eintr?gen in der Tabelle dbo_tv_wellenwebsitesfirmenverbinder f?hren. Dabei werden die Zuordnungen aus der Vorwelle bei der Neuanlage einer neuen Welle einmalig ?bernommen. Jede Zeile der Vorwelle wird also kopiert und die Kopie erh?lt die Welle_uniqueID der neuen Welle. Die Verbindung zwischen Website_uniqueID <-> Firmen_uniqueID <-> FirmenAbrechnung_uniqueID bleibt somit erhalten. The replace code was: text = text.replace('\r\n', '\n').replace('\r', '\n') The fix was: text = String.Replace(text, '\r\n', '\n') text = String.Replace(text, '\r', '\n') All the best, Michael Foord -- 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 bakalarmh at mail.nih.gov Thu May 27 19:10:25 2010 From: bakalarmh at mail.nih.gov (Bakalar, Matthew (NIH/CIT) [C]) Date: Thu, 27 May 2010 13:10:25 -0400 Subject: [IronPython] Internal Assembly Dependency In-Reply-To: <4BFE158F.20600@bakalari.cz> References: <69A3D9C1907FEF4388A1365AA59A9C7314044A0D4B@NIHMLBX05.nih.gov> <4BFE158F.20600@bakalari.cz> Message-ID: <69A3D9C1907FEF4388A1365AA59A9C7314044A0DA4@NIHMLBX05.nih.gov> In response to Lukas: I copied all of the assemblies, along with the script, to one folder. I attempted to add a reference to MathNet.Iridium and received the following error: >>> clr.AddReferenceByPartialName('MathNet.Iridium') Traceback (most recent call last): File "", line 1, in IOError: System.IO.IOException: Could not add reference to assembly MathNet.Irid ium at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] arg s, Boolean& shouldOptimize) at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(Cal lSite site, CodeContext context, TFuncType func, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite s ite, T0 arg0, T1 arg1, T2 arg2) at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(Cal lSite site, CodeContext context, TFuncType func, T0 arg0) at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedF rame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 a rg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at IronPython.Compiler.PythonScriptCode.Run(Scope scope) at IronPython.Hosting.PythonCommandLine.<>c__DisplayClass1.b__0() This leads me to believe IronPython is having trouble loading this particular assembly, but I cannot decode the error message. Have you ever seen this trace before? In Response to David: I tried the solution you suggested with no luck. The error message I receive is the same. I suspect that the hint I've provided above might lead us to a solution. Thanks All, Matthew Bakalar From: Lukas Cenovsky [mailto:cenovsky at bakalari.cz] Sent: Thursday, May 27, 2010 2:48 AM To: Discussion of IronPython Subject: Re: [IronPython] Internal Assembly Dependency Bakalar, Matthew (NIH/CIT) [C] wrote: Hello All, I am new to IronPython, relatively new to C#, and new to this list. I have a C# assembly that I am attempting to access from IronPython. I am able to load the assembly using: clr.AddReferenceToFileAndPath(mypath) without any problems. I can then import the classes that reside within my assembly as well, create instances of these classes, and call certain methods on these instances. There are methods within this assembly that rely on a reference to another assembly (MathNet.Iridium). When I attempt to call these methods from my IronPython script, I receive the following error: IOError: [Errno 2] Could not load file or assembly 'MathNet.Iridium, Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f' or one of its dependencies. The system cannot find the file specified. Now, I never added a reference to MathNet.Iridium in my script. However, I assumed that the C# assembly that I am calling directly was compiled with a reference to this other assembly, and that I would not have to explicitly add a reference. When I create a test assembly entirely in C# that calls the assembly I am attempting to call, and do not include a reference to the MathNet.Iridium assembly, I am able to execute the code without problems. Do I need to add a reference to the MathNet.Iridium assembly from within my IronPython script even though I don't intend to access it directly? Thanks Matthew Bakalar First, try to copy all necessary assemblies to the folder with your script and use AddReference for all of them. If that works, you can experiment with assemblies in different folders. Note, the path in AddReferenceToFileAndPath should be full path. -- -- Luk?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From robinsiebler at 321.net Thu May 27 20:55:25 2010 From: robinsiebler at 321.net (robinsiebler) Date: Thu, 27 May 2010 11:55:25 -0700 (PDT) Subject: [IronPython] Willing to pay for help Message-ID: <28698448.post@talk.nabble.com> This is my 1st IronPython/.NET app. It is really simple, all it does is zip all the files in a folder into an archive, 1 file per zip. The problem is that when it is zipping large files 200MB+ the app stops responding. It is still zipping files, but the UI doesn't update. I don't know how to fix this. The project is here - http://cid-0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip I've looked at all the examples and I am can't seem to figure out how to apply them to my app. I'm sure that if someone shows me how to do it I will get it. I am willing to pay $30 to anyone who will help me solve the problem. The problem is this - when zipping large files (100MB+) the UI stops responding. It doesn't refresh until all the files are zipped. -- View this message in context: http://old.nabble.com/Willing-to-pay-for-help-tp28698448p28698448.html Sent from the IronPython mailing list archive at Nabble.com. From peter.masiar at gmail.com Thu May 27 21:41:46 2010 From: peter.masiar at gmail.com (Peter Masiar) Date: Thu, 27 May 2010 15:41:46 -0400 Subject: [IronPython] Fwd: example of using IronPython with MS Access database (.mdb)? In-Reply-To: References: <4BFAAE0B.5080808@bakalari.cz> Message-ID: I added another wiki page, with example of using Access MDB via adodbapi module - it **is** simpler and more pythonic. http://www.ironpython.info/index.php/ADODB_API Thanks Vernon for helping me to get adodbapi running. Adodbapi is my favorite now! ;-) -- ----- Peter Masiar From curt at hagenlocher.org Thu May 27 22:08:05 2010 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 27 May 2010 13:08:05 -0700 Subject: [IronPython] Willing to pay for help In-Reply-To: <28698448.post@talk.nabble.com> References: <28698448.post@talk.nabble.com> Message-ID: You almost certainly need to be pump messages occasionally if you're going to be performing a long operation on the UI thread. With Windows Forms, this involves calling System.Windows.Forms.Application.DoEvents(). On Thu, May 27, 2010 at 11:55 AM, robinsiebler wrote: > > This is my 1st IronPython/.NET app. It is really simple, all it does is zip > all the files in a folder into an archive, 1 file per zip. > > The problem is that when it is zipping large files 200MB+ the app stops > responding. It is still zipping files, but the UI doesn't update. I don't > know how to fix this. > > The project is here - > > http://cid-0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip > > I've looked at all the examples and I am can't seem to figure out how to > apply them to my app. I'm sur that if someone shows me how to do it I will > get it. > > I am willing to pay $30 to anyone who will help me solve the problem. The > problem is this - when zipping large files (100MB+) the UI stops > responding. > It doesn't refresh until all the files are zipped. > -- > View this message in context: > http://old.nabble.com/Willing-to-pay-for-help-tp28698448p28698448.html > Sent from the IronPython mailing list archive at Nabble.com. > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Thu May 27 22:13:57 2010 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 27 May 2010 13:13:57 -0700 Subject: [IronPython] Internal Assembly Dependency In-Reply-To: <69A3D9C1907FEF4388A1365AA59A9C7314044A0DA4@NIHMLBX05.nih.gov> References: <69A3D9C1907FEF4388A1365AA59A9C7314044A0D4B@NIHMLBX05.nih.gov> <4BFE158F.20600@bakalari.cz> <69A3D9C1907FEF4388A1365AA59A9C7314044A0DA4@NIHMLBX05.nih.gov> Message-ID: The bug at http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26793 suggests you might have success with clr.LoadAssemblyFromFile. Otherwise, you might be able to use the Fusion log viewer ( http://msdn.microsoft.com/en-us/library/e74a18c4(VS.80).aspx) to debug the assembly load process. 2010/5/27 Bakalar, Matthew (NIH/CIT) [C] > In response to Lukas: > > I copied all of the assemblies, along with the script, to one folder. I > attempted to add a reference to MathNet.Iridium and received the following > error: > > > > >>> clr.AddReferenceByPartialName('MathNet.Iridium') > > Traceback (most recent call last): > > File "", line 1, in > > IOError: System.IO.IOException: Could not add reference to assembly > MathNet.Irid > > ium > > at > Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] arg > > s, Boolean& shouldOptimize) > > at > IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(Cal > > lSite site, CodeContext context, TFuncType func, T0 arg0) > > at > System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite s > > ite, T0 arg0, T1 arg1, T2 arg2) > > at > IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(Cal > > lSite site, CodeContext context, TFuncType func, T0 arg0) > > at > IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedF > > rame frame) > > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame) > > at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, > T1 a > > rg1) > > at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) > > at IronPython.Compiler.PythonScriptCode.Run(Scope scope) > > at > IronPython.Hosting.PythonCommandLine.<>c__DisplayClass1. > >b__0() > > > > This leads me to believe IronPython is having trouble loading this > particular assembly, but I cannot decode the error message. Have you ever > seen this trace before? > > > > In Response to David: > > I tried the solution you suggested with no luck. The error message I > receive is the same. I suspect that the hint I've provided above might lead > us to a solution. > > > > Thanks All, > > > > Matthew Bakalar > > > > *From:* Lukas Cenovsky [mailto:cenovsky at bakalari.cz] > *Sent:* Thursday, May 27, 2010 2:48 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Internal Assembly Dependency > > > > Bakalar, Matthew (NIH/CIT) [C] wrote: > > Hello All, > > I am new to IronPython, relatively new to C#, and new to this list. I have > a C# assembly that I am attempting to access from IronPython. I am able to > load the assembly using: > > clr.AddReferenceToFileAndPath(mypath) > > without any problems. I can then import the classes that reside within my > assembly as well, create instances of these classes, and call certain > methods on these instances. There are methods within this assembly that rely > on a reference to another assembly (MathNet.Iridium). When I attempt to call > these methods from my IronPython script, I receive the following error: > > IOError: [Errno 2] Could not load file or assembly 'MathNet.Iridium, > Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f' or > one of its dependencies. The system cannot find the file specified. > > Now, I never added a reference to MathNet.Iridium in my script. However, I > assumed that the C# assembly that I am calling directly was compiled with a > reference to this other assembly, and that I would not have to explicitly > add a reference. When I create a test assembly entirely in C# that calls the > assembly I am attempting to call, and do not include a reference to the > MathNet.Iridium assembly, I am able to execute the code without problems. Do > I need to add a reference to the MathNet.Iridium assembly from within my > IronPython script even though I don't intend to access it directly? > > Thanks > > Matthew Bakalar > > > First, try to copy all necessary assemblies to the folder with your script > and use AddReference for all of them. If that works, you can experiment with > assemblies in different folders. > > Note, the path in AddReferenceToFileAndPath should be full path. > > -- > -- 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 robinsiebler at 321.net Thu May 27 22:25:11 2010 From: robinsiebler at 321.net (robinsiebler) Date: Thu, 27 May 2010 13:25:11 -0700 (PDT) Subject: [IronPython] Willing to pay for help In-Reply-To: References: <28698448.post@talk.nabble.com> Message-ID: <28699466.post@talk.nabble.com> That worked! Give me an e-mail address and I will send you the money. Can you recommend a good book to learn about WinForms and .NET in general? Curt Hagenlocher wrote: > > You almost certainly need to be pump messages occasionally if you're going > to be performing a long operation on the UI thread. With Windows Forms, > this > involves calling System.Windows.Forms.Application.DoEvents(). > > On Thu, May 27, 2010 at 11:55 AM, robinsiebler > wrote: > >> >> This is my 1st IronPython/.NET app. It is really simple, all it does is >> zip >> all the files in a folder into an archive, 1 file per zip. >> >> The problem is that when it is zipping large files 200MB+ the app stops >> responding. It is still zipping files, but the UI doesn't update. I don't >> know how to fix this. >> >> The project is here - >> >> http://cid-0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip >> >> I've looked at all the examples and I am can't seem to figure out how to >> apply them to my app. I'm sur that if someone shows me how to do it I >> will >> get it. >> >> I am willing to pay $30 to anyone who will help me solve the problem. >> The >> problem is this - when zipping large files (100MB+) the UI stops >> responding. >> It doesn't refresh until all the files are zipped. >> -- >> View this message in context: >> http://old.nabble.com/Willing-to-pay-for-help-tp28698448p28698448.html >> Sent from the IronPython mailing list archive at Nabble.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 > > -- View this message in context: http://old.nabble.com/Willing-to-pay-for-help-tp28698448p28699466.html Sent from the IronPython mailing list archive at Nabble.com. From curt at hagenlocher.org Thu May 27 22:31:40 2010 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 27 May 2010 13:31:40 -0700 Subject: [IronPython] Willing to pay for help In-Reply-To: <28699466.post@talk.nabble.com> References: <28698448.post@talk.nabble.com> <28699466.post@talk.nabble.com> Message-ID: If you feel obligated about the money, send it to the charity of your choice. :) The only Windows Forms book I've owned was "Windows Forms 2.0 Programming" by Sells and Weinhardt. If you definitely want to target WinForms (vs WPF), I would probably recommend it. On Thu, May 27, 2010 at 1:25 PM, robinsiebler wrote: > > That worked! Give me an e-mail address and I will send you the money. Can > you > recommend a good book to learn about WinForms and .NET in general? > > > Curt Hagenlocher wrote: > > > > You almost certainly need to be pump messages occasionally if you're > going > > to be performing a long operation on the UI thread. With Windows Forms, > > this > > involves calling System.Windows.Forms.Application.DoEvents(). > > > > On Thu, May 27, 2010 at 11:55 AM, robinsiebler > > wrote: > > > >> > >> This is my 1st IronPython/.NET app. It is really simple, all it does is > >> zip > >> all the files in a folder into an archive, 1 file per zip. > >> > >> The problem is that when it is zipping large files 200MB+ the app stops > >> responding. It is still zipping files, but the UI doesn't update. I > don't > >> know how to fix this. > >> > >> The project is here - > >> > >> > http://cid-0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip > >> > >> I've looked at all the examples and I am can't seem to figure out how to > >> apply them to my app. I'm sur that if someone shows me how to do it I > >> will > >> get it. > >> > >> I am willing to pay $30 to anyone who will help me solve the problem. > >> The > >> problem is this - when zipping large files (100MB+) the UI stops > >> responding. > >> It doesn't refresh until all the files are zipped. > >> -- > >> View this message in context: > >> http://old.nabble.com/Willing-to-pay-for-help-tp28698448p28698448.html > >> Sent from the IronPython mailing list archive at Nabble.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 > > > > > > -- > View this message in context: > http://old.nabble.com/Willing-to-pay-for-help-tp28698448p28699466.html > Sent from the IronPython mailing list archive at Nabble.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 bakalarmh at mail.nih.gov Thu May 27 22:54:43 2010 From: bakalarmh at mail.nih.gov (Bakalar, Matthew (NIH/CIT) [C]) Date: Thu, 27 May 2010 16:54:43 -0400 Subject: [IronPython] Internal Assembly Dependency In-Reply-To: References: <69A3D9C1907FEF4388A1365AA59A9C7314044A0D4B@NIHMLBX05.nih.gov> <4BFE158F.20600@bakalari.cz> <69A3D9C1907FEF4388A1365AA59A9C7314044A0DA4@NIHMLBX05.nih.gov> Message-ID: <69A3D9C1907FEF4388A1365AA59A9C7314044A0DF7@NIHMLBX05.nih.gov> Thanks for the suggestion, I tried the bug fix suggested on the link you posted. clr.LoadAssemblyFromFile does not throw an exception, but it also doesn't return an assembly (in contrast, calling clr.LoadAssemblyFromFile for a different assembly in the same directory returns an object that prints itself as: ) I have been picking through the log files, but I am inexperienced interpreting them. The first log item shows an error, but after that I receive two log items that claim "The operation was succesful. Bind result: hr = 0x0." To confuse matters, at the end of these "successful" log entries is the line: LOG: IJW assembly bind returned file not found. I looked up the error in the first log message, hr = 0x80070002. I found a reference at http://blogs.msdn.com/b/suzcook/archive/2003/05/29/57120.aspx that suggests it is actually a FileNotFoundException. Would this error ever be thrown when the assembly did actually exist? As I said before, I'm using it from this location with pure C# code. I have double checked my sys.path to make sure it includes the folder where the assembly is located. Could the problem be in the naming of the assembly? For reference sake, I am running windows vista x64. Thanks Matthew Bakalar The following items are logged when I attempt to load the problem assembly: *** Assembly Binder Log Entry (5/27/2010 @ 4:39:16 PM) *** The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Users\bakalarmh\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools for Visual Studio\0.2\RemoteScriptFactory.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = NIH\bakalarmh LOG: DisplayName = MathNet.Iridium, Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f (Fully-specified) LOG: Appbase = file:///C:/Users/bakalarmh/AppData/Local/Microsoft/VisualStudio/10.0/Extensions/Microsoft/IronPython Tools for Visual Studio/0.2/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = RemoteScriptFactory.exe Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: No application configuration file found. LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: MathNet.Iridium, Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f LOG: The same bind was seen before, and was failed with hr = 0x80070002. ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070002). *** Assembly Binder Log Entry (5/27/2010 @ 4:39:16 PM) *** The operation was successful. Bind result: hr = 0x0. The operation completed successfully. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Users\bakalarmh\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools for Visual Studio\0.2\RemoteScriptFactory.exe --- A detailed error log follows. LOG: IJW explicit bind. File path:C:\Users\bakalarmh\Documents\NIH Dropbox\My Dropbox\Target\Target\bin\Debug\MathNet.Iridium.DLL. LOG: IJW assembly bind returned file not found. *** Assembly Binder Log Entry (5/27/2010 @ 4:39:16 PM) *** The operation was successful. Bind result: hr = 0x0. The operation completed successfully. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Users\bakalarmh\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools for Visual Studio\0.2\RemoteScriptFactory.exe --- A detailed error log follows. LOG: IJW explicit bind. File path:C:\Users\bakalarmh\Documents\NIH Dropbox\My Dropbox\Target\Target\bin\Debug\MathNet.Iridium.dll. LOG: IJW assembly bind returned file not found. From: Curt Hagenlocher [mailto:curt at hagenlocher.org] Sent: Thursday, May 27, 2010 4:14 PM To: Discussion of IronPython Subject: Re: [IronPython] Internal Assembly Dependency The bug at http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26793 suggests you might have success with clr.LoadAssemblyFromFile. Otherwise, you might be able to use the Fusion log viewer (http://msdn.microsoft.com/en-us/library/e74a18c4(VS.80).aspx) to debug the assembly load process. 2010/5/27 Bakalar, Matthew (NIH/CIT) [C] > In response to Lukas: I copied all of the assemblies, along with the script, to one folder. I attempted to add a reference to MathNet.Iridium and received the following error: >>> clr.AddReferenceByPartialName('MathNet.Iridium') Traceback (most recent call last): File "", line 1, in IOError: System.IO.IOException: Could not add reference to assembly MathNet.Irid ium at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] arg s, Boolean& shouldOptimize) at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(Cal lSite site, CodeContext context, TFuncType func, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite s ite, T0 arg0, T1 arg1, T2 arg2) at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(Cal lSite site, CodeContext context, TFuncType func, T0 arg0) at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedF rame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 a rg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at IronPython.Compiler.PythonScriptCode.Run(Scope scope) at IronPython.Hosting.PythonCommandLine.<>c__DisplayClass1.b__0() This leads me to believe IronPython is having trouble loading this particular assembly, but I cannot decode the error message. Have you ever seen this trace before? In Response to David: I tried the solution you suggested with no luck. The error message I receive is the same. I suspect that the hint I've provided above might lead us to a solution. Thanks All, Matthew Bakalar From: Lukas Cenovsky [mailto:cenovsky at bakalari.cz] Sent: Thursday, May 27, 2010 2:48 AM To: Discussion of IronPython Subject: Re: [IronPython] Internal Assembly Dependency Bakalar, Matthew (NIH/CIT) [C] wrote: Hello All, I am new to IronPython, relatively new to C#, and new to this list. I have a C# assembly that I am attempting to access from IronPython. I am able to load the assembly using: clr.AddReferenceToFileAndPath(mypath) without any problems. I can then import the classes that reside within my assembly as well, create instances of these classes, and call certain methods on these instances. There are methods within this assembly that rely on a reference to another assembly (MathNet.Iridium). When I attempt to call these methods from my IronPython script, I receive the following error: IOError: [Errno 2] Could not load file or assembly 'MathNet.Iridium, Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f' or one of its dependencies. The system cannot find the file specified. Now, I never added a reference to MathNet.Iridium in my script. However, I assumed that the C# assembly that I am calling directly was compiled with a reference to this other assembly, and that I would not have to explicitly add a reference. When I create a test assembly entirely in C# that calls the assembly I am attempting to call, and do not include a reference to the MathNet.Iridium assembly, I am able to execute the code without problems. Do I need to add a reference to the MathNet.Iridium assembly from within my IronPython script even though I don't intend to access it directly? Thanks Matthew Bakalar First, try to copy all necessary assemblies to the folder with your script and use AddReference for all of them. If that works, you can experiment with assemblies in different folders. Note, the path in AddReferenceToFileAndPath should be full path. -- -- 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 curt at hagenlocher.org Thu May 27 23:01:50 2010 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 27 May 2010 14:01:50 -0700 Subject: [IronPython] Internal Assembly Dependency In-Reply-To: <69A3D9C1907FEF4388A1365AA59A9C7314044A0DF7@NIHMLBX05.nih.gov> References: <69A3D9C1907FEF4388A1365AA59A9C7314044A0D4B@NIHMLBX05.nih.gov> <4BFE158F.20600@bakalari.cz> <69A3D9C1907FEF4388A1365AA59A9C7314044A0DA4@NIHMLBX05.nih.gov> <69A3D9C1907FEF4388A1365AA59A9C7314044A0DF7@NIHMLBX05.nih.gov> Message-ID: Is it possible that the assembly has been compiled targeting specifically x86 and you're running a 64-bit process (or vice versa)? 2010/5/27 Bakalar, Matthew (NIH/CIT) [C] > Thanks for the suggestion, I tried the bug fix suggested on the link you > posted. clr.LoadAssemblyFromFile does not throw an exception, but it also > doesn't return an assembly (in contrast, calling clr.LoadAssemblyFromFile > for a different assembly in the same directory returns an object that prints > itself as: PublicKeyToken=null>) > > I have been picking through the log files, but I am inexperienced > interpreting them. The first log item shows an error, but after that I > receive two log items that claim "The operation was succesful. Bind result: > hr = 0x0." To confuse matters, at the end of these "successful" log entries > is the line: > > LOG: IJW assembly bind returned file not found. > > > > I looked up the error in the first log message, hr = 0x80070002. I found a > reference at http://blogs.msdn.com/b/suzcook/archive/2003/05/29/57120.aspxthat suggests it is actually a FileNotFoundException. Would this error ever > be thrown when the assembly did actually exist? As I said before, I'm using > it from this location with pure C# code. I have double checked my sys.path > to make sure it includes the folder where the assembly is located. Could the > problem be in the naming of the assembly? > > > > For reference sake, I am running windows vista x64. > > > > Thanks > > > > Matthew Bakalar > > > > The following items are logged when I attempt to load the problem assembly: > > > > *** Assembly Binder Log Entry (5/27/2010 @ 4:39:16 PM) *** > > > > The operation failed. > > Bind result: hr = 0x80070002. The system cannot find the file specified. > > > > Assembly manager loaded from: > C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll > > Running under executable > C:\Users\bakalarmh\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython > Tools for Visual Studio\0.2\RemoteScriptFactory.exe > > --- A detailed error log follows. > > > > === Pre-bind state information === > > LOG: User = NIH\bakalarmh > > LOG: DisplayName = MathNet.Iridium, Version=2008.8.16.470, Culture=neutral, > PublicKeyToken=c061a3ec32cc0c6f > > (Fully-specified) > > LOG: Appbase = > file:///C:/Users/bakalarmh/AppData/Local/Microsoft/VisualStudio/10.0/Extensions/Microsoft/IronPython > Tools for Visual Studio/0.2/ > > LOG: Initial PrivatePath = NULL > > LOG: Dynamic Base = NULL > > LOG: Cache Base = NULL > > LOG: AppName = RemoteScriptFactory.exe > > Calling assembly : (Unknown). > > === > > LOG: This bind starts in default load context. > > LOG: No application configuration file found. > > LOG: Using host configuration file: > > LOG: Using machine configuration file from > C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. > > LOG: Post-policy reference: MathNet.Iridium, Version=2008.8.16.470, > Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f > > LOG: The same bind was seen before, and was failed with hr = 0x80070002. > > ERR: Unrecoverable error occurred during pre-download check (hr = > 0x80070002). > > > > *** Assembly Binder Log Entry (5/27/2010 @ 4:39:16 PM) *** > > > > The operation was successful. > > Bind result: hr = 0x0. The operation completed successfully. > > > > Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll > > Running under executable C:\Users\bakalarmh\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools for Visual Studio\0.2\RemoteScriptFactory.exe > > --- A detailed error log follows. > > > > LOG: IJW explicit bind. File path:C:\Users\bakalarmh\Documents\NIH Dropbox\My Dropbox\Target\Target\bin\Debug\MathNet.Iridium.DLL. > > LOG: IJW assembly bind returned file not found. > > > > *** Assembly Binder Log Entry (5/27/2010 @ 4:39:16 PM) *** > > > > The operation was successful. > > Bind result: hr = 0x0. The operation completed successfully. > > > > Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll > > Running under executable C:\Users\bakalarmh\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools for Visual Studio\0.2\RemoteScriptFactory.exe > > --- A detailed error log follows. > > > > LOG: IJW explicit bind. File path:C:\Users\bakalarmh\Documents\NIH Dropbox\My Dropbox\Target\Target\bin\Debug\MathNet.Iridium.dll. > > LOG: IJW assembly bind returned file not found. > > > > > > > > > > > > > > *From:* Curt Hagenlocher [mailto:curt at hagenlocher.org] > *Sent:* Thursday, May 27, 2010 4:14 PM > > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Internal Assembly Dependency > > > > The bug at > http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26793 suggests > you might have success with clr.LoadAssemblyFromFile. Otherwise, you might > be able to use the Fusion log viewer ( > http://msdn.microsoft.com/en-us/library/e74a18c4(VS.80).aspx) to debug the > assembly load process. > > 2010/5/27 Bakalar, Matthew (NIH/CIT) [C] > > In response to Lukas: > > I copied all of the assemblies, along with the script, to one folder. I > attempted to add a reference to MathNet.Iridium and received the following > error: > > > > >>> clr.AddReferenceByPartialName('MathNet.Iridium') > > Traceback (most recent call last): > > File "", line 1, in > > IOError: System.IO.IOException: Could not add reference to assembly > MathNet.Irid > > ium > > at > Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] arg > > s, Boolean& shouldOptimize) > > at > IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(Cal > > lSite site, CodeContext context, TFuncType func, T0 arg0) > > at > System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite s > > ite, T0 arg0, T1 arg1, T2 arg2) > > at > IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(Cal > > lSite site, CodeContext context, TFuncType func, T0 arg0) > > at > IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedF > > rame frame) > > at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame > frame) > > at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, > T1 a > > rg1) > > at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) > > at IronPython.Compiler.PythonScriptCode.Run(Scope scope) > > at > IronPython.Hosting.PythonCommandLine.<>c__DisplayClass1. > >b__0() > > > > This leads me to believe IronPython is having trouble loading this > particular assembly, but I cannot decode the error message. Have you ever > seen this trace before? > > > > In Response to David: > > I tried the solution you suggested with no luck. The error message I > receive is the same. I suspect that the hint I've provided above might lead > us to a solution. > > > > Thanks All, > > > > Matthew Bakalar > > > > *From:* Lukas Cenovsky [mailto:cenovsky at bakalari.cz] > *Sent:* Thursday, May 27, 2010 2:48 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Internal Assembly Dependency > > > > Bakalar, Matthew (NIH/CIT) [C] wrote: > > Hello All, > > I am new to IronPython, relatively new to C#, and new to this list. I have > a C# assembly that I am attempting to access from IronPython. I am able to > load the assembly using: > > clr.AddReferenceToFileAndPath(mypath) > > without any problems. I can then import the classes that reside within my > assembly as well, create instances of these classes, and call certain > methods on these instances. There are methods within this assembly that rely > on a reference to another assembly (MathNet.Iridium). When I attempt to call > these methods from my IronPython script, I receive the following error: > > IOError: [Errno 2] Could not load file or assembly 'MathNet.Iridium, > Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f' or > one of its dependencies. The system cannot find the file specified. > > Now, I never added a reference to MathNet.Iridium in my script. However, I > assumed that the C# assembly that I am calling directly was compiled with a > reference to this other assembly, and that I would not have to explicitly > add a reference. When I create a test assembly entirely in C# that calls the > assembly I am attempting to call, and do not include a reference to the > MathNet.Iridium assembly, I am able to execute the code without problems. Do > I need to add a reference to the MathNet.Iridium assembly from within my > IronPython script even though I don't intend to access it directly? > > Thanks > > Matthew Bakalar > > > First, try to copy all necessary assemblies to the folder with your script > and use AddReference for all of them. If that works, you can experiment with > assemblies in different folders. > > Note, the path in AddReferenceToFileAndPath should be full path. > > -- > -- 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 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri May 28 01:02:33 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 27 May 2010 23:02:33 +0000 Subject: [IronPython] Performance str.replace in Silverlight In-Reply-To: <4BFEA0B8.1080400@voidspace.org.uk> References: <4BFEA0B8.1080400@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD4894F2A6@TK5EX14MBXC118.redmond.corp.microsoft.com> Yikes! I'll take a look at this next Tuesday (the entire team is on vacation Until then) - a quick look over the code doesn't show us doing anything too stupid so I'm not sure what the problem is :( But feel free to open a bug in the mean time. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, May 27, 2010 9:41 AM > To: Discussion of IronPython > Subject: [IronPython] Performance str.replace in Silverlight > > Hey guys, > > I just tracked down a really nasty performance bug in our Silverlight > application. It turned out that doing a simple string replace in a 400 > character string was taking 700ms. As we actually do two replaces and > the text is usually substantially longer this was a real problem. > > I fixed the problem by switching to explicitly calling the .NET > String.Replace instead of str.replace, so it looks like an IronPython > issue. It doesn't happen with *all* text, but it looks like non-ascii > exacerbates the problem. > > The particular text that triggered it was: > > Die Neuanlage einer Welle muss auch zu Eintr?gen in der Tabelle > dbo_tv_wellenwebsitesfirmenverbinder f?hren. Dabei werden die > Zuordnungen aus der Vorwelle bei der Neuanlage einer neuen Welle > einmalig ?bernommen. Jede Zeile der Vorwelle wird also kopiert und die > Kopie erh?lt die Welle_uniqueID der neuen Welle. Die Verbindung > zwischen > Website_uniqueID <-> Firmen_uniqueID <-> FirmenAbrechnung_uniqueID > bleibt somit erhalten. > > The replace code was: > > text = text.replace('\r\n', '\n').replace('\r', '\n') > > The fix was: > > text = String.Replace(text, '\r\n', '\n') > text = String.Replace(text, '\r', '\n') > > All the best, > > Michael Foord > > -- > 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 Fri May 28 01:14:49 2010 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 27 May 2010 23:14:49 +0000 Subject: [IronPython] Willing to pay for help In-Reply-To: <28699466.post@talk.nabble.com> References: <28698448.post@talk.nabble.com> <28699466.post@talk.nabble.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD4894F2F5@TK5EX14MBXC118.redmond.corp.microsoft.com> Another way to do this, and one I think you were trying to accomplish, and is probably superior, would be to move this to another thread. In your code you have: #t = Thread(ThreadStart(CreateZip(zipname, fname))) #t.Start() Which I believe is where you're trying to do this. I would recommend moving the whole loop into its own function (probably defined in your Button3Click method so it just closes over the variables) such as: def Button3Click(...): ... def inner_func(unused): for fname in file_list: ... from System.Threading import ThreadPool ThreadPool.QueueUserWorkItem(inner_function) Then you just need to change your updates to the UI to be posted back on the UI thread. You do this using Control.BeginInvoke such as: def inner_func(unused): for fname in file_list: ... def update_text(): self._label4.Text = "Zipping file " + str(count) + " of " + str(len(file_list)) self.BeginInvoke(Action(update_text)) This will have the added benefit of never hanging - even if the zip operation is taking a very long period of time. You'll need to do the same thing for updating the progress bar, and you'll need to flow in the value in self._textBox2.Text, etc... Basically you can't touch the UI from any thread other than the UI thread. All of this was compiled w/ Outlook so hopefully it's mostly accurate and can get you going in the right direction if you want a slightly better solution. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of robinsiebler > Sent: Thursday, May 27, 2010 1:25 PM > To: users at lists.ironpython.com > Subject: Re: [IronPython] Willing to pay for help > > > That worked! Give me an e-mail address and I will send you the money. > Can you > recommend a good book to learn about WinForms and .NET in general? > > > Curt Hagenlocher wrote: > > > > You almost certainly need to be pump messages occasionally if you're > going > > to be performing a long operation on the UI thread. With Windows > Forms, > > this > > involves calling System.Windows.Forms.Application.DoEvents(). > > > > On Thu, May 27, 2010 at 11:55 AM, robinsiebler > > wrote: > > > >> > >> This is my 1st IronPython/.NET app. It is really simple, all it does > is > >> zip > >> all the files in a folder into an archive, 1 file per zip. > >> > >> The problem is that when it is zipping large files 200MB+ the app > stops > >> responding. It is still zipping files, but the UI doesn't update. I > don't > >> know how to fix this. > >> > >> The project is here - > >> > >> http://cid- > 0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip > >> > >> I've looked at all the examples and I am can't seem to figure out > how to > >> apply them to my app. I'm sur that if someone shows me how to do it > I > >> will > >> get it. > >> > >> I am willing to pay $30 to anyone who will help me solve the > problem. > >> The > >> problem is this - when zipping large files (100MB+) the UI stops > >> responding. > >> It doesn't refresh until all the files are zipped. > >> -- > >> View this message in context: > >> http://old.nabble.com/Willing-to-pay-for-help- > tp28698448p28698448.html > >> Sent from the IronPython mailing list archive at Nabble.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 > > > > > > -- > View this message in context: http://old.nabble.com/Willing-to-pay-for- > help-tp28698448p28699466.html > Sent from the IronPython mailing list archive at Nabble.com. > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From brandon at rhodesmill.org Fri May 28 02:25:00 2010 From: brandon at rhodesmill.org (Brandon Craig Rhodes) Date: Thu, 27 May 2010 20:25:00 -0400 Subject: [IronPython] how to make zlib available? Message-ID: <87sk5clvoj.fsf@rhodesmill.org> Hey, everyone! I am helping a client develop a new application that people will run on Windows machines (among other places). It occurred to us that third- party developers will be wanting to extend his application by writing in "familiar" languages like Visual Basic or C#. The "Python for .NET" project, which would have been one potential way to call third-party C# code, looks to have been rather moribund for the last three years, so I hesitated to recommend that we try it. But I remembered how many positive tweets and URLs about IronPython I have read over the last few months, and so I have convinced the client to give me a day to explore getting the application running under IronPython! The first obstacles fell quickly, but now I am encountering a serious obstacle: "zlib" is needed, and not only does something so basic not come with IronPython (is it a licensing thing?), but my normal Python installation in C:\Python26 does not seem to provide it as a separate DLL - it must be built right into the Python executable, I guess since the import mechanism itself might sometimes need it? There seems to be a Windows-specific version of "zlib" available here: http://bitbucket.org/jdhardy/ironpythonzlib/ But I can't get it working either. Its binary distribution's "IronPython.Zlib.dll" file gets completely ignored by IronPython, so far as I can tell, if I put it on my "sys.path" - but maybe that's because I'm using the most recent IronPython, "IronPython 2.6 for .NET 4.0" (as its "C:\Program Files" directory styles itself)? I have then attempted to compile it myself, by installing Visual Studio Express and then finding and running the "msbuild" command like this: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe IronPython.zlib.csproj I mean, I'm not actually sure that command is meaningful, but I saw it somewhere on Stack Overflow and it at least looks like it tries to compile something. But the result is an utter failure. For one thing, it can't find absolutely anything mentioned in the "csproj" file, whose crazy "" paths are, well, crazy! Who on earth has these libraries sitting in locations under a "Bin" directory? Anyway, I tried to repair some of the "" elements by hand, and got a little further, but now I'm somewhere in a tangled forest of incompatibility involving the version number of something called "System.Core" (which not only sounds important, but is declared by the error message to be a "referenced assembly" which is impressively polysyllabic). So: 1. What do *you* guys do every day when you need "zlib"? 2. Should its binary distro work with .NET 4.0 and I'm not trying hard enough? 3. If I need to compile it, how do I make the "csproj" file work on a system where things are not located in exactly the same places they are on jdhardy's system? Thanks for any pointers - I would love to get this app running on IronPython! Not only would we get "real" threads and get to back down from all of these "multiprocessing" experiments I have been doing (because, wow, secondary processes are *heavyweights* under Windows!), but we'd be able to interoperate with .NET and stuff. Plus then I would have a project that let me play with IronPython like the other cool kids. :-) -- Brandon Craig Rhodes brandon at rhodesmill.org http://rhodesmill.org/brandon From cenovsky at bakalari.cz Fri May 28 09:03:59 2010 From: cenovsky at bakalari.cz (Lukas Cenovsky) Date: Fri, 28 May 2010 09:03:59 +0200 Subject: [IronPython] Willing to pay for help In-Reply-To: <1A472770E042064698CB5ADC83A12ACD4894F2F5@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <28698448.post@talk.nabble.com> <28699466.post@talk.nabble.com> <1A472770E042064698CB5ADC83A12ACD4894F2F5@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <4BFF6ADF.7030105@bakalari.cz> I recommend to check DevHawk's posts on Background processing: http://devhawk.net/2008/11/19/IronPython+And+WPF+Part+4+Background+Processing.aspx http://devhawk.net/2008/11/21/Background+Processing+ReRevisited.aspx -- -- Luk?s( Dino Viehland wrote: > Another way to do this, and one I think you were trying to accomplish, and > is probably superior, would be to move this to another thread. In your code > you have: > > #t = Thread(ThreadStart(CreateZip(zipname, fname))) > #t.Start() > > Which I believe is where you're trying to do this. I would recommend moving > the whole loop into its own function (probably defined in your Button3Click > method so it just closes over the variables) such as: > > def Button3Click(...): > ... > def inner_func(unused): > for fname in file_list: > ... > > from System.Threading import ThreadPool > ThreadPool.QueueUserWorkItem(inner_function) > > Then you just need to change your updates to the UI to be posted back on the > UI thread. You do this using Control.BeginInvoke such as: > > def inner_func(unused): > for fname in file_list: > ... > def update_text(): > self._label4.Text = "Zipping file " + str(count) + " of " + str(len(file_list)) > > self.BeginInvoke(Action(update_text)) > > This will have the added benefit of never hanging - even if the zip operation > is taking a very long period of time. You'll need to do the same thing for > updating the progress bar, and you'll need to flow in the value in > self._textBox2.Text, etc... Basically you can't touch the UI from any thread > other than the UI thread. > > All of this was compiled w/ Outlook so hopefully it's mostly accurate and can > get you going in the right direction if you want a slightly better solution. > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of robinsiebler >> Sent: Thursday, May 27, 2010 1:25 PM >> To: users at lists.ironpython.com >> Subject: Re: [IronPython] Willing to pay for help >> >> >> That worked! Give me an e-mail address and I will send you the money. >> Can you >> recommend a good book to learn about WinForms and .NET in general? >> >> >> Curt Hagenlocher wrote: >> >>> You almost certainly need to be pump messages occasionally if you're >>> >> going >> >>> to be performing a long operation on the UI thread. With Windows >>> >> Forms, >> >>> this >>> involves calling System.Windows.Forms.Application.DoEvents(). >>> >>> On Thu, May 27, 2010 at 11:55 AM, robinsiebler >>> wrote: >>> >>> >>>> This is my 1st IronPython/.NET app. It is really simple, all it does >>>> >> is >> >>>> zip >>>> all the files in a folder into an archive, 1 file per zip. >>>> >>>> The problem is that when it is zipping large files 200MB+ the app >>>> >> stops >> >>>> responding. It is still zipping files, but the UI doesn't update. I >>>> >> don't >> >>>> know how to fix this. >>>> >>>> The project is here - >>>> >>>> http://cid- >>>> >> 0c375b07f1f323b6.skydrive.live.com/self.aspx/.Public/ZipfilesGUI.zip >> >>>> I've looked at all the examples and I am can't seem to figure out >>>> >> how to >> >>>> apply them to my app. I'm sur that if someone shows me how to do it >>>> >> I >> >>>> will >>>> get it. >>>> >>>> I am willing to pay $30 to anyone who will help me solve the >>>> >> problem. >> >>>> The >>>> problem is this - when zipping large files (100MB+) the UI stops >>>> responding. >>>> It doesn't refresh until all the files are zipped. >>>> -- >>>> View this message in context: >>>> http://old.nabble.com/Willing-to-pay-for-help- >>>> >> tp28698448p28698448.html >> >>>> Sent from the IronPython mailing list archive at Nabble.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 >>> >>> >>> >> -- >> View this message in context: http://old.nabble.com/Willing-to-pay-for- >> help-tp28698448p28699466.html >> Sent from the IronPython mailing list archive at Nabble.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 fuzzyman at voidspace.org.uk Fri May 28 10:17:54 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 28 May 2010 09:17:54 +0100 Subject: [IronPython] how to make zlib available? In-Reply-To: <87sk5clvoj.fsf@rhodesmill.org> References: <87sk5clvoj.fsf@rhodesmill.org> Message-ID: <4BFF7C32.6030804@voidspace.org.uk> On 28/05/2010 01:25, Brandon Craig Rhodes wrote: > Hey, everyone! > > I am helping a client develop a new application that people will run on > Windows machines (among other places). It occurred to us that third- > party developers will be wanting to extend his application by writing in > "familiar" languages like Visual Basic or C#. The "Python for .NET" > project, which would have been one potential way to call third-party C# > code, looks to have been rather moribund for the last three years, so I > hesitated to recommend that we try it. > > But I remembered how many positive tweets and URLs about IronPython I > have read over the last few months, and so I have convinced the client > to give me a day to explore getting the application running under > IronPython! > > The first obstacles fell quickly, but now I am encountering a serious > obstacle: "zlib" is needed, and not only does something so basic not > come with IronPython (is it a licensing thing?), but my normal Python > installation in C:\Python26 does not seem to provide it as a separate > DLL - it must be built right into the Python executable, I guess since > the import mechanism itself might sometimes need it? > > There seems to be a Windows-specific version of "zlib" available here: > > http://bitbucket.org/jdhardy/ironpythonzlib/ > > But I can't get it working either. Its binary distribution's > "IronPython.Zlib.dll" file gets completely ignored by IronPython, so far > as I can tell, if I put it on my "sys.path" With that dll on sys.path, try: import clr clr.AddReference('IronPython.Zlib') Once you have successfully added a reference to the assembly you should then be able to import from it. HTH, Michael > - but maybe that's because > I'm using the most recent IronPython, "IronPython 2.6 for .NET 4.0" (as > its "C:\Program Files" directory styles itself)? I have then attempted > to compile it myself, by installing Visual Studio Express and then > finding and running the "msbuild" command like this: > > C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe IronPython.zlib.csproj > > I mean, I'm not actually sure that command is meaningful, but I saw it > somewhere on Stack Overflow and it at least looks like it tries to > compile something. But the result is an utter failure. For one thing, > it can't find absolutely anything mentioned in the "csproj" file, whose > crazy "" paths are, well, crazy! Who on earth has these > libraries sitting in locations under a "Bin" directory? Anyway, I tried > to repair some of the "" elements by hand, and got a little > further, but now I'm somewhere in a tangled forest of incompatibility > involving the version number of something called "System.Core" (which > not only sounds important, but is declared by the error message to be a > "referenced assembly" which is impressively polysyllabic). > > So: > > 1. What do *you* guys do every day when you need "zlib"? > 2. Should its binary distro work with .NET 4.0 and I'm not trying hard enough? > 3. If I need to compile it, how do I make the "csproj" file work on a > system where things are not located in exactly the same places they > are on jdhardy's system? > > Thanks for any pointers - I would love to get this app running on > IronPython! Not only would we get "real" threads and get to back down > from all of these "multiprocessing" experiments I have been doing > (because, wow, secondary processes are *heavyweights* under Windows!), > but we'd be able to interoperate with .NET and stuff. Plus then I would > have a project that let me play with IronPython like the other cool > kids. :-) > > -- 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 Fri May 28 10:31:56 2010 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 28 May 2010 09:31:56 +0100 Subject: [IronPython] Performance str.replace in Silverlight In-Reply-To: <1A472770E042064698CB5ADC83A12ACD4894F2A6@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <4BFEA0B8.1080400@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD4894F2A6@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: <4BFF7F7C.5080105@voidspace.org.uk> On 28/05/2010 00:02, Dino Viehland wrote: > Yikes! I'll take a look at this next Tuesday (the entire team is on vacation > Until then) - a quick look over the code doesn't show us doing anything too stupid > so I'm not sure what the problem is :( But feel free to open a bug in the mean > time. > I thought it was quiet. :-) Thanks Michael > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Thursday, May 27, 2010 9:41 AM >> To: Discussion of IronPython >> Subject: [IronPython] Performance str.replace in Silverlight >> >> Hey guys, >> >> I just tracked down a really nasty performance bug in our Silverlight >> application. It turned out that doing a simple string replace in a 400 >> character string was taking 700ms. As we actually do two replaces and >> the text is usually substantially longer this was a real problem. >> >> I fixed the problem by switching to explicitly calling the .NET >> String.Replace instead of str.replace, so it looks like an IronPython >> issue. It doesn't happen with *all* text, but it looks like non-ascii >> exacerbates the problem. >> >> The particular text that triggered it was: >> >> Die Neuanlage einer Welle muss auch zu Eintr?gen in der Tabelle >> dbo_tv_wellenwebsitesfirmenverbinder f?hren. Dabei werden die >> Zuordnungen aus der Vorwelle bei der Neuanlage einer neuen Welle >> einmalig ?bernommen. Jede Zeile der Vorwelle wird also kopiert und die >> Kopie erh?lt die Welle_uniqueID der neuen Welle. Die Verbindung >> zwischen >> Website_uniqueID<-> Firmen_uniqueID<-> FirmenAbrechnung_uniqueID >> bleibt somit erhalten. >> >> The replace code was: >> >> text = text.replace('\r\n', '\n').replace('\r', '\n') >> >> The fix was: >> >> text = String.Replace(text, '\r\n', '\n') >> text = String.Replace(text, '\r', '\n') >> >> All the best, >> >> Michael Foord >> >> -- >> 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. From bakalarmh at mail.nih.gov Fri May 28 15:09:59 2010 From: bakalarmh at mail.nih.gov (Bakalar, Matthew (NIH/CIT) [C]) Date: Fri, 28 May 2010 09:09:59 -0400 Subject: [IronPython] Internal Assembly Dependency In-Reply-To: References: <69A3D9C1907FEF4388A1365AA59A9C7314044A0D4B@NIHMLBX05.nih.gov> <4BFE158F.20600@bakalari.cz> <69A3D9C1907FEF4388A1365AA59A9C7314044A0DA4@NIHMLBX05.nih.gov> <69A3D9C1907FEF4388A1365AA59A9C7314044A0DF7@NIHMLBX05.nih.gov> Message-ID: <69A3D9C1907FEF4388A1365AA59A9C7314044A0E0C@NIHMLBX05.nih.gov> Well, I just rebuilt the assembly on my machine. Now, I am able to load it into IronPython without any problems. Maybe your idea was on target and the library was compiled to target only x86 machines. I am hoping I won't run into any new problems when deploying the app on 32 bit machines. Thanks for all the help everyone Matt Bakalar From: Curt Hagenlocher [mailto:curt at hagenlocher.org] Sent: Thursday, May 27, 2010 5:02 PM To: Discussion of IronPython Subject: Re: [IronPython] Internal Assembly Dependency Is it possible that the assembly has been compiled targeting specifically x86 and you're running a 64-bit process (or vice versa)? 2010/5/27 Bakalar, Matthew (NIH/CIT) [C] > Thanks for the suggestion, I tried the bug fix suggested on the link you posted. clr.LoadAssemblyFromFile does not throw an exception, but it also doesn't return an assembly (in contrast, calling clr.LoadAssemblyFromFile for a different assembly in the same directory returns an object that prints itself as: ) I have been picking through the log files, but I am inexperienced interpreting them. The first log item shows an error, but after that I receive two log items that claim "The operation was succesful. Bind result: hr = 0x0." To confuse matters, at the end of these "successful" log entries is the line: LOG: IJW assembly bind returned file not found. I looked up the error in the first log message, hr = 0x80070002. I found a reference at http://blogs.msdn.com/b/suzcook/archive/2003/05/29/57120.aspx that suggests it is actually a FileNotFoundException. Would this error ever be thrown when the assembly did actually exist? As I said before, I'm using it from this location with pure C# code. I have double checked my sys.path to make sure it includes the folder where the assembly is located. Could the problem be in the naming of the assembly? For reference sake, I am running windows vista x64. Thanks Matthew Bakalar The following items are logged when I attempt to load the problem assembly: *** Assembly Binder Log Entry (5/27/2010 @ 4:39:16 PM) *** The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Users\bakalarmh\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools for Visual Studio\0.2\RemoteScriptFactory.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = NIH\bakalarmh LOG: DisplayName = MathNet.Iridium, Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f (Fully-specified) LOG: Appbase = file:///C:/Users/bakalarmh/AppData/Local/Microsoft/VisualStudio/10.0/Extensions/Microsoft/IronPython Tools for Visual Studio/0.2/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = RemoteScriptFactory.exe Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: No application configuration file found. LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: MathNet.Iridium, Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f LOG: The same bind was seen before, and was failed with hr = 0x80070002. ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070002). *** Assembly Binder Log Entry (5/27/2010 @ 4:39:16 PM) *** The operation was successful. Bind result: hr = 0x0. The operation completed successfully. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Users\bakalarmh\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools for Visual Studio\0.2\RemoteScriptFactory.exe --- A detailed error log follows. LOG: IJW explicit bind. File path:C:\Users\bakalarmh\Documents\NIH Dropbox\My Dropbox\Target\Target\bin\Debug\MathNet.Iridium.DLL. LOG: IJW assembly bind returned file not found. *** Assembly Binder Log Entry (5/27/2010 @ 4:39:16 PM) *** The operation was successful. Bind result: hr = 0x0. The operation completed successfully. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Users\bakalarmh\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools for Visual Studio\0.2\RemoteScriptFactory.exe --- A detailed error log follows. LOG: IJW explicit bind. File path:C:\Users\bakalarmh\Documents\NIH Dropbox\My Dropbox\Target\Target\bin\Debug\MathNet.Iridium.dll. LOG: IJW assembly bind returned file not found. From: Curt Hagenlocher [mailto:curt at hagenlocher.org] Sent: Thursday, May 27, 2010 4:14 PM To: Discussion of IronPython Subject: Re: [IronPython] Internal Assembly Dependency The bug at http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26793 suggests you might have success with clr.LoadAssemblyFromFile. Otherwise, you might be able to use the Fusion log viewer (http://msdn.microsoft.com/en-us/library/e74a18c4(VS.80).aspx) to debug the assembly load process. 2010/5/27 Bakalar, Matthew (NIH/CIT) [C] > In response to Lukas: I copied all of the assemblies, along with the script, to one folder. I attempted to add a reference to MathNet.Iridium and received the following error: >>> clr.AddReferenceByPartialName('MathNet.Iridium') Traceback (most recent call last): File "", line 1, in IOError: System.IO.IOException: Could not add reference to assembly MathNet.Irid ium at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] arg s, Boolean& shouldOptimize) at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(Cal lSite site, CodeContext context, TFuncType func, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite s ite, T0 arg0, T1 arg1, T2 arg2) at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(Cal lSite site, CodeContext context, TFuncType func, T0 arg0) at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedF rame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 a rg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at IronPython.Compiler.PythonScriptCode.Run(Scope scope) at IronPython.Hosting.PythonCommandLine.<>c__DisplayClass1.b__0() This leads me to believe IronPython is having trouble loading this particular assembly, but I cannot decode the error message. Have you ever seen this trace before? In Response to David: I tried the solution you suggested with no luck. The error message I receive is the same. I suspect that the hint I've provided above might lead us to a solution. Thanks All, Matthew Bakalar From: Lukas Cenovsky [mailto:cenovsky at bakalari.cz] Sent: Thursday, May 27, 2010 2:48 AM To: Discussion of IronPython Subject: Re: [IronPython] Internal Assembly Dependency Bakalar, Matthew (NIH/CIT) [C] wrote: Hello All, I am new to IronPython, relatively new to C#, and new to this list. I have a C# assembly that I am attempting to access from IronPython. I am able to load the assembly using: clr.AddReferenceToFileAndPath(mypath) without any problems. I can then import the classes that reside within my assembly as well, create instances of these classes, and call certain methods on these instances. There are methods within this assembly that rely on a reference to another assembly (MathNet.Iridium). When I attempt to call these methods from my IronPython script, I receive the following error: IOError: [Errno 2] Could not load file or assembly 'MathNet.Iridium, Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f' or one of its dependencies. The system cannot find the file specified. Now, I never added a reference to MathNet.Iridium in my script. However, I assumed that the C# assembly that I am calling directly was compiled with a reference to this other assembly, and that I would not have to explicitly add a reference. When I create a test assembly entirely in C# that calls the assembly I am attempting to call, and do not include a reference to the MathNet.Iridium assembly, I am able to execute the code without problems. Do I need to add a reference to the MathNet.Iridium assembly from within my IronPython script even though I don't intend to access it directly? Thanks Matthew Bakalar First, try to copy all necessary assemblies to the folder with your script and use AddReference for all of them. If that works, you can experiment with assemblies in different folders. Note, the path in AddReferenceToFileAndPath should be full path. -- -- 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bakalarmh at mail.nih.gov Fri May 28 15:42:50 2010 From: bakalarmh at mail.nih.gov (Bakalar, Matthew (NIH/CIT) [C]) Date: Fri, 28 May 2010 09:42:50 -0400 Subject: [IronPython] Internal Assembly Dependency In-Reply-To: <69A3D9C1907FEF4388A1365AA59A9C7314044A0DA4@NIHMLBX05.nih.gov> References: <69A3D9C1907FEF4388A1365AA59A9C7314044A0D4B@NIHMLBX05.nih.gov> <4BFE158F.20600@bakalari.cz> <69A3D9C1907FEF4388A1365AA59A9C7314044A0DA4@NIHMLBX05.nih.gov> Message-ID: <69A3D9C1907FEF4388A1365AA59A9C7314044A0E15@NIHMLBX05.nih.gov> To close off this discussion and recap, sorry for the multiple emails today: I recompiled the problem Assembly on my development machine, and can now execute methods that refer to objects in that assembly without explicitly adding a reference to it. In the end, the problem seemed to lie in the Assembly rather than anything I was doing with IronPython. An assembly that I add a reference to in IronPython is able to access other assemblies that it references internally, there is no need to explicitly reference these internal assemblies. Thanks for all the help! Matt Bakalar From: Bakalar, Matthew (NIH/CIT) [C] Sent: Thursday, May 27, 2010 1:10 PM To: Discussion of IronPython Subject: Re: [IronPython] Internal Assembly Dependency In response to Lukas: I copied all of the assemblies, along with the script, to one folder. I attempted to add a reference to MathNet.Iridium and received the following error: >>> clr.AddReferenceByPartialName('MathNet.Iridium') Traceback (most recent call last): File "", line 1, in IOError: System.IO.IOException: Could not add reference to assembly MathNet.Irid ium at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] arg s, Boolean& shouldOptimize) at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(Cal lSite site, CodeContext context, TFuncType func, T0 arg0) at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite s ite, T0 arg0, T1 arg1, T2 arg2) at IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(Cal lSite site, CodeContext context, TFuncType func, T0 arg0) at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedF rame frame) at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 a rg1) at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) at IronPython.Compiler.PythonScriptCode.Run(Scope scope) at IronPython.Hosting.PythonCommandLine.<>c__DisplayClass1.b__0() This leads me to believe IronPython is having trouble loading this particular assembly, but I cannot decode the error message. Have you ever seen this trace before? In Response to David: I tried the solution you suggested with no luck. The error message I receive is the same. I suspect that the hint I've provided above might lead us to a solution. Thanks All, Matthew Bakalar From: Lukas Cenovsky [mailto:cenovsky at bakalari.cz] Sent: Thursday, May 27, 2010 2:48 AM To: Discussion of IronPython Subject: Re: [IronPython] Internal Assembly Dependency Bakalar, Matthew (NIH/CIT) [C] wrote: Hello All, I am new to IronPython, relatively new to C#, and new to this list. I have a C# assembly that I am attempting to access from IronPython. I am able to load the assembly using: clr.AddReferenceToFileAndPath(mypath) without any problems. I can then import the classes that reside within my assembly as well, create instances of these classes, and call certain methods on these instances. There are methods within this assembly that rely on a reference to another assembly (MathNet.Iridium). When I attempt to call these methods from my IronPython script, I receive the following error: IOError: [Errno 2] Could not load file or assembly 'MathNet.Iridium, Version=2008.8.16.470, Culture=neutral, PublicKeyToken=c061a3ec32cc0c6f' or one of its dependencies. The system cannot find the file specified. Now, I never added a reference to MathNet.Iridium in my script. However, I assumed that the C# assembly that I am calling directly was compiled with a reference to this other assembly, and that I would not have to explicitly add a reference. When I create a test assembly entirely in C# that calls the assembly I am attempting to call, and do not include a reference to the MathNet.Iridium assembly, I am able to execute the code without problems. Do I need to add a reference to the MathNet.Iridium assembly from within my IronPython script even though I don't intend to access it directly? Thanks Matthew Bakalar First, try to copy all necessary assemblies to the folder with your script and use AddReference for all of them. If that works, you can experiment with assemblies in different folders. Note, the path in AddReferenceToFileAndPath should be full path. -- -- Luk?? -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at tplus1.com Fri May 28 20:22:20 2010 From: matt at tplus1.com (Matthew Wilson) Date: Fri, 28 May 2010 18:22:20 +0000 (UTC) Subject: [IronPython] ipy.exe ez_setup.py failed Message-ID: Hi -- I'm going to port some code over to IronPython and right now, the setup.py script uses setuptools. I tried installing setuptools by running ipy.exe ez_setup.py, and got an error. Should I rewrite the code not to use setuptools or is it possible to use setuptools with IronPython? Matt From jdhardy at gmail.com Sat May 29 08:42:25 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 29 May 2010 00:42:25 -0600 Subject: [IronPython] how to make zlib available? In-Reply-To: <87sk5clvoj.fsf@rhodesmill.org> References: <87sk5clvoj.fsf@rhodesmill.org> Message-ID: I wrote IronPython.Zlib, so I'm sorry to hear you're having issues. On Thu, May 27, 2010 at 6:25 PM, Brandon Craig Rhodes wrote: > There seems to be a Windows-specific version of "zlib" available here: > > http://bitbucket.org/jdhardy/ironpythonzlib/ Actually, it should work on Linux as well, but I've just never tried it. > > But I can't get it working either. ?Its binary distribution's > "IronPython.Zlib.dll" file gets completely ignored by IronPython, so far > as I can tell, if I put it on my "sys.path" - but maybe that's because > I'm using the most recent IronPython, "IronPython 2.6 for .NET 4.0" (as > its "C:\Program Files" directory styles itself)? You should place it in the 'DLLs' directory under C:\Program Files\IronPython 2.6. This directory doesn't exist when IronPython is installed, so you'll probably have to create it. IronPython will automatically load any DLLs in that directory on startup. One catch, however, is that I have yet to build it for .NET 4. That could be a problem. > I have then attempted > to compile it myself, by installing Visual Studio Express and then > finding and running the "msbuild" command like this: > > C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe IronPython.zlib.csproj That should do the trick, or close enough. You could also try Visual C# Express, but that's a bit of a download to build one small library. > > I mean, I'm not actually sure that command is meaningful, but I saw it > somewhere on Stack Overflow and it at least looks like it tries to > compile something. ?But the result is an utter failure. ?For one thing, > it can't find absolutely anything mentioned in the "csproj" file, whose > crazy "" paths are, well, crazy! ?Who on earth has these > libraries sitting in locations under a "Bin" directory? I do :) That's where the IronPython build process places them when you build it from the source, which I was doing up until 2.6 final was released. Changing them to 'C:\Program Files\IronPython 2.6\...' should do the trick. I'm not really sure of a better way to make them useful for general consumption. > So: > > 1. What do *you* guys do every day when you need "zlib"? IronPython.Zlib. Duh :) > 2. Should its binary distro work with .NET 4.0 and I'm not trying hard enough? I'm not sure. I have a feeling it may require a special build for .NET 4. > 3. If I need to compile it, how do I make the "csproj" file work on a > ? system where things are not located in exactly the same places they > ? are on jdhardy's system? I'm going to have to figure this one out myself. My systems aren't configured *that* strangely, but something still seems to be specific to my machine. All o that said, I just uploaded a .NET 4 binary to http://bitbucket.org/jdhardy/ironpythonzlib/downloads - you want IronPython.Zlib-2.6-clr4.zip. Let me know if this works better for you, and anything else that could be improved to make the process easier. - Jeff From jdhardy at gmail.com Sat May 29 08:48:40 2010 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 29 May 2010 00:48:40 -0600 Subject: [IronPython] ipy.exe ez_setup.py failed In-Reply-To: References: Message-ID: On Fri, May 28, 2010 at 12:22 PM, Matthew Wilson wrote: > Should I rewrite the code not to use setuptools or is it possible to use > setuptools with IronPython? Some parts of setuptools will work, and some parts won't. It's been a while since I looked into it, so I can't remember exatly what doesn't work. I do know, however, that ez_setup.py doesn't work correctly. If you install setuptools manually - download a tarball and drop it into a folder on sys.path - you should be able to run your setup.py and see if still breaks.. Long term, though, I think you're going to want to get away from setuptools - it hasn't been maintained in a while, and there's work afoot to add a good chunk of it's features to distutils in the satndard library to ensure long term maintenance. - Jeff From tristanz at gmail.com Sun May 30 00:59:20 2010 From: tristanz at gmail.com (Tristan Zajonc) Date: Sat, 29 May 2010 18:59:20 -0400 Subject: [IronPython] ctypes on Mono Message-ID: I'm running the the latest IronPython 2.6.1 (.NET 2.0 version) with Mono. I cannot import ctypes. Is this behavior expected? Any solutions? Here are the exact results: On OSX: IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes Traceback (most recent call last): SystemError: libdl.so On Ubuntu (using trunk Mono): IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes Traceback (most recent call last): OSError: IronPython.Runtime.Exceptions.OSException: cannot load library at IronPython.Modules.CTypes.LoadLibrary (System.String library, Int32 mode) [0x00000] in :0 at IronPython.Modules.CTypes.dlopen (System.String library, Int32 mode) [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod*,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 Best, Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From idan at cloudshare.com Sun May 30 15:50:13 2010 From: idan at cloudshare.com (Idan Zaltzberg) Date: Sun, 30 May 2010 16:50:13 +0300 Subject: [IronPython] possible bug with __delattr__ in Ipy 2.6 Message-ID: <26bf20a3c98f525d47c488b09bf58e18@mail.gmail.com> Hi, In IronPython 2.6 I ran the following code: class A(object): def f(self): self.__delattr__('x') a = A() a.x=1 a.f() Traceback (most recent call last): File "", line 1, in File "", line 3, in f AttributeError: 'A' object has no attribute 'x' This code runs ok on cpython so I'm guessing this is bug? -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcronin at asrclkrec.com Sun May 30 22:12:10 2010 From: tcronin at asrclkrec.com (Cronin, Ted) Date: Sun, 30 May 2010 13:12:10 -0700 Subject: [IronPython] ctypes on Mono Message-ID: Sent from my Windows Mobile? phone. ________________________________ From: Tristan Zajonc Sent: Saturday, May 29, 2010 3:59 PM To: Discussion of IronPython Subject: [IronPython] ctypes on Mono I'm running the the latest IronPython 2.6.1 (.NET 2.0 version) with Mono. I cannot import ctypes. Is this behavior expected? Any solutions? Here are the exact results: On OSX: IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes Traceback (most recent call last): SystemError: libdl.so On Ubuntu (using trunk Mono): IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes Traceback (most recent call last): OSError: IronPython.Runtime.Exceptions.OSException: cannot load library at IronPython.Modules.CTypes.LoadLibrary (System.String library, Int32 mode) [0x00000] in :0 at IronPython.Modules.CTypes.dlopen (System.String library, Int32 mode) [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod*,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 Best, Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcronin at asrclkrec.com Sun May 30 22:13:24 2010 From: tcronin at asrclkrec.com (Cronin, Ted) Date: Sun, 30 May 2010 13:13:24 -0700 Subject: [IronPython] ctypes on Mono Message-ID: assassqassassqqqqqqqqqqqqq Sent from my Windows Mobile? phone. ________________________________ From: Tristan Zajonc Sent: Saturday, May 29, 2010 3:59 PM To: Discussion of IronPython Subject: [IronPython] ctypes on Mono I'm running the the latest IronPython 2.6.1 (.NET 2.0 version) with Mono. I cannot import ctypes. Is this behavior expected? Any solutions? Here are the exact results: On OSX: IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes Traceback (most recent call last): SystemError: libdl.so On Ubuntu (using trunk Mono): IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes Traceback (most recent call last): OSError: IronPython.Runtime.Exceptions.OSException: cannot load library at IronPython.Modules.CTypes.LoadLibrary (System.String library, Int32 mode) [0x00000] in :0 at IronPython.Modules.CTypes.dlopen (System.String library, Int32 mode) [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod*,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 Best, Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Mon May 31 00:24:14 2010 From: dinov at microsoft.com (Dino Viehland) Date: Sun, 30 May 2010 22:24:14 +0000 Subject: [IronPython] ctypes on Mono In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD48964922@TK5EX14MBXC118.redmond.corp.microsoft.com> On OS/X I believe you need to use Mono's DllMap feature (http://www.mono-project.com/Config_DllMap) to map from the Linux library name (libdl.so) to the Mac OS/X library which exports dlopen. I actually have no clue what exports it and I don't see one listed over here: http://gemma.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man3/dlopen.3.html so hopefully someone else on the list knows. It looks like on Linux the -X:ExceptionDetail command line option is being passed which is preventing the stack trace from having any line number information - or maybe the stack trace is cut off? Either way it'd be useful to see the line number which is calling dlopen to understand what library we are failing to load. My guess would be that it's trying to load the Python library but I'd think that would work fine (it looks like we pass in a null path in that case which should be alright for dlopen). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tristan Zajonc Sent: Saturday, May 29, 2010 3:59 PM To: Discussion of IronPython Subject: [IronPython] ctypes on Mono I'm running the the latest IronPython 2.6.1 (.NET 2.0 version) with Mono. I cannot import ctypes. Is this behavior expected? Any solutions? Here are the exact results: On OSX: IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes Traceback (most recent call last): SystemError: libdl.so On Ubuntu (using trunk Mono): IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes Traceback (most recent call last): OSError: IronPython.Runtime.Exceptions.OSException: cannot load library at IronPython.Modules.CTypes.LoadLibrary (System.String library, Int32 mode) [0x00000] in :0 at IronPython.Modules.CTypes.dlopen (System.String library, Int32 mode) [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod*,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 Best, Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From tristanz at gmail.com Mon May 31 00:56:55 2010 From: tristanz at gmail.com (Tristan Zajonc) Date: Sun, 30 May 2010 18:56:55 -0400 Subject: [IronPython] ctypes on Mono In-Reply-To: <1A472770E042064698CB5ADC83A12ACD48964922@TK5EX14MBXC118.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD48964922@TK5EX14MBXC118.redmond.corp.microsoft.com> Message-ID: (I'll look into OSX issue, although am happy to hear a solution from other users) I'm not sure why I don't get line numbers. If I pass -XExceptionDetail, I don't get much more: tristanz at aontic1:~$ ipy -X:ExceptionDetail IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433 Type "help", "copyright", "credits" or "license" for more information. >>> import ctypes cannot load library LoadLibrary at offset 0 in file:line:column :0:0 dlopen at offset 0 in file:line:column :0:0 Invoke at offset 0 in file:line:column :0:0 at IronPython.Modules.CTypes.LoadLibrary (System.String library, Int32 mode) [0x00000] in :0 at IronPython.Modules.CTypes.dlopen (System.String library, Int32 mode) [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod*,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 OSError: IronPython.Runtime.Exceptions.OSException: cannot load library at IronPython.Modules.CTypes.LoadLibrary (System.String library, Int32 mode) [0x00000] in :0 at IronPython.Modules.CTypes.dlopen (System.String library, Int32 mode) [0x00000] in :0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod*,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 On Sun, May 30, 2010 at 6:24 PM, Dino Viehland wrote: > On OS/X I believe you need to use Mono?s DllMap feature ( > http://www.mono-project.com/Config_DllMap) to map from the Linux library > name (libdl.so) to the Mac OS/X library which exports dlopen. I actually > have no clue what exports it and I don?t see one listed over here: > http://gemma.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man3/dlopen.3.htmlso hopefully someone else on the list knows. > > > > It looks like on Linux the ?X:ExceptionDetail command line option is being > passed which is preventing the stack trace from having any line number > information - or maybe the stack trace is cut off? Either way it?d be > useful to see the line number which is calling dlopen to understand what > library we are failing to load. My guess would be that it?s trying to load > the Python library but I?d think that would work fine (it looks like we pass > in a null path in that case which should be alright for dlopen). > > > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Tristan Zajonc > > *Sent:* Saturday, May 29, 2010 3:59 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] ctypes on Mono > > > > I'm running the the latest IronPython 2.6.1 (.NET 2.0 version) with Mono. > I cannot import ctypes. > > > > Is this behavior expected? Any solutions? Here are the exact results: > > > > On OSX: > > IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433 > > Type "help", "copyright", "credits" or "license" for more information. > > >>> import ctypes > > Traceback (most recent call last): > > SystemError: libdl.so > > > > On Ubuntu (using trunk Mono): > > > > IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433 > > Type "help", "copyright", "credits" or "license" for more information. > > >>> import ctypes > > Traceback (most recent call last): > > OSError: IronPython.Runtime.Exceptions.OSException: cannot load library > > at IronPython.Modules.CTypes.LoadLibrary (System.String library, Int32 > mode) [0x00000] in :0 > > at IronPython.Modules.CTypes.dlopen (System.String library, Int32 mode) > [0x00000] in :0 > > at (wrapper managed-to-native) > System.Reflection.MonoMethod:InternalInvoke > (System.Reflection.MonoMethod*,object,object[],System.Exception&) > > at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags > invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, > System.Globalization.CultureInfo culture) [0x00000] in :0 > > > > > > Best, > > 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 tristanz at gmail.com Mon May 31 03:59:02 2010 From: tristanz at gmail.com (Tristan Zajonc) Date: Sun, 30 May 2010 21:59:02 -0400 Subject: [IronPython] Implementing Greenlets API in IronPython Message-ID: Hi - The greenlets C-extension module (http://packages.python.org/greenlet/) provides a very basic api that is used by eventlet and gevent to provide asynchronous programming constructs. It would be nice to have a reasonably performant version of the greenlet API in IronPython. Before I start playing around with possibilities, is there an obvious approach to implement the greenlets API in IronPython? Thanks Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: From cgencer at gmail.com Mon May 31 18:12:21 2010 From: cgencer at gmail.com (Can Gencer) Date: Mon, 31 May 2010 18:12:21 +0200 Subject: [IronPython] Using IronClad PyEval_GetLocals, not implemented? Message-ID: Hello, I am trying to use a .pyd module, that is using the PyEval_GetLocals() function together with IronClad. The module imports fine, however when running I get this exception: NotImplementedError: PyEval_GetLocals Error: PyEval_GetLocals is not yet implemented However ,looking at the IronClad source code, I can see that there is an implementation for this function, in eval.c class. Am I missing something here? Thanks for any help! From dinov at microsoft.com Mon May 31 19:28:48 2010 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 31 May 2010 17:28:48 +0000 Subject: [IronPython] Implementing Greenlets API in IronPython In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD489691A2@TK5EX14MBXC118.redmond.corp.microsoft.com> You'll want to first look at GeneratorRewriter.cs - it's responsible for taking a DLR AST and re-writing it so that it can re-start at an arbitrary location and so that it's stackless. There's one of these for debugging and one that's used for IronPython's generators, you can probably adapt either one. You can get the AST to re-write from the function code object but that's not public right now (we'll make it public if anyone has a compelling scenario to do so - this could be it but you'll probably need more public surface area as well). >From there I think you just need to worry about having to save multiple frames (which I get the impression is supported from the docs - eg f() calls g() and then g switches). For that you'll probably want to re-write all of the dynamic expressions in the generator (these show up in several forms though based upon how we're generating code- there's a ReduciableDynamicExpression and some PythonDynamicExpression's floating around now). If greenlets only works across calls then you just need to intercept the ones which are using invoke binders. If you can have a descriptor who's __get__ or __set__ switches then you'd also need to handle gets/sets/etc... If you can do something like import a module which hasn't been loaded yet and then have the top-level module code switch then you'll need to start getting really creative :) You'll then presumably need to change these into using some trampoline to do the actual invocation. Hopefully that will get you started - I'm sure there'll be lots of little issues so if you have questions feel free to ask. If you get it all working we can figure out what exactly we need to make public and how we should expose that so you can do this as an extension - but I'm sure you'll initially be using a bunch of internal APIs. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tristan Zajonc Sent: Sunday, May 30, 2010 6:59 PM To: Discussion of IronPython Subject: [IronPython] Implementing Greenlets API in IronPython Hi - The greenlets C-extension module (http://packages.python.org/greenlet/) provides a very basic api that is used by eventlet and gevent to provide asynchronous programming constructs. It would be nice to have a reasonably performant version of the greenlet API in IronPython. Before I start playing around with possibilities, is there an obvious approach to implement the greenlets API in IronPython? Thanks Tristan -------------- next part -------------- An HTML attachment was scrubbed... URL: