baseimage-tutorial-framework/lib/util.py

19 lines
463 B
Python
Raw Normal View History

import json, xmlrpc.client
from config.envvars import SUPERVISOR_HTTP_URI
2017-11-27 17:42:34 +00:00
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