Skip to content

Commit d63a958

Browse files
committed
dictionary/rtfcre: add Plover version to \cxsystem
1 parent 5179933 commit d63a958

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

plover/dictionary/rtfcre_dict.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import re
1717
import string
1818

19+
from plover import __version__ as plover_version
1920
from plover.formatting import ATOM_RE
2021
from plover.steno import normalize_steno
2122
from plover.steno_dictionary import StenoDictionary
@@ -24,8 +25,8 @@
2425

2526

2627
HEADER = (r'{\rtf1\ansi{\*\cxrev100}'
27-
r'\cxdict{\*\cxsystem Plover}'
28-
r'{\stylesheet{\s0 Normal;}}')
28+
r'\cxdict{\*\cxsystem Plover %s}'
29+
r'{\stylesheet{\s0 Normal;}}') % plover_version
2930

3031

3132
class RegexFormatter:

test/test_rtfcre_dict.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import pytest
77

8+
from plover import __version__ as plover_version
89
from plover.dictionary.rtfcre_dict import RtfDictionary, TranslationFormatter
910
from plover.dictionary.rtfcre_parse import BadRtfError
1011

@@ -422,11 +423,11 @@ def rtf_load_test(*spec, xfail=False):
422423
)
423424

424425
def rtf_save_test(dict_entries, rtf_entries):
425-
rtf_entries = b'\r\n'.join((
426+
rtf_entries = b'\r\n'.join(((
426427
br'{\rtf1\ansi{\*\cxrev100}\cxdict'
427-
br'{\*\cxsystem Plover}'
428-
br'{\stylesheet{\s0 Normal;}}',
429-
) + rtf_entries + (b'}', b''))
428+
br'{\*\cxsystem Plover %s}'
429+
br'{\stylesheet{\s0 Normal;}}'
430+
) % plover_version.encode(),) + rtf_entries + (b'}', b''))
430431
return dict_entries, rtf_entries
431432

432433
RTF_SAVE_TESTS = (

0 commit comments

Comments
 (0)