baseimage-tutorial-framework/lib/tfw/util.py
2018-02-02 18:39:06 +01:00

21 lines
490 B
Python

import json, xmlrpc.client, zmq
from .config.envvars import SUPERVISOR_HTTP_URI
def create_source_code_response_data(filename, content, language):
return {
'filename': filename,
'content': content,
'language': language
}
class SupervisorMixin:
supervisor = xmlrpc.client.ServerProxy(SUPERVISOR_HTTP_URI).supervisor
class ZMQConnectorBase:
def __init__(self, zmq_context=None):
self._zmq_context = zmq_context or zmq.Context.instance()