aboutsummaryrefslogtreecommitdiff
path: root/scripts/swig_bot_lib/remote.py
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-01-06 20:12:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-01-06 20:12:03 +0000
commit9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc (patch)
treedd2a1ddf0476664c2b823409c36cbccd52662ca7 /scripts/swig_bot_lib/remote.py
parent3bd2e91faeb9eeec1aae82c64a3253afff551cfd (diff)
downloadsrc-9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc.tar.gz
src-9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc.zip
Vendor import of lldb trunk r256945:vendor/lldb/lldb-trunk-r256945
Notes
Notes: svn path=/vendor/lldb/dist/; revision=293262 svn path=/vendor/lldb/lldb-trunk-r256945/; revision=293263; tag=vendor/lldb/lldb-trunk-r256945
Diffstat (limited to 'scripts/swig_bot_lib/remote.py')
-rw-r--r--scripts/swig_bot_lib/remote.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/scripts/swig_bot_lib/remote.py b/scripts/swig_bot_lib/remote.py
new file mode 100644
index 000000000000..590a873d6270
--- /dev/null
+++ b/scripts/swig_bot_lib/remote.py
@@ -0,0 +1,39 @@
+#!/usr/bin/env python
+
+"""
+Shared functionality used by `client` and `server` when dealing with
+remote transmission
+"""
+
+# Future imports
+from __future__ import absolute_import
+from __future__ import print_function
+
+# Python modules
+import json
+import logging
+import os
+import socket
+import struct
+import sys
+
+# LLDB modules
+import use_lldb_suite
+
+def generate_config(languages):
+ config = {"languages": languages}
+ return json.dumps(config)
+
+def parse_config(json_reader):
+ json_data = json_reader.read()
+ options_dict = json.loads(json_data)
+ return options_dict
+
+def serialize_response_status(status):
+ status = {"retcode": status[0], "output": status[1]}
+ return json.dumps(status)
+
+def deserialize_response_status(json_reader):
+ json_data = json_reader.read()
+ response_dict = json.loads(json_data)
+ return (response_dict["retcode"], response_dict["output"])