[IronPython] Snippets in Trackback

Curt Hagenlocher curt at hagenlocher.org
Sun Mar 30 13:41:47 CEST 2008


This works for me once I fix the mismatched XML tag (and the mail-induced
line breaks).  And when I don't, I get pretty explicit error messages as the
text of the exception:

SystemError: The 'DockPanel' start tag on line 4 does not match the end tag
of 'DockPanelTest'. Line 5, position 3.
-or-
SyntaxError: EOL while scanning single-quoted string
What was the exception that you were getting?
On Sat, Mar 29, 2008 at 11:42 PM, Davy Mitchell <daftspaniel at gmail.com>
wrote:

> This has the desired effect:
>
> import clr
> clr.AddReference("System.Xml")
> clr.AddReference("PresentationFramework, Version=3.0.0.0,
> Culture=neutral, PublicKeyToken=31bf3856ad364e35")
> clr.AddReference("PresentationCore, Version=3.0.0.0, Culture=neutral,
> PublicKeyToken=31bf3856ad364e35")
> from System.IO import StringReader
> from System.Xml import XmlReader
> from System.Windows.Markup import XamlReader, XamlWriter
> from System.Windows import Window, Application
>
> xaml = """
> <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>        Title="Test" Width="600" Height="400">
> <DockPanel>
> </DockPanelTest>
> </Window>
> """
>
> xr = XmlReader.Create(StringReader(xaml))
> win = XamlReader.Load(xr)
> Application().Run(win)
>
> On Sat, Mar 29, 2008 at 8:34 PM, Curt Hagenlocher <curt at hagenlocher.org>
> wrote:
> > The "snippets" represent executable code that's generated dynamically by
> the
> > DLR from your Python source.  Do you have a small piece of sample code
> that
> > reproduces the failure?
> >
> >
> >
> > On Sat, Mar 29, 2008 at 1:28 PM, Davy Mitchell <daftspaniel at gmail.com>
> > wrote:
> >
> > >
> > >
> > >
> > > Hi All,
> > >
> > > IPY2.0 B1 Vista SP1
> > >
> > > I keep seeing reference to 'Snippets' in IP Tracebacks on different
> > > bits of code. Can't find anything on codeplex so assume it *probably*
> > > something wrong this end.
> > > I don't have a 'Snippets' module AFAIK.
> > >
> > > Typical example
> > > C:\Code\OSProjects>ipy wpf5.py
> > > Traceback (most recent call last):
> > >  File Snippets, line unknown, in Initialize
> > >  File PresentationFramework, line unknown, in Load
> > >
> > > Is it just me or.... :-)
> > >
> > > --
> > >
> > >
> > >
> > > Davy Mitchell
> > > Blog - http://www.latedecember.co.uk/sites/personal/davy/
> > > Twitter - http://twitter.com/daftspaniel
> > > Skype - daftspaniel needgod.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
> >
> >
>
>
>
> --
>  Davy Mitchell
> Blog - http://www.latedecember.co.uk/sites/personal/davy/
> Twitter - http://twitter.com/daftspaniel
> Skype - daftspaniel needgod.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: <http://mail.python.org/pipermail/ironpython-users/attachments/20080330/07a3c841/attachment.html>


More information about the Ironpython-users mailing list