strank | 4 Jul 2008 15:47
Picon

r5587 - branches/index-bug/

Author: strank
Date: 2008-07-04 15:47:00 +0200 (Fri, 04 Jul 2008)
New Revision: 5587

Added:
   branches/index-bug/
Log:
Temporary branch for tackling a bug in node.index

Copied: branches/index-bug (from rev 5586, trunk/docutils)

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
strank | 4 Jul 2008 15:49
Picon

r5588 - branches/index-bug/test/test_nodes.py

Author: strank
Date: 2008-07-04 15:49:49 +0200 (Fri, 04 Jul 2008)
New Revision: 5588

Modified:
   branches/index-bug/test/test_nodes.py
Log:
Two failing tests that demonstrate the index bug

Modified: branches/index-bug/test/test_nodes.py
===================================================================
--- branches/index-bug/test/test_nodes.py	2008-07-04 13:47:00 UTC (rev 5587)
+++ branches/index-bug/test/test_nodes.py	2008-07-04 13:49:49 UTC (rev 5588)
 <at>  <at>  -228,6 +228,35  <at>  <at> 
                                [e[0]])
         self.assertEquals(list(e.traverse(nodes.TextElement)), [e[0][1]])

+    def test_traverse_duplicate_texts(self):
+        e = nodes.Element()
+        e += nodes.TextElement()
+        e[0] += nodes.Text('one')
+        e[0] += nodes.Text('two')
+        e[0] += nodes.Text('three')
+        e[0] += nodes.Text('two')
+        e[0] += nodes.Text('five')
+        # assertEquals is not enough, since it uses '==' equality not 'is'
+        fulltraversedlist = list(e[0][0].traverse(siblings=1))
+        self.assertEquals(len(fulltraversedlist), 5)
+        for ind in range(5):
+            self.assertTrue(fulltraversedlist[ind] is e[0][ind])
(Continue reading)

dkuhlman | 4 Jul 2008 20:18
Picon

r5589 - in trunk/sandbox/OpenDocument: README.txt docs/odtwriter.txt odtwriter/__init__.py odtwriter/styles.odt setup.py

Author: dkuhlman
Date: 2008-07-04 20:17:59 +0200 (Fri, 04 Jul 2008)
New Revision: 5589

Modified:
   trunk/sandbox/OpenDocument/README.txt
   trunk/sandbox/OpenDocument/docs/odtwriter.txt
   trunk/sandbox/OpenDocument/odtwriter/__init__.py
   trunk/sandbox/OpenDocument/odtwriter/styles.odt
   trunk/sandbox/OpenDocument/setup.py
Log:
Fixes and updates -- page size, new visitor methods, nested lists, etc.

Added support for the meta directive.  See docs.
Added support for additional visit_/depart_ methods.
Regularized some of the methods that generated fields: revision,
version, date, address, contact, copyright, organization, etc.
Added more control for control of paper size, thanks to Michael
Schutte:
1. __init__.py attempts to run paperconf.  If paperconf succeeds
   and if the styles.odt file does not contain paper size, the size
   is inserted into the styles.xml in the generated document.
2. Added rst2odt_prepstyles.py script -- Drop page size
   specifications from styles.xml in STYLE_FILE.odt.
Added tools/rst2odt_prepstyles.py to the distribution.

Modified: trunk/sandbox/OpenDocument/README.txt
===================================================================
--- trunk/sandbox/OpenDocument/README.txt	2008-07-04 13:49:49 UTC (rev 5588)
+++ trunk/sandbox/OpenDocument/README.txt	2008-07-04 18:17:59 UTC (rev 5589)
(Continue reading)

dkuhlman | 4 Jul 2008 22:32
Picon

r5590 - trunk/sandbox/OpenDocument/tools/rst2odt_prepstyles.py

Author: dkuhlman
Date: 2008-07-04 22:32:49 +0200 (Fri, 04 Jul 2008)
New Revision: 5590

Added:
   trunk/sandbox/OpenDocument/tools/rst2odt_prepstyles.py
Log:
Added tools/rst2odt_prepstyles.py.

Added: trunk/sandbox/OpenDocument/tools/rst2odt_prepstyles.py
===================================================================
--- trunk/sandbox/OpenDocument/tools/rst2odt_prepstyles.py	2008-07-04 18:17:59 UTC (rev 5589)
+++ trunk/sandbox/OpenDocument/tools/rst2odt_prepstyles.py	2008-07-04 20:32:49 UTC (rev 5590)
 <at>  <at>  -0,0 +1,62  <at>  <at> 
+#!/usr/bin/env python
+"""
+Fix a word-processor-generated styles.odt for odtwriter use: Drop page size
+specifications from styles.xml in STYLE_FILE.odt.
+"""
+
+#
+# Author: Michael Schutte <michi <at> uiae.at>
+
+from lxml import etree
+import sys
+import zipfile
+from tempfile import mkstemp
+import shutil
+import os
+
(Continue reading)

blais | 7 Jul 2008 07:33
Picon

r5591 - trunk/docutils/tools/editors/emacs/rst.el

Author: blais
Date: 2008-07-07 07:33:45 +0200 (Mon, 07 Jul 2008)
New Revision: 5591

Modified:
   trunk/docutils/tools/editors/emacs/rst.el
Log:
Applied patch to rst.el from SMerten.

Modified: trunk/docutils/tools/editors/emacs/rst.el
===================================================================
--- trunk/docutils/tools/editors/emacs/rst.el	2008-07-04 20:32:49 UTC (rev 5590)
+++ trunk/docutils/tools/editors/emacs/rst.el	2008-07-07 05:33:45 UTC (rev 5591)
 <at>  <at>  -413,7 +413,6  <at>  <at> 
   (set (make-local-variable 'font-lock-defaults)
        '(rst-font-lock-keywords-function
 	 t nil nil nil
-	 (font-lock-multiline . t)
 	 (font-lock-mark-block-function . mark-paragraph)))
   (when (boundp 'font-lock-support-mode)
     ;; rst-mode has its own mind about font-lock-support-mode
 <at>  <at>  -3062,6 +3061,12  <at>  <at> 
       ;; Always succeeds because the limit set by PRE-MATCH-FORM is the
       ;; ultimate point to find
       (goto-char (or (rst-forward-indented-block nil limit) limit))
+      (save-excursion
+        ;; Include subsequent empty lines in the font-lock block,
+        ;; in case the user subsequently changes the indentation of the next
+        ;; non-empty line to move it into the indented element.
+        (skip-chars-forward " \t\n")
(Continue reading)

dkuhlman | 8 Jul 2008 22:04
Picon

r5592 - in trunk/sandbox/OpenDocument: MANIFEST README.txt docs/odtwriter.txt odtwriter/__init__.py odtwriter/styles.odt setup.py

Author: dkuhlman
Date: 2008-07-08 22:04:55 +0200 (Tue, 08 Jul 2008)
New Revision: 5592

Modified:
   trunk/sandbox/OpenDocument/MANIFEST
   trunk/sandbox/OpenDocument/README.txt
   trunk/sandbox/OpenDocument/docs/odtwriter.txt
   trunk/sandbox/OpenDocument/odtwriter/__init__.py
   trunk/sandbox/OpenDocument/odtwriter/styles.odt
   trunk/sandbox/OpenDocument/setup.py
Log:
Added support for sub-script and super-script and for classifier on definition list terms.

Modified: trunk/sandbox/OpenDocument/MANIFEST
===================================================================
--- trunk/sandbox/OpenDocument/MANIFEST	2008-07-07 05:33:45 UTC (rev 5591)
+++ trunk/sandbox/OpenDocument/MANIFEST	2008-07-08 20:04:55 UTC (rev 5592)
 <at>  <at>  -5,6 +5,7  <at>  <at> 
 odtwriter/__init__.py
 odtwriter/styles.odt
 tools/rst2odt.py
+tools/rst2odt_prepstyles.py
 docs/odtwriter.txt
 docs/odtwriter.html
 docs/odtwriter.odt

Modified: trunk/sandbox/OpenDocument/README.txt
===================================================================
--- trunk/sandbox/OpenDocument/README.txt	2008-07-07 05:33:45 UTC (rev 5591)
(Continue reading)

strank | 15 Jul 2008 20:13
Picon

r5593 - branches/index-bug/docutils/nodes.py

Author: strank
Date: 2008-07-15 20:13:12 +0200 (Tue, 15 Jul 2008)
New Revision: 5593

Modified:
   branches/index-bug/docutils/nodes.py
Log:
Proposed fix: change index to check for object identity

Modified: branches/index-bug/docutils/nodes.py
===================================================================
--- branches/index-bug/docutils/nodes.py	2008-07-08 20:04:55 UTC (rev 5592)
+++ branches/index-bug/docutils/nodes.py	2008-07-15 18:13:12 UTC (rev 5593)
 <at>  <at>  -572,7 +572,12  <at>  <at> 
         self.children.remove(item)

     def index(self, item):
-        return self.children.index(item)
+        index = self.children.index(item)
+        while self.children[index] is not item:
+            index += 1 + self.children[index + 1:].index(item)
+            # once docutils drops py2.2 support, we can use:
+            #index = self.children.index(item, index + 1)
+        return index

     def is_not_default(self, key):
         if self[key] == [] and key in self.list_attributes:

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
(Continue reading)

strank | 16 Jul 2008 10:06
Picon

r5594 - in branches/index-bug: docutils/nodes.py test/test_nodes.py

Author: strank
Date: 2008-07-16 10:06:51 +0200 (Wed, 16 Jul 2008)
New Revision: 5594

Modified:
   branches/index-bug/docutils/nodes.py
   branches/index-bug/test/test_nodes.py
Log:
Moved the fix into Node.traverse and documented behaviour in test.

Modified: branches/index-bug/docutils/nodes.py
===================================================================
--- branches/index-bug/docutils/nodes.py	2008-07-15 18:13:12 UTC (rev 5593)
+++ branches/index-bug/docutils/nodes.py	2008-07-16 08:06:51 UTC (rev 5594)
 <at>  <at>  -246,6 +246,13  <at>  <at> 
             node = self
             while node.parent:
                 index = node.parent.index(node)
+                if isinstance(node, Text):
+                    # special case since Text nodes have value-equality
+                    while node.parent[index] is not node:
+                        index += 1 + node.parent[index + 1:].index(node)
+                        # once docutils drops py2.2 support, we could use
+                        # the i,j arguments of list.index and beautify this
+                        #index = node.parent.index(node, index + 1)
                 for sibling in node.parent[index+1:]:
                     r.extend(sibling.traverse(include_self=1, descend=descend,
                                               siblings=0, ascend=0,
 <at>  <at>  -572,12 +579,7  <at>  <at> 
         self.children.remove(item)
(Continue reading)

smerten | 16 Jul 2008 23:05
Picon

r5595 - trunk/docutils/tools/editors/emacs/rst.el

Author: smerten
Date: 2008-07-16 23:05:38 +0200 (Wed, 16 Jul 2008)
New Revision: 5595

Modified:
   trunk/docutils/tools/editors/emacs/rst.el
Log:
Reverted patch wrongly attributed to me.

Modified: trunk/docutils/tools/editors/emacs/rst.el
===================================================================
--- trunk/docutils/tools/editors/emacs/rst.el	2008-07-16 08:06:51 UTC (rev 5594)
+++ trunk/docutils/tools/editors/emacs/rst.el	2008-07-16 21:05:38 UTC (rev 5595)
 <at>  <at>  -413,6 +413,7  <at>  <at> 
   (set (make-local-variable 'font-lock-defaults)
        '(rst-font-lock-keywords-function
 	 t nil nil nil
+	 (font-lock-multiline . t)
 	 (font-lock-mark-block-function . mark-paragraph)))
   (when (boundp 'font-lock-support-mode)
     ;; rst-mode has its own mind about font-lock-support-mode
 <at>  <at>  -3061,12 +3062,6  <at>  <at> 
       ;; Always succeeds because the limit set by PRE-MATCH-FORM is the
       ;; ultimate point to find
       (goto-char (or (rst-forward-indented-block nil limit) limit))
-      (save-excursion
-        ;; Include subsequent empty lines in the font-lock block,
-        ;; in case the user subsequently changes the indentation of the next
-        ;; non-empty line to move it into the indented element.
-        (skip-chars-forward " \t\n")
(Continue reading)

smerten | 16 Jul 2008 23:09
Picon

r5596 - trunk/docutils/tools/editors/emacs/rst.el

Author: smerten
Date: 2008-07-16 23:09:56 +0200 (Wed, 16 Jul 2008)
New Revision: 5596

Modified:
   trunk/docutils/tools/editors/emacs/rst.el
Log:
Improved font-lock code to use a better `PRE-MATCH-FORM`. As a result
performance is no longer a problem. `rst-mode-lazy` is no longer
needed. `font-lock-support-mode` is currently switched off.

Modified: trunk/docutils/tools/editors/emacs/rst.el
===================================================================
--- trunk/docutils/tools/editors/emacs/rst.el	2008-07-16 21:05:38 UTC (rev 5595)
+++ trunk/docutils/tools/editors/emacs/rst.el	2008-07-16 21:09:56 UTC (rev 5596)
 <at>  <at>  -359,18 +359,6  <at>  <at> 
   :type '(hook))

 
-(defcustom rst-mode-lazy t
-  "*If non-nil Rst Mode font-locks comment, literal blocks, and section titles
-correctly. Because this is really slow it switches on Lazy Lock Mode
-automatically. You may increase Lazy Lock Defer Time for reasonable results.
-
-If nil comments and literal blocks are font-locked only on the line they start.
-
-The value of this variable is used when Rst Mode is turned on."
-  :group 'rst
-  :type '(boolean))
-
(Continue reading)


Gmane