--- htmlgen-2.2.2.orig/Formtools.py.orig 1999-04-20 03:45:59 +0400 +++ htmlgen-2.2.2.orig/Formtools.py 2008-03-25 15:48:43 +0300 @@ -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 --- htmlgen-2.2.2.orig/HTMLcalendar.py.orig 1999-02-24 07:31:03 +0300 +++ htmlgen-2.2.2.orig/HTMLcalendar.py 2008-03-25 15:48:52 +0300 @@ -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. --- htmlgen-2.2.2.orig/HTMLgen.py.orig 1999-04-21 06:56:50 +0400 +++ htmlgen-2.2.2.orig/HTMLgen.py 2008-03-25 15:53:36 +0300 @@ -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 \n' \ - % (self.stylesheet, self.stylesheet)) + s.append('\n \n' \ + % (self.stylesheet)) if self.style: s.append('\n\n' % self.style) @@ -924,7 +924,7 @@ class MailTo: 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]) @@ -1083,7 +1083,7 @@ class List(UserList.UserList): Overloaded by child classes to represent other list styles. """ - return '%s
  • %s\n' % (self.pad*self.lvl, item) + return '%s
  • %s
  • \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): --- htmlgen-2.2.2.orig/HTMLtest.py.orig 1998-04-26 21:55:50 +0400 +++ htmlgen-2.2.2.orig/HTMLtest.py 2008-03-25 15:54:26 +0300 @@ -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,12 @@ def sample1(filename, aft=None, fore=Non 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 = regsub.split(s, '\n\([\t ]*\n\)+') + paragraphs = string.split(s, '\n\([\t ]*\n\)+') for para in paragraphs: if not para: continue if re_title.search(para) > -1: @@ -247,7 +248,7 @@ def sample1(filename, aft=None, fore=Non p = Paragraph( para ) # using \` to match beginning of paragraph # ^ won't work because it'll match all the newlines - n = p.markup('\`\(\w\)', font2, reg_type='regex') + n = p.markup('\`\(\w\)', font2, reg_type='re') doc.append(p) doc.write(os.path.join(htmldir, filename)) @@ -263,7 +264,7 @@ def sample2(filename, aft=None, fore=Non #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) --- htmlgen-2.2.2.orig/HTMLutil.py.orig 1998-05-29 00:26:59 +0400 +++ htmlgen-2.2.2.orig/HTMLutil.py 2008-03-25 15:49:24 +0300 @@ -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 dependan # 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('\( -1: + if re.search('\( -1: return 1 else: return 0 @@ -125,13 +124,13 @@ def global_substitute(search_func, repl_ 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] --- htmlgen-2.2.2.orig/ImagePaletteH.py.orig 1999-04-21 06:46:16 +0400 +++ htmlgen-2.2.2.orig/ImagePaletteH.py 2008-03-25 14:49:00 +0300 @@ -70,7 +70,7 @@ def negative(mode = "RGB"): 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) --- htmlgen-2.2.2.orig/NavLinks.py.orig 1999-02-26 07:10:19 +0300 +++ htmlgen-2.2.2.orig/NavLinks.py 2008-03-25 15:49:43 +0300 @@ -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 --- htmlgen-2.2.2.orig/StickyForm.py.orig 1999-02-04 07:59:06 +0300 +++ htmlgen-2.2.2.orig/StickyForm.py 2008-03-25 15:49:54 +0300 @@ -1,4 +1,3 @@ -#!/usr/bin/env python # """StickyForm -- state maintaining HTML forms --- htmlgen-2.2.2.orig/barchart.py.orig 1999-03-17 06:13:39 +0300 +++ htmlgen-2.2.2.orig/barchart.py 2008-03-25 15:50:03 +0300 @@ -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 --- htmlgen-2.2.2.orig/colorcube.py.orig 1998-03-19 21:57:56 +0300 +++ htmlgen-2.2.2.orig/colorcube.py 2008-03-25 15:50:16 +0300 @@ -1,4 +1,3 @@ -#!/usr/bin/env python """Utility to generate a table of browser safe colors. """ --- htmlgen-2.2.2.orig/imgfix.py.orig 1998-05-29 00:26:59 +0400 +++ htmlgen-2.2.2.orig/imgfix.py 2008-03-25 15:50:32 +0300 @@ -1,4 +1,3 @@ -#!/usr/bin/env python """Examine and fix the height/width attributes on IMG tags in the given files. """