mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-05 16:31:21 +00:00
26 lines
605 B
Python
26 lines
605 B
Python
import json, xmlrpc.client, zmq
|
|
|
|
from .config.envvars import SUPERVISOR_HTTP_URI
|
|
|
|
|
|
def parse_anchor_from_message(message):
|
|
message_json = json.loads(message)
|
|
return message_json['anchor']
|
|
|
|
|
|
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()
|