From fc0e3a412ac87f4212e8d096b8f469478e7ab709 Mon Sep 17 00:00:00 2001 From: Lakshmi Vyasarajan Date: Tue, 8 Mar 2011 12:14:13 +0530 Subject: [PATCH] Minor fixes to uglify --- hyde/ext/plugins/uglify.py | 16 ++++++---------- hyde/plugin.py | 7 +++++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/hyde/ext/plugins/uglify.py b/hyde/ext/plugins/uglify.py index 5afc6fd..2e0ca6a 100644 --- a/hyde/ext/plugins/uglify.py +++ b/hyde/ext/plugins/uglify.py @@ -4,11 +4,7 @@ Uglify plugin """ from hyde.plugin import CLTransformer -from hyde.fs import File, Folder - -import subprocess -import traceback - +from hyde.fs import File class UglifyPlugin(CLTransformer): """ @@ -20,10 +16,10 @@ class UglifyPlugin(CLTransformer): @property def plugin_name(self): - """ - The name of the plugin. - """ - return "uglify" + """ + The name of the plugin. + """ + return "uglify" def text_resource_complete(self, resource, text): """ @@ -41,7 +37,7 @@ class UglifyPlugin(CLTransformer): if not resource.source_file.kind == 'js': return - if self.site.config.mode.startswith('dev'): + if mode.startswith('dev'): self.logger.debug("Skipping uglify in development mode.") return diff --git a/hyde/plugin.py b/hyde/plugin.py index 11dc980..8f09acd 100644 --- a/hyde/plugin.py +++ b/hyde/plugin.py @@ -262,6 +262,10 @@ class CLTransformer(Plugin): return app def process_args(self, supported): + """ + Given a list of supported arguments, consutructs an argument + list that could be passed on to the call_app function. + """ try: args = getattr(self.settings, 'args').to_dict() except AttributeError: @@ -348,6 +352,9 @@ class TextyPlugin(Plugin): return None def get_params(self, match, start=True): + """ + Default implementation for getting template args. + """ return match.groups(1)[0] if match.lastindex else '' @abc.abstractmethod