viewvc-4intranet/lib/debug.py

204 lines
5.8 KiB
Python
Raw Normal View History

# -*-python-*-
#
# Copyright (C) 1999-2013 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
Work on issue 168, s/ViewCVS/ViewVC. This patch changes references to ViewCVS in comments, strings, and documentation. References to ViewCVS in filenames and urls still need to be fixed. Also, logo.png (the blimp) needs to be updated or replaced. This patch is by Gerard Gerritsen (sigcafe), the only change I've made is to restore a reference to ViewCVS in a comment about backwards compatibility. * windows/README * viewcvs-install * README * templates/include/footer.ezt * templates/include/header.ezt * templates/error.ezt * templates/query.ezt * templates/docroot/help.css * templates/docroot/help_query.html * templates/docroot/help_dirview.html * templates/docroot/help_rootview.html * templates/docroot/styles.css * templates/docroot/help_log.html * templates/diff.ezt * tools/make-release * lib/sapi.py * lib/dbi.py * lib/accept.py * lib/cvsdb.py * lib/config.py * lib/query.py * lib/vclib/bincvs/__init__.py * lib/vclib/svn/__init__.py * lib/vclib/__init__.py * lib/vclib/svn_ra/__init__.py * lib/vclib/ccvs/rcsparse/common.py * lib/vclib/ccvs/rcsparse/__init__.py * lib/vclib/ccvs/rcsparse/default.py * lib/vclib/ccvs/rcsparse/texttools.py * lib/vclib/ccvs/rcsparse/debug.py * lib/vclib/ccvs/__init__.py * lib/vclib/ccvs/blame.py * lib/blame.py * lib/popen.py * lib/compat.py * lib/viewcvs.py * lib/debug.py * INSTALL * bin/standalone.py * bin/make-database * bin/mod_python/query.py * bin/mod_python/viewcvs.py * bin/cgi/query.cgi * bin/cgi/viewcvs.cgi * bin/asp/query.asp * bin/asp/viewcvs.asp * bin/svndbadmin * bin/loginfo-handler * bin/cvsdbadmin * viewcvs.conf.dist git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1200 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-17 20:19:28 +03:00
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit http://viewvc.org/
#
# -----------------------------------------------------------------------
#
# Note: a t_start/t_end pair consumes about 0.00005 seconds on a P3/700.
# the lambda form (when debugging is disabled) should be even faster.
#
import sys
# Set to non-zero to track and print processing times
SHOW_TIMES = 0
# Set to non-zero to display child process info
SHOW_CHILD_PROCESSES = 0
# Set to a server-side path to force the tarball view to generate the
# tarball as a file on the server, instead of transmitting the data
# back to the browser. This enables easy display of error
# considitions in the browser, as well as tarball inspection on the
# server. NOTE: The file will be a TAR archive, *not* gzip-compressed.
TARFILE_PATH = ''
if SHOW_TIMES:
import time
_timers = { }
_times = { }
def t_start(which):
_timers[which] = time.time()
def t_end(which):
t = time.time() - _timers[which]
if _times.has_key(which):
_times[which] = _times[which] + t
else:
_times[which] = t
def t_dump(out):
out.write('<div>')
names = _times.keys()
names.sort()
for name in names:
out.write('%s: %.6fs<br/>\n' % (name, _times[name]))
out.write('</div>')
else:
t_start = t_end = t_dump = lambda *args: None
class ViewVCException:
def __init__(self, msg, status=None):
self.msg = msg
self.status = status
def __str__(self):
if self.status:
return '%s: %s' % (self.status, self.msg)
Work on issue 168, s/ViewCVS/ViewVC. This patch changes references to ViewCVS in comments, strings, and documentation. References to ViewCVS in filenames and urls still need to be fixed. Also, logo.png (the blimp) needs to be updated or replaced. This patch is by Gerard Gerritsen (sigcafe), the only change I've made is to restore a reference to ViewCVS in a comment about backwards compatibility. * windows/README * viewcvs-install * README * templates/include/footer.ezt * templates/include/header.ezt * templates/error.ezt * templates/query.ezt * templates/docroot/help.css * templates/docroot/help_query.html * templates/docroot/help_dirview.html * templates/docroot/help_rootview.html * templates/docroot/styles.css * templates/docroot/help_log.html * templates/diff.ezt * tools/make-release * lib/sapi.py * lib/dbi.py * lib/accept.py * lib/cvsdb.py * lib/config.py * lib/query.py * lib/vclib/bincvs/__init__.py * lib/vclib/svn/__init__.py * lib/vclib/__init__.py * lib/vclib/svn_ra/__init__.py * lib/vclib/ccvs/rcsparse/common.py * lib/vclib/ccvs/rcsparse/__init__.py * lib/vclib/ccvs/rcsparse/default.py * lib/vclib/ccvs/rcsparse/texttools.py * lib/vclib/ccvs/rcsparse/debug.py * lib/vclib/ccvs/__init__.py * lib/vclib/ccvs/blame.py * lib/blame.py * lib/popen.py * lib/compat.py * lib/viewcvs.py * lib/debug.py * INSTALL * bin/standalone.py * bin/make-database * bin/mod_python/query.py * bin/mod_python/viewcvs.py * bin/cgi/query.cgi * bin/cgi/viewcvs.cgi * bin/asp/query.asp * bin/asp/viewcvs.asp * bin/svndbadmin * bin/loginfo-handler * bin/cvsdbadmin * viewcvs.conf.dist git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1200 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-12-17 20:19:28 +03:00
return "ViewVC Unrecoverable Error: %s" % self.msg
def PrintException(server, exc_data):
status = exc_data['status']
msg = exc_data['msg']
tb = exc_data['stacktrace']
server.header(status=status)
server.write("<h3>An Exception Has Occurred</h3>\n")
s = ''
if msg:
s = '<p><pre>%s</pre></p>' % server.escape(msg)
if status:
This patch (mostly by Marten Thavenius) upgrades ViewCVS to XHTML 1.0 Strict. Changes have been made in the EZT templates, the CSS files, HTML code embedded in the Python files as well as in the help files. The original code structure and design is the very same. No other improvements have been made to the browser code and it still uses the old layout tables to create the page grid. Apart from the XHTML/CSS code changes, the patch adds an argument (-x x) for CVSGraph in viewcvs.py in the view_cvsgraph function to tell CVSGraph to generate XHTML code. For Mozilla/Firefox to recognize the id attribute in the image map generated, the content-type must be set to application/xhtml+xml (see https://bugzilla.mozilla.org/show_bug.cgi?id=109445). This patch does however not change the content-type, but uses an ugly hack to make the CVSGraph output work in Mozilla with the current text/html content-type: a name attribute is merged into the id attribute in the map_name defined in the cvsgraph.conf.dist file. The XHTML code does not contain the standard XML declaration, just the XHTML 1.0 Strict Doctype. This is to keep ViewCVS as encoding agnostic as before and let the browser decide which encoding to use. An XML file without the encoding declared must be interpreted as UTF-8 (or UTF-16 if the byte order mark is included). * viewcvs/cvsgraph.conf.dist Add name="" hack to the 'map_name' variable so Mozilla/Firefox will work. * viewcvs/lib/ezt.py XHTML-ize sample output. * viewcvs/lib/viewcvs.py XHTML-ize hard-coded output. (view_cvsgraph): Pass "-x x" to cvsgraph to force XHTML production. * viewcvs/lib/blame.py * viewcvs/lib/debug.py * viewcvs/lib/py2html.py * viewcvs/lib/query.py * viewcvs/lib/vclib/bincvs/__init__.py * viewcvs/templates/annotate.ezt * viewcvs/templates/diff.ezt * viewcvs/templates/dir_alternate.ezt * viewcvs/templates/directory.ezt * viewcvs/templates/error.ezt * viewcvs/templates/graph.ezt * viewcvs/templates/log.ezt * viewcvs/templates/log_table.ezt * viewcvs/templates/markup.ezt * viewcvs/templates/query.ezt * viewcvs/templates/query_form.ezt * viewcvs/templates/query_results.ezt * viewcvs/templates/revision.ezt * viewcvs/templates/roots.ezt * viewcvs/templates/docroot/help_dirview.html * viewcvs/templates/docroot/help_log.html * viewcvs/templates/docroot/help_logtable.html * viewcvs/templates/docroot/help_query.html * viewcvs/templates/docroot/help_rootview.html * viewcvs/templates/docroot/styles.css * viewcvs/templates/include/branch.ezt * viewcvs/templates/include/branch_form.ezt * viewcvs/templates/include/diff_form.ezt * viewcvs/templates/include/dir_footer.ezt * viewcvs/templates/include/dir_header.ezt * viewcvs/templates/include/file_header.ezt * viewcvs/templates/include/footer.ezt * viewcvs/templates/include/header.ezt * viewcvs/templates/include/paging.ezt * viewcvs/templates/include/sort.ezt * viewcvs/templates/include/view_tag.ezt XHTML-ize hard-coded output and templatized data. * viewcvs/CHANGES Note this change. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1109 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-28 21:06:16 +04:00
s = s + ('<h4>HTTP Response Status</h4>\n<p><pre>\n%s</pre></p><hr />\n'
% status)
server.write(s)
server.write("<h4>Python Traceback</h4>\n<p><pre>")
server.write(server.escape(tb))
server.write("</pre></p>\n")
def GetExceptionData():
# capture the exception before doing anything else
exc_type, exc, exc_tb = sys.exc_info()
exc_dict = {
'status' : None,
'msg' : None,
'stacktrace' : None,
}
try:
* lib/sapi.py - Filled in ModPythonServer and AspServer header() methods to make use of the new http 'status' parameter. Also, changed CgiServer's header() method to ignore the status parameter under IIS to prevent the server from discarding the ViewCVS output and instead sending a static error page. - ModPythonFile and AspFile classes have been eliminated and replaced with a more generic File class. All server classes have new write() and flush() methods. - Common code from AspServer and ModPythonServer has been moved into a base class called ThreadedServer. AspProxy is renamed to ThreadedServerProxy. - All server classes now inherit from a new base class called Server which contains the small amount of code common to all of them. - added fix_iis_path_info() function, renamed IIS_FixURL() to fix_iis_url() - renamed getFile() methods to file() * lib/viewcvs.py - Eliminated global server variable. Changed some scattered server.escape() calls into cgi.escape() calls. Got around other uses of the variable by adding a server member to the Request class. - Deleted gstein's strongly worded comment about the quality of the sapi hack :) - Page-global 'g_name_printed' is now passed as a normal parameter called 'name_printed' to the augment_entry() function - Got rid of some confusing string manipulation in human_readable_diff() - added 'server' parameter to viewcvs.main() to avoid relying on the sapi.server global variable * cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp - Added 'server' parameter to viewcvs.main() calls * standalone.py: - Changed StandaloneServer.header() method to accept http status code - Added 'server' parameter to viewcvs.main() call * lib/query.py - added 'server' parameter to query.main() to avoid relying on the sapi.server global variable - got rid of global 'server' variable and page-global 'viewcvs_link' variable, instead those values are passed as function parameters * cgi/query.cgi, windows/query.py, windows/query.asp - Added 'server' parameter to query.main() calls * lib/debug.py - Changed PrintStackTrace(), PrintException(), and DumpChildren() not to rely on global sapi.server variable and to use new server.write() method * lib/popen.py - changed server.getFile() calls to server.file() git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-13 02:08:09 +03:00
import traceback, string
if isinstance(exc, ViewVCException):
exc_dict['msg'] = exc.msg
exc_dict['status'] = exc.status
tb = string.join(traceback.format_exception(exc_type, exc, exc_tb), '')
exc_dict['stacktrace'] = tb
finally:
# prevent circular reference. sys.exc_info documentation warns
# "Assigning the traceback return value to a local variable in a function
# that is handling an exception will cause a circular reference..."
# This is all based on 'exc_tb', and we're now done with it. Toss it.
del exc_tb
return exc_dict
if SHOW_CHILD_PROCESSES:
class Process:
def __init__(self, command, inStream, outStream, errStream):
self.command = command
self.debugIn = inStream
self.debugOut = outStream
self.debugErr = errStream
import sapi
if not sapi.server is None:
if not sapi.server.pageGlobals.has_key('processes'):
sapi.server.pageGlobals['processes'] = [self]
else:
sapi.server.pageGlobals['processes'].append(self)
* lib/sapi.py - Filled in ModPythonServer and AspServer header() methods to make use of the new http 'status' parameter. Also, changed CgiServer's header() method to ignore the status parameter under IIS to prevent the server from discarding the ViewCVS output and instead sending a static error page. - ModPythonFile and AspFile classes have been eliminated and replaced with a more generic File class. All server classes have new write() and flush() methods. - Common code from AspServer and ModPythonServer has been moved into a base class called ThreadedServer. AspProxy is renamed to ThreadedServerProxy. - All server classes now inherit from a new base class called Server which contains the small amount of code common to all of them. - added fix_iis_path_info() function, renamed IIS_FixURL() to fix_iis_url() - renamed getFile() methods to file() * lib/viewcvs.py - Eliminated global server variable. Changed some scattered server.escape() calls into cgi.escape() calls. Got around other uses of the variable by adding a server member to the Request class. - Deleted gstein's strongly worded comment about the quality of the sapi hack :) - Page-global 'g_name_printed' is now passed as a normal parameter called 'name_printed' to the augment_entry() function - Got rid of some confusing string manipulation in human_readable_diff() - added 'server' parameter to viewcvs.main() to avoid relying on the sapi.server global variable * cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp - Added 'server' parameter to viewcvs.main() calls * standalone.py: - Changed StandaloneServer.header() method to accept http status code - Added 'server' parameter to viewcvs.main() call * lib/query.py - added 'server' parameter to query.main() to avoid relying on the sapi.server global variable - got rid of global 'server' variable and page-global 'viewcvs_link' variable, instead those values are passed as function parameters * cgi/query.cgi, windows/query.py, windows/query.asp - Added 'server' parameter to query.main() calls * lib/debug.py - Changed PrintStackTrace(), PrintException(), and DumpChildren() not to rely on global sapi.server variable and to use new server.write() method * lib/popen.py - changed server.getFile() calls to server.file() git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-13 02:08:09 +03:00
def DumpChildren(server):
import os
if not server.pageGlobals.has_key('processes'):
return
server.header()
lastOut = None
i = 0
for k in server.pageGlobals['processes']:
i = i + 1
This patch (mostly by Marten Thavenius) upgrades ViewCVS to XHTML 1.0 Strict. Changes have been made in the EZT templates, the CSS files, HTML code embedded in the Python files as well as in the help files. The original code structure and design is the very same. No other improvements have been made to the browser code and it still uses the old layout tables to create the page grid. Apart from the XHTML/CSS code changes, the patch adds an argument (-x x) for CVSGraph in viewcvs.py in the view_cvsgraph function to tell CVSGraph to generate XHTML code. For Mozilla/Firefox to recognize the id attribute in the image map generated, the content-type must be set to application/xhtml+xml (see https://bugzilla.mozilla.org/show_bug.cgi?id=109445). This patch does however not change the content-type, but uses an ugly hack to make the CVSGraph output work in Mozilla with the current text/html content-type: a name attribute is merged into the id attribute in the map_name defined in the cvsgraph.conf.dist file. The XHTML code does not contain the standard XML declaration, just the XHTML 1.0 Strict Doctype. This is to keep ViewCVS as encoding agnostic as before and let the browser decide which encoding to use. An XML file without the encoding declared must be interpreted as UTF-8 (or UTF-16 if the byte order mark is included). * viewcvs/cvsgraph.conf.dist Add name="" hack to the 'map_name' variable so Mozilla/Firefox will work. * viewcvs/lib/ezt.py XHTML-ize sample output. * viewcvs/lib/viewcvs.py XHTML-ize hard-coded output. (view_cvsgraph): Pass "-x x" to cvsgraph to force XHTML production. * viewcvs/lib/blame.py * viewcvs/lib/debug.py * viewcvs/lib/py2html.py * viewcvs/lib/query.py * viewcvs/lib/vclib/bincvs/__init__.py * viewcvs/templates/annotate.ezt * viewcvs/templates/diff.ezt * viewcvs/templates/dir_alternate.ezt * viewcvs/templates/directory.ezt * viewcvs/templates/error.ezt * viewcvs/templates/graph.ezt * viewcvs/templates/log.ezt * viewcvs/templates/log_table.ezt * viewcvs/templates/markup.ezt * viewcvs/templates/query.ezt * viewcvs/templates/query_form.ezt * viewcvs/templates/query_results.ezt * viewcvs/templates/revision.ezt * viewcvs/templates/roots.ezt * viewcvs/templates/docroot/help_dirview.html * viewcvs/templates/docroot/help_log.html * viewcvs/templates/docroot/help_logtable.html * viewcvs/templates/docroot/help_query.html * viewcvs/templates/docroot/help_rootview.html * viewcvs/templates/docroot/styles.css * viewcvs/templates/include/branch.ezt * viewcvs/templates/include/branch_form.ezt * viewcvs/templates/include/diff_form.ezt * viewcvs/templates/include/dir_footer.ezt * viewcvs/templates/include/dir_header.ezt * viewcvs/templates/include/file_header.ezt * viewcvs/templates/include/footer.ezt * viewcvs/templates/include/header.ezt * viewcvs/templates/include/paging.ezt * viewcvs/templates/include/sort.ezt * viewcvs/templates/include/view_tag.ezt XHTML-ize hard-coded output and templatized data. * viewcvs/CHANGES Note this change. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1109 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-28 21:06:16 +04:00
server.write("<table>\n")
server.write("<tr><td colspan=\"2\">Child Process%i</td></tr>" % i)
server.write("<tr>\n <td style=\"vertical-align:top\">Command Line</td> <td><pre>")
* lib/sapi.py - Filled in ModPythonServer and AspServer header() methods to make use of the new http 'status' parameter. Also, changed CgiServer's header() method to ignore the status parameter under IIS to prevent the server from discarding the ViewCVS output and instead sending a static error page. - ModPythonFile and AspFile classes have been eliminated and replaced with a more generic File class. All server classes have new write() and flush() methods. - Common code from AspServer and ModPythonServer has been moved into a base class called ThreadedServer. AspProxy is renamed to ThreadedServerProxy. - All server classes now inherit from a new base class called Server which contains the small amount of code common to all of them. - added fix_iis_path_info() function, renamed IIS_FixURL() to fix_iis_url() - renamed getFile() methods to file() * lib/viewcvs.py - Eliminated global server variable. Changed some scattered server.escape() calls into cgi.escape() calls. Got around other uses of the variable by adding a server member to the Request class. - Deleted gstein's strongly worded comment about the quality of the sapi hack :) - Page-global 'g_name_printed' is now passed as a normal parameter called 'name_printed' to the augment_entry() function - Got rid of some confusing string manipulation in human_readable_diff() - added 'server' parameter to viewcvs.main() to avoid relying on the sapi.server global variable * cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp - Added 'server' parameter to viewcvs.main() calls * standalone.py: - Changed StandaloneServer.header() method to accept http status code - Added 'server' parameter to viewcvs.main() call * lib/query.py - added 'server' parameter to query.main() to avoid relying on the sapi.server global variable - got rid of global 'server' variable and page-global 'viewcvs_link' variable, instead those values are passed as function parameters * cgi/query.cgi, windows/query.py, windows/query.asp - Added 'server' parameter to query.main() calls * lib/debug.py - Changed PrintStackTrace(), PrintException(), and DumpChildren() not to rely on global sapi.server variable and to use new server.write() method * lib/popen.py - changed server.getFile() calls to server.file() git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-13 02:08:09 +03:00
server.write(server.escape(k.command))
server.write("</pre></td>\n</tr>\n")
This patch (mostly by Marten Thavenius) upgrades ViewCVS to XHTML 1.0 Strict. Changes have been made in the EZT templates, the CSS files, HTML code embedded in the Python files as well as in the help files. The original code structure and design is the very same. No other improvements have been made to the browser code and it still uses the old layout tables to create the page grid. Apart from the XHTML/CSS code changes, the patch adds an argument (-x x) for CVSGraph in viewcvs.py in the view_cvsgraph function to tell CVSGraph to generate XHTML code. For Mozilla/Firefox to recognize the id attribute in the image map generated, the content-type must be set to application/xhtml+xml (see https://bugzilla.mozilla.org/show_bug.cgi?id=109445). This patch does however not change the content-type, but uses an ugly hack to make the CVSGraph output work in Mozilla with the current text/html content-type: a name attribute is merged into the id attribute in the map_name defined in the cvsgraph.conf.dist file. The XHTML code does not contain the standard XML declaration, just the XHTML 1.0 Strict Doctype. This is to keep ViewCVS as encoding agnostic as before and let the browser decide which encoding to use. An XML file without the encoding declared must be interpreted as UTF-8 (or UTF-16 if the byte order mark is included). * viewcvs/cvsgraph.conf.dist Add name="" hack to the 'map_name' variable so Mozilla/Firefox will work. * viewcvs/lib/ezt.py XHTML-ize sample output. * viewcvs/lib/viewcvs.py XHTML-ize hard-coded output. (view_cvsgraph): Pass "-x x" to cvsgraph to force XHTML production. * viewcvs/lib/blame.py * viewcvs/lib/debug.py * viewcvs/lib/py2html.py * viewcvs/lib/query.py * viewcvs/lib/vclib/bincvs/__init__.py * viewcvs/templates/annotate.ezt * viewcvs/templates/diff.ezt * viewcvs/templates/dir_alternate.ezt * viewcvs/templates/directory.ezt * viewcvs/templates/error.ezt * viewcvs/templates/graph.ezt * viewcvs/templates/log.ezt * viewcvs/templates/log_table.ezt * viewcvs/templates/markup.ezt * viewcvs/templates/query.ezt * viewcvs/templates/query_form.ezt * viewcvs/templates/query_results.ezt * viewcvs/templates/revision.ezt * viewcvs/templates/roots.ezt * viewcvs/templates/docroot/help_dirview.html * viewcvs/templates/docroot/help_log.html * viewcvs/templates/docroot/help_logtable.html * viewcvs/templates/docroot/help_query.html * viewcvs/templates/docroot/help_rootview.html * viewcvs/templates/docroot/styles.css * viewcvs/templates/include/branch.ezt * viewcvs/templates/include/branch_form.ezt * viewcvs/templates/include/diff_form.ezt * viewcvs/templates/include/dir_footer.ezt * viewcvs/templates/include/dir_header.ezt * viewcvs/templates/include/file_header.ezt * viewcvs/templates/include/footer.ezt * viewcvs/templates/include/header.ezt * viewcvs/templates/include/paging.ezt * viewcvs/templates/include/sort.ezt * viewcvs/templates/include/view_tag.ezt XHTML-ize hard-coded output and templatized data. * viewcvs/CHANGES Note this change. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1109 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-28 21:06:16 +04:00
server.write("<tr>\n <td style=\"vertical-align:top\">Standard In:</td> <td>")
if k.debugIn is lastOut and not lastOut is None:
This patch (mostly by Marten Thavenius) upgrades ViewCVS to XHTML 1.0 Strict. Changes have been made in the EZT templates, the CSS files, HTML code embedded in the Python files as well as in the help files. The original code structure and design is the very same. No other improvements have been made to the browser code and it still uses the old layout tables to create the page grid. Apart from the XHTML/CSS code changes, the patch adds an argument (-x x) for CVSGraph in viewcvs.py in the view_cvsgraph function to tell CVSGraph to generate XHTML code. For Mozilla/Firefox to recognize the id attribute in the image map generated, the content-type must be set to application/xhtml+xml (see https://bugzilla.mozilla.org/show_bug.cgi?id=109445). This patch does however not change the content-type, but uses an ugly hack to make the CVSGraph output work in Mozilla with the current text/html content-type: a name attribute is merged into the id attribute in the map_name defined in the cvsgraph.conf.dist file. The XHTML code does not contain the standard XML declaration, just the XHTML 1.0 Strict Doctype. This is to keep ViewCVS as encoding agnostic as before and let the browser decide which encoding to use. An XML file without the encoding declared must be interpreted as UTF-8 (or UTF-16 if the byte order mark is included). * viewcvs/cvsgraph.conf.dist Add name="" hack to the 'map_name' variable so Mozilla/Firefox will work. * viewcvs/lib/ezt.py XHTML-ize sample output. * viewcvs/lib/viewcvs.py XHTML-ize hard-coded output. (view_cvsgraph): Pass "-x x" to cvsgraph to force XHTML production. * viewcvs/lib/blame.py * viewcvs/lib/debug.py * viewcvs/lib/py2html.py * viewcvs/lib/query.py * viewcvs/lib/vclib/bincvs/__init__.py * viewcvs/templates/annotate.ezt * viewcvs/templates/diff.ezt * viewcvs/templates/dir_alternate.ezt * viewcvs/templates/directory.ezt * viewcvs/templates/error.ezt * viewcvs/templates/graph.ezt * viewcvs/templates/log.ezt * viewcvs/templates/log_table.ezt * viewcvs/templates/markup.ezt * viewcvs/templates/query.ezt * viewcvs/templates/query_form.ezt * viewcvs/templates/query_results.ezt * viewcvs/templates/revision.ezt * viewcvs/templates/roots.ezt * viewcvs/templates/docroot/help_dirview.html * viewcvs/templates/docroot/help_log.html * viewcvs/templates/docroot/help_logtable.html * viewcvs/templates/docroot/help_query.html * viewcvs/templates/docroot/help_rootview.html * viewcvs/templates/docroot/styles.css * viewcvs/templates/include/branch.ezt * viewcvs/templates/include/branch_form.ezt * viewcvs/templates/include/diff_form.ezt * viewcvs/templates/include/dir_footer.ezt * viewcvs/templates/include/dir_header.ezt * viewcvs/templates/include/file_header.ezt * viewcvs/templates/include/footer.ezt * viewcvs/templates/include/header.ezt * viewcvs/templates/include/paging.ezt * viewcvs/templates/include/sort.ezt * viewcvs/templates/include/view_tag.ezt XHTML-ize hard-coded output and templatized data. * viewcvs/CHANGES Note this change. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1109 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-28 21:06:16 +04:00
server.write("<em>Output from process %i</em>" % (i - 1))
elif k.debugIn:
* lib/sapi.py - Filled in ModPythonServer and AspServer header() methods to make use of the new http 'status' parameter. Also, changed CgiServer's header() method to ignore the status parameter under IIS to prevent the server from discarding the ViewCVS output and instead sending a static error page. - ModPythonFile and AspFile classes have been eliminated and replaced with a more generic File class. All server classes have new write() and flush() methods. - Common code from AspServer and ModPythonServer has been moved into a base class called ThreadedServer. AspProxy is renamed to ThreadedServerProxy. - All server classes now inherit from a new base class called Server which contains the small amount of code common to all of them. - added fix_iis_path_info() function, renamed IIS_FixURL() to fix_iis_url() - renamed getFile() methods to file() * lib/viewcvs.py - Eliminated global server variable. Changed some scattered server.escape() calls into cgi.escape() calls. Got around other uses of the variable by adding a server member to the Request class. - Deleted gstein's strongly worded comment about the quality of the sapi hack :) - Page-global 'g_name_printed' is now passed as a normal parameter called 'name_printed' to the augment_entry() function - Got rid of some confusing string manipulation in human_readable_diff() - added 'server' parameter to viewcvs.main() to avoid relying on the sapi.server global variable * cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp - Added 'server' parameter to viewcvs.main() calls * standalone.py: - Changed StandaloneServer.header() method to accept http status code - Added 'server' parameter to viewcvs.main() call * lib/query.py - added 'server' parameter to query.main() to avoid relying on the sapi.server global variable - got rid of global 'server' variable and page-global 'viewcvs_link' variable, instead those values are passed as function parameters * cgi/query.cgi, windows/query.py, windows/query.asp - Added 'server' parameter to query.main() calls * lib/debug.py - Changed PrintStackTrace(), PrintException(), and DumpChildren() not to rely on global sapi.server variable and to use new server.write() method * lib/popen.py - changed server.getFile() calls to server.file() git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-13 02:08:09 +03:00
server.write("<pre>")
server.write(server.escape(k.debugIn.getvalue()))
server.write("</pre>")
* lib/sapi.py - Filled in ModPythonServer and AspServer header() methods to make use of the new http 'status' parameter. Also, changed CgiServer's header() method to ignore the status parameter under IIS to prevent the server from discarding the ViewCVS output and instead sending a static error page. - ModPythonFile and AspFile classes have been eliminated and replaced with a more generic File class. All server classes have new write() and flush() methods. - Common code from AspServer and ModPythonServer has been moved into a base class called ThreadedServer. AspProxy is renamed to ThreadedServerProxy. - All server classes now inherit from a new base class called Server which contains the small amount of code common to all of them. - added fix_iis_path_info() function, renamed IIS_FixURL() to fix_iis_url() - renamed getFile() methods to file() * lib/viewcvs.py - Eliminated global server variable. Changed some scattered server.escape() calls into cgi.escape() calls. Got around other uses of the variable by adding a server member to the Request class. - Deleted gstein's strongly worded comment about the quality of the sapi hack :) - Page-global 'g_name_printed' is now passed as a normal parameter called 'name_printed' to the augment_entry() function - Got rid of some confusing string manipulation in human_readable_diff() - added 'server' parameter to viewcvs.main() to avoid relying on the sapi.server global variable * cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp - Added 'server' parameter to viewcvs.main() calls * standalone.py: - Changed StandaloneServer.header() method to accept http status code - Added 'server' parameter to viewcvs.main() call * lib/query.py - added 'server' parameter to query.main() to avoid relying on the sapi.server global variable - got rid of global 'server' variable and page-global 'viewcvs_link' variable, instead those values are passed as function parameters * cgi/query.cgi, windows/query.py, windows/query.asp - Added 'server' parameter to query.main() calls * lib/debug.py - Changed PrintStackTrace(), PrintException(), and DumpChildren() not to rely on global sapi.server variable and to use new server.write() method * lib/popen.py - changed server.getFile() calls to server.file() git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-13 02:08:09 +03:00
server.write("</td>\n</tr>\n")
if k.debugOut is k.debugErr:
This patch (mostly by Marten Thavenius) upgrades ViewCVS to XHTML 1.0 Strict. Changes have been made in the EZT templates, the CSS files, HTML code embedded in the Python files as well as in the help files. The original code structure and design is the very same. No other improvements have been made to the browser code and it still uses the old layout tables to create the page grid. Apart from the XHTML/CSS code changes, the patch adds an argument (-x x) for CVSGraph in viewcvs.py in the view_cvsgraph function to tell CVSGraph to generate XHTML code. For Mozilla/Firefox to recognize the id attribute in the image map generated, the content-type must be set to application/xhtml+xml (see https://bugzilla.mozilla.org/show_bug.cgi?id=109445). This patch does however not change the content-type, but uses an ugly hack to make the CVSGraph output work in Mozilla with the current text/html content-type: a name attribute is merged into the id attribute in the map_name defined in the cvsgraph.conf.dist file. The XHTML code does not contain the standard XML declaration, just the XHTML 1.0 Strict Doctype. This is to keep ViewCVS as encoding agnostic as before and let the browser decide which encoding to use. An XML file without the encoding declared must be interpreted as UTF-8 (or UTF-16 if the byte order mark is included). * viewcvs/cvsgraph.conf.dist Add name="" hack to the 'map_name' variable so Mozilla/Firefox will work. * viewcvs/lib/ezt.py XHTML-ize sample output. * viewcvs/lib/viewcvs.py XHTML-ize hard-coded output. (view_cvsgraph): Pass "-x x" to cvsgraph to force XHTML production. * viewcvs/lib/blame.py * viewcvs/lib/debug.py * viewcvs/lib/py2html.py * viewcvs/lib/query.py * viewcvs/lib/vclib/bincvs/__init__.py * viewcvs/templates/annotate.ezt * viewcvs/templates/diff.ezt * viewcvs/templates/dir_alternate.ezt * viewcvs/templates/directory.ezt * viewcvs/templates/error.ezt * viewcvs/templates/graph.ezt * viewcvs/templates/log.ezt * viewcvs/templates/log_table.ezt * viewcvs/templates/markup.ezt * viewcvs/templates/query.ezt * viewcvs/templates/query_form.ezt * viewcvs/templates/query_results.ezt * viewcvs/templates/revision.ezt * viewcvs/templates/roots.ezt * viewcvs/templates/docroot/help_dirview.html * viewcvs/templates/docroot/help_log.html * viewcvs/templates/docroot/help_logtable.html * viewcvs/templates/docroot/help_query.html * viewcvs/templates/docroot/help_rootview.html * viewcvs/templates/docroot/styles.css * viewcvs/templates/include/branch.ezt * viewcvs/templates/include/branch_form.ezt * viewcvs/templates/include/diff_form.ezt * viewcvs/templates/include/dir_footer.ezt * viewcvs/templates/include/dir_header.ezt * viewcvs/templates/include/file_header.ezt * viewcvs/templates/include/footer.ezt * viewcvs/templates/include/header.ezt * viewcvs/templates/include/paging.ezt * viewcvs/templates/include/sort.ezt * viewcvs/templates/include/view_tag.ezt XHTML-ize hard-coded output and templatized data. * viewcvs/CHANGES Note this change. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1109 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-28 21:06:16 +04:00
server.write("<tr>\n <td style=\"vertical-align:top\">Standard Out & Error:</td> <td><pre>")
if k.debugOut:
* lib/sapi.py - Filled in ModPythonServer and AspServer header() methods to make use of the new http 'status' parameter. Also, changed CgiServer's header() method to ignore the status parameter under IIS to prevent the server from discarding the ViewCVS output and instead sending a static error page. - ModPythonFile and AspFile classes have been eliminated and replaced with a more generic File class. All server classes have new write() and flush() methods. - Common code from AspServer and ModPythonServer has been moved into a base class called ThreadedServer. AspProxy is renamed to ThreadedServerProxy. - All server classes now inherit from a new base class called Server which contains the small amount of code common to all of them. - added fix_iis_path_info() function, renamed IIS_FixURL() to fix_iis_url() - renamed getFile() methods to file() * lib/viewcvs.py - Eliminated global server variable. Changed some scattered server.escape() calls into cgi.escape() calls. Got around other uses of the variable by adding a server member to the Request class. - Deleted gstein's strongly worded comment about the quality of the sapi hack :) - Page-global 'g_name_printed' is now passed as a normal parameter called 'name_printed' to the augment_entry() function - Got rid of some confusing string manipulation in human_readable_diff() - added 'server' parameter to viewcvs.main() to avoid relying on the sapi.server global variable * cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp - Added 'server' parameter to viewcvs.main() calls * standalone.py: - Changed StandaloneServer.header() method to accept http status code - Added 'server' parameter to viewcvs.main() call * lib/query.py - added 'server' parameter to query.main() to avoid relying on the sapi.server global variable - got rid of global 'server' variable and page-global 'viewcvs_link' variable, instead those values are passed as function parameters * cgi/query.cgi, windows/query.py, windows/query.asp - Added 'server' parameter to query.main() calls * lib/debug.py - Changed PrintStackTrace(), PrintException(), and DumpChildren() not to rely on global sapi.server variable and to use new server.write() method * lib/popen.py - changed server.getFile() calls to server.file() git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-13 02:08:09 +03:00
server.write(server.escape(k.debugOut.getvalue()))
server.write("</pre></td>\n</tr>\n")
else:
This patch (mostly by Marten Thavenius) upgrades ViewCVS to XHTML 1.0 Strict. Changes have been made in the EZT templates, the CSS files, HTML code embedded in the Python files as well as in the help files. The original code structure and design is the very same. No other improvements have been made to the browser code and it still uses the old layout tables to create the page grid. Apart from the XHTML/CSS code changes, the patch adds an argument (-x x) for CVSGraph in viewcvs.py in the view_cvsgraph function to tell CVSGraph to generate XHTML code. For Mozilla/Firefox to recognize the id attribute in the image map generated, the content-type must be set to application/xhtml+xml (see https://bugzilla.mozilla.org/show_bug.cgi?id=109445). This patch does however not change the content-type, but uses an ugly hack to make the CVSGraph output work in Mozilla with the current text/html content-type: a name attribute is merged into the id attribute in the map_name defined in the cvsgraph.conf.dist file. The XHTML code does not contain the standard XML declaration, just the XHTML 1.0 Strict Doctype. This is to keep ViewCVS as encoding agnostic as before and let the browser decide which encoding to use. An XML file without the encoding declared must be interpreted as UTF-8 (or UTF-16 if the byte order mark is included). * viewcvs/cvsgraph.conf.dist Add name="" hack to the 'map_name' variable so Mozilla/Firefox will work. * viewcvs/lib/ezt.py XHTML-ize sample output. * viewcvs/lib/viewcvs.py XHTML-ize hard-coded output. (view_cvsgraph): Pass "-x x" to cvsgraph to force XHTML production. * viewcvs/lib/blame.py * viewcvs/lib/debug.py * viewcvs/lib/py2html.py * viewcvs/lib/query.py * viewcvs/lib/vclib/bincvs/__init__.py * viewcvs/templates/annotate.ezt * viewcvs/templates/diff.ezt * viewcvs/templates/dir_alternate.ezt * viewcvs/templates/directory.ezt * viewcvs/templates/error.ezt * viewcvs/templates/graph.ezt * viewcvs/templates/log.ezt * viewcvs/templates/log_table.ezt * viewcvs/templates/markup.ezt * viewcvs/templates/query.ezt * viewcvs/templates/query_form.ezt * viewcvs/templates/query_results.ezt * viewcvs/templates/revision.ezt * viewcvs/templates/roots.ezt * viewcvs/templates/docroot/help_dirview.html * viewcvs/templates/docroot/help_log.html * viewcvs/templates/docroot/help_logtable.html * viewcvs/templates/docroot/help_query.html * viewcvs/templates/docroot/help_rootview.html * viewcvs/templates/docroot/styles.css * viewcvs/templates/include/branch.ezt * viewcvs/templates/include/branch_form.ezt * viewcvs/templates/include/diff_form.ezt * viewcvs/templates/include/dir_footer.ezt * viewcvs/templates/include/dir_header.ezt * viewcvs/templates/include/file_header.ezt * viewcvs/templates/include/footer.ezt * viewcvs/templates/include/header.ezt * viewcvs/templates/include/paging.ezt * viewcvs/templates/include/sort.ezt * viewcvs/templates/include/view_tag.ezt XHTML-ize hard-coded output and templatized data. * viewcvs/CHANGES Note this change. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1109 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-28 21:06:16 +04:00
server.write("<tr>\n <td style=\"vertical-align:top\">Standard Out:</td> <td><pre>")
if k.debugOut:
* lib/sapi.py - Filled in ModPythonServer and AspServer header() methods to make use of the new http 'status' parameter. Also, changed CgiServer's header() method to ignore the status parameter under IIS to prevent the server from discarding the ViewCVS output and instead sending a static error page. - ModPythonFile and AspFile classes have been eliminated and replaced with a more generic File class. All server classes have new write() and flush() methods. - Common code from AspServer and ModPythonServer has been moved into a base class called ThreadedServer. AspProxy is renamed to ThreadedServerProxy. - All server classes now inherit from a new base class called Server which contains the small amount of code common to all of them. - added fix_iis_path_info() function, renamed IIS_FixURL() to fix_iis_url() - renamed getFile() methods to file() * lib/viewcvs.py - Eliminated global server variable. Changed some scattered server.escape() calls into cgi.escape() calls. Got around other uses of the variable by adding a server member to the Request class. - Deleted gstein's strongly worded comment about the quality of the sapi hack :) - Page-global 'g_name_printed' is now passed as a normal parameter called 'name_printed' to the augment_entry() function - Got rid of some confusing string manipulation in human_readable_diff() - added 'server' parameter to viewcvs.main() to avoid relying on the sapi.server global variable * cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp - Added 'server' parameter to viewcvs.main() calls * standalone.py: - Changed StandaloneServer.header() method to accept http status code - Added 'server' parameter to viewcvs.main() call * lib/query.py - added 'server' parameter to query.main() to avoid relying on the sapi.server global variable - got rid of global 'server' variable and page-global 'viewcvs_link' variable, instead those values are passed as function parameters * cgi/query.cgi, windows/query.py, windows/query.asp - Added 'server' parameter to query.main() calls * lib/debug.py - Changed PrintStackTrace(), PrintException(), and DumpChildren() not to rely on global sapi.server variable and to use new server.write() method * lib/popen.py - changed server.getFile() calls to server.file() git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-13 02:08:09 +03:00
server.write(server.escape(k.debugOut.getvalue()))
server.write("</pre></td>\n</tr>\n")
This patch (mostly by Marten Thavenius) upgrades ViewCVS to XHTML 1.0 Strict. Changes have been made in the EZT templates, the CSS files, HTML code embedded in the Python files as well as in the help files. The original code structure and design is the very same. No other improvements have been made to the browser code and it still uses the old layout tables to create the page grid. Apart from the XHTML/CSS code changes, the patch adds an argument (-x x) for CVSGraph in viewcvs.py in the view_cvsgraph function to tell CVSGraph to generate XHTML code. For Mozilla/Firefox to recognize the id attribute in the image map generated, the content-type must be set to application/xhtml+xml (see https://bugzilla.mozilla.org/show_bug.cgi?id=109445). This patch does however not change the content-type, but uses an ugly hack to make the CVSGraph output work in Mozilla with the current text/html content-type: a name attribute is merged into the id attribute in the map_name defined in the cvsgraph.conf.dist file. The XHTML code does not contain the standard XML declaration, just the XHTML 1.0 Strict Doctype. This is to keep ViewCVS as encoding agnostic as before and let the browser decide which encoding to use. An XML file without the encoding declared must be interpreted as UTF-8 (or UTF-16 if the byte order mark is included). * viewcvs/cvsgraph.conf.dist Add name="" hack to the 'map_name' variable so Mozilla/Firefox will work. * viewcvs/lib/ezt.py XHTML-ize sample output. * viewcvs/lib/viewcvs.py XHTML-ize hard-coded output. (view_cvsgraph): Pass "-x x" to cvsgraph to force XHTML production. * viewcvs/lib/blame.py * viewcvs/lib/debug.py * viewcvs/lib/py2html.py * viewcvs/lib/query.py * viewcvs/lib/vclib/bincvs/__init__.py * viewcvs/templates/annotate.ezt * viewcvs/templates/diff.ezt * viewcvs/templates/dir_alternate.ezt * viewcvs/templates/directory.ezt * viewcvs/templates/error.ezt * viewcvs/templates/graph.ezt * viewcvs/templates/log.ezt * viewcvs/templates/log_table.ezt * viewcvs/templates/markup.ezt * viewcvs/templates/query.ezt * viewcvs/templates/query_form.ezt * viewcvs/templates/query_results.ezt * viewcvs/templates/revision.ezt * viewcvs/templates/roots.ezt * viewcvs/templates/docroot/help_dirview.html * viewcvs/templates/docroot/help_log.html * viewcvs/templates/docroot/help_logtable.html * viewcvs/templates/docroot/help_query.html * viewcvs/templates/docroot/help_rootview.html * viewcvs/templates/docroot/styles.css * viewcvs/templates/include/branch.ezt * viewcvs/templates/include/branch_form.ezt * viewcvs/templates/include/diff_form.ezt * viewcvs/templates/include/dir_footer.ezt * viewcvs/templates/include/dir_header.ezt * viewcvs/templates/include/file_header.ezt * viewcvs/templates/include/footer.ezt * viewcvs/templates/include/header.ezt * viewcvs/templates/include/paging.ezt * viewcvs/templates/include/sort.ezt * viewcvs/templates/include/view_tag.ezt XHTML-ize hard-coded output and templatized data. * viewcvs/CHANGES Note this change. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1109 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-28 21:06:16 +04:00
server.write("<tr>\n <td style=\"vertical-align:top\">Standard Error:</td> <td><pre>")
if k.debugErr:
* lib/sapi.py - Filled in ModPythonServer and AspServer header() methods to make use of the new http 'status' parameter. Also, changed CgiServer's header() method to ignore the status parameter under IIS to prevent the server from discarding the ViewCVS output and instead sending a static error page. - ModPythonFile and AspFile classes have been eliminated and replaced with a more generic File class. All server classes have new write() and flush() methods. - Common code from AspServer and ModPythonServer has been moved into a base class called ThreadedServer. AspProxy is renamed to ThreadedServerProxy. - All server classes now inherit from a new base class called Server which contains the small amount of code common to all of them. - added fix_iis_path_info() function, renamed IIS_FixURL() to fix_iis_url() - renamed getFile() methods to file() * lib/viewcvs.py - Eliminated global server variable. Changed some scattered server.escape() calls into cgi.escape() calls. Got around other uses of the variable by adding a server member to the Request class. - Deleted gstein's strongly worded comment about the quality of the sapi hack :) - Page-global 'g_name_printed' is now passed as a normal parameter called 'name_printed' to the augment_entry() function - Got rid of some confusing string manipulation in human_readable_diff() - added 'server' parameter to viewcvs.main() to avoid relying on the sapi.server global variable * cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp - Added 'server' parameter to viewcvs.main() calls * standalone.py: - Changed StandaloneServer.header() method to accept http status code - Added 'server' parameter to viewcvs.main() call * lib/query.py - added 'server' parameter to query.main() to avoid relying on the sapi.server global variable - got rid of global 'server' variable and page-global 'viewcvs_link' variable, instead those values are passed as function parameters * cgi/query.cgi, windows/query.py, windows/query.asp - Added 'server' parameter to query.main() calls * lib/debug.py - Changed PrintStackTrace(), PrintException(), and DumpChildren() not to rely on global sapi.server variable and to use new server.write() method * lib/popen.py - changed server.getFile() calls to server.file() git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-13 02:08:09 +03:00
server.write(server.escape(k.debugErr.getvalue()))
server.write("</pre></td>\n</tr>\n")
* lib/sapi.py - Filled in ModPythonServer and AspServer header() methods to make use of the new http 'status' parameter. Also, changed CgiServer's header() method to ignore the status parameter under IIS to prevent the server from discarding the ViewCVS output and instead sending a static error page. - ModPythonFile and AspFile classes have been eliminated and replaced with a more generic File class. All server classes have new write() and flush() methods. - Common code from AspServer and ModPythonServer has been moved into a base class called ThreadedServer. AspProxy is renamed to ThreadedServerProxy. - All server classes now inherit from a new base class called Server which contains the small amount of code common to all of them. - added fix_iis_path_info() function, renamed IIS_FixURL() to fix_iis_url() - renamed getFile() methods to file() * lib/viewcvs.py - Eliminated global server variable. Changed some scattered server.escape() calls into cgi.escape() calls. Got around other uses of the variable by adding a server member to the Request class. - Deleted gstein's strongly worded comment about the quality of the sapi hack :) - Page-global 'g_name_printed' is now passed as a normal parameter called 'name_printed' to the augment_entry() function - Got rid of some confusing string manipulation in human_readable_diff() - added 'server' parameter to viewcvs.main() to avoid relying on the sapi.server global variable * cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp - Added 'server' parameter to viewcvs.main() calls * standalone.py: - Changed StandaloneServer.header() method to accept http status code - Added 'server' parameter to viewcvs.main() call * lib/query.py - added 'server' parameter to query.main() to avoid relying on the sapi.server global variable - got rid of global 'server' variable and page-global 'viewcvs_link' variable, instead those values are passed as function parameters * cgi/query.cgi, windows/query.py, windows/query.asp - Added 'server' parameter to query.main() calls * lib/debug.py - Changed PrintStackTrace(), PrintException(), and DumpChildren() not to rely on global sapi.server variable and to use new server.write() method * lib/popen.py - changed server.getFile() calls to server.file() git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-13 02:08:09 +03:00
server.write("</table>\n")
server.flush()
lastOut = k.debugOut
This patch (mostly by Marten Thavenius) upgrades ViewCVS to XHTML 1.0 Strict. Changes have been made in the EZT templates, the CSS files, HTML code embedded in the Python files as well as in the help files. The original code structure and design is the very same. No other improvements have been made to the browser code and it still uses the old layout tables to create the page grid. Apart from the XHTML/CSS code changes, the patch adds an argument (-x x) for CVSGraph in viewcvs.py in the view_cvsgraph function to tell CVSGraph to generate XHTML code. For Mozilla/Firefox to recognize the id attribute in the image map generated, the content-type must be set to application/xhtml+xml (see https://bugzilla.mozilla.org/show_bug.cgi?id=109445). This patch does however not change the content-type, but uses an ugly hack to make the CVSGraph output work in Mozilla with the current text/html content-type: a name attribute is merged into the id attribute in the map_name defined in the cvsgraph.conf.dist file. The XHTML code does not contain the standard XML declaration, just the XHTML 1.0 Strict Doctype. This is to keep ViewCVS as encoding agnostic as before and let the browser decide which encoding to use. An XML file without the encoding declared must be interpreted as UTF-8 (or UTF-16 if the byte order mark is included). * viewcvs/cvsgraph.conf.dist Add name="" hack to the 'map_name' variable so Mozilla/Firefox will work. * viewcvs/lib/ezt.py XHTML-ize sample output. * viewcvs/lib/viewcvs.py XHTML-ize hard-coded output. (view_cvsgraph): Pass "-x x" to cvsgraph to force XHTML production. * viewcvs/lib/blame.py * viewcvs/lib/debug.py * viewcvs/lib/py2html.py * viewcvs/lib/query.py * viewcvs/lib/vclib/bincvs/__init__.py * viewcvs/templates/annotate.ezt * viewcvs/templates/diff.ezt * viewcvs/templates/dir_alternate.ezt * viewcvs/templates/directory.ezt * viewcvs/templates/error.ezt * viewcvs/templates/graph.ezt * viewcvs/templates/log.ezt * viewcvs/templates/log_table.ezt * viewcvs/templates/markup.ezt * viewcvs/templates/query.ezt * viewcvs/templates/query_form.ezt * viewcvs/templates/query_results.ezt * viewcvs/templates/revision.ezt * viewcvs/templates/roots.ezt * viewcvs/templates/docroot/help_dirview.html * viewcvs/templates/docroot/help_log.html * viewcvs/templates/docroot/help_logtable.html * viewcvs/templates/docroot/help_query.html * viewcvs/templates/docroot/help_rootview.html * viewcvs/templates/docroot/styles.css * viewcvs/templates/include/branch.ezt * viewcvs/templates/include/branch_form.ezt * viewcvs/templates/include/diff_form.ezt * viewcvs/templates/include/dir_footer.ezt * viewcvs/templates/include/dir_header.ezt * viewcvs/templates/include/file_header.ezt * viewcvs/templates/include/footer.ezt * viewcvs/templates/include/header.ezt * viewcvs/templates/include/paging.ezt * viewcvs/templates/include/sort.ezt * viewcvs/templates/include/view_tag.ezt XHTML-ize hard-coded output and templatized data. * viewcvs/CHANGES Note this change. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1109 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-28 21:06:16 +04:00
server.write("<table>\n")
server.write("<tr><td colspan=\"2\">Environment Variables</td></tr>")
for k, v in os.environ.items():
This patch (mostly by Marten Thavenius) upgrades ViewCVS to XHTML 1.0 Strict. Changes have been made in the EZT templates, the CSS files, HTML code embedded in the Python files as well as in the help files. The original code structure and design is the very same. No other improvements have been made to the browser code and it still uses the old layout tables to create the page grid. Apart from the XHTML/CSS code changes, the patch adds an argument (-x x) for CVSGraph in viewcvs.py in the view_cvsgraph function to tell CVSGraph to generate XHTML code. For Mozilla/Firefox to recognize the id attribute in the image map generated, the content-type must be set to application/xhtml+xml (see https://bugzilla.mozilla.org/show_bug.cgi?id=109445). This patch does however not change the content-type, but uses an ugly hack to make the CVSGraph output work in Mozilla with the current text/html content-type: a name attribute is merged into the id attribute in the map_name defined in the cvsgraph.conf.dist file. The XHTML code does not contain the standard XML declaration, just the XHTML 1.0 Strict Doctype. This is to keep ViewCVS as encoding agnostic as before and let the browser decide which encoding to use. An XML file without the encoding declared must be interpreted as UTF-8 (or UTF-16 if the byte order mark is included). * viewcvs/cvsgraph.conf.dist Add name="" hack to the 'map_name' variable so Mozilla/Firefox will work. * viewcvs/lib/ezt.py XHTML-ize sample output. * viewcvs/lib/viewcvs.py XHTML-ize hard-coded output. (view_cvsgraph): Pass "-x x" to cvsgraph to force XHTML production. * viewcvs/lib/blame.py * viewcvs/lib/debug.py * viewcvs/lib/py2html.py * viewcvs/lib/query.py * viewcvs/lib/vclib/bincvs/__init__.py * viewcvs/templates/annotate.ezt * viewcvs/templates/diff.ezt * viewcvs/templates/dir_alternate.ezt * viewcvs/templates/directory.ezt * viewcvs/templates/error.ezt * viewcvs/templates/graph.ezt * viewcvs/templates/log.ezt * viewcvs/templates/log_table.ezt * viewcvs/templates/markup.ezt * viewcvs/templates/query.ezt * viewcvs/templates/query_form.ezt * viewcvs/templates/query_results.ezt * viewcvs/templates/revision.ezt * viewcvs/templates/roots.ezt * viewcvs/templates/docroot/help_dirview.html * viewcvs/templates/docroot/help_log.html * viewcvs/templates/docroot/help_logtable.html * viewcvs/templates/docroot/help_query.html * viewcvs/templates/docroot/help_rootview.html * viewcvs/templates/docroot/styles.css * viewcvs/templates/include/branch.ezt * viewcvs/templates/include/branch_form.ezt * viewcvs/templates/include/diff_form.ezt * viewcvs/templates/include/dir_footer.ezt * viewcvs/templates/include/dir_header.ezt * viewcvs/templates/include/file_header.ezt * viewcvs/templates/include/footer.ezt * viewcvs/templates/include/header.ezt * viewcvs/templates/include/paging.ezt * viewcvs/templates/include/sort.ezt * viewcvs/templates/include/view_tag.ezt XHTML-ize hard-coded output and templatized data. * viewcvs/CHANGES Note this change. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1109 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-28 21:06:16 +04:00
server.write("<tr>\n <td style=\"vertical-align:top\"><pre>")
* lib/sapi.py - Filled in ModPythonServer and AspServer header() methods to make use of the new http 'status' parameter. Also, changed CgiServer's header() method to ignore the status parameter under IIS to prevent the server from discarding the ViewCVS output and instead sending a static error page. - ModPythonFile and AspFile classes have been eliminated and replaced with a more generic File class. All server classes have new write() and flush() methods. - Common code from AspServer and ModPythonServer has been moved into a base class called ThreadedServer. AspProxy is renamed to ThreadedServerProxy. - All server classes now inherit from a new base class called Server which contains the small amount of code common to all of them. - added fix_iis_path_info() function, renamed IIS_FixURL() to fix_iis_url() - renamed getFile() methods to file() * lib/viewcvs.py - Eliminated global server variable. Changed some scattered server.escape() calls into cgi.escape() calls. Got around other uses of the variable by adding a server member to the Request class. - Deleted gstein's strongly worded comment about the quality of the sapi hack :) - Page-global 'g_name_printed' is now passed as a normal parameter called 'name_printed' to the augment_entry() function - Got rid of some confusing string manipulation in human_readable_diff() - added 'server' parameter to viewcvs.main() to avoid relying on the sapi.server global variable * cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp - Added 'server' parameter to viewcvs.main() calls * standalone.py: - Changed StandaloneServer.header() method to accept http status code - Added 'server' parameter to viewcvs.main() call * lib/query.py - added 'server' parameter to query.main() to avoid relying on the sapi.server global variable - got rid of global 'server' variable and page-global 'viewcvs_link' variable, instead those values are passed as function parameters * cgi/query.cgi, windows/query.py, windows/query.asp - Added 'server' parameter to query.main() calls * lib/debug.py - Changed PrintStackTrace(), PrintException(), and DumpChildren() not to rely on global sapi.server variable and to use new server.write() method * lib/popen.py - changed server.getFile() calls to server.file() git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-13 02:08:09 +03:00
server.write(server.escape(k))
This patch (mostly by Marten Thavenius) upgrades ViewCVS to XHTML 1.0 Strict. Changes have been made in the EZT templates, the CSS files, HTML code embedded in the Python files as well as in the help files. The original code structure and design is the very same. No other improvements have been made to the browser code and it still uses the old layout tables to create the page grid. Apart from the XHTML/CSS code changes, the patch adds an argument (-x x) for CVSGraph in viewcvs.py in the view_cvsgraph function to tell CVSGraph to generate XHTML code. For Mozilla/Firefox to recognize the id attribute in the image map generated, the content-type must be set to application/xhtml+xml (see https://bugzilla.mozilla.org/show_bug.cgi?id=109445). This patch does however not change the content-type, but uses an ugly hack to make the CVSGraph output work in Mozilla with the current text/html content-type: a name attribute is merged into the id attribute in the map_name defined in the cvsgraph.conf.dist file. The XHTML code does not contain the standard XML declaration, just the XHTML 1.0 Strict Doctype. This is to keep ViewCVS as encoding agnostic as before and let the browser decide which encoding to use. An XML file without the encoding declared must be interpreted as UTF-8 (or UTF-16 if the byte order mark is included). * viewcvs/cvsgraph.conf.dist Add name="" hack to the 'map_name' variable so Mozilla/Firefox will work. * viewcvs/lib/ezt.py XHTML-ize sample output. * viewcvs/lib/viewcvs.py XHTML-ize hard-coded output. (view_cvsgraph): Pass "-x x" to cvsgraph to force XHTML production. * viewcvs/lib/blame.py * viewcvs/lib/debug.py * viewcvs/lib/py2html.py * viewcvs/lib/query.py * viewcvs/lib/vclib/bincvs/__init__.py * viewcvs/templates/annotate.ezt * viewcvs/templates/diff.ezt * viewcvs/templates/dir_alternate.ezt * viewcvs/templates/directory.ezt * viewcvs/templates/error.ezt * viewcvs/templates/graph.ezt * viewcvs/templates/log.ezt * viewcvs/templates/log_table.ezt * viewcvs/templates/markup.ezt * viewcvs/templates/query.ezt * viewcvs/templates/query_form.ezt * viewcvs/templates/query_results.ezt * viewcvs/templates/revision.ezt * viewcvs/templates/roots.ezt * viewcvs/templates/docroot/help_dirview.html * viewcvs/templates/docroot/help_log.html * viewcvs/templates/docroot/help_logtable.html * viewcvs/templates/docroot/help_query.html * viewcvs/templates/docroot/help_rootview.html * viewcvs/templates/docroot/styles.css * viewcvs/templates/include/branch.ezt * viewcvs/templates/include/branch_form.ezt * viewcvs/templates/include/diff_form.ezt * viewcvs/templates/include/dir_footer.ezt * viewcvs/templates/include/dir_header.ezt * viewcvs/templates/include/file_header.ezt * viewcvs/templates/include/footer.ezt * viewcvs/templates/include/header.ezt * viewcvs/templates/include/paging.ezt * viewcvs/templates/include/sort.ezt * viewcvs/templates/include/view_tag.ezt XHTML-ize hard-coded output and templatized data. * viewcvs/CHANGES Note this change. git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@1109 8cb11bc2-c004-0410-86c3-e597b4017df7
2005-09-28 21:06:16 +04:00
server.write("</pre></td>\n <td style=\"vertical-align:top\"><pre>")
* lib/sapi.py - Filled in ModPythonServer and AspServer header() methods to make use of the new http 'status' parameter. Also, changed CgiServer's header() method to ignore the status parameter under IIS to prevent the server from discarding the ViewCVS output and instead sending a static error page. - ModPythonFile and AspFile classes have been eliminated and replaced with a more generic File class. All server classes have new write() and flush() methods. - Common code from AspServer and ModPythonServer has been moved into a base class called ThreadedServer. AspProxy is renamed to ThreadedServerProxy. - All server classes now inherit from a new base class called Server which contains the small amount of code common to all of them. - added fix_iis_path_info() function, renamed IIS_FixURL() to fix_iis_url() - renamed getFile() methods to file() * lib/viewcvs.py - Eliminated global server variable. Changed some scattered server.escape() calls into cgi.escape() calls. Got around other uses of the variable by adding a server member to the Request class. - Deleted gstein's strongly worded comment about the quality of the sapi hack :) - Page-global 'g_name_printed' is now passed as a normal parameter called 'name_printed' to the augment_entry() function - Got rid of some confusing string manipulation in human_readable_diff() - added 'server' parameter to viewcvs.main() to avoid relying on the sapi.server global variable * cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp - Added 'server' parameter to viewcvs.main() calls * standalone.py: - Changed StandaloneServer.header() method to accept http status code - Added 'server' parameter to viewcvs.main() call * lib/query.py - added 'server' parameter to query.main() to avoid relying on the sapi.server global variable - got rid of global 'server' variable and page-global 'viewcvs_link' variable, instead those values are passed as function parameters * cgi/query.cgi, windows/query.py, windows/query.asp - Added 'server' parameter to query.main() calls * lib/debug.py - Changed PrintStackTrace(), PrintException(), and DumpChildren() not to rely on global sapi.server variable and to use new server.write() method * lib/popen.py - changed server.getFile() calls to server.file() git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-13 02:08:09 +03:00
server.write(server.escape(v))
server.write("</pre></td>\n</tr>")
server.write("</table>")
else:
* lib/sapi.py - Filled in ModPythonServer and AspServer header() methods to make use of the new http 'status' parameter. Also, changed CgiServer's header() method to ignore the status parameter under IIS to prevent the server from discarding the ViewCVS output and instead sending a static error page. - ModPythonFile and AspFile classes have been eliminated and replaced with a more generic File class. All server classes have new write() and flush() methods. - Common code from AspServer and ModPythonServer has been moved into a base class called ThreadedServer. AspProxy is renamed to ThreadedServerProxy. - All server classes now inherit from a new base class called Server which contains the small amount of code common to all of them. - added fix_iis_path_info() function, renamed IIS_FixURL() to fix_iis_url() - renamed getFile() methods to file() * lib/viewcvs.py - Eliminated global server variable. Changed some scattered server.escape() calls into cgi.escape() calls. Got around other uses of the variable by adding a server member to the Request class. - Deleted gstein's strongly worded comment about the quality of the sapi hack :) - Page-global 'g_name_printed' is now passed as a normal parameter called 'name_printed' to the augment_entry() function - Got rid of some confusing string manipulation in human_readable_diff() - added 'server' parameter to viewcvs.main() to avoid relying on the sapi.server global variable * cgi/viewcvs.cgi, windows/viewcvs.py, windows/viewcvs.asp - Added 'server' parameter to viewcvs.main() calls * standalone.py: - Changed StandaloneServer.header() method to accept http status code - Added 'server' parameter to viewcvs.main() call * lib/query.py - added 'server' parameter to query.main() to avoid relying on the sapi.server global variable - got rid of global 'server' variable and page-global 'viewcvs_link' variable, instead those values are passed as function parameters * cgi/query.cgi, windows/query.py, windows/query.asp - Added 'server' parameter to query.main() calls * lib/debug.py - Changed PrintStackTrace(), PrintException(), and DumpChildren() not to rely on global sapi.server variable and to use new server.write() method * lib/popen.py - changed server.getFile() calls to server.file() git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@642 8cb11bc2-c004-0410-86c3-e597b4017df7
2003-03-13 02:08:09 +03:00
def DumpChildren(server):
pass