MCPcopy Create free account
hub / github.com/danvk/webdiff / pick_a_port

Function pick_a_port

webdiff/app.py:263–275  ·  view source on GitHub ↗
(args, webdiff_config)

Source from the content-addressed store, hash-verified

261
262
263def pick_a_port(args, webdiff_config):
264 if 'port' in args:
265 return args['port']
266
267 env_port = os.environ.get('WEBDIFF_PORT')
268 if env_port:
269 return int(env_port)
270
271 # gitconfig
272 if webdiff_config['port'] != -1:
273 return webdiff_config['port']
274
275 return random_port()
276
277
278def run_http():

Callers 1

runFunction · 0.85

Calls 1

random_portFunction · 0.85

Tested by

no test coverage detected