[IronPython] can't inherit??

Curt Hagenlocher curt at hagenlocher.org
Tue Apr 28 17:18:17 CEST 2009


One immediately apparent problem is that the strategy for formatting the
code that initializes attributes is completely broken for Python -- you need
to know how far to indent each of the lines in the code and not just the
first one.

On Mon, Apr 27, 2009 at 11:24 AM, Ivan Porto Carrero <ivan at flanders.co.nz>wrote:

> it's a bad subject but I didn't know how else to call it.
>
> For the DynamicScriptControl somebody submitted an ironpython
> implementation in February but I only just now got round to adding it.
> And I have problems :)
>
> The link below has the line that fails for IronPython but works for
> IronRuby
>
>
> http://code.google.com/p/dynamic-script-control/source/browse/trunk/src/DynamicScriptControl/ScriptConverter.cs#37
>
> So the idea is that you read a script file containing a wpf/silverlight
> control. Because you cannot have DLR controls in WPF atm there is this
> dynamic script control to allow you to have DLR controls participate in
> XAML.
>
> So what happens in IronRuby is the following.
> The script converter generates a script that will set the properties and
> create an instance of the control. This control is then put into the XAML
> object graph.
> The script that is generated actually monkey patches the initialize method
> of the the control class to populate the control properties.
>
> The implementation that has been provided to me actually inherits of the
> first control to override the constructor and to do the proper
> initializations, only it doesn't work.
> it tells me that it cannot find the parent class I get an
> UnboundNameException and AFAICT I shouldn't get that.
>
> I'm using the latest nightly builds.
>
> The ruby implementation of the control
>
> http://code.google.com/p/dynamic-script-control/source/browse/trunk/src/TestApplication/prefilled_text_box.rb
>
> the python implementation
>
> http://code.google.com/p/dynamic-script-control/source/browse/trunk/src/TestApplication/prefilled_text_box.py
>
> The ruby code formatter (for monkey patching the control):
>
> http://code.google.com/p/dynamic-script-control/source/browse/trunk/src/DynamicScriptControl/Formatters/RubyFormatter.cs
>
> The python code formatter:
>
> http://code.google.com/p/dynamic-script-control/source/browse/trunk/src/DynamicScriptControl/Formatters/PythonFormatter.cs
>
>
> I'm pretty sure this is a 5 second fix for somebody that knows what they're
> doing with IronPython, so help help ... ;)
>
> Thanks
>
> ---
> Met vriendelijke groeten - Best regards - Salutations
> Ivan Porto Carrero
> GSM: +32.486.787.582
> Blog: http://flanders.co.nz
> Twitter: http://twitter.com/casualjim
> Author of IronRuby in Action (http://manning.com/carrero)
>
> Steven Wright<http://www.brainyquote.com/quotes/authors/s/steven_wright.html> - "A lot of people are afraid of heights. Not me, I'm afraid of widths."
> _______________________________________________
> 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: <http://mail.python.org/pipermail/ironpython-users/attachments/20090428/034784b1/attachment.html>


More information about the Ironpython-users mailing list