diff piecrust/pathutil.py @ 1114:8af2ea1f5c34

tasks: Add new `tasks` command and infrastructure, with `mention` task. * The new command lets `chef` run tasks from a queue. * The webmention endpoint now adds a mention task. * Moved mention handling code to a task runner.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 22 Feb 2018 22:12:45 -0800
parents 3ceeca7bb71c
children 40a40305c4e1
line wrap: on
line diff
--- a/piecrust/pathutil.py	Wed Feb 21 21:21:42 2018 -0800
+++ b/piecrust/pathutil.py	Thu Feb 22 22:12:45 2018 -0800
@@ -56,3 +56,9 @@
             res.append(n)
     return res
 
+
+def ensure_dir(path, mode=0o755):
+    try:
+        os.makedirs(path, mode=mode, exist_ok=True)
+    except OSError:
+        pass