Mercurial > piecrust2
annotate piecrust/publishing/shell.py @ 852:4850f8c21b6e
core: Start of the big refactor for PieCrust 3.0.
* Everything is a `ContentSource`, including assets directories.
* Most content sources are subclasses of the base file-system source.
* A source is processed by a "pipeline", and there are 2 built-in pipelines,
one for assets and one for pages. The asset pipeline is vaguely functional,
but the page pipeline is completely broken right now.
* Rewrite the baking process as just running appropriate pipelines on each
content item. This should allow for better parallelization.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 17 May 2017 00:11:48 -0700 |
parents | 42da89d8bd51 |
children | 13e8b50a2113 |
rev | line source |
---|---|
613
e2e955a3bb25
publish: Add publish command.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
1 import shlex |
621
8f9c0bdb3724
publish: Polish/refactor the publishing workflows.
Ludovic Chabant <ludovic@chabant.com>
parents:
614
diff
changeset
|
2 from piecrust.publishing.base import ShellCommandPublisherBase |
613
e2e955a3bb25
publish: Add publish command.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
3 |
e2e955a3bb25
publish: Add publish command.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
4 |
621
8f9c0bdb3724
publish: Polish/refactor the publishing workflows.
Ludovic Chabant <ludovic@chabant.com>
parents:
614
diff
changeset
|
5 class ShellCommandPublisher(ShellCommandPublisherBase): |
613
e2e955a3bb25
publish: Add publish command.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
6 PUBLISHER_NAME = 'shell' |
e2e955a3bb25
publish: Add publish command.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
7 |
621
8f9c0bdb3724
publish: Polish/refactor the publishing workflows.
Ludovic Chabant <ludovic@chabant.com>
parents:
614
diff
changeset
|
8 def _getCommandArgs(self, ctx): |
623
42da89d8bd51
publish: Change the `shell` config setting name for the command to run.
Ludovic Chabant <ludovic@chabant.com>
parents:
621
diff
changeset
|
9 target_cmd = self.getConfigValue('command') |
613
e2e955a3bb25
publish: Add publish command.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
10 if not target_cmd: |
e2e955a3bb25
publish: Add publish command.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
11 raise Exception("No command specified for publish target: %s" % |
e2e955a3bb25
publish: Add publish command.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
12 self.target) |
e2e955a3bb25
publish: Add publish command.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
13 args = shlex.split(target_cmd) |
621
8f9c0bdb3724
publish: Polish/refactor the publishing workflows.
Ludovic Chabant <ludovic@chabant.com>
parents:
614
diff
changeset
|
14 return args |
613
e2e955a3bb25
publish: Add publish command.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
15 |