diff options
-rw-r--r-- | __init__.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/__init__.py b/__init__.py index 50bf8a2..906b5a3 100644 --- a/__init__.py +++ b/__init__.py @@ -18,13 +18,10 @@ def run(pelican): options = pelican.settings.get('MINIFY', {}) htmlfile = re.compile(r'.html?$') pool = multiprocessing.Pool() - + + # find all html & htm files and give them to the workers to minify for base, dirs, files in os.walk(pelican.settings['OUTPUT_PATH']): - for f in files: - # filter only html files - if not htmlfile.search(f): - continue - # add full html path to wooker pool + for f in filter(htmlfile.search, files): filepath = os.path.join(base, f) pool.apply_async(worker, (filepath, options)) |