languages

package
v0.0.42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendIfMissing

func AppendIfMissing(slice []string, s string) []string

AppendIfMissing Append to a string slice only if the string is not yet in the slice

func CheckAndSetRSymlinks(rPath string) error

func CheckIfPythonProfileDExists

func CheckIfPythonProfileDExists() bool

func CheckIfRSymlinkExists

func CheckIfRSymlinkExists() bool

CheckIfRSymlinkExists checks if the R symlink exists

func CheckIfRscriptSymlinkExists

func CheckIfRscriptSymlinkExists() bool

CheckIfRscriptSymlinkExists checks if the Rscript symlink exists

func CheckPromptAndSetPythonPATH

func CheckPromptAndSetPythonPATH(pythonPaths []string) error

CheckPromptAndSetPythonPATH prompts user to set Python PATH

func CheckPromtAndSetRSymlinks(rPaths []string) error

func ConvertStringSliceToVersionSlice added in v0.0.7

func ConvertStringSliceToVersionSlice(strings []string) ([]*version.Version, error)

func ConvertVersionSliceToStringSlice added in v0.0.7

func ConvertVersionSliceToStringSlice(versions []*version.Version) []string

func DownloadAndInstallPython

func DownloadAndInstallPython(pythonVersion string, osType config.OperatingSystem) error

DownloadAndInstallPython Downloads the Python installer, and installs Python

func DownloadAndInstallR

func DownloadAndInstallR(rVersion string, osType config.OperatingSystem) error

DownloadAndInstallR Downloads the R installer, and installs R

func GetPythonPaths

func GetPythonPaths() []string

GetPythonPaths returns the paths workbench will look for Python underneath the root directories with the format /root/{pythonVersion}/bin/python

func GetPythonRootDirs

func GetPythonRootDirs() []string

GetPythonRootDirs returns the root directories for Python

func GetRPaths

func GetRPaths() []string

GetRPaths returns the paths workbench will look for R underneath the root directories with the format /root/{rversion}/bin/R

func GetRRootDirs

func GetRRootDirs() []string

GetRRootDirs returns the root directories for R

func PromptAndInstallPython

func PromptAndInstallPython(osType config.OperatingSystem) ([]string, error)

PromptAndInstallPython Prompts user if they want to install Python and does the installation

func PromptAndInstallR

func PromptAndInstallR(osType config.OperatingSystem) ([]string, error)

PromptAndInstallR Prompts user if they want to install R and does the installation

func PromptAndRespond

func PromptAndRespond() ([]string, error)

Prompt asking users which languages they will use

func PromptAndSetRSymlinks(rPaths []string) error

PromptAndSetRSymlinks prompts user to set R symlinks

func PythonInstallPrompt

func PythonInstallPrompt() (bool, error)

PythonInstallPrompt Prompt users if they would like to install Python versions

func PythonLocationPATHPrompt

func PythonLocationPATHPrompt(pythonPaths []string) (string, error)

PythonLocationPATHPrompt asks users which Python binary they want to add to PATH

func PythonPATHPrompt

func PythonPATHPrompt() (bool, error)

PythonPATHPrompt asks users if they would like to set Python PATH

func PythonSelectVersionsPrompt

func PythonSelectVersionsPrompt(availablePythonVersions []string) ([]string, error)

PythonSelectVersionsPrompt Prompt asking users which Python version(s) they would like to install

func RInstallPrompt

func RInstallPrompt() (bool, error)

RInstallPrompt Prompt users if they would like to install R versions

func RLocationSymlinksPrompt

func RLocationSymlinksPrompt(rPaths []string) (string, error)

RLocationSymlinksPrompt asks users which R binary they want to symlink

func RSelectVersionsPrompt

func RSelectVersionsPrompt(availableRVersions []string) ([]string, error)

RSelectVersionsPrompt Prompt asking users which R version(s) they would like to install

func RSymlinkPrompt

func RSymlinkPrompt() (bool, error)

RSymlinkPrompt asks users if they would like to set R symlinks

func RemovePythonFromPath

func RemovePythonFromPath(pythonPath string) (string, error)

RemovePythonFromPath removes python or python3 from the end of a path so the directory can be used

func RemovePythonFromPathSlice

func RemovePythonFromPathSlice(pythonPaths []string) ([]string, error)

RemovePythonFromPathSlice removes python or python3 from the end of a set of path strings in a slice so the directories can be used

func RemoveSystemRPaths

func RemoveSystemRPaths(rPaths []string) []string

RemoveSystemRPaths removes the system R paths from string slice

func RetrieveValidPythonVersions

func RetrieveValidPythonVersions(osType config.OperatingSystem) ([]string, error)

func RetrieveValidRVersions

func RetrieveValidRVersions() ([]string, error)

func ScanAndHandlePythonVersions

func ScanAndHandlePythonVersions(osType config.OperatingSystem) error

ScanAndHandlePythonVersions scans for Python versions, handles result/errors and creates PythonConfig

func ScanAndHandleRVersions

func ScanAndHandleRVersions(osType config.OperatingSystem) error

ScanAndHandleRVersions scans for R versions, handles result/errors and creates RConfig

func ScanForPythonVersions

func ScanForPythonVersions() ([]string, error)

ScanForPythonVersions scans for Python versions in locations workbench will also look

func ScanForRVersions

func ScanForRVersions() ([]string, error)

ScanForRVersions scans for R versions in locations workbench will also look

func SetRSymlinks(rPath string) error

SetRSymlinks sets the R symlinks (both R and Rscript)

func SortVersionsDesc added in v0.0.7

func SortVersionsDesc(versions []*version.Version) []*version.Version

func UpgradePythonTools

func UpgradePythonTools(pythonVersion string) error

func ValidatePythonVersions

func ValidatePythonVersions(pythonVersions []string, osType config.OperatingSystem) error

func ValidateRVersions

func ValidateRVersions(rVersions []string) error

Types

type InstallerInfo

type InstallerInfo struct {
	Name    string
	URL     string
	Version string
}

InstallerInfo contains the information needed to download and install R and Python

func PopulateInstallerInfo

func PopulateInstallerInfo(language string, version string, osType config.OperatingSystem) (InstallerInfo, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL