Exemple #1
0
    def __init__(self, config, force):
        self.force = force
        self.path = []

        self.conf = {
            'entry_dir': get_conf('entries'),
            'layout_dir': get_conf('layout'),
            'style_dir': get_conf('style'),
            'output_dir': get_conf('htdocs'),
            'ignore': ('*.pyc', '.hg', '.git', '.svn'),
            'locals': {},
            'mixins': [],
            }

        try:
            exec file(config) in self.conf
        except Exception, e:
            raise RuntimeError("Error running config: %s" % e)
Exemple #2
0
# generate a very simple blog, somewhat like PyBlosxom's defaults.

from ennepe import get_conf, cook, clean

# File locations
# --------------
#
#   * ``entry_dir``: a Maildir containing all the blog entries.
#   * ``layout_dir``: the blog's layout, as a skeleton directory tree.
#   * ``style_dir``: Kid templates used for filling the layouts.
#   * ``output_dir``: location where we will write the generated pages.
#
# All these directories must already exist. They default to the following
# subdirectories of ~/.ennepe:

entry_dir = get_conf('entries')
layout_dir = get_conf('layout')
style_dir = get_conf('style')
output_dir = get_conf('htdocs')

# Custom Variables
# ----------------
#
#   * ``locals``: a dict of local variables passed to all templates.
#
# This is initially empty; add anything you want to use in all layouts.
# Our example uses:

locals['blogname'] = 'Example Blog'
locals['blogroot'] = 'http://blog.polutropon.example/'
locals['authname'] = 'Example Author'