Imported existing code
This commit is contained in:
35
indra/copy_win_scripts/CMakeLists.txt
Normal file
35
indra/copy_win_scripts/CMakeLists.txt
Normal file
@@ -0,0 +1,35 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# The copy_win_scripts folder contains scripts handy for launching the
|
||||
# from the windows command line on windows.
|
||||
# The cmake target created copies the scripts to the
|
||||
# build directory being used, which where the scripts
|
||||
# need to be executed from.
|
||||
|
||||
include(CMakeCopyIfDifferent)
|
||||
|
||||
set(win_scripts-src ${CMAKE_SOURCE_DIR}/copy_win_scripts)
|
||||
set(win_scripts-dst ${CMAKE_BINARY_DIR}/batch)
|
||||
|
||||
set(file-list
|
||||
llstart.py
|
||||
start-client.py
|
||||
start-servers.py
|
||||
stop-servers.py
|
||||
user_config.py
|
||||
)
|
||||
|
||||
foreach(file ${file-list})
|
||||
if(EXISTS ${win_scripts-src}/${file})
|
||||
set(win_scripts-files ${win_scripts-files} ${file})
|
||||
endif(EXISTS ${win_scripts-src}/${file})
|
||||
endforeach(file ${file-list})
|
||||
|
||||
copy_if_different(
|
||||
${win_scripts-src}
|
||||
${win_scripts-dst}
|
||||
win_scripts-targets
|
||||
${win_scripts-files}
|
||||
)
|
||||
|
||||
add_custom_target(copy_win_scripts ALL DEPENDS ${win_scripts-targets})
|
||||
68
indra/copy_win_scripts/start-client.py
Normal file
68
indra/copy_win_scripts/start-client.py
Normal file
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env python
|
||||
import sys, getopt
|
||||
import os
|
||||
import llstart
|
||||
|
||||
def usage():
|
||||
print """start-client.py
|
||||
|
||||
--grid <grid>
|
||||
--farm <grid>
|
||||
--region <starting region name>
|
||||
"""
|
||||
|
||||
def start_client(grid, slurl, build_config, my_args):
|
||||
login_url = "https://login.%s.lindenlab.com/cgi-bin/login.cgi" % (grid)
|
||||
|
||||
viewer_args = { "--grid" : grid,
|
||||
"--loginuri" : login_url }
|
||||
viewer_args.update(my_args)
|
||||
# *sigh* We must put --url at the end of the argument list.
|
||||
if viewer_args.has_key("--url"):
|
||||
slurl = viewer_args["--url"]
|
||||
del(viewer_args["--url"])
|
||||
viewer_args = llstart.get_args_from_dict(viewer_args)
|
||||
if slurl is not None:
|
||||
viewer_args += " --url %s" % slurl
|
||||
|
||||
# Figure out path stuff.
|
||||
# The client should run from indra/newview
|
||||
# but the exe is at indra/build-<xxx>/newview/<target>
|
||||
build_path = os.path.dirname(os.getcwd());
|
||||
f = open("start-client.log", "w")
|
||||
print >>f, "Viewer startup arguments:"
|
||||
llstart.start("viewer", "../../newview",
|
||||
"%s/newview/%s/secondlife-bin.exe" % (build_path, build_config),
|
||||
viewer_args, f)
|
||||
f.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
grid = llstart.get_config("grid")
|
||||
|
||||
if grid == None:
|
||||
grid = "aditi"
|
||||
|
||||
build_config = llstart.get_config("build_config")
|
||||
my_args = llstart.get_config("viewer_args", force_dict = True)
|
||||
opts, args = getopt.getopt(sys.argv[1:], "u:r:f:g:i:h",
|
||||
["region=", "username=", "farm=", "grid=", "ip=", "help"])
|
||||
region = None
|
||||
for o, a in opts:
|
||||
if o in ("-r", "--region", "-u", "--username"):
|
||||
region = a
|
||||
if o in ("-f", "--farm", "-g", "--grid"):
|
||||
grid = a
|
||||
if o in ("-h", "--help"):
|
||||
usage()
|
||||
sys.exit(0)
|
||||
|
||||
slurl = llstart.get_config("slurl")
|
||||
if slurl == None:
|
||||
if region is None:
|
||||
region = llstart.get_user_name()
|
||||
slurl = "//%s/128/128/" % (region)
|
||||
# Ensure the slurl has quotes around it.
|
||||
if slurl is not None:
|
||||
slurl = '"%s"' % (slurl.strip('"\''))
|
||||
|
||||
start_client(grid, slurl, build_config, my_args)
|
||||
Reference in New Issue
Block a user