Mercurial > jouvence
diff tests/conftest.py @ 24:2ef526c301cc 0.3.0
Add support for sections and synopsis.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 05 Jan 2017 09:27:11 -0800 |
parents | ee741bbe96a8 |
children |
line wrap: on
line diff
--- a/tests/conftest.py Wed Jan 04 23:39:13 2017 -0800 +++ b/tests/conftest.py Thu Jan 05 09:27:11 2017 -0800 @@ -4,10 +4,10 @@ import yaml import pytest from jouvence.document import ( - JouvenceSceneElement, + JouvenceSceneElement, JouvenceSceneSection, TYPE_ACTION, TYPE_CENTEREDACTION, TYPE_CHARACTER, TYPE_DIALOG, TYPE_PARENTHETICAL, TYPE_TRANSITION, TYPE_LYRICS, TYPE_PAGEBREAK, - TYPE_EMPTYLINES, + TYPE_SYNOPSIS, _scene_element_type_str) from jouvence.parser import JouvenceParser, JouvenceParserError @@ -170,11 +170,6 @@ cur_paras.append(JouvenceSceneElement(TYPE_PAGEBREAK, None)) continue - if RE_BLANK_LINE.match(item): - text = len(item) * '\n' - cur_paras.append(JouvenceSceneElement(TYPE_EMPTYLINES, text)) - continue - token = item[:1] if token == '.': if cur_header or cur_paras: @@ -197,6 +192,12 @@ cur_paras.append(_t(item[1:])) elif token == '~': cur_paras.append(_l(item[1:])) + elif token == '#': + cur_paras.append( + JouvenceSceneSection(1, item[1:])) + elif token == '+': + cur_paras.append( + JouvenceSceneElement(TYPE_SYNOPSIS, item[1:])) else: raise Exception("Unknown token: %s" % token) if cur_header or cur_paras: