#! /usr/bin/env python3
ID = '$Id: cvs2xhtml,v 1.15 2021/03/28 02:20:34 eagle Exp $'
#
# cvs2xhtml -- Convert cvs log output to XHTML Strict.
#
# Copyright 2002, 2004, 2006-2008, 2021 Russ Allbery
# See the documentation at the end of this file for the license.
import getopt, string, sys, time
# This page header is common to all generated pages. Variables are in all
# caps surrounded by %%, and are substituted when the header is printed.
page_header = '''
%NAME% Change History
%NAME% Change History
'''
# Used to report parsing errors when parsing the cvs log input.
class FormatException(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def version():
"""Return the version number of this program.
Returns the verison number of this program as a string containing the
program name, the CVS revision number, and the last modification date in
parentheses. This is taken from the global ID variable.
"""
# Make sure CVS doesn't see a variable here to substitute.
if ID != '$' + 'Id$':
data = ID.split()
date = data[3].replace("/", "-")
program = data[1][:-2]
version = data[2]
return program + " " + version + " (" + date + ")"
else:
return ''
def usage():
"""Print usage information for this program.
"""
print("Usage: cvs log | cvs2xhtml [-hv] -n -s