Chromium Code Reviews| Index: remoting/host/linux/linux_me2me_host.py |
| diff --git a/remoting/host/linux/linux_me2me_host.py b/remoting/host/linux/linux_me2me_host.py |
| index 9c80e789fea03b45f8023609b0e08d11677e9f38..9ca1f4382893184d61b5a63354184928d129e9d8 100755 |
| --- a/remoting/host/linux/linux_me2me_host.py |
| +++ b/remoting/host/linux/linux_me2me_host.py |
| @@ -55,13 +55,7 @@ DEFAULT_SIZE_NO_RANDR = "1600x1200" |
| SCRIPT_PATH = os.path.abspath(sys.argv[0]) |
| SCRIPT_DIR = os.path.dirname(SCRIPT_PATH) |
| -IS_INSTALLED = (os.path.basename(sys.argv[0]) != 'linux_me2me_host.py') |
| - |
| -if IS_INSTALLED: |
| - HOST_BINARY_NAME = "chrome-remote-desktop-host" |
| -else: |
| - HOST_BINARY_NAME = "remoting_me2me_host" |
| - |
| +HOST_BINARY_NAME = "chrome-remote-desktop-host" |
| CHROME_REMOTING_GROUP_NAME = "chrome-remote-desktop" |
| HOME_DIR = os.environ["HOME"] |
| @@ -105,13 +99,14 @@ def is_supported_platform(): |
| def get_randr_supporting_x_server(): |
| """Returns a path to an X server that supports the RANDR extension, if this |
| is found on the system. Otherwise returns None.""" |
| - try: |
| - xvfb = "/usr/bin/Xvfb-randr" |
| - if not os.path.exists(xvfb): |
| - xvfb = locate_executable("Xvfb-randr") |
| + |
| + xvfb = "/usr/bin/Xvfb-randr" |
| + if os.path.exists(xvfb): |
| + return xvfb |
| + |
| + xvfb = os.path.join(SCRIPT_DIR, "Xvfb-randr") |
| + if os.path.exists(xvfb): |
| return xvfb |
| - except Exception: |
| - return None |
|
Sergey Ulanov
2016/04/18 23:58:36
add return None here. get() function without retur
Lambros
2016/04/19 01:51:29
Done.
|
| class Config: |
| @@ -497,7 +492,8 @@ class Desktop: |
| def launch_host(self, host_config): |
| # Start remoting host |
| - args = [locate_executable(HOST_BINARY_NAME), "--host-config=-"] |
| + host_path = os.path.join(SCRIPT_DIR, HOST_BINARY_NAME) |
| + args = [host_path, "--host-config=-"] |
| if self.pulseaudio_pipe: |
| args.append("--audio-pipe-name=%s" % self.pulseaudio_pipe) |
| if self.server_supports_exact_resize: |
| @@ -517,9 +513,9 @@ class Desktop: |
| signal.signal(signal.SIGUSR1, sigusr1_handler) |
| args.append("--signal-parent") |
| + logging.info(args) |
| self.host_proc = subprocess.Popen(args, env=self.child_env, |
| stdin=subprocess.PIPE) |
| - logging.info(args) |
| if not self.host_proc.pid: |
| raise Exception("Could not start Chrome Remote Desktop host") |
| @@ -630,25 +626,6 @@ def choose_x_session(): |
| return None |
| -def locate_executable(exe_name): |
| - if IS_INSTALLED: |
| - # If the script is running from its installed location, search the host |
| - # binary only in the same directory. |
| - paths_to_try = [ SCRIPT_DIR ] |
| - else: |
| - paths_to_try = map(lambda p: os.path.join(SCRIPT_DIR, p), |
| - [".", |
| - "../../../out/Debug", |
| - "../../../out/Default", |
| - "../../../out/Release"]) |
| - for path in paths_to_try: |
| - exe_path = os.path.join(path, exe_name) |
| - if os.path.exists(exe_path): |
| - return exe_path |
| - |
| - raise Exception("Could not locate executable '%s'" % exe_name) |
| - |
| - |
| class ParentProcessLogger(object): |
| """Redirects logs to the parent process, until the host is ready or quits. |
| @@ -1192,7 +1169,8 @@ Web Store: https://chrome.google.com/remotedesktop""" |
| if options.host_version: |
|
Sergey Ulanov
2016/04/18 23:58:36
I don't think we need this flag anymore (it was us
Lambros
2016/04/19 01:51:29
Flag removed in https://codereview.chromium.org/18
|
| # TODO(sergeyu): Also check RPM package version once we add RPM package. |
| - return os.system(locate_executable(HOST_BINARY_NAME) + " --version") >> 8 |
| + host_path = os.path.join(SCRIPT_DIR, HOST_BINARY_NAME) |
|
Sergey Ulanov
2016/04/18 23:58:36
If we still need the flag, then this expression is
Lambros
2016/04/19 01:51:29
Acknowledged.
|
| + return os.system(host_path + " --version") >> 8 |
| if options.watch_resolution: |
| watch_for_resolution_changes(options.watch_resolution) |