| Index: mojo/devtools/common/devtoolslib/linux_shell.py
|
| diff --git a/mojo/devtools/common/devtoolslib/linux_shell.py b/mojo/devtools/common/devtoolslib/linux_shell.py
|
| index 30ab4e98b4c0fa8be358fdd3d1e2f423cbdf2252..4b3d98a4cd2ef636807a1620f8db2db4fb869dd4 100644
|
| --- a/mojo/devtools/common/devtoolslib/linux_shell.py
|
| +++ b/mojo/devtools/common/devtoolslib/linux_shell.py
|
| @@ -5,6 +5,7 @@
|
| import subprocess
|
|
|
| from devtoolslib.shell import Shell
|
| +from devtoolslib import http_server
|
|
|
|
|
| class LinuxShell(Shell):
|
| @@ -20,6 +21,22 @@ class LinuxShell(Shell):
|
| self.executable_path = executable_path
|
| self.command_prefix = command_prefix if command_prefix else []
|
|
|
| + def ServeLocalDirectory(self, local_dir_path, port=0):
|
| + """Serves the content of the local (host) directory, making it available to
|
| + the shell under the url returned by the function.
|
| +
|
| + The server will run on a separate thread until the program terminates. The
|
| + call returns immediately.
|
| +
|
| + Args:
|
| + local_dir_path: path to the directory to be served
|
| + port: port at which the server will be available to the shell
|
| +
|
| + Returns:
|
| + The url that the shell can use to access the content of |local_dir_path|.
|
| + """
|
| + return 'http://%s:%d/' % http_server.StartHttpServer(local_dir_path, port)
|
| +
|
| def Run(self, arguments):
|
| """Runs the shell with given arguments until shell exits, passing the stdout
|
| mingled with stderr produced by the shell onto the stdout.
|
|
|