Stefan Behnel | 1 Sep 10:21
Picon
Favicon
Gravatar

Re: objectify factories


jholg <at> gmx.de wrote:
>> Given the current behaviour of _setElementValue(), I'd say it should just
>> go and annotate everything it produces.
> 
> Meaning an additional TypedElementMaker, right? I think it is actually nice to have the not-annotating
ElementMaker as a choice.

BTW, that's easy to achieve, I just added a simple "annotate=True" keyword
argument to objectify.ElementMaker (not comitted yet). If you create a new E
factory and pass False, it will just skip the annotation step.

Stefan
Stefan Behnel | 2 Sep 18:25
Picon
Favicon
Gravatar

lxml 2.0alpha1 released

Hi all,

I'm proudly announcing the first alpha release of lxml 2.0. It features a
major cleanup both behind the scenes and at the surface, that improves the XML
tool integration and makes the API clearer and more consistent in many places.
The major new addition, however, is the lxml.html package, a new toolkit for
HTML handling.

The web site for the pre-2.0 series is online at

http://codespeak.net/lxml/dev/

The "what's new" page has a description of the major changes:

http://codespeak.net/lxml/dev/lxml2.html

and the ChangeLog has a more detailed list, see below.

This being an alpha release means that not everything is stable, both in terms
of crashes and the API. There will be a small number of alpha releases to make
the advancements publicly available, before the beta releases focus on
improving the stability.

I warmly invite everyone to contribute to the final release by discussing the
API changes and the new features on the mailing list. There is always space
for improvements!

There is currently a known problem with Microsoft's compilers, so Windows
builds may not become available for 2.0alpha1. The next alpha will hopefully
come with prebuilt binaries for that platform. Building with the more
(Continue reading)

Stefan Behnel | 3 Sep 09:29
Picon
Favicon
Gravatar

Re: [XML-SIG] lxml 2.0alpha1 released

Hi,

Gloria W wrote:
> Stefan, congratulations. This is definitely useful.

Thanks! :)

> Please talk a bit about the API, and how it differs/varies from
> cElementTree,

http://codespeak.net/lxml/dev/compatibility.html

> or link to some examples.

The docs are full of doctest examples. However, as lxml.html is still pretty
new, its docs are not as comprehensive as those for lxml.etree yet.

> For example, the node nesting,
> the usage of a 'tail' for trailing text. I wonder if lxml offers more of
> a DOM compliant node nesting, or if it conforms to the
> conventions/oddities of ElemenTree.

lxml.etree aims for ElementTree compatibility, so these things work alike. The
above link describes the differences that we either cannot work around for
technical reasons (or performance reasons) or that are considerate decisions
where we think ElementTree is wrong.

Note that the ElementTree API is more and more becoming a basis for other APIs
in lxml. There is lxml.objectify, which replaces a lot of this API by
something that works more like Python objects themselves (a data binding
(Continue reading)

Picon

Re: lxml 2.0alpha1 released

Le dimanche 2 septembre 2007 18:25, Stefan Behnel a écrit :

>     * XSLT objects now support deep copying

Good ;o)

--

-- 
   Frédéric
Stefan Behnel | 3 Sep 09:55
Picon
Favicon
Gravatar

Re: lxml 2.0alpha1 released


Frédéric Mantegazza wrote:
> Le dimanche 2 septembre 2007 18:25, Stefan Behnel a écrit :
> 
>>     * XSLT objects now support deep copying
> 
> Good ;o)

... although that's such a recent feature that I wouldn't bet my household on
it. Since you had code that stumbled over the lack of that feature, could you
give it some more testing so that we can see if it works? Especially in the
threaded case?

Thanks,
Stefan
Picon

Re: lxml 2.0alpha1 released

Le lundi 3 septembre 2007 09:55, Stefan Behnel a écrit :

> Frédéric Mantegazza wrote:

> > Le dimanche 2 septembre 2007 18:25, Stefan Behnel a écrit :

> >>     * XSLT objects now support deep copying
> >
> > Good ;o)
>
> ... although that's such a recent feature that I wouldn't bet my
> household on it. Since you had code that stumbled over the lack of that
> feature, could you give it some more testing so that we can see if it
> works? Especially in the threaded case?

Ok, I will make tests.

--

-- 
   Frédéric
jholg | 3 Sep 12:59
Picon
Picon

Re: cython + python2.4 problem (was: objectify factories)

Hi,

> the trunk now builds with Cython instead of Pyrex, so please install it to
> get
> rid of the one failing doctest. (the reason the test fails is that Cython
> knows about the package you specify in distutils, Pyrex ignores it).
> 
> http://www.cython.org/
> 
> lxml requires Cython 0.9.6.5.

Lazy me, not like you hadn't announced that quite a while ago.
However, unfortunately: 
Just downloaded cython and tried to build lxml:

0 lb54320 <at> adevp02 .../lxml $ /apps/pydev/bin/python2.4 setup.py build
Traceback (most recent call last):
  File "setup.py", line 28, in ?
    import setupinfo
  File "/data/pydev/hjoukl/LXML/lxml/setupinfo.py", line 5, in ?
    from Cython.Distutils import build_ext as build_pyx
[...]
  File "/apps/pydev/lib/python2.4/site-packages/Cython/Compiler/TypeSlots.py", line 88
    full_args = "O" + self.fixed_arg_format if self.has_dummy_arg else self.fixed_arg_format
                                             ^
SyntaxError: invalid syntax

Seems like cython relies on Python2.5 syntax, which renders it unusable for me. Any chance to remove the
hard 2.5-syntax-dependency? At a quick glance this seems to be the only place where conditional
expressions turn up.
(Continue reading)

jholg | 4 Sep 12:00
Picon
Picon

Re: lxml 2.0alpha1 released

Hi,

>     * Extended type annotation in objectify: new xsiannotate() function

I propose renaming the existing annotate() function to pyannotate() and adding a public interface
annotate() to the internal _annotate(), so you can xsi-typify and py-typify in one step.
I also think it would be better to change the defaults of the "ignore_old" keyword args of the annotation
functions to False, to avoid:

>>> root = E.root(E.i(23), E.s("12"), E.sub())
>>> print objectify.dump(root)
root = None [ObjectifiedElement]
    i = 23 [IntElement]
      * py:pytype = 'int'
    s = '12' [StringElement]
      * py:pytype = 'str'
    sub = '' [StringElement]
>>> objectify.annotate(root)
>>> print objectify.dump(root)
root = None [ObjectifiedElement]
    i = 23 [IntElement]
      * py:pytype = 'int'
    s = 12 [IntElement]
      * py:pytype = 'int'
    sub = '' [StringElement]
>>> 

where you lose the "str" type information of root.s.
I think the current default is a bit counter-intuitive.

(Continue reading)

Picon

Re: lxml 1.3.4 released

Le jeudi 30 août 2007 12:28, Stefan Behnel a écrit :

> I just released lxml 1.3.4 to PyPI. It has a minor bug fix and a few
> compatibility enhancements both backwards and forwards. Changelog
> follows.

On my debian etch (stable), I only have setuptools 0.6c3, but lxml 1.3.4 
needs at least 0.6c5... I just changed the test in setup.py, and all 
compiled fine. But may I have some problems? Do 1.3.4 *really* need 
setuptools >=0.6c5?

--

-- 
   Frédéric
jholg | 4 Sep 15:46
Picon
Picon

Re: lxml 1.3.4 released

Hi,

> On my debian etch (stable), I only have setuptools 0.6c3, but lxml 1.3.4 
> needs at least 0.6c5... I just changed the test in setup.py, and all 
> compiled fine. But may I have some problems? Do 1.3.4 *really* need 
> setuptools >=0.6c5?

I had the same issue on my kubuntu system the other day, and did the same thing to get it to build (I *think* that
was svn trunk, though), because
I'd rather use os packages than easy_install newer setuptools, if possible.
Worked for me.

Holger
--

-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

Gmane