Mercurial > piecrust2
comparison piecrust/publishing/rsync.py @ 622:5d8e0c8cdb5f
publish: Add the `rsync` publisher.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 08 Feb 2016 20:44:38 -0800 |
parents | |
children | b45fb2137a07 |
comparison
equal
deleted
inserted
replaced
621:8f9c0bdb3724 | 622:5d8e0c8cdb5f |
---|---|
1 from piecrust.publishing.base import ShellCommandPublisherBase | |
2 | |
3 | |
4 class RsyncPublisher(ShellCommandPublisherBase): | |
5 PUBLISHER_NAME = 'rsync' | |
6 PUBLISHER_SCHEME = 'rsync' | |
7 | |
8 def _getCommandArgs(self, ctx): | |
9 if self.has_url_config: | |
10 dest = self.parsed_url.netloc + self.parsed_url.path | |
11 else: | |
12 dest = self.getConfigValue('destination') | |
13 | |
14 rsync_options = None | |
15 if not self.has_url_config: | |
16 rsync_options = self.getConfigValue('options') | |
17 if rsync_options is None: | |
18 rsync_options = ['-avc', '--delete'] | |
19 | |
20 args = ['rsync'] + rsync_options | |
21 args += [ctx.bake_out_dir, dest] | |
22 return args | |
23 |