Re: [IronPython] Calling python script from c#

2006-11-28 Thread Sanghyeon Seo
2006/11/29, Dino Viehland <[EMAIL PROTECTED]>: > Is libxml2 a pyd? If so we currently don't support importing pyd's (it would > require matching CPython's extension interface). Instead you might be able > to use the .NET XML libraries as a work around. Yes, Python binding of libxml2 is a C ext

Re: [IronPython] Subclassing a Control

2006-11-28 Thread Michael Foord
Dino Viehland wrote: > CreateParams is a property, so you'll need to construct a property to do this: > > class TransLabel(Label): > def get_CreateParams(self): > cp = super(TransLabel, self).CreateParams > cp.ExStyle = cp.ExStyle | 20 > retu

Re: [IronPython] Subclassing a Control

2006-11-28 Thread Dino Viehland
CreateParams is a property, so you'll need to construct a property to do this: class TransLabel(Label): def get_CreateParams(self): cp = super(TransLabel, self).CreateParams cp.ExStyle = cp.ExStyle | 20 return cp CreateParams = proper

Re: [IronPython] Help.. I need decorators

2006-11-28 Thread Dino Viehland
The one workaround I am aware of is to write a base class in C# that has the necessary attributes and then implement the rest in Python by deriving from that class. If you need to have the base class call the derived class you can add some protected abstract methods that the Python class would

Re: [IronPython] Help.. I need decorators

2006-11-28 Thread Ivan Porto Carrero
Yes I agree any temporary workaround would be great... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord Sent: Wednesday, 29 November 2006 8:34 a.m. To: Discussion of IronPython Subject: Re: [IronPython] Help.. I need decorators Dino Viehland

Re: [IronPython] IronPython in a web application

2006-11-28 Thread Szymon Kobalczyk
Hi, In our system IP is used for many things including text templates in similar fashion to what you describe. My implementation is basically turning the whole template into Python function and then compiles it using PythonEngine.CreateMethodUnscoped so it can be reused with different argument

Re: [IronPython] How to implement in C# ironpython extension?

2006-11-28 Thread Dino Viehland
__getitem__ and __setitem__ can be implemented by implementing an indexer in C#. These will automatically be transformed. To implement __getattribute__ / __setattr__ you can implement ICustomAttributes and intercept all attribute access. You'll need to fall back to the type to get the default

Re: [IronPython] Help.. I need decorators

2006-11-28 Thread Michael Foord
Dino Viehland wrote: > There's both the syntax issue and the implementation issue. The syntax issue > is more obvious and we have candidates for classes and methods (e.g. > something like __attributes__ = ... for classes, and decorators for methods - > harder are attributes on the return type,

Re: [IronPython] Calling python script from c#

2006-11-28 Thread Dino Viehland
Is libxml2 a pyd? If so we currently don't support importing pyd's (it would require matching CPython's extension interface). Instead you might be able to use the .NET XML libraries as a work around. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of mike

Re: [IronPython] Class with slots and getattr not compatible

2006-11-28 Thread Dino Viehland
Thanks for the bug report! From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick O'Brien Sent: Monday, November 20, 2006 4:36 PM To: users@lists.ironpython.com Subject: [IronPython] Class with slots and getattr not compatible Ticket: http://www.codeplex.com/WorkItem/View.aspx?Pr

Re: [IronPython] How to implement in C# ironpython extension?

2006-11-28 Thread luismg
Look into the "Tutorial" folder of the ironpython distribution. There are examples in C# and in VB.Net. If you know C# or any other .Net language, it's just a matter of writing your classes and compile them as .dll. Then you can create a "DLLs" directory into the same folder where your ipy.exe is

[IronPython] Calling python script from c#

2006-11-28 Thread Michael Niemaz
Hi, I'm trying to run a python script from c# using the executeFile method. The debugger seems to stop on an import statement (libxml2) : import libxml2 I did used AddToPath to add the related modules. Is there another way to tell the CLR where the imported modules are? Am I missing something

[IronPython] Calling python script from c#

2006-11-28 Thread mike
Hi, I'm trying to run python script from c# using the executeFile pe method. It's works to some extent ... that is if the script does not make any local import such as: import libxml2 Having this would crash on an import from the libxml2 script: from libxmlmods import libml2 I didtry to p

[IronPython] Calling python script from c#

2006-11-28 Thread miken
Hi, I'm trying to run a python script from c# using the executeFile method. The debugger seems to stop on an import statement (libxml2) : import libxml2 I did used AddToPath to add the related modules. Is there another way to tell the CLR where the imported modules are? Am I missing something

Re: [IronPython] How to implement in C# ironpython extension?

2006-11-28 Thread Andrew
Thank you for answer! I should to be more acurate. How to implement in C# extension special methods: __getitem__, __setitem__, __getattr__, __setattr__ and other special methods? Thanks. ___ users mailing list users@lists.ironpython.com http://lists.iro

[IronPython] calling python module from C#

2006-11-28 Thread Michael Niemaz
Hi all, I'd like to invoke python modules from C#. I'm using the PythonEngine and ExecuteFile method but it looks like it does not handle python imports correctly. The python module I execute imports the famous libxml2. It seems to crash on its initilisation: from libxmlmods import libx

[IronPython] IronPython in a web application

2006-11-28 Thread Ian Warwick
Hi, New guy here. I am developing a web application that uses the Front Controller pattern, the idea was that it would provide rich functionality for mapping UI Elements to business objects. It came to the point where it would be nice to have content parts that I could write up in a text f

Re: [IronPython] Help.. I need decorators

2006-11-28 Thread Dino Viehland
There's both the syntax issue and the implementation issue. The syntax issue is more obvious and we have candidates for classes and methods (e.g. something like __attributes__ = ... for classes, and decorators for methods - harder are attributes on the return type, on the parameters, on fields,

Re: [IronPython] Unpickler.persistent_load, please...

2006-11-28 Thread Patrick O'Brien
On 11/28/06, Dino Viehland <[EMAIL PROTECTED]> wrote: This is the first request for this we've gotten and it hasn't really been on our todo list. I've opened a bug ( http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=6011). In the mean time I'd suggest using the stand

Re: [IronPython] Unpickler.persistent_load, please...

2006-11-28 Thread Dino Viehland
This is the first request for this we've gotten and it hasn't really been on our todo list. I've opened a bug (http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=6011). In the mean time I'd suggest using the standard pickle module which ships w/ CPython - it appears

Re: [IronPython] Help.. I need decorators

2006-11-28 Thread Michael Foord
Dino Viehland wrote: > This comes up on a semi-regular basis. We currently don't have any support > for attributes. We've considered many ways to do this but likely won't have > support until 2.0 at the earliest. > Can I ask what the difficulty with it is ? It surely isn't just a syntax issue

Re: [IronPython] Do we have any option for Intellisense??

2006-11-28 Thread Michael Foord
Patrick O'Brien wrote: > On 11/28/06, Blesson Varghese <[EMAIL PROTECTED]> wrote: >> >> I want to write code to provide Intellisense to an IDE for Iron >> Python...Do we have any options within the Python Engine to do that??? >> >> -- >> > > I'm not sure I'd have time t

Re: [IronPython] Help.. I need decorators

2006-11-28 Thread Dino Viehland
This comes up on a semi-regular basis. We currently don't have any support for attributes. We've considered many ways to do this but likely won't have support until 2.0 at the earliest. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ivan Porto Carrero Sent: Monday, November 20

Re: [IronPython] UnicodeError's object attribute

2006-11-28 Thread Dino Viehland
Still catching up on e-mail after last week (it was Thanksgiving here). Thanks for reporting this and following up. This is just a silly copy & paste error in ExceptionConverter.cs. UnicodeErrorInit has the line: Ops.SetAttr(DefaultContext.Default, self, SymbolTable.StringToId("@object"), @o

Re: [IronPython] Do we have any option for Intellisense??

2006-11-28 Thread Patrick O'Brien
On 11/28/06, Blesson Varghese <[EMAIL PROTECTED]> wrote: I want to write code to provide Intellisense to an IDE for Iron Python...Do we have any options within the Python Engine to do that??? -- I'm not sure I'd have time to do it, but I'm thinking about rewriting

[IronPython] Intellisense in Python

2006-11-28 Thread Thane Plummer
Here's how I implement intellisense in Python. This is very easy for an interactive command line, and a bit trickier for an editor. The code was gleaned from an Idle implementation, and I haven't changed it in years. It works fine with both CPython and IronPython, returning both the stdlib and .

Re: [IronPython] Do we have any option for Intellisense??

2006-11-28 Thread Thane Plummer
Have you looked at the code for tab completion? Ipy.exe -X:TabCompletion On the other hand, why not write it in Python? It works for me. _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Blesson Varghese Sent: Tuesday, November 28, 2006 1:58 AM To: users@lists.iro