Skip to content

Commit

Permalink
Adds a few cmd line arguments to aid server deployment (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Crean authored Apr 19, 2018
1 parent 3735fb1 commit df24923
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scripts/vcdat
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import requests
import sys
import tempfile
import os

import argparse

def isBound(port):
import socket
Expand Down Expand Up @@ -39,6 +39,14 @@ VCDAT_PORT = getPort("VCDAT_PORT", "5000")
os.environ["UVCDAT_ANONYMOUS_LOG"] = "no"
logfile = tempfile.NamedTemporaryFile()

parser = argparse.ArgumentParser()
parser.add_argument("--print-log", help="Output to screen instead of log file", action='store_true') # Because i cant do --print for whatever reason.
parser.add_argument("--no-browser", help="Don't start a browser automatically", action='store_true')

args = parser.parse_args()
if(args.print_log):
logfile = sys.stdout

print "Logs are going to:", logfile.name

try:
Expand Down Expand Up @@ -79,6 +87,8 @@ while True:
except BaseException:
continue
if resp.status_code == 200:
if(args.no_browser):
break
import webbrowser
webbrowser.open("http://localhost:%s" % VCDAT_PORT)
break
Expand Down

0 comments on commit df24923

Please sign in to comment.