diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-09-16 00:26:01 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-09-16 00:26:13 -0400 |
commit | 05c9a4fa2756c0713e5dc56a69531cdadb4f411d (patch) | |
tree | 7f0860dc070d03ffc91cadba8120d5df143ad701 | |
parent | e73211f67f5679cf2aa6127c82b83435933efbaa (diff) | |
download | python-termcast-server-05c9a4fa2756c0713e5dc56a69531cdadb4f411d.tar.gz python-termcast-server-05c9a4fa2756c0713e5dc56a69531cdadb4f411d.zip |
use the updated metadata escape (see App::Termcast 0.13)
-rw-r--r-- | termcast.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/termcast.py b/termcast.py index c86a9af..23c4b62 100644 --- a/termcast.py +++ b/termcast.py @@ -5,7 +5,7 @@ import re import vt100 auth_re = re.compile(b'^hello ([^ ]+) ([^ ]+)$') -extra_data_re = re.compile(b'\033\[H(\000([^\377]*)\377)\033\[H\033\[2J') +extra_data_re = re.compile(b'\033\]499;([^\007]*)\007') class Handler(object): def __init__(self, rows, cols): @@ -27,9 +27,9 @@ class Handler(object): m = extra_data_re.search(data) if m is None: break - extra_data_json = m.group(2) + extra_data_json = m.group(1) extra_data = json.loads(extra_data_json.decode('utf-8')) - data = data[:m.start(1)] + data[m.end(1):] + data = data[:m.start(0)] + data[m.end(0):] if "geometry" in extra_data: self.rows = extra_data["geometry"][1] self.cols = extra_data["geometry"][0] @@ -123,7 +123,7 @@ class Connection(object): extra_data = {} m = extra_data_re.match(buf) if m is not None: - extra_data_json = m.group(2) + extra_data_json = m.group(1) extra_data = json.loads(extra_data_json.decode('utf-8')) buf = buf[len(m.group(0)):] |