-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18b051e
commit f677a15
Showing
18 changed files
with
518 additions
and
586 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# CyderUtils | ||
|
||
## A Java utility library | ||
|
||
# At one point all sound cards were working but Gradle got in the way somehow: https://github.com/NathanCheshire/CyderUtils/actions/runs/9733328552 | ||
At one point all sound cards were working but Gradle got in the way somehow: https://github.com/NathanCheshire/CyderUtils/actions/runs/9733328552 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,9 @@ dreamifies | |
dreamifying | ||
dreamifier | ||
ffmpeg | ||
lowpass | ||
lowpass | ||
cyder | ||
cyderutils | ||
natche | ||
nathancheshire | ||
nightcore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
src/main/java/com/github/natche/cyderutils/process/PevProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.github.natche.cyderutils.process; | ||
|
||
import com.google.common.base.Preconditions; | ||
|
||
import java.io.File; | ||
|
||
/** The standard {@link PythonVirtualEnvironment} provider for use throughout Cyder. */ | ||
public enum PevProvider { | ||
/** The {@link PythonVirtualEnvironment} provider instance. */ | ||
INSTANCE; | ||
|
||
/** | ||
* The environment variable used to register the default {@link PythonVirtualEnvironment} | ||
* used by Cyder. This environment variable must point to a valid executable for this | ||
* provider to not throw when {@link #getProvider()} is invoked. | ||
*/ | ||
public static final String CYDER_PYTHON_EXECUTABLE_PATH = "CYDER_PYTHON_EXECUTABLE_PATH"; | ||
|
||
/** The encapsulated provider instance. */ | ||
private final PythonVirtualEnvironment provider; | ||
|
||
PevProvider() { | ||
String cyderPythonExecutablePath = System.getenv(CYDER_PYTHON_EXECUTABLE_PATH); | ||
File file = new File(cyderPythonExecutablePath); | ||
|
||
PythonVirtualEnvironment localProvider; | ||
|
||
try { | ||
localProvider = PythonVirtualEnvironment.from(file); | ||
} catch (Exception ignored) { | ||
localProvider = null; | ||
} | ||
|
||
this.provider = localProvider; | ||
} | ||
|
||
/** | ||
* Returns the provider instance. | ||
* This object is created at runtime via the environment variable pointed to be | ||
* {@link #CYDER_PYTHON_EXECUTABLE_PATH}. This method will throw if this variable is not | ||
* present in the system or points to an invalid binary/executable. | ||
* | ||
* @return the provider instance | ||
* @throws CyderProcessException if the provider is not available | ||
*/ | ||
public PythonVirtualEnvironment getProvider() { | ||
Preconditions.checkState(provider != null); | ||
return provider; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 0 additions & 66 deletions
66
src/main/java/com/github/natche/cyderutils/process/PythonPackage.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.