debian/0000755000000000000000000000000012255346730007175 5ustar debian/control0000644000000000000000000001112512255341324010572 0ustar Source: python-docutils Section: python Priority: optional Maintainer: Debian Python Modules Team Uploaders: Michael Schutte , Dmitry Shachnev Build-Depends: debhelper (>= 7) Build-Depends-Indep: python-all (>= 2.6.6-3~), python3-all (>= 3.1.2-7~), python-roman, python3-roman, xml-core Standards-Version: 3.9.5 X-Python-Version: >= 2.4 XS-Testsuite: autopkgtest Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/python-docutils/trunk/ Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/python-docutils/trunk/ Homepage: http://docutils.sourceforge.net/ Package: python-docutils Provides: docutils Architecture: all Depends: ${misc:Depends}, ${python:Depends}, python-roman, docutils-common (= ${source:Version}) Recommends: python-pil, python-pygments, libpaper-utils, docutils-doc (= ${source:Version}) Suggests: texlive-latex-recommended, texlive-latex-base, texlive-lang-french, fonts-linuxlibertine | ttf-linux-libertine Conflicts: python-odtwriter, docutils-writer-odt Replaces: python-odtwriter, docutils-writer-odt Breaks: python-epydoc (<< 3.0.1-4~), python-sphinx (<< 1.1.3+dfsg-7~) Description: text processing system for reStructuredText (implemented in Python 2) reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. It is useful for in-line program documentation (such as Python docstrings), for quickly creating simple web pages, and for standalone documents. . The purpose of the Docutils project is to create a set of tools for processing reStructuredText documentation into useful formats, such as HTML, LaTeX, ODT or Unix manpages. . This package includes Python 2 modules and command line utilities. Package: python3-docutils Provides: docutils Architecture: all Depends: ${misc:Depends}, ${python3:Depends}, python3-roman, docutils-common (= ${source:Version}) Recommends: python3-pil, python3-pygments, libpaper-utils Conflicts: python-docutils (<< 0.7-3~), python-odtwriter, docutils-writer-odt Breaks: python3-sphinx (<< 1.1.3+dfsg-7~) Suggests: texlive-latex-recommended, texlive-latex-base, texlive-lang-french, fonts-linuxlibertine | ttf-linux-libertine, docutils-doc Description: text processing system for reStructuredText (implemented in Python 3) reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. It is useful for in-line program documentation (such as Python docstrings), for quickly creating simple web pages, and for standalone documents. . The purpose of the Docutils project is to create a set of tools for processing reStructuredText documentation into useful formats, such as HTML, LaTeX, ODT or Unix manpages. . This package includes Python 3 modules and command line utilities. Package: docutils-common Architecture: all Depends: ${misc:Depends}, Recommends: python-docutils | python3-docutils Conflicts: python-docutils (<< 0.7-3~) Breaks: python-odtwriter, docutils-writer-odt Replaces: python-docutils (<< 0.7-3~), python-odtwriter, docutils-writer-odt Description: text processing system for reStructuredText - common data reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. It is useful for in-line program documentation (such as Python docstrings), for quickly creating simple web pages, and for standalone documents. . The purpose of the Docutils project is to create a set of tools for processing reStructuredText documentation into useful formats, such as HTML, LaTeX, ODT or Unix manpages. . This package includes data and configuration files. Package: docutils-doc Section: doc Architecture: all Depends: ${misc:Depends} Conflicts: python-docutils (<< 0.7-3~) Replaces: python-docutils (<< 0.7-3~) Description: text processing system for reStructuredText - documentation reStructuredText is an easy-to-read, what-you-see-is-what-you-get plaintext markup syntax and parser system. It is useful for in-line program documentation (such as Python docstrings), for quickly creating simple web pages, and for standalone documents. . The purpose of the Docutils project is to create a set of tools for processing reStructuredText documentation into useful formats, such as HTML, LaTeX, ODT or Unix manpages. . This package includes documentation in HTML and (gzipped) reST formats. debian/rules0000755000000000000000000001231412177241657010263 0ustar #!/usr/bin/make -f export PYTHONWARNINGS=d export PYTHONHASHSEED=random -include /usr/share/python/python.mk scripts = \ rst-buildhtml \ rst2html \ rst2latex \ rst2man \ rst2odt \ rst2odt_prepstyles \ rst2pseudoxml \ rst2s5 \ rst2xetex \ rst2xml \ rstpep2html \ pre_localize_css = 's,href="(([.][.]/)*)docutils/.*/([^/]+[.]css)",href="$$1css/$$3",g;' pre_strip_images1 = 's,([^]*>,$$1,g;' pre_strip_images2 = 's,([^]*\bsrc="http://[^"]+"[^>]*>,$$1,g;' pre_strip_images = $(pre_strip_images1)$(pre_strip_images2) python_all = pyversions -r | tr ' ' '\n' | xargs -t -I {} env {} python3_all = $(patsubst py%,py3%,$(python_all)) build build-indep: build-stamp build-stamp: dh_testdir # Remove convenience copy of the roman module rm -f docutils/utils/roman.py # Check if move-data-to-usr-share.diff is up-to-date if grep -r __file__ --include='*.py' docutils/ | grep -vw _datadir; then \ echo "Error: Some uses of __file__ are not guarded by _datadir()." \ "Is move-data-to-usr-share.diff up-to-date?"; \ exit 1; \ fi # Build modules for Python 2.X python setup.py build --build-lib=build/py2/ ifeq "$(filter nocheck,$(DEB_BUILD_OPTIONS))" "" # Run test suite for Python 2.X: $(python_all) test/alltests.py --verbose # Run rst-buildhtml tests: PYTHONPATH=$(CURDIR)/build/py2 python tools/test/test_buildhtml.py --verbose endif # Build modules for Python 3.X python3 setup.py build --build-lib=build/py3/ ifeq "$(filter nocheck,$(DEB_BUILD_OPTIONS))" "" # Run test suite for Python 3.X: $(python3_all) test3/alltests.py --verbose endif # Build documentation: PYTHONPATH=. python tools/buildhtml.py \ --local --link-stylesheet --traceback \ . PYTHONPATH=. python tools/buildhtml.py \ --link-stylesheet --traceback \ docs ( ls *.html && find docs/ -name '*.html' ) \ | xargs perl -0777 -p -i -e $(pre_localize_css)$(pre_strip_images) touch build-stamp clean: dh_testdir rm -f build-stamp rm -rf build/ find -name '*.py[co]' -delete rm -f *.html find docs -name '*.html' -not -name 'quickref.html' -delete rm -rf docutils.egg-info cd test && rm -rf alltests.out record.txt functional/output/*/ functional/output/[a-z]*.* rm -rf test3/ dh_clean install: build dh_testdir dh_testroot dh_installdirs mkdir -p debian/tmp python setup.py build --build-lib=build/py2/ install \ --root debian/tmp --no-compile $(py_setup_install_args) \ --install-scripts=/usr/share/docutils/scripts/python2/ python3 setup.py build --build-lib=build/py3/ install \ --root debian/tmp --no-compile $(py_setup_install_args) \ --install-scripts=/usr/share/docutils/scripts/python3/ # Move data files outside dist-packages: mkdir -p debian/tmp/usr/share/ cp -rlf debian/tmp/usr/lib/python2.*/*-packages/docutils debian/tmp/usr/share/ find debian/tmp/usr/lib/python[23]*/*-packages/docutils/ -type f '!' -name '*.py' -delete find debian/tmp/usr/share/docutils/ \( -name '*.py' -o -name '*.py[co]' \) '!' -path '*/scripts/*' -delete find debian/tmp/ -type d -empty -delete sed -i -e 's/^\(_debian_package\) = /\1 = 1/' debian/tmp/usr/lib/python[23]*/*-packages/docutils/__init__.py # Give scripts canonical names mkdir -p debian/tmp/usr/share/docutils/scripts/python2/ set -ex && for python in python2 python3; do \ dir=debian/tmp/usr/share/docutils/scripts/$$python/; \ for exe in $(filter-out rst-buildhtml,$(scripts)); do \ mv $$dir/$$exe.py $$dir/$$exe; \ done; \ install tools/buildhtml.py $$dir/rst-buildhtml; \ sed -i -e "1 s,^#!.*,#!/usr/bin/$${python%2}," $$dir/rst-buildhtml; \ done : # Make the man pages (we want to do this *after* renaming all the : # tools, because their executable name goes into the --help output) mkdir -p debian/tmp/man/ set -ex && for exe in $(filter-out rst2odt_prepstyles,$(scripts)); do \ export PYTHONPATH=.; \ cp debian/$$exe.txt debian/tmp/man/$$exe.txt; \ python debian/tmp/usr/share/docutils/scripts/python2/$$exe --help | \ sed \ -e '1 s/^Usage$$/Synopsis/' \ -e 's/^=/====/' \ -e '3 s/^ //' \ -e '4 a Description' \ -e '4 a ===========' \ >> debian/tmp/man/$$exe.txt;\ python tools/rst2man.py debian/tmp/man/$$exe.txt \ debian/tmp/man/$$exe.1; \ done PYTHONPATH=. python tools/rst2man.py debian/rst2odt_prepstyles.txt \ debian/tmp/man/rst2odt_prepstyles.1 sed -i -e 's,"\(docutils/writers/\),"/usr/share/\1,g' debian/tmp/man/* # Build architecture-independent files here. binary-indep: build install dh_testdir dh_testroot dh_installdocs -XCOPYING mkdir -p debian/docutils-doc/usr/share/doc/python-docutils/ cd debian/docutils-doc/usr/share/doc/python-docutils/ && ln -sf ../docutils-doc/*.html . dh_install -p docutils-common -X /scripts/ dh_install -N docutils-common dh_lintian dh_python2 -p python-docutils dh_python3 -p python3-docutils dh_installexamples dh_installcatalogs dh_installxmlcatalogs dh_installman dh_installchangelogs dh_link dh_compress -p docutils-doc -X.dtd -X.html -X.txt dh_compress -N docutils-doc dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb build-arch binary-arch: # We have nothing to do by default. binary: binary-indep binary-arch .PHONY: build build-arch build-indep clean binary-indep binary-arch binary install configure debian/python3-docutils.preinst0000644000000000000000000000030111624504276014025 0ustar #!/bin/sh set -e if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt 0.8 then update-alternatives --remove rst2newlatex /usr/share/docutils/scripts/python3/rst2newlatex fi #DEBHELPER# debian/docutils-common.install0000644000000000000000000000032112144450647013675 0ustar /usr/share/docutils/ tools/editors/emacs/rst.el usr/share/emacs/site-lisp debian/50python-docutils.el etc/emacs/site-start.d docs/ref/*.dtd usr/share/xml/docutils/ debian/docutils.xml usr/share/mime/packages/ debian/docutils-common.lintian-overrides0000644000000000000000000000013411573011604015656 0ustar # As per Policy 10.7.4: docutils-common: conflicts-with-version python-docutils (<< 0.7-3~) debian/rst-buildhtml.txt0000644000000000000000000000031411307057352012522 0ustar ============= rst-buildhtml ============= ----------------------------------- convert many reST documents to HTML ----------------------------------- :Manual section: 1 :Manual group: text processing debian/python3-docutils.docs0000644000000000000000000000000611573255277013302 0ustar *.txt debian/python3-docutils.lintian-overrides0000644000000000000000000000025111577436312016005 0ustar # Even deconfigured python-docutils (<< 0.7-3~) would prevent correct installation of alternatives: python3-docutils: conflicts-with-version python-docutils (<< 0.7-3~) debian/docutils-doc.links0000644000000000000000000000054011633233227012622 0ustar /usr/share/doc/docutils-doc/docs /usr/share/doc/python-docutils/docs /usr/share/doc/docutils-doc/docs /usr/share/doc/python3-docutils/docs /usr/share/doc/docutils-doc/css /usr/share/doc/python-docutils/css /usr/share/doc/docutils-doc/css /usr/share/doc/python3-docutils/css /usr/share/doc/docutils-doc/HISTORY.txt /usr/share/doc/docutils-doc/changelog debian/patches/0000755000000000000000000000000012255346730010624 5ustar debian/patches/no-local-roman.diff0000644000000000000000000000130412177236226014273 0ustar Description: Use the "roman" module from python-roman instead of the local copy. Author: Michael Schutte Forwarded: not-needed Last-Update: 2013-07-22 --- a/docutils/parsers/rst/states.py +++ b/docutils/parsers/rst/states.py @@ -116,7 +116,8 @@ from docutils.parsers.rst import directives, languages, tableparser, roles from docutils.parsers.rst.languages import en as _fallback_language_module from docutils.utils import escape2null, unescape, column_width -from docutils.utils import punctuation_chars, roman, urischemes +from docutils.utils import punctuation_chars, urischemes +import roman class MarkupError(DataError): pass class UnknownInterpretedRoleError(DataError): pass debian/patches/move-data-to-usr-share.diff0000644000000000000000000001267512177236226015676 0ustar Description: Allow all data files to be moved to /usr/share/docutils/. Author: Jakub Wilk Forwarded: not-needed Last-Update: 2013-07-22 --- a/docutils/parsers/rst/directives/misc.py +++ b/docutils/parsers/rst/directives/misc.py @@ -10,6 +10,7 @@ import os.path import re import time +import docutils from docutils import io, nodes, statemachine, utils from docutils.utils.error_reporting import SafeString, ErrorString from docutils.utils.error_reporting import locale_encoding @@ -47,7 +48,7 @@ 'class': directives.class_option, 'name': directives.unchanged} - standard_include_path = os.path.join(os.path.dirname(states.__file__), + standard_include_path = os.path.join(docutils._datadir(states.__file__), 'include') def run(self): --- a/docutils/writers/html4css1/__init__.py +++ b/docutils/writers/html4css1/__init__.py @@ -44,13 +44,13 @@ default_stylesheet = 'html4css1.css' default_stylesheet_dirs = ['.', utils.relative_path( - os.path.join(os.getcwd(), 'dummy'), os.path.dirname(__file__))] + os.path.join(os.getcwd(), 'dummy'), docutils._datadir(__file__))] default_template = 'template.txt' default_template_path = utils.relative_path( os.path.join(os.getcwd(), 'dummy'), - os.path.join(os.path.dirname(__file__), default_template)) + os.path.join(docutils._datadir(__file__), default_template)) settings_spec = ( 'HTML-Specific Options', --- a/docutils/writers/latex2e/__init__.py +++ b/docutils/writers/latex2e/__init__.py @@ -23,6 +23,7 @@ import roman except ImportError: import docutils.utils.roman as roman +import docutils from docutils import frontend, nodes, languages, writers, utils, io from docutils.utils.error_reporting import SafeString from docutils.transforms import writer_aux @@ -34,7 +35,7 @@ """Formats this writer supports.""" default_template = 'default.tex' - default_template_path = os.path.dirname(__file__) + default_template_path = docutils._datadir(__file__) default_preamble = '\n'.join([r'% PDF Standard Fonts', r'\usepackage{mathptmx} % Times', --- a/docutils/writers/odf_odt/__init__.py +++ b/docutils/writers/odf_odt/__init__.py @@ -399,13 +399,13 @@ default_stylesheet_path = utils.relative_path( os.path.join(os.getcwd(), 'dummy'), - os.path.join(os.path.dirname(__file__), default_stylesheet)) + os.path.join(docutils._datadir(__file__), default_stylesheet)) default_template = 'template.txt' default_template_path = utils.relative_path( os.path.join(os.getcwd(), 'dummy'), - os.path.join(os.path.dirname(__file__), default_template)) + os.path.join(docutils._datadir(__file__), default_template)) settings_spec = ( 'ODF-Specific Options', --- a/docutils/writers/pep_html/__init__.py +++ b/docutils/writers/pep_html/__init__.py @@ -24,13 +24,13 @@ default_stylesheet_path = utils.relative_path( os.path.join(os.getcwd(), 'dummy'), - os.path.join(os.path.dirname(__file__), default_stylesheet)) + os.path.join(docutils._datadir(__file__), default_stylesheet)) default_template = 'template.txt' default_template_path = utils.relative_path( os.path.join(os.getcwd(), 'dummy'), - os.path.join(os.path.dirname(__file__), default_template)) + os.path.join(docutils._datadir(__file__), default_template)) settings_spec = html4css1.Writer.settings_spec + ( 'PEP/HTML-Specific Options', --- a/docutils/writers/s5_html/__init__.py +++ b/docutils/writers/s5_html/__init__.py @@ -21,7 +21,7 @@ themes_dir_path = utils.relative_path( os.path.join(os.getcwd(), 'dummy'), - os.path.join(os.path.dirname(__file__), 'themes')) + os.path.join(docutils._datadir(__file__), 'themes')) def find_theme(name): # Where else to look for a theme? --- a/docutils/__init__.py +++ b/docutils/__init__.py @@ -215,3 +215,18 @@ a certain input context or output format. """ return format in self.supported + +import os + +_debian_package = 0 + +if _debian_package: + def _datadir(path): + dirname = os.path.dirname(path) + prefix = os.path.join(os.path.dirname(__file__), '') # _datadir + assert path.startswith(prefix), "%r doesn't start with %r" % (path, prefix) + suffix = dirname[len(prefix):] + return os.path.join('/usr/share/docutils/', suffix) +else: + def _datadir(path): + return os.path.dirname(path) --- a/test/test_parsers/test_rst/test_directives/test_include.py +++ b/test/test_parsers/test_rst/test_directives/test_include.py @@ -11,6 +11,7 @@ import os.path import sys from __init__ import DocutilsTestSupport +import docutils from docutils.parsers.rst import states from docutils._compat import b from docutils.utils.code_analyzer import with_pygments @@ -45,7 +46,7 @@ utf_16_error_str = ("UnicodeError: Unable to decode input data. " "Tried the following encodings: 'ascii'.\n" " (%s)" % utf_16_error_str) -nonexistent = os.path.join(os.path.dirname(states.__file__), +nonexistent = os.path.join(docutils._datadir(states.__file__), 'include', 'nonexistent') nonexistent_rel = DocutilsTestSupport.utils.relative_path( os.path.join(DocutilsTestSupport.testroot, 'dummy'), nonexistent) debian/patches/python3-pil-no-bytestrings.diff0000644000000000000000000000355112177241004016624 0ustar Description: Python 3: don't pass byte strings to PIL.Image.open() With Python 3.X, pass Unicode strings (rather than byte strings) to PIL.Image.open(). . This is to work around a PIL bug: http://bugs.debian.org/708449 Author: Jakub Wilk Forwarded: no Bug-Debian: http://bugs.debian.org/708159 Last-Update: 2013-08-03 --- a/docutils/parsers/rst/directives/images.py +++ b/docutils/parsers/rst/directives/images.py @@ -127,8 +127,11 @@ if PIL and self.state.document.settings.file_insertion_enabled: imagepath = urllib.url2pathname(image_node['uri']) try: - img = PIL.Image.open( - imagepath.encode(sys.getfilesystemencoding())) + if isinstance(imagepath, str): + imagepath_str = imagepath + else: + imagepath_str = imagepath.encode(sys.getfilesystemencoding()) + img = PIL.Image.open(imagepath_str) except (IOError, UnicodeEncodeError): pass # TODO: warn? else: --- a/docutils/writers/html4css1/__init__.py +++ b/docutils/writers/html4css1/__init__.py @@ -1039,8 +1039,11 @@ and self.settings.file_insertion_enabled): imagepath = urllib.url2pathname(uri) try: - img = PIL.Image.open( - imagepath.encode(sys.getfilesystemencoding())) + if isinstance(imagepath, str): + imagepath_str = imagepath + else: + imagepath_str = imagepath.encode(sys.getfilesystemencoding()) + img = PIL.Image.open(imagepath_str) except (IOError, UnicodeEncodeError): pass # TODO: warn? else: debian/patches/rst2odt_prepstyles-elementtree.diff0000644000000000000000000000411412200220325017635 0ustar Description: Port rst2odt_prepstyles to ElementTree rst2odt_prepstyles uses lxml to parse, modify and write XML. Use ElementTree, which is shipped with Python >= 2.5, in place of lxml. Bug-Debian: http://bugs.debian.org/714319 Author: Michael Schutte Forwarded: https://sourceforge.net/p/docutils/patches/114/ Last-Update: 2013-08-06 --- a/tools/rst2odt_prepstyles.py +++ b/tools/rst2odt_prepstyles.py @@ -12,7 +12,15 @@ # # Author: Michael Schutte -from lxml import etree +try: + from xml.etree import ElementTree as etree +except ImportError: + try: + from elementtree import ElementTree as etree + except ImportError: + raise ImportError('Missing an implementation of ElementTree. ' \ + 'Please install either Python >= 2.5 or ElementTree.') + import sys import zipfile from tempfile import mkstemp @@ -27,12 +35,22 @@ def prepstyle(filename): zin = zipfile.ZipFile(filename) - styles = zin.read("styles.xml") - - root = etree.fromstring(styles) - for el in root.xpath("//style:page-layout-properties", - namespaces=NAMESPACES): - for attr in el.attrib: + styles = zin.open("styles.xml") + + root = None + # some extra effort to preserve namespace prefixes + for event, elem in etree.iterparse(styles, events=("start", "start-ns")): + if event == "start-ns": + etree.register_namespace(elem[0], elem[1]) + elif event == "start": + if root is None: + root = elem + + styles.close() + + for el in root.findall(".//style:page-layout-properties", + namespaces=NAMESPACES): + for attr in el.attrib.keys(): if attr.startswith("{%s}" % NAMESPACES["fo"]): del el.attrib[attr] @@ -42,7 +60,7 @@ for item in zin.infolist(): if item.filename == "styles.xml": - zout.writestr(item, etree.tostring(root)) + zout.writestr(item, etree.tostring(root, encoding="UTF-8")) else: zout.writestr(item, zin.read(item.filename)) debian/patches/odt-writer-ascii-filenames.diff0000644000000000000000000000320212177756047016613 0ustar Description: Use only ASCII filenames in the ODF packages generated by the ODT writer The odf_odt writer embeds images in its output files and uses the original filenames as part of the embedded filenames. Since the OpenDocument standard does not specify the filename charset, recode to ASCII (dropping non-representable characters) to be on the safe side. This patch also removes an invalid assumption about the encoding used internally by the interpreter, which has caused Debian bug #714317, and fixes #714313. Author: Michael Schutte Bug-Debian: http://bugs.debian.org/714317 Bug-Debian: http://bugs.debian.org/714313 Forwarded: https://sourceforge.net/p/docutils/patches/113/ Last-Update: 2013-08-05 --- a/docutils/writers/odf_odt/__init__.py +++ b/docutils/writers/odf_odt/__init__.py @@ -595,8 +595,7 @@ continue try: # encode/decode - destination1 = destination.decode('latin-1').encode('utf-8') - zfile.write(source, destination1) + zfile.write(source, destination) except OSError, e: self.document.reporter.warning( "Can't open file %s." % (source, )) @@ -2076,7 +2075,8 @@ else: self.image_count += 1 filename = os.path.split(source)[1] - destination = 'Pictures/1%08x%s' % (self.image_count, filename, ) + destination = 'Pictures/1%08x_%s' % (self.image_count, + filename.encode("ascii", "ignore")) if source.startswith('http:'): try: imgfile = urllib2.urlopen(source) debian/patches/emacs-sensible-browser.diff0000644000000000000000000000113412064154444016025 0ustar Description: Use ‘sensible-browser’ to preview S5 slides. Use ‘sensible-browser’ (rather than ‘firefox’, which does not exist in Debian) as a program to preview S5 slides. Author: Jakub Wilk Forwarded: not-needed Last-Update: 2011-08-21 --- a/tools/editors/emacs/rst.el +++ b/tools/editors/emacs/rst.el @@ -4032,7 +4032,7 @@ )) ;; FIXME: Should be `defcustom` or use something like `browse-url`. -(defvar rst-slides-program "firefox" +(defvar rst-slides-program "sensible-browser" "Program used to preview S5 slides.") (defun rst-compile-slides-preview () debian/patches/no-test-skipping.diff0000644000000000000000000000134611724013531014663 0ustar Description: Do not skip tests. If Build-Depends are satisfied, importing ElementTree should not fail. If it does, it's better to fail than to skip the test silently. Author: Jakub Wilk Forwarded: not-needed Last-Update: 2012-03-02 --- a/test/test_writers/test_odt.py +++ b/test/test_writers/test_odt.py @@ -74,6 +74,7 @@ from elementtree import ElementTree as etree WhichElementTree = 'elementtree' except ImportError, e: + raise s1 = '\nSkipped test of odf_odt writer. ' \ 'In order to test odf_odt writer ' \ 'must install either a version of Python containing ' \ debian/patches/python3.3-odt-writer.diff0000644000000000000000000000241112145214125015305 0ustar Description: port the ODT writer to Python 3.3 ElementTree API Author: Jakub Wilk Forwarded: yes Bug: http://sourceforge.net/p/docutils/bugs/200/ Bug-Debian: http://bugs.debian.org/692285 Last-Update: 2013-05-16 --- a/docutils/writers/odf_odt/__init__.py +++ b/docutils/writers/odf_odt/__init__.py @@ -88,16 +88,20 @@ # that support for the ability to get the parent of an element. # if WhichElementTree == 'elementtree': - class _ElementInterfaceWrapper(etree._ElementInterface): + import weakref + _parents = weakref.WeakKeyDictionary() + if isinstance(etree.Element, type): + _ElementInterface = etree.Element + else: + _ElementInterface = etree._ElementInterface + class _ElementInterfaceWrapper(_ElementInterface): def __init__(self, tag, attrib=None): - etree._ElementInterface.__init__(self, tag, attrib) - if attrib is None: - attrib = {} - self.parent = None + _ElementInterface.__init__(self, tag, attrib) + _parents[self] = None def setparent(self, parent): - self.parent = parent + _parents[self] = parent def getparent(self): - return self.parent + return _parents[self] # debian/patches/test-sys-path.diff0000644000000000000000000000176012145214125014175 0ustar Description: fix sys.path for tests Fix sys.path in the test support module so that is matches paths that are in the Debian package. Author: Jakub Wilk Forwarded: not-needed Last-Update: 2013-05-16 --- a/test/DocutilsTestSupport.py +++ b/test/DocutilsTestSupport.py @@ -52,12 +52,9 @@ os.chdir(testroot) if sys.version_info >= (3,0): sys.path.insert(0, os.path.normpath(os.path.join(testroot, - '..', 'build', 'lib'))) - sys.path.append(os.path.normpath(os.path.join(testroot, '..', - 'build', 'lib', 'extras'))) + '..', 'build', 'py3'))) else: - sys.path.insert(0, os.path.normpath(os.path.join(testroot, '..'))) - sys.path.append(os.path.normpath(os.path.join(testroot, '..', 'extras'))) + sys.path.insert(0, os.path.normpath(os.path.join(testroot, '..', 'build', 'py2'))) sys.path.insert(0, testroot) try: debian/patches/iepngfix-license.diff0000644000000000000000000000340612121567572014713 0ustar Description: Update license information for IE PNG Alpha Fix. Upstream author of IE PNG Alpha Fix agreed that every version of his script can be distributed under the terms of the LGPL 2.1 or later version. Author: Jakub Wilk Bug: http://sourceforge.net/p/docutils/bugs/169/ Bug-Debian: http://bugs.debian.org/563696 Forwarded: no Last-Update: 2011-03-02 --- a/docutils/writers/s5_html/themes/default/iepngfix.htc +++ b/docutils/writers/s5_html/themes/default/iepngfix.htc @@ -4,7 +4,7 @@