All pastes #385063 Raw Edit

logs2html patch

public text v1 · immutable
·published 2007-03-07 15:51 UTC
rendered paste body
***************
*** 200,205 ****
              or prev and prev.newfile() or next and next.newfile()):
              logfile.generate(options.style, options.prefix, prev, next,
                               options.searchbox)
      outfilename = os.path.join(dir, 'index.html')
      try:
          outfile = open(outfilename, 'w')
--- 200,213 ----
              or prev and prev.newfile() or next and next.newfile()):
              logfile.generate(options.style, options.prefix, prev, next,
                               options.searchbox)
+     latestLogName = 'latest.log.html'
+     if len(logfiles) > 0:
+         try:
+             os.unlink(os.path.join(dir, latestLogName))
+         except OSError, e:
+             pass
+         os.symlink(logfiles[0].link, os.path.join(dir, latestLogName))
+         logfiles[0].link = latestLogName
      outfilename = os.path.join(dir, 'index.html')
      try:
          outfile = open(outfilename, 'w')