QuickTopic (SM) free message boards QuickTopic (SM) free message boards
Skip to Messages
  Sign In to access your topic list  |New Topic |My Topics|Profile
Upgrade to Pro   Customize, show pictures, add an intro, and more:   QuickTopic Pro...and check out QuickThreadSM
Topic: general online.effbot.org discussion (2005)
Branched from topic: general online.effbot.org discussion
Printer-Friendly Page
All messages    << 73-88  57-72 of 95  41-56 >>
About these ads
Who | When
Messagessort recent-top    (not accepting new messages)
Alain  57
02-25-2005 06:38 AM ET (US)
I am experimenting with ElementTree. I find it marvellous but i miss something. While parsing an XML file, the comment info gets lost. Is there any way to preserve it? I really need the comments !

Alain
Fredrik LundhPerson was signed in when posted  58
03-02-2005 03:22 PM ET (US)
Edited by author 03-02-2005 03:23 PM
Alain, the current ElementTree parser ignores comments (they're not really part of the infoset, just like Python comments are not part of the Python program). Also see:

http://www.quicktopic.com/28/H/v2dA7ee7u55Jx/p9.10.1
Just van Rossum  59
03-23-2005 11:39 AM ET (US)
Regarding plist: for completeness' sake (but not a fun example of ElementTree) there's also plistlib.py in plat-mac in the Python std lib.
Fredrik LundhPerson was signed in when posted  60
03-24-2005 06:59 AM ET (US)
Now that plist files are appearing all over the place, shouldn't plistlib be made available on all platforms?
Fredrik LundhPerson was signed in when posted  61
03-30-2005 02:04 AM ET (US)
Btw, for those asking about comment support in ElementTree, this page shows one (unsupported) way to deal with comments and processing instructions:

http://effbot.org/zone/element-pi.htm
max khesin  62
03-31-2005 09:55 AM ET (US)
Kudos on the PIL release!
One question has been bothering me for a while: why not fix the TIFF group 4 issue - I mean this question has come up on the Net since 2000 and you pointed to a patch here
http://mail.python.org/pipermail/image-sig/2003-July/002354.html
quite a while ago.
Just to throw in some perspecive: TIFF group4 is billions of dicuments. It is the standard image repository format used for document storage.
And I hate patching :).
Casey Whitelaw  63
04-01-2005 06:40 PM ET (US)
Great to see the new PIL release, thanks a lot. I use PIL for all kinds of little toys (the latest is an image compositor thingo at http://projects.caseyporn.com/multimatic/ ), and it's amazingly useful.
Jesse Andrews  64
04-17-2005 10:05 PM ET (US)
Saw your comment about needing to de-gasbag a planet, so I did something about it . . .

I wrote a program that creates a GreaseMonkey user script that removes whoever you want from a planet (it only works within firefox). If you are interested check http://overstimulate.com/reorbit ... If you have fixed it already sorry for bothering you ;)

btw, thanks for all the python resources! I get to work full time in python thanks to you, mark pilgram, ... (too many to list)
gervin23  65
04-28-2005 03:05 AM ET (US)
Edited by author 04-28-2005 03:07 AM
i've been using elementtree and sgmlop for a couple days now and must say i love the speed and simplicity, nice job.

one question however, when using the sample code for grabbing anchor tags found on http://effbot.org/zone/sgmlop-patterns.htm, links to urls with ampersands (i.e. this page) get truncated at the first occurrence. the rest of the href data seems to be getting trapped inside resolve_entityref method.

for example, sending output to the console and using using http://foo.com?a=1&b=2&c=3 as a url i get (in order of execution):
b=2&c=3 #from resolve_entityref()
http://foo.com?a=1 #from finish_starttag()

i'm using sgmlop-1.1.1-20040207.

any ideas?
Costas Malamas  66
04-28-2005 04:45 AM ET (US)
I am wondering why ElementTree doesn't support preserving comments in the XML structure. I am guessing complexity isn't the issue here.

Here's my patch to enable it:
1126a1127
> parser.CommentHandler = self._comment
1186a1188,1192
> def _comment(self, text):
> self._target.start(Comment,{})
> self._target.data(self._fixtext(text))
> self._target.end(Comment)
>
Fredrik LundhPerson was signed in when posted  67
05-04-2005 04:18 AM ET (US)
Comments are not part of the XML information model (an XML processor is free to ignore them), and ElementTree isn't really designed for applications that need to create XML for human consumption, so leaving them out wasn't a very hard decision.

If you need comment and PI support, you can use a custom parser. See:

http://effbot.org/zone/element-pi.htm
midtoadPerson was signed in when posted  68
05-11-2005 08:16 PM ET (US)
Fredrik, what would be the best way for me to go about adding a 'width' parameter to the line_draw method in PIL? I'd like to be able to draw a line wider than a single pixel. I'm building an open-source web app using CherryPy, SQLObject, PIL and ElementTree (among others).

thanks
S
Fredrik LundhPerson was signed in when posted  69
05-13-2005 11:51 AM ET (US)
Edited by author 05-13-2005 11:52 AM
Did you see this comment in the 1.1.5 CHANGES document:

Added width option to ImageDraw.line(). The current implementation works best for straight lines; it does not support line joins, so polylines won't look good.

(An improved line join algorithm would be welcome, of course)
Stewart Midwinter  70
05-13-2005 12:02 PM ET (US)
What's the smilie symbol for a sheepish grin? I did in fact look through the changes list for the latest version of PIL, but failed to notice the addition of the 'width' option for line drawing. Thanks for adding that!

S
Olle Jonsson  71
05-25-2005 06:41 AM ET (US)
Oh, I came by the blog, via why the lucky stiff's comment on the Twisted mailing list posting on "violence humour".

Thanks for the Swedish news/commentary coverage. I live in Copenhagen, so your blog was a very welcome find.
Aloys  72
07-20-2005 02:57 AM ET (US)
Hi Fredrik,

I find your cElementTree a really great tool, and I use it in a current project.
Unfortunately this library doesn't support the weak referencing.
I updated your C code to make it work, as explained in the Python Manual, and now everything is perfect!
If you're interested in the changes I've done, I can send them to you.

Thanks!
RSS link What's this?
All messages    << 73-88  57-72 of 95  41-56 >>
QuickTopicSM message boards
Over 200,000 topics served
Learn more Frequently asked questions  Acknowledgements
What they're saying about QuickTopic
 Questions, comments, or suggestions? Contact Us
Read our use policy before beginning. We value your privacy; please read our privacy statement.
Copyright ©1999-2008 Internicity Inc. All rights reserved.