@@ -218,7 +218,6 @@ class StylusPlugin(CLTransformer): | |||||
return | return | ||||
stylus = self.app | stylus = self.app | ||||
source = File.make_temp(text.strip()) | source = File.make_temp(text.strip()) | ||||
target = source | |||||
supported = [("compress", "c"), ("include", "I")] | supported = [("compress", "c"), ("include", "I")] | ||||
args = [unicode(stylus)] | args = [unicode(stylus)] | ||||
@@ -231,6 +230,7 @@ class StylusPlugin(CLTransformer): | |||||
"Cannot process %s. Error occurred when " | "Cannot process %s. Error occurred when " | ||||
"processing [%s]" % (stylus.name, resource.source_file), | "processing [%s]" % (stylus.name, resource.source_file), | ||||
sys.exc_info()) | sys.exc_info()) | ||||
target = File(source.path + '.css') | |||||
return target.read_all() | return target.read_all() | ||||
@@ -307,7 +307,7 @@ class Generator(object): | |||||
for node in node.walk(): | for node in node.walk(): | ||||
logger.debug("Generating Node [%s]", node) | logger.debug("Generating Node [%s]", node) | ||||
self.events.begin_node(node) | self.events.begin_node(node) | ||||
for resource in node.resources: | |||||
for resource in sorted(node.resources): | |||||
self.__generate_resource__(resource, incremental) | self.__generate_resource__(resource, incremental) | ||||
self.events.node_complete(node) | self.events.node_complete(node) | ||||
@@ -45,6 +45,12 @@ class Processable(object): | |||||
def __repr__(self): | def __repr__(self): | ||||
return self.path | return self.path | ||||
def __lt__(self, other): | |||||
return self.source.path < other.source.path | |||||
def __gt__(self, other): | |||||
return self.source.path > other.source.path | |||||
@property | @property | ||||
def path(self): | def path(self): | ||||
""" | """ | ||||
@@ -188,7 +194,7 @@ class Node(Processable): | |||||
yielding the child nodes depth-first. | yielding the child nodes depth-first. | ||||
""" | """ | ||||
yield self | yield self | ||||
for child in self.child_nodes: | |||||
for child in sorted([node for node in self.child_nodes]): | |||||
for node in child.walk(): | for node in child.walk(): | ||||
yield node | yield node | ||||
@@ -207,7 +213,7 @@ class Node(Processable): | |||||
Walks the resources in this hierarchy. | Walks the resources in this hierarchy. | ||||
""" | """ | ||||
for node in self.walk(): | for node in self.walk(): | ||||
for resource in node.resources: | |||||
for resource in sorted([resource for resource in node.resources]): | |||||
yield resource | yield resource | ||||
@property | @property | ||||
@@ -1,16 +1,15 @@ | |||||
* { | |||||
border: 0; | |||||
padding: 0; | |||||
margin: 0; | |||||
} | |||||
@import "inc/reset.css"; | |||||
#header { | #header { | ||||
color: #333333; | |||||
color: #333; | |||||
border-left: 1px; | border-left: 1px; | ||||
border-right: 2px; | border-right: 2px; | ||||
} | } | ||||
#footer { | #footer { | ||||
color: #333333; | |||||
color: #333; | |||||
} | } | ||||
#content { | #content { | ||||
-webkit-border-radius: 10px; | -webkit-border-radius: 10px; | ||||
-moz-border-radius: 10px; | -moz-border-radius: 10px; | ||||
@@ -1,4 +1,4 @@ | |||||
@option compress: no; | |||||
@option style: expanded; | |||||
@import "inc/mixin"; | @import "inc/mixin"; | ||||
@import "inc/vars"; | @import "inc/vars"; | ||||
@@ -1,4 +1 @@ | |||||
*{border:0;padding:0;margin:0} | |||||
#header{color:#333;border-left:1px;border-right:2px} | |||||
#footer{color:#333} | |||||
#content{-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px} | |||||
*{border:0;padding:0;margin:0}#header{color:#333;border-left:1px;border-right:2px}#footer{color:#333}#content{-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px} |
@@ -29,7 +29,7 @@ class TestStylus(object): | |||||
def test_can_execute_stylus(self): | def test_can_execute_stylus(self): | ||||
s = Site(TEST_SITE) | s = Site(TEST_SITE) | ||||
s.config.plugins = ['hyde.ext.plugins.css.StylusPlugin'] | s.config.plugins = ['hyde.ext.plugins.css.StylusPlugin'] | ||||
paths = ['/usr/local/share/npm/bin/stylus'] | |||||
paths = ['/usr/local/bin/stylus', '/usr/local/share/npm/bin/stylus'] | |||||
for path in paths: | for path in paths: | ||||
if File(path).exists: | if File(path).exists: | ||||
s.config.stylus = Expando(dict(app=path)) | s.config.stylus = Expando(dict(app=path)) | ||||
@@ -47,7 +47,7 @@ class TestStylus(object): | |||||
s = Site(TEST_SITE) | s = Site(TEST_SITE) | ||||
s.config.mode = "production" | s.config.mode = "production" | ||||
s.config.plugins = ['hyde.ext.plugins.css.StylusPlugin'] | s.config.plugins = ['hyde.ext.plugins.css.StylusPlugin'] | ||||
paths = ['/usr/local/share/npm/bin/stylus'] | |||||
paths = ['/usr/local/bin/stylus', '/usr/local/share/npm/bin/stylus'] | |||||
for path in paths: | for path in paths: | ||||
if File(path).exists: | if File(path).exists: | ||||
s.config.stylus = Expando(dict(app=path)) | s.config.stylus = Expando(dict(app=path)) | ||||