diff --git a/hyde/ext/plugins/stylus.py b/hyde/ext/plugins/stylus.py index 03d6b63..74e73cf 100644 --- a/hyde/ext/plugins/stylus.py +++ b/hyde/ext/plugins/stylus.py @@ -50,13 +50,21 @@ class StylusPlugin(CLTransformer): if len(afile.kind.strip()) == 0: afile = File(afile.path + '.styl') ref = self.site.content.resource_from_path(afile.path) + if not ref: - raise self.template.exception_class( + try: + include = self.settings.args.include + except AttributeError: + include = False + if not include: + raise self.template.exception_class( "Cannot import from path [%s]" % afile.path) - ref.is_processable = False - return "\n" + \ - self.template.get_include_statement(ref.relative_path) + \ - "\n" + else: + ref.is_processable = False + return "\n" + \ + self.template.get_include_statement(ref.relative_path) + \ + "\n" + return '@import "' + path + '"\n' text = import_finder.sub(import_to_include, text) return text @@ -101,7 +109,7 @@ class StylusPlugin(CLTransformer): args.append(str(source)) try: self.call_app(args) - except subprocess.CalledProcessError: + except subprocess.CalledProcessError, e: raise self.template.exception_class( "Cannot process %s. Error occurred when " "processing [%s]" % (stylus.name, resource.source_file)) diff --git a/hyde/tests/ext/test_combine.py b/hyde/tests/ext/test_combine.py index 2d3dbd8..20da2fd 100644 --- a/hyde/tests/ext/test_combine.py +++ b/hyde/tests/ext/test_combine.py @@ -65,11 +65,15 @@ combine: --- First line + """) - assert text == """First line + expected = """First line var a = 1 + 2; var b = a + 3; -var c = a + 5;""" +var c = a + 5; +""" + + assert text == expected return def test_combine_remove(self):