Zachary Turner | 9befc01 | 2015-11-24 21:35:50 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | """ |
| 4 | Shared functionality used by `client` and `server` when dealing with |
Zachary Turner | 24a95f8 | 2015-11-30 22:31:13 +0000 | [diff] [blame^] | 5 | remote transmission |
Zachary Turner | 9befc01 | 2015-11-24 21:35:50 +0000 | [diff] [blame] | 6 | """ |
| 7 | |
| 8 | # Future imports |
| 9 | from __future__ import absolute_import |
| 10 | from __future__ import print_function |
| 11 | |
| 12 | # Python modules |
| 13 | import json |
| 14 | import logging |
| 15 | import os |
| 16 | import socket |
| 17 | import struct |
| 18 | import sys |
| 19 | |
| 20 | # LLDB modules |
| 21 | import use_lldb_suite |
| 22 | |
Zachary Turner | 24a95f8 | 2015-11-30 22:31:13 +0000 | [diff] [blame^] | 23 | def generate_config(languages): |
| 24 | config = {"languages": languages} |
Zachary Turner | 9befc01 | 2015-11-24 21:35:50 +0000 | [diff] [blame] | 25 | return json.dumps(config) |
| 26 | |
Zachary Turner | 24a95f8 | 2015-11-30 22:31:13 +0000 | [diff] [blame^] | 27 | def parse_config(json_reader): |
| 28 | json_data = json_reader.read() |
| 29 | options_dict = json.loads(json_data) |
| 30 | return options_dict |