diff --git a/stream/__init__.py b/stream/__init__.py new file mode 100644 index 0000000..ed2c9d4 --- /dev/null +++ b/stream/__init__.py @@ -0,0 +1 @@ +from .stream import * diff --git a/stream/__init__.pyc b/stream/__init__.pyc deleted file mode 100644 index 32f77a6..0000000 Binary files a/stream/__init__.pyc and /dev/null differ diff --git a/stream/stream.py b/stream/stream.py new file mode 100644 index 0000000..978d283 --- /dev/null +++ b/stream/stream.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- # + +from pelican import signals +from os import listdir +from os.path import isfile, join + +def getStream(page): + dir = 'content/stream' + images = [f for f in listdir(dir) if isfile(join(dir, f))] + print('>>> The stream is streaming!', images) + page.stream = 'jaja' + +def register(): + signals.page_generator_finalized.connect(getStream) + # signals.article_generator_finalized.connect(getStream) diff --git a/stream/stream.pyc b/stream/stream.pyc deleted file mode 100644 index c247a3b..0000000 Binary files a/stream/stream.pyc and /dev/null differ