Mercurial > piecrust2
comparison piecrust/importing/piecrust.py @ 1164:727110ea112a
core: Remove more YAML deprecation warnings.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 04 Oct 2019 08:48:07 -0700 |
parents | 8a96ff3f2b01 |
children |
comparison
equal
deleted
inserted
replaced
1163:ed308313bcda | 1164:727110ea112a |
---|---|
94 if file_count == 0: | 94 if file_count == 0: |
95 logger.debug("Deleting empty directory: %s" % item) | 95 logger.debug("Deleting empty directory: %s" % item) |
96 shutil.rmtree(item_path) | 96 shutil.rmtree(item_path) |
97 | 97 |
98 def convertConfig(self, content): | 98 def convertConfig(self, content): |
99 config = yaml.load(content) | 99 config = yaml.safe_load(content) |
100 sitec = config.setdefault('site', {}) | 100 sitec = config.setdefault('site', {}) |
101 if 'templates_dirs' in sitec: | 101 if 'templates_dirs' in sitec: |
102 tdc = sitec['templates_dirs'] | 102 tdc = sitec['templates_dirs'] |
103 cl = len('_content/') | 103 cl = len('_content/') |
104 if isinstance(tdc, str) and re.match(r'^_content[/\\]', tdc): | 104 if isinstance(tdc, str) and re.match(r'^_content[/\\]', tdc): |