diff --git a/hyde/ext/plugins/less.py b/hyde/ext/plugins/less.py index a9cce06..575072a 100644 --- a/hyde/ext/plugins/less.py +++ b/hyde/ext/plugins/less.py @@ -18,6 +18,16 @@ class LessCSSPlugin(CLTransformer): def __init__(self, site): super(LessCSSPlugin, self).__init__(site) + def begin_site(self): + """ + Find all the less css files and set their relative deploy path. + """ + for resource in self.site.content.walk_resources(): + if resource.source_file.kind == 'less': + new_name = resource.source_file.name_without_extension + ".css" + target_folder = File(resource.relative_deploy_path).parent + resource.relative_deploy_path = target_folder.child(new_name) + def begin_text_resource(self, resource, text): """ Replace @import statements with {% include %} statements. @@ -70,8 +80,4 @@ class LessCSSPlugin(CLTransformer): raise self.template.exception_class( "Cannot process %s. Error occurred when " "processing [%s]" % (self.app.name, resource.source_file)) - out = target.read_all() - new_name = resource.source_file.name_without_extension + ".css" - target_folder = File(resource.relative_path).parent - resource.relative_deploy_path = target_folder.child(new_name) - return out + return target.read_all() diff --git a/hyde/ext/plugins/sorter.py b/hyde/ext/plugins/sorter.py index 05ad99b..c923283 100644 --- a/hyde/ext/plugins/sorter.py +++ b/hyde/ext/plugins/sorter.py @@ -96,8 +96,8 @@ class SorterPlugin(Plugin): return for name, settings in config.sorter.__dict__.items(): - self.logger.info("Adding sort methods for [%s]" % name) sort_method_name = 'walk_resources_sorted_by_%s' % name + self.logger.debug("Adding sort methods for [%s]" % name) add_method(Node, sort_method_name, sort_method, settings=settings) match_method_name = 'is_%s' % name add_method(Resource, match_method_name, filter_method, settings) diff --git a/hyde/ext/plugins/stylus.py b/hyde/ext/plugins/stylus.py index 98b8608..6977a15 100644 --- a/hyde/ext/plugins/stylus.py +++ b/hyde/ext/plugins/stylus.py @@ -18,6 +18,16 @@ class StylusPlugin(CLTransformer): def __init__(self, site): super(StylusPlugin, self).__init__(site) + def begin_site(self): + """ + Find all the styl files and set their relative deploy path. + """ + for resource in self.site.content.walk_resources(): + if resource.source_file.kind == 'styl': + new_name = resource.source_file.name_without_extension + ".css" + target_folder = File(resource.relative_deploy_path).parent + resource.relative_deploy_path = target_folder.child(new_name) + def begin_text_resource(self, resource, text): """ Replace @import statements with {% include %} statements. @@ -95,8 +105,4 @@ class StylusPlugin(CLTransformer): raise self.template.exception_class( "Cannot process %s. Error occurred when " "processing [%s]" % (stylus.name, resource.source_file)) - out = target.read_all() - new_name = resource.source_file.name_without_extension + ".css" - target_folder = File(resource.relative_path).parent - resource.relative_deploy_path = target_folder.child(new_name) - return out + return target.read_all() diff --git a/hyde/generator.py b/hyde/generator.py index 5b2acfc..be2ef7e 100644 --- a/hyde/generator.py +++ b/hyde/generator.py @@ -95,7 +95,7 @@ class Generator(object): """ Start Generation. Perform setup tasks and inform plugins. """ - logger.info("Begin Generation") + logger.debug("Begin Generation") self.events.begin_generation() def load_site_if_needed(self): @@ -112,7 +112,7 @@ class Generator(object): """ Generation complete. Inform plugins and cleanup. """ - logger.info("Generation Complete") + logger.debug("Generation Complete") self.events.generation_complete() def get_dependencies(self, resource): diff --git a/hyde/server.py b/hyde/server.py index 6a07793..236c2bb 100644 --- a/hyde/server.py +++ b/hyde/server.py @@ -34,7 +34,7 @@ class HydeRequestHandler(SimpleHTTPRequestHandler): and serve. """ self.server.request_time = datetime.now() - logger.info("Processing request: [%s]" % self.path) + logger.debug("Processing request: [%s]" % self.path) result = urlparse.urlparse(self.path) query = urlparse.parse_qs(result.query) if 'refresh' in query or result.query=='refresh': @@ -73,6 +73,7 @@ class HydeRequestHandler(SimpleHTTPRequestHandler): if not res: logger.error("Cannot load file: [%s]" % path) + print site.content.resource_deploy_map return site.config.deploy_root_path.child(path) else: @@ -188,7 +189,7 @@ class HydeWebServer(HTTPServer): return self.regenerate() try: - logger.info('Generating node [%s]' % node) + logger.debug('Serving node [%s]' % node) self.generator.generate_node(node, incremental=True) except Exception, exception: logger.error( @@ -206,9 +207,9 @@ class HydeWebServer(HTTPServer): if not dest.exists: return self.generate_node(resource.node) try: - logger.info('Generating resource [%s]' % resource) + logger.debug('Serving resource [%s]' % resource) self.generator.generate_resource(resource, incremental=True) except Exception, exception: logger.error( - 'Error [%s] occured when generating the resource [%s]' + 'Error [%s] occured when serving the resource [%s]' % (repr(exception), resource))