summaryrefslogtreecommitdiff
path: root/dev-python/htmlgen
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-python/htmlgen
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-python/htmlgen')
-rw-r--r--dev-python/htmlgen/Manifest5
-rw-r--r--dev-python/htmlgen/files/htmlgen-2.2.2-python-2.5.patch145
-rw-r--r--dev-python/htmlgen/files/htmlgen-pillow.patch53
-rw-r--r--dev-python/htmlgen/htmlgen-2.2.2-r1.ebuild59
-rw-r--r--dev-python/htmlgen/metadata.xml8
5 files changed, 270 insertions, 0 deletions
diff --git a/dev-python/htmlgen/Manifest b/dev-python/htmlgen/Manifest
new file mode 100644
index 000000000000..6f311e1f5741
--- /dev/null
+++ b/dev-python/htmlgen/Manifest
@@ -0,0 +1,5 @@
+AUX htmlgen-2.2.2-python-2.5.patch 5226 BLAKE2B 9b724899e92734150193b22d2e80db27c1ebb13cd42fa4484f30908335b7d070f67ef1af9a0d18e79b5c1a5d575261172fbd2959999a50721322a52798cf21e5 SHA512 340cc8603aa112b82a366b820691a49be62713d5d3611944d842b5170b7a267259dc8af75fedf30cbb8af9c514cc8f102caeca9e106a7afa8f154f0601b9d947
+AUX htmlgen-pillow.patch 1621 BLAKE2B efcbd0729a18edb98206a407fc6caf3412cabefa426f632b176f2e44825cb09e6a0677a249e15aa2e8ac578b225364f676217871f13be1cb7f3b1f1947090cfb SHA512 160896ecbac5135730ba06765d108e223f56b7fdc38595ff3a575639a7562e2259afad37ff3ada3633437ac01596501c044fc1a0438cd5a24a66ada98f41926f
+DIST HTMLgen.tgz 316415 BLAKE2B 8a01df9243f32628437bf2a83f906e946da73f0fe4f8e879d4689173da8fe877b28a8941473e3ccc300009a94f777bcbb438dceb52bc7e991796ffc702474574 SHA512 8301d4a28c29f477f07eedee2bffd6d07e345f08c056402098fa966f0e61895ed4dea60b653793b30d8457a7d692e3af772514d86ae440950fd52719bbadf942
+EBUILD htmlgen-2.2.2-r1.ebuild 1510 BLAKE2B cbf19eceae3729c52a74e4409606969fc5a14f2850ecf30ebb4b456d5bdedf23260ec669eac46e2b344da191200be2ed3fe9e64dc199ce4a5c45f48ac3797e13 SHA512 e869760d9711a89805fc7b763b348b8fdd4b253ec74935832c459e8321012404714173dc2f735af3c1f9dbc406de4ca46faa1cb3d5c249a2b7c654cc095db872
+MISC metadata.xml 236 BLAKE2B 167eb58da19caba0e03167e2f209e118ce8a468851bca2790a0353112848fffcd72522497e5f951bf5c6eafa9691fa2a1ad980843cb4170a8194f3b8178ebe16 SHA512 0f2c2a0401b53543eac90eafdd4d11c5913be07f47b968e2892ca92c265adbd9564f02a491ff2607d7031194ba3e50c7720851537341b1541120821c487147a3
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/files/htmlgen-pillow.patch b/dev-python/htmlgen/files/htmlgen-pillow.patch
new file mode 100644
index 000000000000..0c4f3daa27f4
--- /dev/null
+++ b/dev-python/htmlgen/files/htmlgen-pillow.patch
@@ -0,0 +1,53 @@
+Fix PIL imports for Pillow compat
+https://bugs.gentoo.org/show_bug.cgi?id=471506
+--- HTMLgen/ImageH.py 1999-04-20 22:40:28.000000000 -0400
++++ HTMLgen/ImageH.py 2013-06-08 14:00:49.261734532 -0400
+@@ -576,7 +576,7 @@
+ "Display image (for debug purposes only)"
+
+ try:
+- import ImageTk
++ from PIL import ImageTk
+ ImageTk._show(self, title)
+ # note: caller must enter mainloop
+ except:
+--- HTMLgen/ImagePaletteH.py 2013-06-08 13:56:03.476318926 -0400
++++ HTMLgen/ImagePaletteH.py 2013-06-08 14:01:26.564871622 -0400
+@@ -87,7 +87,7 @@
+
+ if not lut:
+ try:
+- import GimpPaletteFile
++ from PIL import GimpPaletteFile
+ fp.seek(0)
+ p = GimpPaletteFile.GimpPaletteFile(fp)
+ lut = p.getpalette()
+@@ -96,7 +96,7 @@
+
+ if not lut:
+ try:
+- import GimpGradientFile
++ from PIL import GimpGradientFile
+ fp.seek(0)
+ p = GimpGradientFile.GimpGradientFile(fp)
+ lut = p.getpalette()
+@@ -105,7 +105,7 @@
+
+ if not lut:
+ try:
+- import PaletteFile
++ from PIL import PaletteFile
+ fp.seek(0)
+ p = PaletteFile.PaletteFile(fp)
+ lut = p.getpalette()
+--- HTMLgen/imgsize.py 1998-05-25 13:56:37.000000000 -0400
++++ HTMLgen/imgsize.py 2013-06-08 14:01:48.731358969 -0400
+@@ -15,7 +15,7 @@
+
+ try: #Following switcheroo ensures that if PIL is installed it's used instead
+ # of the HTMLgen-bundled copies.
+- import Image
++ from PIL import Image
+ except ImportError:
+ import ImageH
+ Image = ImageH
diff --git a/dev-python/htmlgen/htmlgen-2.2.2-r1.ebuild b/dev-python/htmlgen/htmlgen-2.2.2-r1.ebuild
new file mode 100644
index 000000000000..528d9be0955b
--- /dev/null
+++ b/dev-python/htmlgen/htmlgen-2.2.2-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils python-r1
+
+MY_P="HTMLgen"
+DESCRIPTION="HTMLgen - Python modules for the generation of HTML documents"
+HOMEPAGE="http://soc.if.usp.br/manual/python-htmlgen/html/main.html"
+SRC_URI="http://starship.python.net/crew/friedrich/${MY_P}.tgz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 ia64 ppc x86"
+IUSE="doc"
+
+DEPEND="${PYTHON_DEPS}
+ dev-python/pillow[${PYTHON_USEDEP}]"
+RDEPEND="${DEPEND}"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-python-2.5.patch"
+ epatch "${FILESDIR}/${PN}-pillow.patch"
+}
+
+src_compile() {
+ return 0
+}
+
+src_install() {
+ # doing this manually because their build scripts suck
+ local files="HTMLgen.py HTMLcolors.py HTMLutil.py HTMLcalendar.py
+ barchart.py colorcube.py imgsize.py NavLinks.py Formtools.py
+ ImageH.py ImageFileH.py ImagePaletteH.py GifImagePluginH.py
+ JpegImagePluginH.py PngImagePluginH.py"
+
+ mkdir htmlgen || die
+ touch htmlgen/__init__.py || die
+ ln ${files} htmlgen/ || die
+ python_foreach_impl python_domodule htmlgen
+
+ if use doc; then
+ # fix the image locations in the docs
+ sed -i -e "s;../image/;image/;g" html/* || die "sed failed"
+ dohtml html/*
+ dohtml -r image
+ fi
+ dodoc README
+}
+
+pkg_postinst() {
+ ewarn "htmlgen now resides in its own subdirectory"
+ ewarn "so you need to do \"from htmlgen import HTMLgen\" instead of \"import HTMLgen\""
+}
diff --git a/dev-python/htmlgen/metadata.xml b/dev-python/htmlgen/metadata.xml
new file mode 100644
index 000000000000..9e5274c5b4ae
--- /dev/null
+++ b/dev-python/htmlgen/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+</maintainer>
+</pkgmetadata>