Mercurial > piecrust2
comparison piecrust/processing/pygments_style.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 | ee3fe63cc51d |
children |
comparison
equal
deleted
inserted
replaced
1163:ed308313bcda | 1164:727110ea112a |
---|---|
9 def __init__(self): | 9 def __init__(self): |
10 super(PygmentsStyleProcessor, self).__init__({'pygstyle': 'css'}) | 10 super(PygmentsStyleProcessor, self).__init__({'pygstyle': 'css'}) |
11 | 11 |
12 def _doProcess(self, in_path, out_path): | 12 def _doProcess(self, in_path, out_path): |
13 with open(in_path, 'r') as fp: | 13 with open(in_path, 'r') as fp: |
14 config = yaml.load(fp) | 14 config = yaml.safe_load(fp) |
15 | 15 |
16 style_name = config.get('style', 'default') | 16 style_name = config.get('style', 'default') |
17 class_name = config.get('class', '.highlight') | 17 class_name = config.get('class', '.highlight') |
18 fmt = HtmlFormatter(style=style_name).get_style_defs(class_name) | 18 fmt = HtmlFormatter(style=style_name).get_style_defs(class_name) |
19 | 19 |