customdoc
index
/home/u11/umhameld/workspace/birchscripts/customdoc.py

December  7, 2004, Dr. Brian Fristensky, University of Manitoba
 Description: Customize local copy of BIRCH documentation by 
 converting URLs and other strings in HTML files to correspond 
 to local files and directory structures.
 Synopsis: customdoc.py oldstrings newstrings htmldirs
 Files: oldstrings      old strings to be replaced
       newstrings      new strings to replace old strings
       htmldirs        directories in which to change HTML files
 
 
@modified: May 26 2010
@author: Dale Hamel
@contact: umhameld@cc.umanitoba.ca

 
Modules
       
os
re
sys

 
Classes
       
Parameters

 
class Parameters
     Methods defined here:
__init__(self)
Initializes arguments:
        OLDSTRFN=""
        NEWSTRFN=""
        DIRFN=""
Then calls read_args() to fill in their values from command line
read_args(self)
Reads command line arguments into a Parameter object

 
Functions
       
change_file(htmlfn)
Run through infile, changing old URLs to new URLs
Note that these changes are consecutive. However,
lines containing PROTECT are not changed.
get_list(fn)
Read in old and new strings, striping 
leading and trailing whitespace, including
newline characters.
main()
Called when not in documentation mode.
traverse(P)
Generates a list of all files and directories in current directory,
then recursively visits all sub-directories and lists HTML files

 
Data
        BEGIN_DELETE = '<!-- BEGIN delete -->'
BEGIN_REPLACE = '<!-- BEGIN replace name="'
BM = <birchlib.Birchmod instance>
DIRLIST = None
END_DELETE = '<!-- END delete -->'
END_REPLACE = '<!-- END replace -->'
NEWLIST = None
OLDLIST = None
PROGRAM = 'customdoc.py: '
PROTECT = "<!-- DON'T CHANGE -->"
TEMPFN = '18165.TEMP'
USAGE = '\n\t USAGE: customdoc.py oldstrings newstrings htmldirs'
blib = '/home/u11/umhameld/public_html/local/pylib/'