from mocha.web.WebServer import WebServer

from mocha.oms import Oms
from mocha.oms.memory import MemoryOms

import sys
from getopt import getopt

if __name__ == "__main__":

	port = 8081

	(opts, remaining) = getopt(sys.argv[1:], "p", [ "port=" ])
	for opt in opts:
		if opt[0] == "--port":
			port = int(opt[1])
	
	print("Mocha User Interface Service - running on port", port)

	oms = MemoryOms()

	server = WebServer(("127.0.0.1", port), oms)
	server.serve_forever()

