From scoder at codespeak.net Tue Jun 15 19:47:05 2010 From: scoder at codespeak.net (scoder at codespeak.net) Date: Tue, 15 Jun 2010 19:47:05 +0200 (CEST) Subject: [Lxml-checkins] r75411 - in lxml/trunk: . doc Message-ID: <20100615174705.14750282B9D@codespeak.net> Author: scoder Date: Tue Jun 15 19:47:04 2010 New Revision: 75411 Modified: lxml/trunk/ (props changed) lxml/trunk/doc/parsing.txt Log: r5600 at lenny: sbehnel | 2010-06-15 19:46:57 +0200 doc clarification Modified: lxml/trunk/doc/parsing.txt ============================================================================== --- lxml/trunk/doc/parsing.txt (original) +++ lxml/trunk/doc/parsing.txt Tue Jun 15 19:47:04 2010 @@ -649,13 +649,16 @@ >>> context.root.getchildren() [] -**WARNING**: During the 'start' event, the descendants and following siblings -are not yet available and should not be accessed. During the 'end' event, the -element and its descendants can be freely modified, but its following siblings -should not be accessed. During either of the two events, you **must not** -modify or move the ancestors (parents) of the current element. You should -also avoid moving or discarding the element itself. The golden rule is: do -not touch anything that will have to be touched again by the parser later on. +**WARNING**: During the 'start' event, any content of the element, +such as the descendants, following siblings or text, is not yet +available and should not be accessed. Only attributes are guaranteed +to be set. During the 'end' event, the element and its descendants +can be freely modified, but its following siblings should not be +accessed. During either of the two events, you **must not** modify or +move the ancestors (parents) of the current element. You should also +avoid moving or discarding the element itself. The golden rule is: do +not touch anything that will have to be touched again by the parser +later on. If you have elements with a long list of children in your XML file and want to save more memory during parsing, you can clean up the preceding siblings of From scoder at codespeak.net Tue Jun 15 20:06:39 2010 From: scoder at codespeak.net (scoder at codespeak.net) Date: Tue, 15 Jun 2010 20:06:39 +0200 (CEST) Subject: [Lxml-checkins] r75412 - in lxml/trunk: . doc Message-ID: <20100615180639.4174B282B9D@codespeak.net> Author: scoder Date: Tue Jun 15 20:06:37 2010 New Revision: 75412 Modified: lxml/trunk/ (props changed) lxml/trunk/doc/FAQ.txt Log: r5602 at lenny: sbehnel | 2010-06-15 20:06:33 +0200 better version reporting in bug-FAQ Modified: lxml/trunk/doc/FAQ.txt ============================================================================== --- lxml/trunk/doc/FAQ.txt (original) +++ lxml/trunk/doc/FAQ.txt Tue Jun 15 20:06:37 2010 @@ -560,12 +560,15 @@ .. sourcecode:: python + import sys from lxml import etree - print "lxml.etree: ", etree.LXML_VERSION - print "libxml used: ", etree.LIBXML_VERSION - print "libxml compiled: ", etree.LIBXML_COMPILED_VERSION - print "libxslt used: ", etree.LIBXSLT_VERSION - print "libxslt compiled: ", etree.LIBXSLT_COMPILED_VERSION + + print("%-20s: %s" % ('Python', sys.version_info)) + print("%-20s: %s" % ('lxml.etree', etree.LXML_VERSION)) + print("%-20s: %s" % ('libxml used', etree.LIBXML_VERSION)) + print("%-20s: %s" % ('libxml compiled', etree.LIBXML_COMPILED_VERSION)) + print("%-20s: %s" % ('libxslt used', etree.LIBXSLT_VERSION)) + print("%-20s: %s" % ('libxslt compiled', etree.LIBXSLT_COMPILED_VERSION)) If you can figure that the problem is not in lxml but in the underlying libxml2 or libxslt, you can ask right on the respective From scoder at codespeak.net Sat Jun 19 10:53:52 2010 From: scoder at codespeak.net (scoder at codespeak.net) Date: Sat, 19 Jun 2010 10:53:52 +0200 (CEST) Subject: [Lxml-checkins] r75465 - in lxml/trunk: . doc/s5 doc/s5/ui/default Message-ID: <20100619085352.070FC282BD4@codespeak.net> Author: scoder Date: Sat Jun 19 10:53:50 2010 New Revision: 75465 Added: lxml/trunk/doc/s5/rst2s5.py Modified: lxml/trunk/ (props changed) lxml/trunk/doc/s5/Makefile lxml/trunk/doc/s5/ui/default/pretty.css Log: r5604 at lenny: sbehnel | 2010-06-18 10:51:25 +0200 ship with rst2s5 command that properly includes pygments Modified: lxml/trunk/doc/s5/Makefile ============================================================================== --- lxml/trunk/doc/s5/Makefile (original) +++ lxml/trunk/doc/s5/Makefile Sat Jun 19 10:53:50 2010 @@ -4,7 +4,7 @@ slides: $(SLIDES) %.html: %.txt - rst2s5 --current-slide --language=en $< $@ + python rst2s5.py --current-slide --language=en $< $@ clean: rm -f *~ $(SLIDES) Added: lxml/trunk/doc/s5/rst2s5.py ============================================================================== --- (empty file) +++ lxml/trunk/doc/s5/rst2s5.py Sat Jun 19 10:53:50 2010 @@ -0,0 +1,92 @@ +# -*- coding: utf-8 -*- +""" + The Pygments reStructuredText directive + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This fragment is a Docutils_ 0.5 directive that renders source code + (to HTML only, currently) via Pygments. + + To use it, adjust the options below and copy the code into a module + that you import on initialization. The code then automatically + registers a ``sourcecode`` directive that you can use instead of + normal code blocks like this:: + + .. sourcecode:: python + + My code goes here. + + If you want to have different code styles, e.g. one with line numbers + and one without, add formatters with their names in the VARIANTS dict + below. You can invoke them instead of the DEFAULT one by using a + directive option:: + + .. sourcecode:: python + :linenos: + + My code goes here. + + Look at the `directive documentation`_ to get all the gory details. + + .. _Docutils: http://docutils.sf.net/ + .. _directive documentation: + http://docutils.sourceforge.net/docs/howto/rst-directives.html + + :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +# Options +# ~~~~~~~ + +# Set to True if you want inline CSS styles instead of classes +INLINESTYLES = False +STYLE = "fruity" + +from pygments.formatters import HtmlFormatter + +# The default formatter +DEFAULT = HtmlFormatter(noclasses=INLINESTYLES, style=STYLE) + +# Add name -> formatter pairs for every variant you want to use +VARIANTS = { + # 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True), +} + + +from docutils import nodes +from docutils.parsers.rst import directives, Directive + +from pygments import highlight +from pygments.lexers import get_lexer_by_name, TextLexer + +class Pygments(Directive): + """ Source code syntax hightlighting. + """ + required_arguments = 1 + optional_arguments = 0 + final_argument_whitespace = True + option_spec = dict([(key, directives.flag) for key in VARIANTS]) + has_content = True + + def run(self): + self.assert_has_content() + try: + lexer = get_lexer_by_name(self.arguments[0]) + except ValueError: + # no lexer found - use the text one instead of an exception + lexer = TextLexer() + # take an arbitrary option if more than one is given + formatter = self.options and VARIANTS[self.options.keys()[0]] or DEFAULT + +# print >>open('ui/default/pygments.css', 'w'), formatter.get_style_defs('.highlight') + parsed = highlight(u'\n'.join(self.content), lexer, formatter) + return [nodes.raw('', parsed, format='html')] + +directives.register_directive('sourcecode', Pygments) + +from docutils.core import publish_cmdline, default_description + +description = ('Generates S5 (X)HTML slideshow documents from standalone ' + 'reStructuredText sources. ' + default_description) + +publish_cmdline(writer_name='s5', description=description) Modified: lxml/trunk/doc/s5/ui/default/pretty.css ============================================================================== --- lxml/trunk/doc/s5/ui/default/pretty.css (original) +++ lxml/trunk/doc/s5/ui/default/pretty.css Sat Jun 19 10:53:50 2010 @@ -158,3 +158,64 @@ .syntax .vg { color: #bb60d5 } /* Name.Variable.Global */ .syntax .vi { color: #bb60d5 } /* Name.Variable.Instance */ .syntax .il { color: #40a070 } /* Literal.Number.Integer.Long */ + +/* .highlight { background: #f0f0f0; } */ +.highlight .c { color: #60a0b0; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #FF0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #404040 } /* Generic.Output */ +.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0040D0 } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #40a070 } /* Literal.Number */ +.highlight .s { color: #4070a0 } /* Literal.String */ +.highlight .na { color: #4070a0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60add5 } /* Name.Constant */ +.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287e } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #bb60d5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #40a070 } /* Literal.Number.Float */ +.highlight .mh { color: #40a070 } /* Literal.Number.Hex */ +.highlight .mi { color: #40a070 } /* Literal.Number.Integer */ +.highlight .mo { color: #40a070 } /* Literal.Number.Oct */ +.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070a0 } /* Literal.String.Char */ +.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070a0 } /* Literal.String.Double */ +.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #c65d09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070a0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ +.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ +.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ +.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */ From scoder at codespeak.net Sat Jun 19 10:53:56 2010 From: scoder at codespeak.net (scoder at codespeak.net) Date: Sat, 19 Jun 2010 10:53:56 +0200 (CEST) Subject: [Lxml-checkins] r75466 - in lxml/trunk: . doc Message-ID: <20100619085356.B9185282BD4@codespeak.net> Author: scoder Date: Sat Jun 19 10:53:55 2010 New Revision: 75466 Modified: lxml/trunk/ (props changed) lxml/trunk/CHANGES.txt lxml/trunk/doc/main.txt lxml/trunk/version.txt Log: r5605 at lenny: sbehnel | 2010-06-19 10:53:40 +0200 prepare release of lxml 2.3alpha1 Modified: lxml/trunk/CHANGES.txt ============================================================================== --- lxml/trunk/CHANGES.txt (original) +++ lxml/trunk/CHANGES.txt Sat Jun 19 10:53:55 2010 @@ -2,8 +2,8 @@ lxml changelog ============== -2.3 (under development) -======================= +2.3alpha1 (2010-06-19) +====================== Features added -------------- @@ -89,24 +89,12 @@ now use the hash value of the underlying Python value (string, number, etc.) to which they compare equal. -* Crash in XPath evaluation when reading smart strings from a document - other than the original context document. - * Parsing broken fragments in lxml.html could fail if the fragment contained an orphaned closing '' tag. -* Manually instantiating the custom element classes in - ``lxml.objectify`` could crash. - * Using XSLT extension elements around the root of the output document crashed. -* Support recent versions of html5lib by not requiring its - ``XHTMLParser`` in ``htmlparser.py`` anymore. - -* Invalid XML text characters were not rejected by the API when they - appeared in unicode strings directly after non-ASCII characters. - * ``lxml.cssselect`` did not distinguish between ``x[attr="val"]`` and ``x [attr="val"]`` (with a space). The latter now matches the attribute independent of the element. @@ -143,6 +131,48 @@ * Static builds include libiconv, in addition to libxml2 and libxslt. +2.2.6 (2010-03-02) +================== + +Bugs fixed +---------- + +* Fixed several Python 3 regressions by building with Cython 0.11.3. + + +2.2.5 (2010-02-28) +================== + +Features added +-------------- + +* Support for running XSLT extension elements on the input root node + (e.g. in a template matching on "/"). + +Bugs fixed +---------- + +* Crash in XPath evaluation when reading smart strings from a document + other than the original context document. + +* Support recent versions of html5lib by not requiring its + ``XHTMLParser`` in ``htmlparser.py`` anymore. + +* Manually instantiating the custom element classes in + ``lxml.objectify`` could crash. + +* Invalid XML text characters were not rejected by the API when they + appeared in unicode strings directly after non-ASCII characters. + +* lxml.html.open_http_urllib() did not work in Python 3. + +* The functions ``strip_tags()`` and ``strip_elements()`` in + ``lxml.etree`` did not remove all occurrences of a tag in all cases. + +* Crash in XSLT extension elements when the XSLT context node is not + an element. + + 2.2.4 (2009-11-11) ================== Modified: lxml/trunk/doc/main.txt ============================================================================== --- lxml/trunk/doc/main.txt (original) +++ lxml/trunk/doc/main.txt Sat Jun 19 10:53:55 2010 @@ -147,8 +147,8 @@ source release. If you can't wait, consider trying a less recent release version first. -The latest version is `lxml 2.2.4`_, released 2009-11-11 -(`changes for 2.2.4`_). `Older versions`_ are listed below. +The latest version is `lxml 2.3alpha`_, released 2010-06-19 +(`changes for 2.3aplha1`_). `Older versions`_ are listed below. Please take a look at the `installation instructions`_! @@ -218,28 +218,28 @@ See the web sites of lxml `1.3 `_, `2.0 `_, `2.1 -`_ and the `current in-development -version `_. +`_ and the `current stable version +`_ -.. _`PDF documentation`: lxmldoc-2.2.4.pdf +.. `current in-development version `_. -* `lxml 2.2.3`_, released 2009-10-30 (`changes for 2.2.3`_) +.. _`PDF documentation`: lxmldoc-2.3alpha1.pdf -* `lxml 2.2.2`_, released 2009-06-21 (`changes for 2.2.2`_) +* `lxml 2.3alpha1`_, released 2010-06-19 (`changes for 2.3alpha1`_) -* `lxml 2.2.1`_, released 2009-06-02 (`changes for 2.2.1`_) +* `lxml 2.2.6`_, released 2010-03-02 (`changes for 2.2.6`_) -* `lxml 2.2`_, released 2009-03-21 (`changes for 2.2`_) +* `lxml 2.2.5`_, released 2010-02-28 (`changes for 2.2.5`_) -* `lxml 2.2beta4`_, released 2009-02-27 (`changes for 2.2beta4`_) +* `lxml 2.2.4`_, released 2009-11-11 (`changes for 2.2.4`_) -* `lxml 2.2beta3`_, released 2009-02-17 (`changes for 2.2beta3`_) +* `lxml 2.2.3`_, released 2009-10-30 (`changes for 2.2.3`_) -* `lxml 2.2beta2`_, released 2009-01-25 (`changes for 2.2beta2`_) +* `lxml 2.2.2`_, released 2009-06-21 (`changes for 2.2.2`_) -* `lxml 2.2beta1`_, released 2008-12-12 (`changes for 2.2beta1`_) +* `lxml 2.2.1`_, released 2009-06-02 (`changes for 2.2.1`_) -* `lxml 2.2alpha1`_, released 2008-11-23 (`changes for 2.2alpha1`_) +* `lxml 2.2`_, released 2009-03-21 (`changes for 2.2`_) * `lxml 2.1.5`_, released 2009-01-06 (`changes for 2.1.5`_) @@ -327,16 +327,14 @@ * `lxml 0.5`_, released 2005-04-08 +.. _`lxml 2.3alpha1`: lxml-2.3alpha1.tgz +.. _`lxml 2.2.6`: lxml-2.2.6.tgz +.. _`lxml 2.2.5`: lxml-2.2.5.tgz .. _`lxml 2.2.4`: lxml-2.2.4.tgz .. _`lxml 2.2.3`: lxml-2.2.3.tgz .. _`lxml 2.2.2`: lxml-2.2.2.tgz .. _`lxml 2.2.1`: lxml-2.2.1.tgz .. _`lxml 2.2`: lxml-2.2.tgz -.. _`lxml 2.2beta4`: lxml-2.2beta4.tgz -.. _`lxml 2.2beta3`: lxml-2.2beta3.tgz -.. _`lxml 2.2beta2`: lxml-2.2beta2.tgz -.. _`lxml 2.2beta1`: lxml-2.2beta1.tgz -.. _`lxml 2.2alpha1`: lxml-2.2alpha1.tgz .. _`lxml 2.1.5`: lxml-2.1.5.tgz .. _`lxml 2.1.4`: lxml-2.1.4.tgz .. _`lxml 2.1.3`: lxml-2.1.3.tgz @@ -380,16 +378,14 @@ .. _`lxml 0.5.1`: lxml-0.5.1.tgz .. _`lxml 0.5`: lxml-0.5.tgz +.. _`changes for 2.3alpha1`: changes-2.3alpha1.html +.. _`changes for 2.2.6`: changes-2.2.6.html +.. _`changes for 2.2.5`: changes-2.2.5.html .. _`changes for 2.2.4`: changes-2.2.4.html .. _`changes for 2.2.3`: changes-2.2.3.html .. _`changes for 2.2.2`: changes-2.2.2.html .. _`changes for 2.2.1`: changes-2.2.1.html .. _`changes for 2.2`: changes-2.2.html -.. _`changes for 2.2beta4`: changes-2.2beta4.html -.. _`changes for 2.2beta3`: changes-2.2beta3.html -.. _`changes for 2.2beta2`: changes-2.2beta2.html -.. _`changes for 2.2beta1`: changes-2.2beta1.html -.. _`changes for 2.2alpha1`: changes-2.2alpha1.html .. _`changes for 2.1.5`: changes-2.1.5.html .. _`changes for 2.1.4`: changes-2.1.4.html .. _`changes for 2.1.3`: changes-2.1.3.html Modified: lxml/trunk/version.txt ============================================================================== --- lxml/trunk/version.txt (original) +++ lxml/trunk/version.txt Sat Jun 19 10:53:55 2010 @@ -1 +1 @@ -2.3dev +2.3alpha1 From scoder at codespeak.net Sat Jun 19 11:23:13 2010 From: scoder at codespeak.net (scoder at codespeak.net) Date: Sat, 19 Jun 2010 11:23:13 +0200 (CEST) Subject: [Lxml-checkins] r75467 - in lxml/trunk: . doc Message-ID: <20100619092313.874A9282BD4@codespeak.net> Author: scoder Date: Sat Jun 19 11:23:11 2010 New Revision: 75467 Modified: lxml/trunk/ (props changed) lxml/trunk/doc/main.txt Log: r5608 at lenny: sbehnel | 2010-06-19 11:23:05 +0200 typos Modified: lxml/trunk/doc/main.txt ============================================================================== --- lxml/trunk/doc/main.txt (original) +++ lxml/trunk/doc/main.txt Sat Jun 19 11:23:11 2010 @@ -147,8 +147,8 @@ source release. If you can't wait, consider trying a less recent release version first. -The latest version is `lxml 2.3alpha`_, released 2010-06-19 -(`changes for 2.3aplha1`_). `Older versions`_ are listed below. +The latest version is `lxml 2.3alpha1`_, released 2010-06-19 +(`changes for 2.3alpha1`_). `Older versions`_ are listed below. Please take a look at the `installation instructions`_! From scoder at codespeak.net Sat Jun 19 12:04:59 2010 From: scoder at codespeak.net (scoder at codespeak.net) Date: Sat, 19 Jun 2010 12:04:59 +0200 (CEST) Subject: [Lxml-checkins] r75468 - in lxml/trunk: . src/lxml/tests Message-ID: <20100619100459.4EDAB282BD4@codespeak.net> Author: scoder Date: Sat Jun 19 12:04:57 2010 New Revision: 75468 Modified: lxml/trunk/ (props changed) lxml/trunk/src/lxml/tests/common_imports.py lxml/trunk/src/lxml/tests/test_elementtree.py Log: r5610 at lenny: sbehnel | 2010-06-19 12:04:52 +0200 test fixes Modified: lxml/trunk/src/lxml/tests/common_imports.py ============================================================================== --- lxml/trunk/src/lxml/tests/common_imports.py (original) +++ lxml/trunk/src/lxml/tests/common_imports.py Sat Jun 19 12:04:57 2010 @@ -43,10 +43,12 @@ """Remove test methods that do not work with the current lib version. """ find_required_version = version_dict.get + def dummy_test_method(self): + pass for name in dir(test_class): expected_version = find_required_version(name, (0,0,0)) if expected_version > current_version: - setattr(test_class, name, None) + setattr(test_class, name, dummy_test_method) try: import doctest Modified: lxml/trunk/src/lxml/tests/test_elementtree.py ============================================================================== --- lxml/trunk/src/lxml/tests/test_elementtree.py (original) +++ lxml/trunk/src/lxml/tests/test_elementtree.py Sat Jun 19 12:04:57 2010 @@ -2619,7 +2619,7 @@ root2 = fromstring(xml2) self.assertEquals('TEST', root[0].get('{%s}a' % ns_href)) - required_versions_ET['test_itertext'] = (1,3) + required_versions_ET['test_register_namespace'] = (1,3) def test_register_namespace(self): # ET 1.3+ Element = self.etree.Element From scoder at codespeak.net Sat Jun 19 13:19:32 2010 From: scoder at codespeak.net (scoder at codespeak.net) Date: Sat, 19 Jun 2010 13:19:32 +0200 (CEST) Subject: [Lxml-checkins] r75469 - lxml/tag/lxml-2.3alpha1 Message-ID: <20100619111932.306595080C@codespeak.net> Author: scoder Date: Sat Jun 19 13:19:30 2010 New Revision: 75469 Added: lxml/tag/lxml-2.3alpha1/ - copied from r75468, lxml/trunk/ Log: tag for lxml 2.3alpha1 From scoder at codespeak.net Mon Jun 21 20:08:06 2010 From: scoder at codespeak.net (scoder at codespeak.net) Date: Mon, 21 Jun 2010 20:08:06 +0200 (CEST) Subject: [Lxml-checkins] r75482 - lxml/trunk Message-ID: <20100621180806.3C8B4282BE0@codespeak.net> Author: scoder Date: Mon Jun 21 20:08:03 2010 New Revision: 75482 Modified: lxml/trunk/ (props changed) lxml/trunk/buildlibxml.py Log: r5612 at lenny: sbehnel | 2010-06-21 20:07:58 +0200 prevent unrelated multiprocessing errors from breaking the build Modified: lxml/trunk/buildlibxml.py ============================================================================== --- lxml/trunk/buildlibxml.py (original) +++ lxml/trunk/buildlibxml.py Mon Jun 21 20:08:03 2010 @@ -10,15 +10,14 @@ multi_make_options = [] try: - from multiprocessing import cpu_count -except ImportError: - pass -else: - cpus = cpu_count() + import multiprocessing + cpus = multiprocessing.cpu_count() if cpus > 1: if cpus > 5: cpus = 5 multi_make_options = ['-j%d' % (cpus+1)] +except: + pass # use pre-built libraries on Windows From jholg at codespeak.net Fri Jun 25 14:08:35 2010 From: jholg at codespeak.net (jholg at codespeak.net) Date: Fri, 25 Jun 2010 14:08:35 +0200 (CEST) Subject: [Lxml-checkins] r75584 - in lxml/trunk/src/lxml: . tests Message-ID: <20100625120835.8C0EC282B9C@codespeak.net> Author: jholg Date: Fri Jun 25 14:08:33 2010 New Revision: 75584 Modified: lxml/trunk/src/lxml/lxml.objectify.pyx lxml/trunk/src/lxml/tests/test_objectify.py Log: Fixed DataElement() to use PyType.stringify, with test. Modified: lxml/trunk/src/lxml/lxml.objectify.pyx ============================================================================== --- lxml/trunk/src/lxml/lxml.objectify.pyx (original) +++ lxml/trunk/src/lxml/lxml.objectify.pyx Fri Jun 25 14:08:33 2010 @@ -1973,6 +1973,9 @@ if dict_result is not NULL: _pytype = (dict_result).name + if _pytype is None: + _pytype = _pytypename(_value) + if _value is None and _pytype != u"str": _pytype = _pytype or u"NoneType" strval = None @@ -1984,11 +1987,12 @@ else: strval = u"false" else: - strval = unicode(_value) + stringify = unicode + dict_result = python.PyDict_GetItem(_PYTYPE_DICT, _pytype) + if dict_result is not NULL: + stringify = (dict_result).stringify + strval = stringify(_value) - if _pytype is None: - _pytype = _pytypename(_value) - if _pytype is not None: if _pytype == u"NoneType" or _pytype == u"none": strval = None Modified: lxml/trunk/src/lxml/tests/test_objectify.py ============================================================================== --- lxml/trunk/src/lxml/tests/test_objectify.py (original) +++ lxml/trunk/src/lxml/tests/test_objectify.py Fri Jun 25 14:08:33 2010 @@ -318,6 +318,13 @@ arg = objectify.DataElement(3.1415) self.assertRaises(ValueError, objectify.DataElement, arg, _xsi="xsd:int") + + def test_data_element_element_arg(self): + arg = objectify.Element('arg') + value = objectify.DataElement(arg) + self.assert_(isinstance(value, objectify.ObjectifiedElement)) + for attr in arg.attrib: + self.assertEquals(value.get(attr), arg.get(attr)) def test_root(self): root = self.Element("test") @@ -1968,6 +1975,14 @@ self.assertEquals(r.date.pyval, parse_date(stringify_date(time))) self.assertEquals(r.date.text, stringify_date(time)) + date = objectify.DataElement(time) + + self.assert_(isinstance(date, DatetimeElement)) + self.assert_(isinstance(date.pyval, datetime)) + + self.assertEquals(date.pyval, parse_date(stringify_date(time))) + self.assertEquals(date.text, stringify_date(time)) + def test_object_path(self): root = self.XML(xml_str) path = objectify.ObjectPath( "root.c1.c2" ) From jholg at codespeak.net Fri Jun 25 14:43:48 2010 From: jholg at codespeak.net (jholg at codespeak.net) Date: Fri, 25 Jun 2010 14:43:48 +0200 (CEST) Subject: [Lxml-checkins] r75585 - in lxml/trunk/doc: . s5 Message-ID: <20100625124348.E7660282B9C@codespeak.net> Author: jholg Date: Fri Jun 25 14:43:47 2010 New Revision: 75585 Modified: lxml/trunk/doc/build.txt lxml/trunk/doc/s5/Makefile Log: Fixed doc/s5/Makefile to use PYTHON option, correction of easy_install cmd Modified: lxml/trunk/doc/build.txt ============================================================================== --- lxml/trunk/doc/build.txt (original) +++ lxml/trunk/doc/build.txt Fri Jun 25 14:43:47 2010 @@ -46,7 +46,7 @@ you want to be an lxml developer, then you do need a working Cython installation. You can use EasyInstall_ to install it:: - easy_install Cython>=0.13 + easy_install "Cython>=0.13" lxml currently requires Cython 0.13, later release versions should work as well. Modified: lxml/trunk/doc/s5/Makefile ============================================================================== --- lxml/trunk/doc/s5/Makefile (original) +++ lxml/trunk/doc/s5/Makefile Fri Jun 25 14:43:47 2010 @@ -1,10 +1,11 @@ +PYTHON?=python SLIDES=$(subst .txt,.html,$(wildcard *.txt)) slides: $(SLIDES) %.html: %.txt - python rst2s5.py --current-slide --language=en $< $@ + $(PYTHON) rst2s5.py --current-slide --language=en $< $@ clean: rm -f *~ $(SLIDES) From scoder at codespeak.net Fri Jun 25 16:14:46 2010 From: scoder at codespeak.net (scoder at codespeak.net) Date: Fri, 25 Jun 2010 16:14:46 +0200 (CEST) Subject: [Lxml-checkins] r75593 - lxml/trunk Message-ID: <20100625141446.8D943282B9C@codespeak.net> Author: scoder Date: Fri Jun 25 16:14:45 2010 New Revision: 75593 Modified: lxml/trunk/ (props changed) lxml/trunk/CREDITS.txt Log: r5618 at lenny: sbehnel | 2010-06-25 16:14:38 +0200 credits Modified: lxml/trunk/CREDITS.txt ============================================================================== --- lxml/trunk/CREDITS.txt (original) +++ lxml/trunk/CREDITS.txt Fri Jun 25 16:14:45 2010 @@ -15,7 +15,7 @@ creator and maintainer of lxml.html Holger Joukl - bug reports, feedback and development on lxml.objectify + ISO-Schematron support, development on lxml.objectify, bug reports, feedback Sidnei da Silva official MS Windows builds