aboutsummaryrefslogtreecommitdiff
path: root/python2-htmlgen-Applied-Deb-patch.patch
blob: d6a957ce10ad6e19788644fe2f06a0dfd992c2d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
From c0b16bbad9b8e396bdb64c638a3540547acfa3a5 Mon Sep 17 00:00:00 2001
From: Pjotr Prins <pjotr.public01@thebird.nl>
Date: Sat, 13 Feb 2016 13:39:03 +0100
Subject: [PATCH 1/2] Applied Deb patch

---
 Formtools.py     |  1 -
 HTMLcalendar.py  |  9 ++++-----
 HTMLgen.py       |  6 +++---
 HTMLtest.py      | 12 ++++++------
 HTMLutil.py      | 19 +++++++++----------
 ImagePaletteH.py |  2 +-
 Makefile         | 10 ++++++++++
 NavLinks.py      |  1 -
 barchart.py      |  1 -
 colorcube.py     |  1 -
 10 files changed, 33 insertions(+), 29 deletions(-)

diff --git a/Formtools.py b/Formtools.py
index bb598f4..1dabccd 100644
--- a/Formtools.py
+++ b/Formtools.py
@@ -1,4 +1,3 @@
-#! /usr/bin/env python
 "Provide some supporting classes to simplify Input Forms with HTMLgen"
 #'$Id: Formtools.py,v 1.1 1999/04/19 23:45:36 friedric Exp friedric $'
 # COPYRIGHT (C) 1999  ROBIN FRIEDRICH  email: Robin.Friedrich@pdq.net
diff --git a/HTMLcalendar.py b/HTMLcalendar.py
index 3a03915..35edf27 100644
--- a/HTMLcalendar.py
+++ b/HTMLcalendar.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # COPYRIGHT (C) 1997  ROBIN FRIEDRICH
 # Permission to  use, copy, modify, and distribute this software and its
 # documentation  for  any  purpose  and  without fee  is hereby granted,
@@ -212,12 +211,12 @@ def makeint(value):
             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.
diff --git a/HTMLgen.py b/HTMLgen.py
index 10ecd28..dbdbd81 100644
--- a/HTMLgen.py
+++ b/HTMLgen.py
@@ -284,7 +284,7 @@ class SimpleDocument(BasicDocument):
         if self.meta: s.append(str(self.meta))
         if self.base: s.append(str(self.base))
         if self.stylesheet:
-            s.append('\n <LINK rel=stylesheet href="%s" type=text/css title="%s">\n' \
+            s.append('\n <LINK rel=stylesheet href="%s" type="text/css" title="%s">\n' \
                      % (self.stylesheet, self.stylesheet))
         if self.style:
             s.append('\n<STYLE>\n<!--\n%s\n-->\n</style>\n' % self.style)
@@ -1083,7 +1083,7 @@ class List(UserList.UserList):
 
         Overloaded by child classes to represent other list styles.
         """
-        return '%s<LI>%s\n' % (self.pad*self.lvl, item)
+        return '%s<LI>%s</LI>\n' % (self.pad*self.lvl, item)
 
     def start_element(self):
         """Generic creator for the HTML element opening tag.
@@ -2463,7 +2463,7 @@ class URL:
         import urlparse
         self.unparse = urlparse.urlunparse
         self.proto, self.node, self.path, self.params, self.query, self.fragment = \
-                    urlparse(url)
+                    urlparse.urlparse(url)
         self.dir, self.file = self.split(self.path)
 
     def split(self, p):
diff --git a/HTMLtest.py b/HTMLtest.py
index 5850a04..283233f 100755
--- a/HTMLtest.py
+++ b/HTMLtest.py
@@ -1,8 +1,8 @@
-#!/bin/env python
+#!/usr/bin/env python
 
 """Test script which generates the online documentation for HTMLgen.
 """
-import string, regex, regsub, os, time, glob
+import string, re, os, time, glob
 from HTMLcolors import *
 from HTMLgen import *
 import HTMLgen  #only so I can pick off the __version__
@@ -232,11 +232,11 @@ def sample1(filename, aft=None, fore=None, top=None, home=None):
     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 @@ def sample2(filename, aft=None, fore=None, top=None, home=None):
     #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)
diff --git a/HTMLutil.py b/HTMLutil.py
index 2baf168..9a877e5 100755
--- a/HTMLutil.py
+++ b/HTMLutil.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 """This module provides utility functions/classes associated with HTMLgen.
 
 This is functionality use by HTMLgen script writers rather than by HTMLgen
@@ -19,7 +18,7 @@ itself. (i.e. HTMLgen.py is not dependant on this module.)
 # 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 +78,7 @@ def been_marked(text):
     """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 +124,13 @@ def global_substitute(search_func, repl_func, s):
 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 +149,13 @@ def find_docstring( s, begin=0):
         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 +165,13 @@ def find_comment( s, begin=0 ):
     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]
diff --git a/ImagePaletteH.py b/ImagePaletteH.py
index 83bb867..e723847 100644
--- a/ImagePaletteH.py
+++ b/ImagePaletteH.py
@@ -70,7 +70,7 @@ def negative(mode = "RGB"):
     return ImagePalette(mode, palette * len(mode))
 
 def random(mode = "RGB"):
-    from whrandom import randint
+#    from whrandom import randint
     palette = map(lambda a: randint(0, 255), [0]*256*len(mode))
     return ImagePalette(mode, palette)
 
diff --git a/Makefile b/Makefile
index 1788fa6..e1ec846 100644
--- a/Makefile
+++ b/Makefile
@@ -62,6 +62,16 @@ install: compileall
 	python installp.py -f $(MODULES) $(MODULESC) $(PIL) $(PILC)
 	@echo Installation of $(PACKAGE) done.
 
+debinstall:
+	if [ -z "$(PYLIBDIR)" ]; then \
+	  echo "Unset PYLIBDIR."; \
+	  exit 1; \
+	fi; \
+	for f in $(MODULES) $(PIL); do \
+	  install -m 644 $$f $(PYLIBDIR)/; \
+	done
+	@echo Installation of $(PACKAGE) done.
+
 checkin:
 	ci -u $(MODULES) $(PIL) $(EXTRAS) $(TEST) Makefile
 
diff --git a/NavLinks.py b/NavLinks.py
index fcecbb3..51ef774 100644
--- a/NavLinks.py
+++ b/NavLinks.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 #'$Id: NavLinks.py,v 1.1 1999/02/04 04:54:29 friedric Exp friedric $'
 # COPYRIGHT (C) 1999  ROBIN FRIEDRICH  email:Robin.Friedrich@pdq.net
 # Permission to use, copy, modify, and distribute this software and
diff --git a/barchart.py b/barchart.py
index 882cde5..a901fe4 100755
--- a/barchart.py
+++ b/barchart.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 
 """Provides BarChart class which creates HTML 1D bar charts,
 and StackedBarChart class to deal with multiple data plotting
diff --git a/colorcube.py b/colorcube.py
index be91154..94fa7dd 100644
--- a/colorcube.py
+++ b/colorcube.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 
 """Utility to generate a table of browser safe colors.
 """
-- 
2.1.4