From 1de8dd23a2dca8e12a3ec5392c177250763c0d94 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 29 Mar 2014 17:55:51 +0100 Subject: [PATCH] Re-add disabled code. --- webapp/handlers_base.py | 9 ++++++++- webapp/handlers_stasy.py | 10 +++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/webapp/handlers_base.py b/webapp/handlers_base.py index 8b0b95d2..618f08f2 100644 --- a/webapp/handlers_base.py +++ b/webapp/handlers_base.py @@ -70,7 +70,14 @@ class BaseHandler(tornado.web.RequestHandler): def static_url(self, path, static=True): ret = tornado.web.RequestHandler.static_url(self, path) - + if self.settings.get("debug", False): + return ret + + elif self.request.host == "admin.ipfire.org": + return ret + + elif static: + return "http://static.ipfire.org%s" % ret return ret diff --git a/webapp/handlers_stasy.py b/webapp/handlers_stasy.py index bd0f4e10..d384bc57 100644 --- a/webapp/handlers_stasy.py +++ b/webapp/handlers_stasy.py @@ -3,7 +3,7 @@ from __future__ import division import datetime -#import hwdata +import hwdata import ipaddr import logging import re @@ -321,8 +321,8 @@ class StasyStatsVendorDetail(StasyBaseHandler): def get(self, bus, vendor_id): # XXX some way ugly bus2cls = { -# "pci" : hwdata.PCI, -# "usb" : hwdata.USB + "pci" : hwdata.PCI, + "usb" : hwdata.USB } cls = bus2cls[bus.lower()] vendor_name = cls().get_vendor(vendor_id) @@ -337,8 +337,8 @@ class StasyStatsVendorDetail(StasyBaseHandler): class StasyStatsModelDetail(StasyBaseHandler): def get(self, bus, vendor_id, model_id): bus2cls = { -# "pci" : hwdata.PCI, -# "usb" : hwdata.USB + "pci" : hwdata.PCI, + "usb" : hwdata.USB } cls = bus2cls[bus.lower()] -- 2.47.3