#39: Disable old Trac CSS files ------------------------+------------------------------------- Reporter: jdreimann | Owner: gjm Type: task | Status: accepted Priority: critical | Milestone: RC1 for initial release Component: ui design | Version: Resolution: | Keywords: ------------------------+-------------------------------------
Comment (by gjm): r1329142 should fix and for a bonus looks a bit more readable to me: {{{svn diff -r 1329141 bloodhound_theme/bhtheme/theme.py}}}: {{{ #!diff Index: bloodhound_theme/bhtheme/theme.py =================================================================== --- bloodhound_theme/bhtheme/theme.py (revision 1329114) +++ bloodhound_theme/bhtheme/theme.py (working copy) @@ -78,14 +78,14 @@ def post_process_request(self, req, template, data, content_type): """Post process request filter. - Removes all trac provided css if required""" + Removes all trac provided css if required""" if self.disable_all_trac_css: links = req.chrome.get('links',{}) - indices = [i for (i,ss) in enumerate(links.get('stylesheet',[])) - if ss.get('href').startswith(req.base_path + - '/chrome/common/css/')] - for i in indices: - del links['stylesheet'][i] + stylesheets = links.get('stylesheet',[]) + if stylesheets: + path = req.base_path + '/chrome/common/css/' + links['stylesheet'] = [ss for ss in stylesheets + if not ss.get('href').startswith(path)] return template, data, content_type class QuickCreateTicketDialog(Component): }}} -- Ticket URL: <https://issues.apache.org/bloodhound/ticket/39#comment:8> Apache Bloodhound <https://issues.apache.org/bloodhound/> The Apache Bloodhound (incubating) issue tracker