annotate piecrust/__init__.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 f6f9a284a5f3
children 7d83b9484b98
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
f485ba500df3 Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents: 0
diff changeset
1
f485ba500df3 Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents: 0
diff changeset
2 CACHE_DIR = '_cache'
36
485682a6de50 New site layout support.
Ludovic Chabant <ludovic@chabant.com>
parents: 3
diff changeset
3 ASSETS_DIR = 'assets'
485682a6de50 New site layout support.
Ludovic Chabant <ludovic@chabant.com>
parents: 3
diff changeset
4 TEMPLATES_DIR = 'templates'
485682a6de50 New site layout support.
Ludovic Chabant <ludovic@chabant.com>
parents: 3
diff changeset
5 THEME_DIR = 'theme'
711
ab5c6a8ae90a bake: Replace hard-coded taxonomy support with "generator" system.
Ludovic Chabant <ludovic@chabant.com>
parents: 708
diff changeset
6 THEMES_DIR = 'themes'
3
f485ba500df3 Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents: 0
diff changeset
7
36
485682a6de50 New site layout support.
Ludovic Chabant <ludovic@chabant.com>
parents: 3
diff changeset
8 CONFIG_PATH = 'config.yml'
485682a6de50 New site layout support.
Ludovic Chabant <ludovic@chabant.com>
parents: 3
diff changeset
9 THEME_CONFIG_PATH = 'theme_config.yml'
273
d70a4adb61dd themes: Add the `chef themes` command
Ludovic Chabant <ludovic@chabant.com>
parents: 100
diff changeset
10 THEME_INFO_PATH = 'theme_info.yml'
415
0e9a94b7fdfa bake: Improve bake record information.
Ludovic Chabant <ludovic@chabant.com>
parents: 307
diff changeset
11 ASSET_DIR_SUFFIX = '-assets'
3
f485ba500df3 Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents: 0
diff changeset
12
f485ba500df3 Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents: 0
diff changeset
13 DEFAULT_FORMAT = 'markdown'
f485ba500df3 Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents: 0
diff changeset
14 DEFAULT_TEMPLATE_ENGINE = 'jinja2'
f485ba500df3 Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents: 0
diff changeset
15 DEFAULT_POSTS_FS = 'flat'
f485ba500df3 Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents: 0
diff changeset
16 DEFAULT_DATE_FORMAT = '%b %d, %Y'
708
d3a5a086e5cd templating: Use HTTPS URLs for a couple things.
Ludovic Chabant <ludovic@chabant.com>
parents: 682
diff changeset
17 DEFAULT_THEME_SOURCE = 'https://bitbucket.org/ludovicchabant/'
3
f485ba500df3 Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents: 0
diff changeset
18
708
d3a5a086e5cd templating: Use HTTPS URLs for a couple things.
Ludovic Chabant <ludovic@chabant.com>
parents: 682
diff changeset
19 PIECRUST_URL = 'https://bolt80.com/piecrust/'
3
f485ba500df3 Gigantic change to basically make PieCrust 2 vaguely functional.
Ludovic Chabant <ludovic@chabant.com>
parents: 0
diff changeset
20
792
58ebf50235a5 routing: Simplify how routes are defined.
Ludovic Chabant <ludovic@chabant.com>
parents: 787
diff changeset
21 CACHE_VERSION = 29
584
9ccc933ac2c7 internal: Refactor the app configuration class.
Ludovic Chabant <ludovic@chabant.com>
parents: 415
diff changeset
22
69
cb1ed436642c Always use version generated by `setup.py`. Better version generation.
Ludovic Chabant <ludovic@chabant.com>
parents: 36
diff changeset
23 try:
cb1ed436642c Always use version generated by `setup.py`. Better version generation.
Ludovic Chabant <ludovic@chabant.com>
parents: 36
diff changeset
24 from piecrust.__version__ import APP_VERSION
cb1ed436642c Always use version generated by `setup.py`. Better version generation.
Ludovic Chabant <ludovic@chabant.com>
parents: 36
diff changeset
25 except ImportError:
cb1ed436642c Always use version generated by `setup.py`. Better version generation.
Ludovic Chabant <ludovic@chabant.com>
parents: 36
diff changeset
26 APP_VERSION = 'unknown'
cb1ed436642c Always use version generated by `setup.py`. Better version generation.
Ludovic Chabant <ludovic@chabant.com>
parents: 36
diff changeset
27
100
69d5eecfa449 Better `prepare` command, with templates and help topics.
Ludovic Chabant <ludovic@chabant.com>
parents: 69
diff changeset
28 import os.path
69d5eecfa449 Better `prepare` command, with templates and help topics.
Ludovic Chabant <ludovic@chabant.com>
parents: 69
diff changeset
29 RESOURCES_DIR = os.path.join(os.path.dirname(__file__), 'resources')
69d5eecfa449 Better `prepare` command, with templates and help topics.
Ludovic Chabant <ludovic@chabant.com>
parents: 69
diff changeset
30