Skip to content
Permalink
Browse files

core: plugins: Layers: split LAYERS in PRE_BUILD_LAYERS and POST_BUIL…

…D_LAYERS

Signed-off-by: Florian Scherf <f.scherf@pengutronix.de>
  • Loading branch information...
fscherf committed Jul 7, 2019
1 parent e409737 commit 034f79f921288afb4300766473ba4b791b99967c
Showing with 34 additions and 52 deletions.
  1. +28 −0 flamingo/core/plugins/layers.py
  2. +6 −0 flamingo/default_settings.py
  3. +0 −1 flamingo/plugins/__init__.py
  4. +0 −51 flamingo/plugins/layers.py
@@ -0,0 +1,28 @@
import os


def _cp(context, source, destination):
for root, dirs, files in os.walk(source):
for f in files:
src = os.path.join(root, f)

dst = os.path.normpath(os.path.join(
destination, os.path.relpath(root, source), f))

context.cp(src, dst)


class PreBuildLayers:
def pre_build(self, context):
OUTPUT_ROOT = context.settings.OUTPUT_ROOT

for layer in context.settings.PRE_BUILD_LAYERS:
_cp(context, layer, OUTPUT_ROOT)


class PostBuildLayers:
def post_build(self, context):
OUTPUT_ROOT = context.settings.OUTPUT_ROOT

for layer in context.settings.POST_BUILD_LAYERS:
_cp(context, layer, OUTPUT_ROOT)
@@ -2,6 +2,7 @@

# plugins / hooks
CORE_PLUGINS_PRE = [
'flamingo.core.plugins.layers.PreBuildLayers',
'flamingo.core.plugins.MetaDataProcessor',
'flamingo.core.plugins.Hooks',
]
@@ -20,6 +21,7 @@
CORE_PLUGINS_POST = [
'flamingo.core.plugins.Media',
'flamingo.core.plugins.Static',
'flamingo.core.plugins.layers.PostBuildLayers',
]

CACHE_HOOKS = True
@@ -56,3 +58,7 @@
OUTPUT_ROOT = 'output'
MEDIA_ROOT = 'output/media'
STATIC_ROOT = 'output/static'

# layers
PRE_BUILD_LAYERS = []
POST_BUILD_LAYERS = []
@@ -9,7 +9,6 @@
from .rst.file import rstFile # NOQA
from .redirects import Redirects # NOQA
from .tags.tags import Tags # NOQA
from .layers import Layers # NOQA
from .html import HTML # NOQA
from .i18n import I18N # NOQA
from .time import Time # NOQA

This file was deleted.

0 comments on commit 034f79f

Please sign in to comment.
You can’t perform that action at this time.