How to use the ck.repo.module.web.module.server_handler function in ck

To help you get started, we’ve selected a few ck examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ctuning / ck / ck / repo / module / web / module.py View on Github external
if cid!='' and cid!='web':
          if ext!='': ext+='&'
          ext+='wcid='+cid

       if i.get('extra_url','')!='':
          if ext!='': ext+='&'
          ext+=i['extra_url']

       if ext!='':
          rurl+='/?'+ext

       import webbrowser
       webbrowser.open(rurl)

    try:
       server = ThreadedHTTPServer((host, int(port)), server_handler)
       # Prevent issues with socket reuse
       server.allow_reuse_address=True
       server.serve_forever()
    except KeyboardInterrupt:
       ck.out('Keyboard interrupt, terminating CK web service ...')
       server.socket.close()
       return {'return':0}
    except OSError as e:
       return {'return':1, 'error':'problem starting CK web service ('+format(e)+')'}

    return {'return':0}

ck

Collective Knowledge - a lightweight knowledge manager to organize, cross-link, share and reuse artifacts and workflows based on FAIR principles

Apache-2.0
Latest version published 5 months ago

Package Health Score

78 / 100
Full package analysis

Similar packages