Skip to content

Instantly share code, notes, and snippets.

@benfulton
Created July 7, 2014 03:20
Show Gist options
  • Save benfulton/a9d3b56073a0a0f84254 to your computer and use it in GitHub Desktop.
Save benfulton/a9d3b56073a0a0f84254 to your computer and use it in GitHub Desktop.
Launch the WaferSlim SLIM server from a source directory
import sys
sys.path.append("/path/to/GIT/waferslim/src")
import waferslim.server
import logging
#sys.argv = ['programname', '-iq', '-q', directory]
def start_server():
''' Convenience method to start the server (used by __main__)'''
(options, args) = waferslim.server._get_options()
waferslim.server._setup_logging(options)
waferslim.server._setup_syspath(options)
waferslim.server._setup_encoding(options)
waferslim.server._setup_port(options, args)
# logging.getLogger('WaferSlimServer').info("About to start server")
waferslim.server.WaferSlimServer(options).serve_forever()
start_server()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment