Mercurial > piecrust2
diff piecrust/page.py @ 792:58ebf50235a5
routing: Simplify how routes are defined.
* No more declaring the type of route parameters -- the sources and generators
already know what type each parameter is supposed to be.
* Same for variadic parameters -- we know already.
* Update cache version to force a clear reload of the config.
* Update tests.
TODO: simplify code in the `Route` class to use source or generator transparently.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 07 Sep 2016 08:58:41 -0700 |
parents | e7481bbbb29f |
children | e01473c3ea7e |
line wrap: on
line diff
--- a/piecrust/page.py Mon Sep 05 22:30:05 2016 -0700 +++ b/piecrust/page.py Wed Sep 07 08:58:41 2016 -0700 @@ -11,7 +11,6 @@ from piecrust.configuration import ( Configuration, ConfigurationError, parse_config_header) -from piecrust.routing import IRouteMetadataProvider logger = logging.getLogger(__name__) @@ -37,7 +36,7 @@ FLAG_RAW_CACHE_VALID = 2**0 -class Page(IRouteMetadataProvider): +class Page(object): def __init__(self, source, source_metadata, rel_path): self.source = source self.source_metadata = source_metadata @@ -140,13 +139,6 @@ if was_cache_valid: self._flags |= FLAG_RAW_CACHE_VALID - def getRouteMetadata(self): - page_dt = self.datetime - return { - 'year': page_dt.year, - 'month': page_dt.month, - 'day': page_dt.day} - def _parse_config_date(page_date): if page_date is None: