[IronPython] [Language Question] Building a function pointer/delegate like

2007-06-19 Thread Mohamed A. Meligy
Hey all, I'm trying to build a filter web user control using IP 2.0 (included in ASP.NET 2.0 Futures May 2007 CTP). In it, I need other pages/controls using this filtering control to be able to assign a property in the filter control to a method in that pages/control using the filter, so, inside t

[IronPython] Console history

2007-06-19 Thread Sanghyeon Seo
This is my pet peeve. This applies to both 1.1 and 2.0a1. 1. Run ipy.exe with -X:TabCompletion. 2. Execute a line. (Let's say "a = 1".) 3. Press up arrow. (The last line appears.) 4. Press down arrow. (The line stays.) What I want: 4. The line disappears. Otherwise, you're forced to delete the

Re: [IronPython] Threading and SQLAlchemy

2007-06-19 Thread Michael Foord
Curtis Scheer wrote: > Thanks, Michael that was it. Now however the python help will not work now > that I added that to the path. I see you had a post on that earlier, did you > ever come up with a solution on that? > The standard library 'site.py' overrides the built-in help with one that w

Re: [IronPython] Threading and SQLAlchemy

2007-06-19 Thread Curtis Scheer
Thanks, Michael that was it. Now however the python help will not work now that I added that to the path. I see you had a post on that earlier, did you ever come up with a solution on that? -Original Message- From: Michael Foord [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 19, 2007 6:11

Re: [IronPython] Threading and SQLAlchemy

2007-06-19 Thread Michael Foord
Curtis Scheer wrote: > I am trying to import the SQLAlchemy module into IronPython to see if I can > do some testing of existing Python code we have. Has anyone had success > using this module in IronPython? > > > It appears to be failing when trying to import the python threading module > like so:

[IronPython] Threading and SQLAlchemy

2007-06-19 Thread Curtis Scheer
I am trying to import the SQLAlchemy module into IronPython to see if I can do some testing of existing Python code we have. Has anyone had success using this module in IronPython? It appears to be failing when trying to import the python threading module like so: try: import thread, threadi

Re: [IronPython] .NET Exception to Python Exception conversion

2007-06-19 Thread Michael Foord
I think this is a useful example. I've posted it to the cookbook: http://www.ironpython.info/index.php/Handling_Unhandled_Exceptions Michael Foord Dino Viehland wrote: > > If the exception was raised in Python then you should be able to do: > > print event.Exception.Data[‘PythonExceptionInfo’] >

Re: [IronPython] .NET Exception to Python Exception conversion

2007-06-19 Thread Michael Foord
Cool - thanks. :-) Michael Dino Viehland wrote: > It's a little bit different, and you don't need to create the PythonEngine > (or at least until we close on that issue :) ), but it's: > > import clr > clr.AddReference('IronPython') > from IronPython.Hosting import PythonEngine > PythonEngine.Cu

Re: [IronPython] .NET Exception to Python Exception conversion

2007-06-19 Thread Dino Viehland
It's a little bit different, and you don't need to create the PythonEngine (or at least until we close on that issue :) ), but it's: import clr clr.AddReference('IronPython') from IronPython.Hosting import PythonEngine PythonEngine.CurrentEngine.FormatException(someException) We no longer autom

Re: [IronPython] .NET Exception to Python Exception conversion

2007-06-19 Thread Michael Foord
Dino Viehland wrote: > > If the exception was raised in Python then you should be able to do: > > print event.Exception.Data[‘PythonExceptionInfo’] > > which will contain the Python exception object, not that I’m sure you > can format that one much better. > > What you probably want to do is call

Re: [IronPython] .NET Exception to Python Exception conversion

2007-06-19 Thread Dino Viehland
If the exception was raised in Python then you should be able to do: print event.Exception.Data['PythonExceptionInfo'] which will contain the Python exception object, not that I'm sure you can format that one much better. What you probably want to do is call PythonEngine.FormatException(event.

Re: [IronPython] stack overflow issue

2007-06-19 Thread Benjamin West
> >>> > >> Hmm... well the super call isn't necessary with Form and __init__. Does > >> that help? > > > > Why not? This is just a test case. In my application, __init__ does > > other things that are required. I also like the way ironpython treats > > keyword arguments for controls. > > > The c

Re: [IronPython] stack overflow issue

2007-06-19 Thread Michael Foord
Benjamin West wrote: > On 6/19/07, Michael Foord <[EMAIL PROTECTED]> wrote: > >> Benjamin West wrote: >> >>> http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=6014 >>> >>> Anyone have guidelines on avoiding this kind of thing, or if there is >>> a fix that will make this a no

Re: [IronPython] stack overflow issue

2007-06-19 Thread Benjamin West
On 6/19/07, Michael Foord <[EMAIL PROTECTED]> wrote: > Benjamin West wrote: > > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=6014 > > > > Anyone have guidelines on avoiding this kind of thing, or if there is > > a fix that will make this a non-issue? > > > > Hmm... well the supe

Re: [IronPython] stack overflow issue

2007-06-19 Thread Michael Foord
Benjamin West wrote: > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=6014 > > Anyone have guidelines on avoiding this kind of thing, or if there is > a fix that will make this a non-issue? > Hmm... well the super call isn't necessary with Form and __init__. Does that help?

[IronPython] stack overflow issue

2007-06-19 Thread Benjamin West
http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=6014 Anyone have guidelines on avoiding this kind of thing, or if there is a fix that will make this a non-issue? -Ben codeplex butchers the white space: import clr clr.AddReference("System.Windows.Forms") from System.Windows.Form

Re: [IronPython] Is IronPython Project on CodePlex Now Accepting Patches?

2007-06-19 Thread M. David Peterson
Thanks for the clarification, Dino. Kind of sucks that you can't turn it off! On 6/19/07, Dino Viehland <[EMAIL PROTECTED]> wrote: Unfortunately we're still not accepting patches. It looks like this is just a new CodePlex feature but there doesn't appear to be anyway to turn it off. -Ori

[IronPython] .NET Exception to Python Exception conversion

2007-06-19 Thread Laurent Debacker
Hello, I'm catching exceptions raised in my winforms thread using def exceptionHandler(sender, event): print event.Exception Application.ThreadException += ThreadExceptionEventHandler(exceptionHandler) Application.SetUnhandledExceptionMode( Unhand

Re: [IronPython] Passing a reference to a string

2007-06-19 Thread John Barham
> The output value of the ref parameter will be returned in the return value: So it is. Thanks! ___ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: [IronPython] Passing a reference to a string

2007-06-19 Thread John Barham
> Is it an out argument or a ref argument? According to .NET Reflector the signature of the method I'm calling is: public void _GetXml(..., ref string o_xml) so I presume the o_xml parameter is a "ref argument". Nonetheless its (changed) value is being returned as Martin said, despite the void

Re: [IronPython] Passing a reference to a string

2007-06-19 Thread Michael Foord
John Barham wrote: > I'm trying to call a C# method from IP that takes a reference to a > string as one of its parameters. I'm passing it a System.String() > object, but the string is not changed after I call the method. I know > that CPython (and presumably IP) strings are immutable so how do I

Re: [IronPython] Passing a reference to a string

2007-06-19 Thread Martin Maly
The output value of the ref parameter will be returned in the return value: r.cs: public class C{ public static string M(ref string s) { string old = s; s = "new string"; return old; } } D:\Merlin1\Main\Bin\Debug>csc /t:library r.cs Microsoft (R) Visual C# 2005 Co

[IronPython] Passing a reference to a string

2007-06-19 Thread John Barham
I'm trying to call a C# method from IP that takes a reference to a string as one of its parameters. I'm passing it a System.String() object, but the string is not changed after I call the method. I know that CPython (and presumably IP) strings are immutable so how do I get C# to change the string

Re: [IronPython] directshow and vmr9

2007-06-19 Thread Dave Fugate
A good starting point would be to look over the IronPython Direct3D sample found at http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=47 which shows how to use managed DirectX wrappers. That being said, I don't think DirectShow is in the managed API and you should be ab

Re: [IronPython] Is IronPython Project on CodePlex Now Accepting Patches?

2007-06-19 Thread Michael Foord
Dino Viehland wrote: > Unfortunately we're still not accepting patches. It looks like this is just > a new CodePlex feature but there doesn't appear to be anyway to turn it off. > Hey, welcome back. I hope you had a good break. Michael http://www.voidspace.org.uk/ironpython/index.shtml > --

Re: [IronPython] Is IronPython Project on CodePlex Now Accepting Patches?

2007-06-19 Thread Dino Viehland
Unfortunately we're still not accepting patches. It looks like this is just a new CodePlex feature but there doesn't appear to be anyway to turn it off. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sylvain Hellegouarch Sent: Tuesday, June 19, 2007 12

Re: [IronPython] Compiling from IronPython?

2007-06-19 Thread Michael Foord
mike arty wrote: > First, is there a way to compile applications straight from IronPython > or is it necessary to first translate your code to C#? Second, if > there is a way to compile straight from IronPython, how does this > effect performance of the compiled program( i.e. compiling a program

[IronPython] Compiling from IronPython?

2007-06-19 Thread mike arty
First, is there a way to compile applications straight from IronPython or is it necessary to first translate your code to C#? Second, if there is a way to compile straight from IronPython, how does this effect performance of the compiled program(i.e. compiling a program from c# vs ironpython - any

Re: [IronPython] Is IronPython Project on CodePlex Now Accepting Patches?

2007-06-19 Thread Sylvain Hellegouarch
Nice. Question though: What kind of patch format should be expected by the teams? - Sylvain M. David Peterson a écrit : > @ http://www.codeplex.com/IronPython/SourceControl/PatchList.aspx > > " Anyone can upload a patch. Patches are evaluated by project team > members and either Applied or Decl