+++ /dev/null
-Use native python instead of external pyxml dependency. Patch from Debian.
-
-https://bugs.gentoo.org/367733
-
-
---- a/README.txt
-+++ b/README.txt
-@@ -15,9 +15,8 @@ universal and easy to use for desktop users and developers.
- Requirements
- ~~~~~~~~~~~~
-
-- - Python >= 2.3
-- - wxPython 2.6
-- - python-xml (PyXML)
-+ - Python >= 2.4
-+ - wxPython >= 2.6
- - gettext >= 0.14
-
-
---- a/lib/xmltools.py
-+++ b/lib/xmltools.py
-@@ -20,7 +20,6 @@
- #
-
- import xml.dom.minidom
--import xml.dom.ext
-
- from lib import meta
-
-@@ -30,7 +29,7 @@ def _textData(element):
-
- text = ''
- for node in element.childNodes:
-- text = node.data
-+ text = node.data.strip()
-
- return text
-
-@@ -99,7 +98,7 @@ class RegisterConfigGenerator:
- or ''))
-
- return doc
--
-+
-
- def generatePlainDictConfig(**args):
- """Generate configuration and return DOM object"""
-@@ -113,10 +112,11 @@ def generatePlainDictConfig(**args):
- def writePlainDictConfig(doc, path):
- """Write XML file"""
-
-- fd = open(path, 'w')
-- xml.dom.ext.PrettyPrint(doc, fd)
-+ import codecs
-+ fd = codecs.open(path, 'w', 'utf-8')
-+ doc.writexml(fd, addindent = " ", newl = "\n", encoding = "UTF-8")
- fd.close()
--
-+
-
-
- class RegisterConfigParser:
-@@ -144,32 +144,32 @@ class RegisterConfigParser:
-
- for nameElement in registerElement.getElementsByTagName('name'):
- for node in nameElement.childNodes:
-- name = node.data
-+ name = node.data.strip()
-
- for formatElement in registerElement.getElementsByTagName('format'):
- for node in formatElement.childNodes:
-- format = node.data
-+ format = node.data.strip()
-
- for pathElement in registerElement.getElementsByTagName('path'):
- for node in pathElement.childNodes:
-- path = node.data
-+ path = node.data.strip()
-
- for versionElement in registerElement.getElementsByTagName('version'):
- for node in versionElement.childNodes:
- version = node.data.strip()
-
- for authorElement in registerElement.getElementsByTagName('author'):
-- authors.append({'name': authorElement.getAttribute('name'),
-- 'email': authorElement.getAttribute('email')})
-+ authors.append({'name': authorElement.getAttribute('name').strip(),
-+ 'email': authorElement.getAttribute('email').strip()})
-
- for md5Element in registerElement.getElementsByTagName('md5'):
- for node in md5Element.childNodes:
-- md5 = node.data
-+ md5 = node.data.strip()
-
- for encodingElement in \
- registerElement.getElementsByTagName('encoding'):
- for node in encodingElement.childNodes:
-- encoding = node.data
-+ encoding = node.data.strip()
-
- for licenceElement in \
- registerElement.getElementsByTagName('licence'):
-@@ -241,8 +241,9 @@ def generateIndexFile(index):
- def writeIndexFile(doc, path):
- """Write XML file"""
-
-- fd = open(path, 'wb')
-- xml.dom.ext.PrettyPrint(doc, fd)
-+ import codecs
-+ fd = codecs.open(path, 'wb', 'utf-8')
-+ doc.writexml(fd, addindent = " ", newl = "\n", encoding = "UTF-8")
- fd.close()
-
-
-@@ -511,7 +512,8 @@ def generateMainConfig(props):
- def writeConfig(doc, path):
- """Write XML file"""
-
-- fd = open(path, 'w')
-- xml.dom.ext.PrettyPrint(doc, fd)
-+ import codecs
-+ fd = codecs.open(path, 'w', 'utf-8')
-+ doc.writexml(fd, addindent = " ", newl = "\n", encoding = "UTF-8")
- fd.close()
-
---- a/opendict.py
-+++ b/opendict.py
-@@ -53,16 +53,6 @@ except ImportError:
- print >> sys.stderr, "**"
- sys.exit(1)
-
--
--try:
-- import xml.dom.ext
--except ImportError:
-- print >> sys.stderr, "**"
-- print >> sys.stderr, "** Error: Python/XML library not found"
-- print >> sys.stderr, "** Please install python-xml (PyXML) to run OpenDict"
-- print >> sys.stderr, "**"
-- sys.exit(1)
--
- # get_main_dir() returns the directory name of the script or the
- # directory name of the exe
- def get_main_dir():
+++ /dev/null
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-GCONF_DEBUG="no" # We skip gnome2_src_configure entirely
-PYTHON_COMPAT=( python2_7 )
-
-inherit eutils gnome2 python-single-r1 readme.gentoo
-
-DESCRIPTION="OpenDict is a free cross-platform dictionary program"
-HOMEPAGE="http://opendict.sourceforge.net/"
-SRC_URI="http://opendict.idiles.com/files/${P}.tar.gz"
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 ppc x86"
-
-IUSE=""
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-RDEPEND="${PYTHON_DEPS}
- dev-python/wxpython:2.8[${PYTHON_USEDEP}]
-"
-DEPEND="${RDEPEND}"
-
-DISABLE_AUTOFORMATTING="yes"
-DOC_CONTENTS="If you want system-wide plugins, unzip them into
-${ROOT}usr/share/${PN}/dictionaries/plugins
-
-Some are available from http://opendict.sourceforge.net/?cid=3"
-
-src_prepare() {
- epatch "${FILESDIR}"/${P}-pyxml.patch
-
- sed -e "s:), '..')):), '../../../../..', 'share', 'opendict')):g" \
- -i "${S}/lib/info.py"
-
- gnome2_src_prepare
-}
-
-src_configure() {
- # override gnome2_src_configure
- default
-}
-
-src_compile() {
- # evil makefile
- :
-}
-
-src_install() {
- # makefile is broken, do it manually
-
- dodir /usr/share/${PN}/dictionaries/plugins # global dictionary plugins folder
-
- # Needed by GUI
- insinto /usr/share/${PN}
- doins "${S}"/copying.html
-
- insinto /usr/share/${PN}/pixmaps
- doins "${S}"/pixmaps/*
-
- DHOME="$(python_get_sitedir)/opendict"
- insinto "${DHOME}/lib"
- doins -r "${S}"/lib/*
- exeinto "${DHOME}"
- python_fix_shebang opendict.py
- doexe opendict.py
-
- dosym "${DHOME}/opendict.py" /usr/bin/opendict
-
- domenu misc/${PN}.desktop
-
- insinto /usr/share/icons/hicolor/24x24/apps/
- newins "${S}/pixmaps/icon-24x24.png" opendict.png
- insinto /usr/share/icons/hicolor/32x32/apps/
- newins "${S}/pixmaps/icon-32x32.png" opendict.png
- insinto /usr/share/icons/hicolor/48x48/apps/
- newins "${S}/pixmaps/icon-48x48.png" opendict.png
- insinto /usr/share/icons/hicolor/scalable/apps/
- newins "${S}/pixmaps/SVG/icon-rune.svg" opendict.svg
-
- doman opendict.1
- dodoc README.txt TODO.txt doc/Plugin-HOWTO.html
-
- readme.gentoo_create_doc
-}
-
-pkg_postinst() {
- gnome2_pkg_postinst
- readme.gentoo_print_elog
-}