annotate piecrust/publishing/shell.py @ 861:d214918d4d2c

cm: Update Werkzeug.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 08 Jun 2017 08:52:45 -0700
parents 42da89d8bd51
children 13e8b50a2113
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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