diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-23 15:38:29 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-23 15:38:29 +0000 |
commit | 7de8b1873902cb8857a27ae6b0b6d5b5291d62b0 (patch) | |
tree | 78c19a6307e0bee6eb8a2cda8fc99b6bcc373072 /remoting/tools/runclient.py | |
parent | e5366896e9ccb3dd17c590d115bd999e987a33af (diff) | |
download | chromium_src-7de8b1873902cb8857a27ae6b0b6d5b5291d62b0.zip chromium_src-7de8b1873902cb8857a27ae6b0b6d5b5291d62b0.tar.gz chromium_src-7de8b1873902cb8857a27ae6b0b6d5b5291d62b0.tar.bz2 |
Get scripts working independent of where they are run.
Also store script data in home directory.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/2832019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50598 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/tools/runclient.py')
-rwxr-xr-x | remoting/tools/runclient.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/remoting/tools/runclient.py b/remoting/tools/runclient.py index 62db605..000b70e 100755 --- a/remoting/tools/runclient.py +++ b/remoting/tools/runclient.py @@ -9,11 +9,24 @@ # so that the host authentication arguments can be automatically set. import os +import platform -auth_filename = '.chromotingAuthToken' +auth_filepath = os.path.join(os.getenv('HOME'), '.chromotingAuthToken') +script_path = os.path.dirname(__file__) + +if platform.system() == "Windows": + # TODO(garykac): Make this work on Windows. + print 'Not yet supported on Windows.' + exit(1) +elif platform.system() == "Darwin": # Darwin == MacOSX + client_path = '../../xcodebuild/Debug/chromoting_simple_client' +else: + client_path = '../../out/Debug/chromoting_x11_client' + +client_path = os.path.join(script_path, client_path) # Read username and auth token from token file. -auth = open(auth_filename) +auth = open(auth_filepath) authinfo = auth.readlines() username = authinfo[0].rstrip() @@ -26,9 +39,8 @@ print 'Host JID:', username + '/chromoting', hostjid_suffix = raw_input() hostjid = username + '/chromoting' + hostjid_suffix -# TODO(garykac): Make this work on Windows. command = [] -command.append('../../out/Debug/chromoting_x11_client') +command.append(client_path) command.append('--host_jid ' + hostjid) command.append('--jid ' + username) command.append('--token ' + authtoken) |