2
# This file is part of Tarmac.
4
# Tarmac is free software: you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License version 3 as
7
# the Free Software Foundation.
9
# Tarmac is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with Tarmac. If not, see <http://www.gnu.org/licenses/>.
17
# Copyright 2009 Elliot Murphy
18
"""Simple WSGI web application for showing the current Tarmac status."""
22
from tarmac.config import TarmacConfig
29
render = web.template.render('templates/')
32
"""The main page of the status site."""
35
config = TarmacConfig()
36
self.statusfile = config.get('Tarmac', 'log_file')
39
tail = subprocess.Popen(('tail', '-n40', self.statusfile),
40
stdout = subprocess.PIPE,
41
stderr = subprocess.PIPE)
42
output, errput = tail.communicate()
43
return render.index(output, errput)
47
if len(sys.argv) != 3:
48
print "Please specify a port number and a project name: ./webui.py 8080 default"
50
app = web.application(urls, globals())
54
if __name__ == "__main__":