(args, webdiff_config)
| 261 | |
| 262 | |
| 263 | def 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 | |
| 278 | def run_http(): |