view piecrust/publishing/shell.py @ 622:5d8e0c8cdb5f

publish: Add the `rsync` publisher.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 08 Feb 2016 20:44:38 -0800
parents 8f9c0bdb3724
children 42da89d8bd51
line wrap: on
line source

import shlex
from piecrust.publishing.base import ShellCommandPublisherBase


class ShellCommandPublisher(ShellCommandPublisherBase):
    PUBLISHER_NAME = 'shell'

    def _getCommandArgs(self, ctx):
        target_cmd = self.getConfigValue('cmd')
        if not target_cmd:
            raise Exception("No command specified for publish target: %s" %
                            self.target)
        args = shlex.split(target_cmd)
        return args