diff options
author | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-07-18 01:52:56 +0000 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2009-07-18 01:52:56 +0000 |
commit | b04f4a1ad3315c26e55981567fc172dad46d15be (patch) | |
tree | cb543530c924fa5730b7327e685ea6a1040f3411 /dev-python/htmlgen | |
parent | Fix -exif sed. bug #275568 (diff) | |
download | gentoo-2-b04f4a1ad3315c26e55981567fc172dad46d15be.tar.gz gentoo-2-b04f4a1ad3315c26e55981567fc172dad46d15be.tar.bz2 gentoo-2-b04f4a1ad3315c26e55981567fc172dad46d15be.zip |
Fix support for Python 2.5 (bug #278167).
(Portage version: 13833-svn/cvs/Linux x86_64)
Diffstat (limited to 'dev-python/htmlgen')
-rw-r--r-- | dev-python/htmlgen/ChangeLog | 8 | ||||
-rw-r--r-- | dev-python/htmlgen/files/htmlgen-2.2.2-python-2.5.patch | 145 | ||||
-rw-r--r-- | dev-python/htmlgen/htmlgen-2.2.2.ebuild | 14 |
3 files changed, 161 insertions, 6 deletions
diff --git a/dev-python/htmlgen/ChangeLog b/dev-python/htmlgen/ChangeLog index 88384c5543df..a57fa0958fe8 100644 --- a/dev-python/htmlgen/ChangeLog +++ b/dev-python/htmlgen/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-python/htmlgen -# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/htmlgen/ChangeLog,v 1.11 2008/10/27 09:11:22 hawking Exp $ +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/htmlgen/ChangeLog,v 1.12 2009/07/18 01:52:56 arfrever Exp $ + + 18 Jul 2009; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> + htmlgen-2.2.2.ebuild, +files/htmlgen-2.2.2-python-2.5.patch: + Fix support for Python 2.5 (bug #278167). 27 Oct 2008; Ali Polatel <hawking@gentoo.org> htmlgen-2.2.2.ebuild: Use python_need_rebuild. diff --git a/dev-python/htmlgen/files/htmlgen-2.2.2-python-2.5.patch b/dev-python/htmlgen/files/htmlgen-2.2.2-python-2.5.patch new file mode 100644 index 000000000000..7bdff6815011 --- /dev/null +++ b/dev-python/htmlgen/files/htmlgen-2.2.2-python-2.5.patch @@ -0,0 +1,145 @@ +--- HTMLcalendar.py ++++ HTMLcalendar.py +@@ -212,12 +212,12 @@ + return value + else: + raise TypeError, ('cannot convert to int', value) +-import regex +-datepat = regex.compile('^ *\([0-9*][0-9]?\)[/-]' #first 2 char date field ++import re ++datepat = re.compile('^ *\([0-9*][0-9]?\)[/-]' #first 2 char date field + '\([0-9][0-9]?\)[/-]?' #second 2 char date field + '\([12][0-9][0-9][0-9]\)?[ \t]*:') #optional year field +-daypat = regex.compile('^ *\('+string.join(day_name,'\|')+'\)') +-timepat = regex.compile('\([0-9][0-9]?\):\([0-9][0-9]\)') ++daypat = re.compile('^ *\('+string.join(day_name,'\|')+'\)') ++timepat = re.compile('\([0-9][0-9]?\):\([0-9][0-9]\)') + + def read_appt_file(filename): + """Parsing function. +--- HTMLgen.py ++++ HTMLgen.py +@@ -924,7 +924,7 @@ + def antispam(self, address): + """Process a string with HTML encodings to defeat address spiders. + """ +- from whrandom import choice ++ from random import choice + buffer = map(None, address) + for i in range(0, len(address), choice((2,3,4))): + buffer[i] = '&#%d;' % ord(buffer[i]) +--- HTMLtest.py ++++ HTMLtest.py +@@ -2,7 +2,7 @@ + + """Test script which generates the online documentation for HTMLgen. + """ +-import string, regex, regsub, os, time, glob ++import string, re, re, os, time, glob + from HTMLcolors import * + from HTMLgen import * + import HTMLgen #only so I can pick off the __version__ +@@ -232,11 +232,11 @@ + doc.email = 'jefferson@montecello.virginia.gov' + doc.logo = ('../image/eagle21.gif', 64, 54) + # parse Declaration of Independence +- re_hline = regex.compile('^--+$') +- re_title = regex.compile('^Title:\(.*$\)') ++ re_hline = re.compile('^--+$') ++ re_title = re.compile('^Title:\(.*$\)') + font2 = Font(size='+2') + s = open(os.path.join(datadir, 'DoI.txt')).read() +- paragraphs = regsub.split(s, '\n\([\t ]*\n\)+') ++ paragraphs = re.split(s, '\n\([\t ]*\n\)+') + for para in paragraphs: + if not para: continue + if re_title.search(para) > -1: +@@ -263,7 +263,7 @@ + #Ok parse that file + f = open(mpath(os.path.join(datadir, 'parrot.txt'))) + line = f.readline() +- re_dialog = regex.compile('\(^[OC].*:\)\(.*\)') ++ re_dialog = re.compile('\(^[OC].*:\)\(.*\)') + while line: + if re_dialog.search(line) > -1: + role, prose = re_dialog.group(1,2) +--- HTMLutil.py ++++ HTMLutil.py +@@ -19,7 +19,7 @@ + # OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + # PERFORMANCE OF THIS SOFTWARE. + __version__ = '$Id: HTMLutil.py,v 1.3 1998/05/28 20:14:52 friedric Exp $' +-import string, regex, os ++import string, re, os + import HTMLgen, HTMLcolors + from types import * + +@@ -79,7 +79,7 @@ + """Determine if the text have been marked by a previous gsub. + (ugly hack but it works) + """ +- if regex.search('\(</?FONT\)\|\(</?STRONG\)', text) > -1: ++ if re.search('\(</?FONT\)\|\(</?STRONG\)', text) > -1: + return 1 + else: + return 0 +@@ -125,13 +125,13 @@ + not_backslash = "[^\\\\]" + triple_single = "'''" + triple_double = '"""' +-_doc_start_re = regex.compile( ++_doc_start_re = re.compile( + "\(^\|" + not_backslash + "\)" # bol or not backslash + + "\(" + triple_single + "\|" + triple_double + "\)" ) + single_re = not_backslash + triple_single + double_re = not_backslash + triple_double +-_triple_re = { triple_single : regex.compile(single_re), +- triple_double : regex.compile(double_re) } ++_triple_re = { triple_single : re.compile(single_re), ++ triple_double : re.compile(double_re) } + + del not_backslash, triple_single, triple_double, \ + single_re, double_re +@@ -150,13 +150,13 @@ + return (None, None) + return startquote, quotefinder.regs[0][1] + +-string_re = regex.compile('\(\(\'[^\'\n]*\'\)\|\("[^"\n]"\)\)') ++string_re = re.compile('\(\(\'[^\'\n]*\'\)\|\("[^"\n]"\)\)') + def find_string_literal( s, begin=0 ): + if string_re.search(s, begin) > -1: + return string_re.regs[1] + return (None, None) + +-comment_re = regex.compile('#.*$') ++comment_re = re.compile('#.*$') + def find_comment( s, begin=0 ): + while comment_re.search(s, begin) > -1: + if been_marked(comment_re.group(0)): +@@ -166,13 +166,13 @@ + return (None, None) + + Name = '[a-zA-Z_][a-zA-Z0-9_]*' +-func_re = regex.compile('\(^[ \t]*def[ \t]+' +Name+ '\)[ \t]*(') ++func_re = re.compile('\(^[ \t]*def[ \t]+' +Name+ '\)[ \t]*(') + def find_function( s, begin=0 ): + if func_re.search(s, begin) > -1: + return func_re.regs[1] + return (None, None) + +-class_re = regex.compile('\(^[ \t]*class[ \t]+' +Name+ '\)[ \t]*[(:]') ++class_re = re.compile('\(^[ \t]*class[ \t]+' +Name+ '\)[ \t]*[(:]') + def find_class( s, begin=0 ): + if class_re.search(s, begin) > -1: + return class_re.regs[1] +--- ImagePaletteH.py ++++ ImagePaletteH.py +@@ -70,7 +70,7 @@ + return ImagePalette(mode, palette * len(mode)) + + def random(mode = "RGB"): +- from whrandom import randint ++ from random import randint + palette = map(lambda a: randint(0, 255), [0]*256*len(mode)) + return ImagePalette(mode, palette) + diff --git a/dev-python/htmlgen/htmlgen-2.2.2.ebuild b/dev-python/htmlgen/htmlgen-2.2.2.ebuild index d308099c42b9..03d050193e57 100644 --- a/dev-python/htmlgen/htmlgen-2.2.2.ebuild +++ b/dev-python/htmlgen/htmlgen-2.2.2.ebuild @@ -1,8 +1,10 @@ -# Copyright 1999-2008 Gentoo Foundation +# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/htmlgen/htmlgen-2.2.2.ebuild,v 1.14 2008/10/27 09:11:22 hawking Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/htmlgen/htmlgen-2.2.2.ebuild,v 1.15 2009/07/18 01:52:56 arfrever Exp $ -inherit python +EAPI="2" + +inherit eutils python MY_P="HTMLgen" DESCRIPTION="HTMLgen - Python modules for the generation of HTML documents" @@ -11,7 +13,7 @@ SRC_URI="http://starship.python.net/crew/friedrich/${MY_P}.tgz" LICENSE="BSD" SLOT="0" -KEYWORDS="ia64 ppc x86" +KEYWORDS="~amd64 ia64 ppc x86" IUSE="doc" DEPEND="virtual/python @@ -19,6 +21,10 @@ DEPEND="virtual/python S="${WORKDIR}/${MY_P}" +src_prepare() { + epatch "${FILESDIR}/${P}-python-2.5.patch" +} + src_install() { python_need_rebuild |