Browse Source

Minor fixes to uglify

main
Lakshmi Vyasarajan 13 years ago
parent
commit
fc0e3a412a
2 changed files with 13 additions and 10 deletions
  1. +6
    -10
      hyde/ext/plugins/uglify.py
  2. +7
    -0
      hyde/plugin.py

+ 6
- 10
hyde/ext/plugins/uglify.py View File

@@ -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



+ 7
- 0
hyde/plugin.py View File

@@ -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


Loading…
Cancel
Save