httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@locus.apache.org
Subject cvs commit: apache-site/websrc viewcvs.cgi
Date Mon, 05 Jun 2000 13:18:25 GMT
ask         00/06/05 06:18:25

  Modified:    websrc   viewcvs.cgi
  Log:
  upgrade from 0.5 to 0.6-dev ?!
  
  (I didn't do this, but uncommited changes that are in production are on my
  list of bad things that should be avoided)
  
  Revision  Changes    Path
  1.3       +24 -14    apache-site/websrc/viewcvs.cgi
  
  Index: viewcvs.cgi
  ===================================================================
  RCS file: /home/cvs/apache-site/websrc/viewcvs.cgi,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- viewcvs.cgi	2000/05/12 12:01:49	1.2
  +++ viewcvs.cgi	2000/06/05 13:18:24	1.3
  @@ -21,12 +21,12 @@
   # derived from software by Bill Fenner, with additional modifications by
   # Henrik Nordstrom and Ken Coar). The cvsweb distribution can be found
   # on Zeller's site:
  -#   http://linux.fh-heilbronn.de/~zeller/cgi/cvsweb.cgi
  +#   http://stud.fh-heilbronn.de/~zeller/cgi/cvsweb.cgi/
   #
   # -----------------------------------------------------------------------
   #
   
  -__version__ = '0.5'
  +__version__ = '0.6-dev'
   
   #########################################################################
   #
  @@ -69,7 +69,7 @@
   
   #########################################################################
   
  -checkout_magic_path = '~checkout~/'
  +checkout_magic_path = '~checkout~'
   viewcvs_mime_type = 'text/vnd.viewcvs-markup'
   
   # put here the variables we need in order to hold our state - they will be
  @@ -113,15 +113,17 @@
       # clean it up. this removes duplicate '/' characters and any that may
       # exist at the front or end of the path.
       parts = filter(None, string.split(where, '/'))
  -    where = string.join(parts, '/')
   
       # does it have the magic checkout prefix?
  -    if where[:len(checkout_magic_path)] == checkout_magic_path:
  +    if parts and parts[0] == checkout_magic_path:
         self.has_checkout_magic = 1
  -      where = where[len(checkout_magic_path):]
  +      del parts[0]
       else:
         self.has_checkout_magic = 0
   
  +    # put it back together
  +    where = string.join(parts, '/')
  +
       script_name = os.environ['SCRIPT_NAME']	### clean this up?
       if where:
         url = script_name + '/' + urllib.quote(where)
  @@ -334,7 +336,7 @@
   
   def download_url(request, url, revision, mime_type):
     if cfg.options.checkout_magic and mime_type != viewcvs_mime_type:
  -    url = '%s/%s%s/%s' % \
  +    url = '%s/%s/%s/%s' % \
             (request.script_name, checkout_magic_path,
              os.path.dirname(request.where), url)
   
  @@ -484,15 +486,20 @@
   
   def markup_stream_enscript(lang, fp):
     sys.stdout.flush()
  -  cmd = "%senscript --color -W html -E%s -o - - 2> /dev/null " \
  -        "| sed -n '/^<PRE>$/,/<\\/PRE>$/p'" % \
  -        (cfg.options.enscript_path, lang,)
  -  enscript = os.popen(cmd, "w")
  +  enscript = popen.pipe_cmds([(cfg.options.enscript_path + 'enscript',
  +                               '--color', '-W', 'html', '-E' + lang, '-o',
  +                               '-', '-'),
  +                              ('sed', '-n', '/^<PRE>$/,/<\\/PRE>$/p')])
  +
     while 1:
       chunk = fp.read(CHUNK_SIZE)
       if not chunk:
  +      if fp.eof() is None:
  +        time.sleep(1)
  +        continue
         break
       enscript.write(chunk)
  +
     enscript.close()
   
   markup_streamers = {
  @@ -612,6 +619,9 @@
           markup_stream_enscript(lang, fp)
         else:
           markup_stream_default(fp)
  +  status = fp.close()
  +  if status:
  +    raise error, 'pipe error status: %d' % status
     html_footer()
   
   def get_file_data(full_name):
  @@ -924,7 +934,7 @@
   def get_logs(full_name, files, view_tag):
   
     if len(files) == 0:
  -    return { }, { }
  +    return { }, [ ]
   
     fileinfo = { }
     alltags = {		# all the tags seen in the files of this dir
  @@ -1008,7 +1018,7 @@
     if not hideattic:
       try:
         attic_files = os.listdir(full_name + '/Attic')
  -    except OSError:
  +    except os.error:
         pass
       else:
         ### filter for just RCS files?
  @@ -1258,7 +1268,7 @@
     print '</table>'
   
     if num_files and not num_displayed:
  -    print '<p><b>NOTE:</b> There are %d files, but none match the current'
\
  +    print '<p><b>NOTE:</b> There are %d files, but none match the current
' \
             'tag (%s)' % (num_files, view_tag)
     if unreadable:
       print '<hr size=1 noshade><b>NOTE:</b> One or more files were ' \
  
  
  

Mime
View raw message