Permalink
Browse files

Rename pretty_route to just route

  • Loading branch information...
1 parent 855e16d commit fbe50780dfa47970f9a34df55210b3a7cb9cd30f @veeti committed Apr 15, 2012
Showing with 10 additions and 10 deletions.
  1. +1 −1 vasara/compiler.py
  2. +3 −3 vasara/item.py
  3. +1 −1 vasara/site.py
  4. +3 −3 vasara/tests/test_item.py
  5. +2 −2 vasara/tests/test_site.py
View
@@ -16,7 +16,7 @@ def compile(self):
for key, item in self.site.items.iteritems():
content = item.templated
- route = item.route
+ route = item.file_route
path = os.path.join(self.output_path, route)
path_dir = os.path.dirname(path)
View
@@ -11,7 +11,7 @@ def __init__(self, key, site, raw, route=None):
self.key = key
self.site = site
self.raw_content = raw
- self.route = route
+ self.file_route = route
self.filters = []
self.filtered = False
self.templater = None
@@ -47,5 +47,5 @@ def templated(self):
return self.templater(self)
@property
- def pretty_route(self):
- return self.route.replace("/index.html", "/")
+ def route(self):
+ return self.file_route.replace("/index.html", "/")
View
@@ -41,7 +41,7 @@ def match(self, expression):
def route(self, expression, callable):
for match, item in self.match(expression):
- item.route = callable(match, item)
+ item.file_route = callable(match, item)
def filter(self, expression, filter):
for match, item in self.match(expression):
@@ -60,6 +60,6 @@ def templater(item):
self.assertEqual("Hello, test_templater_property!", self.item.templated)
def test_pretty_route(self):
- """Ensures that the pretty_route property displays a "prettified" route."""
- self.item.route = "test/index.html"
- self.assertEqual("test/", self.item.pretty_route)
+ """Ensures that the route property displays a "prettified" route."""
+ self.item.file_route = "test/index.html"
+ self.assertEqual("test/", self.item.route)
@@ -33,8 +33,8 @@ def test_route(self):
# Override the index item's route
self.site.route(r"index", lambda match, item: "index.html")
- self.assertEqual("index.html", self.site.items["index"].route)
- self.assertEqual("test/test/index.html", self.site.items["test/test"].route)
+ self.assertEqual("index.html", self.site.items["index"].file_route)
+ self.assertEqual("test/test/index.html", self.site.items["test/test"].file_route)
def test_filter(self):
"""Ensures that filters are set properly on items."""

0 comments on commit fbe5078

Please sign in to comment.