Package qupath.ext.biop.cmd
Class VirtualEnvironmentRunner
- java.lang.Object
-
- qupath.ext.biop.cmd.VirtualEnvironmentRunner
-
public class VirtualEnvironmentRunner extends java.lang.Object
A wrapper to run python virtualenvs, that tries to figure out the commands to run based on the environment type
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VirtualEnvironmentRunner.EnvType
This enum helps us figure out the type of virtualenv.
-
Constructor Summary
Constructors Constructor Description VirtualEnvironmentRunner(java.lang.String environmentNameOrPath, VirtualEnvironmentRunner.EnvType type, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
runCommand()
This builds, runs the command and outputs it to the logger as it is being runvoid
setArguments(java.util.List<java.lang.String> arguments)
This is the code you actually want to run after 'python'.
-
-
-
Constructor Detail
-
VirtualEnvironmentRunner
public VirtualEnvironmentRunner(java.lang.String environmentNameOrPath, VirtualEnvironmentRunner.EnvType type, java.lang.String name)
-
-
Method Detail
-
setArguments
public void setArguments(java.util.List<java.lang.String> arguments)
This is the code you actually want to run after 'python'. For example addingArrays.asList("--version")
should return the version of python that is being run.- Parameters:
arguments
-
-
runCommand
public java.lang.String[] runCommand() throws java.io.IOException, java.lang.InterruptedException
This builds, runs the command and outputs it to the logger as it is being run- Returns:
- a string list containing the log of the command
- Throws:
java.io.IOException
- // In case there is an issue starting the processjava.lang.InterruptedException
- // In case there is an issue after the process is started
-
-