fix namespace collision with 'config'

workspace
Brendan Howell 5 years ago
parent 24acd79fed
commit fb5aa9f2be

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

Loading…
Cancel
Save