def use_startstyle(self, inlinestyletext):
# type: (Optional[str]) -> None
if inlinestyletext:
# Transform YAML-like JSON
# e.g. '{based_on_style: pep8, column_limit: 79}'
# into '{"based_on_style": "pep8", "column_limit": 79}'
# which can be parsed as JSON.
inlinestyletext = re.sub(r'([a-zA-Z_]\w+)', r'"\1"', inlinestyletext)
d = json.JSONDecoder().decode(inlinestyletext) # type: ignore
self.initial_style = style_make(d)
评论列表
文章目录