Move cloud code (module independent) to a builtin package.

This commit is contained in:
grossmj
2014-05-07 19:31:53 -06:00
parent 44bcc94e3e
commit c0a876af68
8 changed files with 131 additions and 68 deletions

View File

@ -39,6 +39,8 @@ from .config import Config
from .handlers.jsonrpc_websocket import JSONRPCWebSocket
from .handlers.version_handler import VersionHandler
from .handlers.file_upload_handler import FileUploadHandler
from .builtins.server_version import server_version
from .builtins.interfaces import interfaces
from .modules import MODULES
import logging
@ -115,6 +117,11 @@ class Server(object):
# instance.start() # starts the new process
#=======================================================================
# special built-in to return the server version
JSONRPCWebSocket.register_destination("builtin.version", server_version)
# special built-in to return the available interfaces on this host
JSONRPCWebSocket.register_destination("builtin.interfaces", interfaces)
for module in MODULES:
instance = module(module.__name__.lower(),
"127.0.0.1", # ZeroMQ server address