From 19eeae5eca89820dcc416025f40dc5b2553119fc Mon Sep 17 00:00:00 2001 From: Grygoriy Fuchedzhy Date: Tue, 7 Jun 2011 17:57:03 +0300 Subject: [PATCH] added ability to hyde.server to serve urls stripped with urlcleaner plugin --- hyde/server.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hyde/server.py b/hyde/server.py index 5ab4ce1..eaf5893 100644 --- a/hyde/server.py +++ b/hyde/server.py @@ -68,6 +68,11 @@ class HydeRequestHandler(SimpleHTTPRequestHandler): if isinstance(deployed, Folder): node = site.content.node_from_relative_path(path) res = node.get_resource('index.html') + elif hasattr(site.config, 'urlcleaner') and hasattr(site.config.urlcleaner, 'strip_extensions'): + for ext in site.config.urlcleaner.strip_extensions: + res = site.content.resource_from_relative_deploy_path(path + '.' + ext) + if res: + break else: res = site.content.resource_from_relative_deploy_path(path)