diff options
Diffstat (limited to 'nikola/plugins/command/auto/__init__.py')
| -rw-r--r-- | nikola/plugins/command/auto/__init__.py | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/nikola/plugins/command/auto/__init__.py b/nikola/plugins/command/auto/__init__.py index 9de5622..2c6d0e7 100644 --- a/nikola/plugins/command/auto/__init__.py +++ b/nikola/plugins/command/auto/__init__.py @@ -37,6 +37,7 @@ import sys import typing import webbrowser +import blinker import pkg_resources from nikola.plugin_categories import Command @@ -122,7 +123,8 @@ class CommandAuto(Command): 'long': 'process', 'default': 0, 'type': int, - 'help': 'Number of subprocesses (nikola build argument)' + 'help': 'Number of subprocesses', + 'section': 'Arguments passed to `nikola build`' }, { 'name': 'parallel-type', @@ -130,8 +132,25 @@ class CommandAuto(Command): 'long': 'parallel-type', 'default': 'process', 'type': str, - 'help': "Parallelization mode ('process' or 'thread', nikola build argument)" + 'help': "Parallelization mode ('process' or 'thread')", + 'section': 'Arguments passed to `nikola build`' }, + { + 'name': 'db-file', + 'long': 'db-file', + 'default': '.doit.db', + 'type': str, + 'help': 'Database file', + 'section': 'Arguments passed to `nikola build`' + }, + { + 'name': 'backend', + 'long': 'backend', + 'default': 'dbm', + 'type': str, + 'help': "Database backend ('dbm', 'json', 'sqlite3')", + 'section': 'Arguments passed to `nikola build`' + } ] def _execute(self, options, args): @@ -149,6 +168,8 @@ class CommandAuto(Command): elif Observer is None: req_missing(['watchdog'], 'use the "auto" command') + blinker.signal('auto_command_starting').send(self.site) + if sys.argv[0].endswith('__main__.py'): self.nikola_cmd = [sys.executable, '-m', 'nikola', 'build'] else: @@ -161,6 +182,10 @@ class CommandAuto(Command): self.nikola_cmd += ['--process={}'.format(options['process']), '--parallel-type={}'.format(options['parallel-type'])] + if options: + self.nikola_cmd += ['--db-file={}'.format(options['db-file']), + '--backend={}'.format(options['backend'])] + port = options and options.get('port') self.snippet = '''<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] |
