|
10 | 10 | from ..__common__ import * |
11 | 11 |
|
12 | 12 |
|
13 | | -__CODES = ["ccitt1", "ccitt2", "eu", "ita1", "ita2", "ita2_us", "murray", "uk"] |
| 13 | +__CODES = ["ccitt1", "ccitt2", "eu", "ita1", "ita2", "ita2_us"] |
14 | 14 | if PY3: |
15 | | - __CODES.extend(["ita2_meteo", "mtk2"]) |
| 15 | + __CODES.extend(["ita2_meteo", "mtk2", "murray", "uk"]) |
16 | 16 | __guess__ = ["baudot%s-{}-{}".format(x, y) for x in __CODES for y in ["lsb", "msb"]] |
17 | 17 | __examples1__ = { |
18 | 18 | 'enc(baudot-BAD_ALPHABET)': None, |
|
51 | 51 |
|
52 | 52 |
|
53 | 53 | PATTERN = r"^baudot%s([-_](?:ccitt1|ccitt2|eu|fr|ita1|ita2|ita2[-_](?:us" + (r"|meteo" if PY3 else r"") + r")" + \ |
54 | | - (r"|mtk2" if PY3 else r"") + r"|murray|uk|us_tty)(?:[-_](?:lsb|msb))?)?$" |
| 54 | + (r"|mtk2|murray|uk" if PY3 else r"") + r"|us_tty)(?:[-_](?:lsb|msb))?)?$" |
55 | 55 | # reserved character |
56 | 56 | RES_CHR = "\xff" |
57 | 57 |
|
|
116 | 116 | "\x003\n- '87\r\xff4Ю,Э:(5+)2Щ6019?Ш\xff./=\xff", |
117 | 117 | ] |
118 | 118 | # Murray code ; NB: not all fractions are supported (source: https://en.wikipedia.org/wiki/Baudot_code) |
119 | | -MURRAY = [ |
120 | | - "00100", "11011", |
121 | | - " E\xffA\xffSIU\nDRJNFCKTZLWHYPQOBF\xffMXV\x7f", |
122 | | - "\x003\xff\xff\xff'87\n²4\xff-\u215f(\xff5./2\xff6019?\xff\xff,£)*" if PY3 else \ |
123 | | - "\x003\xff\xff\xff'87\n²4\xff-\u215f(\xff5./2\xff6019?\xff\xff,$)*", |
124 | | -] |
| 119 | +if PY3: |
| 120 | + MURRAY = [ |
| 121 | + "00100", "11011", |
| 122 | + " E\xffA\xffSIU\nDRJNFCKTZLWHYPQOBF\xffMXV\x7f", |
| 123 | + "\x003\xff\xff\xff'87\n²4\xff-\u215f(\xff5./2\xff6019?\xff\xff,£)*" if PY3 else \ |
| 124 | + "\x003\xff\xff\xff'87\n²4\xff-\u215f(\xff5./2\xff6019?\xff\xff,$)*", |
| 125 | + ] |
125 | 126 | # English Baudot ; NB: not all fractions are supported (sources: https://fr.qwe.wiki/wiki/Baudot_code |
126 | 127 | # https://en.wikipedia.org/wiki/Baudot_code) |
127 | | -UK = [ |
128 | | - "10000", "01000", |
129 | | - "\x00AE/YUIO\xffJGHBCFD -XZSTWV\x7fKMLRQNP", |
130 | | - "\x0012\u215f34\xff5 67\xb989\xff0\xff.\xff:\xff²?'\x7f()=-/£+" if PY3 else \ |
131 | | - "\x0012\xff34\xff5 67\xb989\xff0\xff.\xff:\xff²?'\x7f()=-/$+", |
132 | | -] |
| 128 | +if PY3: |
| 129 | + UK = [ |
| 130 | + "10000", "01000", |
| 131 | + "\x00AE/YUIO\xffJGHBCFD -XZSTWV\x7fKMLRQNP", |
| 132 | + "\x0012\u215f34\xff5 67\xb989\xff0\xff.\xff:\xff²?'\x7f()=-/£+" if PY3 else \ |
| 133 | + "\x0012\xff34\xff5 67\xb989\xff0\xff.\xff:\xff²?'\x7f()=-/$+", |
| 134 | + ] |
133 | 135 |
|
134 | 136 |
|
135 | 137 | def _bits_from_tape(tape, trans={'*': "1", ' ': "0"}): |
|
0 commit comments