Пример #1
0
def run(*args):
    stderr = sys.stderr
    try:
        sys.stderr = sys.stdout
        main(['logs2html'] + list(args))
    except SystemExit as e:
        if e.args[0] != 0:
            print("SystemExit(%s)" % repr(e.args[0]))
    finally:
        sys.stderr = stderr
Пример #2
0
def run(*args):
    stderr = sys.stderr
    try:
        sys.stderr = sys.stdout
        main(['logs2html'] + list(args))
    except SystemExit as e:
        if e.args[0] != 0:
            print("SystemExit(%s)" % repr(e.args[0]))
    finally:
        sys.stderr = stderr
Пример #3
0
 def test_main(self):
     self.create('somechannel-20130316.log')
     self.create('somechannel-20130316.log.html')
     self.create('somechannel-20130317.log')
     self.create('somechannel-20130318.log')
     main(['logs2html', self.tmpdir])
     self.assertTrue(os.path.exists(self.filename('index.html')))
     if hasattr(os, 'symlink'):
         self.assertTrue(os.path.exists(self.filename('latest.log.html')))
     self.assertTrue(os.path.exists(self.filename('irclog.css')))
     self.assertTrue(
         os.path.exists(self.filename('somechannel-20130316.log.html')))
     self.assertTrue(
         os.path.exists(self.filename('somechannel-20130317.log.html')))
     self.assertTrue(
         os.path.exists(self.filename('somechannel-20130318.log.html')))
Пример #4
0
 def test_main(self):
     self.create('somechannel-20130316.log')
     self.create('somechannel-20130316.log.html')
     self.create('somechannel-20130317.log')
     self.create('somechannel-20130318.log')
     main(['logs2html', self.tmpdir])
     self.assertTrue(os.path.exists(self.filename('index.html')))
     if hasattr(os, 'symlink'):
         self.assertTrue(os.path.exists(self.filename('latest.log.html')))
     self.assertTrue(os.path.exists(self.filename('irclog.css')))
     self.assertTrue(os.path.exists(
         self.filename('somechannel-20130316.log.html')))
     self.assertTrue(os.path.exists(
         self.filename('somechannel-20130317.log.html')))
     self.assertTrue(os.path.exists(
         self.filename('somechannel-20130318.log.html')))