|
|
|
@ -10,8 +10,8 @@ class IhrApp(Bottle):
|
|
|
|
|
super(IhrApp, self).__init__()
|
|
|
|
|
self.name = "IHR App"
|
|
|
|
|
self.route("/", callback=self.index)
|
|
|
|
|
self.route("/config/<bureau>", callback=self.config)
|
|
|
|
|
self.route("/config/<bureau>", callback=self.config, method="POST")
|
|
|
|
|
self.route("/config/<bureau>", callback=self.bureau_config)
|
|
|
|
|
self.route("/config/<bureau>", callback=self.bureau_config, method="POST")
|
|
|
|
|
self.bureaus = []
|
|
|
|
|
|
|
|
|
|
def index(self):
|
|
|
|
@ -23,16 +23,16 @@ class IhrApp(Bottle):
|
|
|
|
|
<ul>
|
|
|
|
|
"""
|
|
|
|
|
for bureau in self.bureaus:
|
|
|
|
|
out += '<li><a href="/config/{0}">{0}</li>\n'.format(bureau)
|
|
|
|
|
out += '<li><a href="/config/{0}">{0}</a></li>\n'.format(bureau)
|
|
|
|
|
|
|
|
|
|
out += '<li><a href="/config/printers">Printers</li>\n'
|
|
|
|
|
out += '<li><a href="/config/mgmt">Management</li>\n'
|
|
|
|
|
out += '<li><a href="/config/printers">Printers</a></li>\n'
|
|
|
|
|
out += '<li><a href="/config/mgmt">Management</a></li>\n'
|
|
|
|
|
|
|
|
|
|
out += "</ul>"
|
|
|
|
|
|
|
|
|
|
return out
|
|
|
|
|
|
|
|
|
|
def config(self, bureau):
|
|
|
|
|
def bureau_config(self, bureau):
|
|
|
|
|
# parse the config and make it into a form
|
|
|
|
|
out = "<h3>config file for " + bureau + "</h3>\n"
|
|
|
|
|
basedir = os.path.expanduser("~/.screenless")
|
|
|
|
|