[email protected] | 9af13ce | 2010-09-16 21:45:48 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #ifndef NET_TEST_PYTHON_UTILS_H_ | ||||
6 | #define NET_TEST_PYTHON_UTILS_H_ | ||||
[email protected] | 9af13ce | 2010-09-16 21:45:48 | [diff] [blame] | 7 | |
David Benjamin | 76ee79eb | 2019-03-15 17:02:09 | [diff] [blame] | 8 | #include <vector> |
9 | |||||
[email protected] | 9af13ce | 2010-09-16 21:45:48 | [diff] [blame] | 10 | #include "base/compiler_specific.h" |
David Benjamin | 76ee79eb | 2019-03-15 17:02:09 | [diff] [blame] | 11 | #include "base/environment.h" |
[email protected] | 9af13ce | 2010-09-16 21:45:48 | [diff] [blame] | 12 | |
[email protected] | a3ef483 | 2013-02-02 05:12:33 | [diff] [blame] | 13 | namespace base { |
[email protected] | 2f3b1cc | 2014-03-17 23:07:15 | [diff] [blame] | 14 | class CommandLine; |
[email protected] | 9af13ce | 2010-09-16 21:45:48 | [diff] [blame] | 15 | class FilePath; |
[email protected] | a3ef483 | 2013-02-02 05:12:33 | [diff] [blame] | 16 | } |
[email protected] | 9af13ce | 2010-09-16 21:45:48 | [diff] [blame] | 17 | |
David Benjamin | 76ee79eb | 2019-03-15 17:02:09 | [diff] [blame] | 18 | // Modifies |map| to use the specified Python path. |
19 | void SetPythonPathInEnvironment(const std::vector<base::FilePath>& python_path, | ||||
20 | base::EnvironmentMap* map); | ||||
[email protected] | 9af13ce | 2010-09-16 21:45:48 | [diff] [blame] | 21 | |
[email protected] | 813e9cd1 | 2010-11-09 21:49:40 | [diff] [blame] | 22 | // Return the location of the compiler-generated python protobuf. |
[email protected] | a3ef483 | 2013-02-02 05:12:33 | [diff] [blame] | 23 | bool GetPyProtoPath(base::FilePath* dir); |
[email protected] | 813e9cd1 | 2010-11-09 21:49:40 | [diff] [blame] | 24 | |
mbjorge | 49e77410 | 2016-11-28 22:31:23 | [diff] [blame] | 25 | // Returns if a virtualenv is currently active. |
26 | bool IsInPythonVirtualEnv(); | ||||
27 | |||||
[email protected] | 2bbc7f2 | 2012-09-12 21:53:15 | [diff] [blame] | 28 | // Returns the command that should be used to launch Python. |
[email protected] | 2f3b1cc | 2014-03-17 23:07:15 | [diff] [blame] | 29 | bool GetPythonCommand(base::CommandLine* python_cmd) WARN_UNUSED_RESULT; |
[email protected] | 9af13ce | 2010-09-16 21:45:48 | [diff] [blame] | 30 | |
31 | #endif // NET_TEST_PYTHON_UTILS_H_ |