diff piecrust/plugins/builtin.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 8178671f9a04
children 986ecdaa2a36
line wrap: on
line diff
--- a/piecrust/plugins/builtin.py	Wed Feb 21 21:21:42 2018 -0800
+++ b/piecrust/plugins/builtin.py	Thu Feb 22 22:12:45 2018 -0800
@@ -17,6 +17,7 @@
         from piecrust.commands.builtin.publishing import PublishCommand
         from piecrust.commands.builtin.scaffolding import PrepareCommand
         from piecrust.commands.builtin.serving import ServeCommand
+        from piecrust.commands.builtin.tasks import TasksCommand
         from piecrust.commands.builtin.themes import ThemesCommand
         from piecrust.commands.builtin.util import (
             InitCommand, PurgeCommand, ImportCommand)
@@ -39,7 +40,9 @@
             ShowRecordCommand(),
             ServeCommand(),
             AdministrationPanelCommand(),
-            PublishCommand()]
+            PublishCommand(),
+            TasksCommand()
+        ]
 
     def getCommandExtensions(self):
         from piecrust.commands.builtin.scaffolding import (
@@ -165,3 +168,8 @@
             SftpPublisher,
             RsyncPublisher]
 
+    def getTaskRunners(self):
+        from piecrust.tasks.mentions import MentionTaskRunner
+
+        return [
+            MentionTaskRunner]