utils

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2021 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const OS = runtime.GOOS

Variables

This section is empty.

Functions

func ClearLastMessage

func ClearLastMessage(length int)

clear last message, by set character at start position and send null strings

func ClearVersion

func ClearVersion(version string) string

func CompareExpression

func CompareExpression(exp, libDir string) (bool, error)

func CompareVersion

func CompareVersion(a, operator, b string) (bool, error)
compare <a> <operator> <b> and return bool result

For example: ("4.0.0a", "<=", "4.0.0") = (400, "<=", 400) => true WARNING: Letters are also integers, starts with 1

func FindMinValue

func FindMinValue(values []int) int

func FindPythonLibDirectory

func FindPythonLibDirectory() string

select one dir without version

func FormatName

func FormatName(dirName string) string

format name for correct search

func GetAllPackageDirs

func GetAllPackageDirs(pkgName, libDir string) []string

func GetDirSize

func GetDirSize(path string) int64

Count size of all files in directory and return bytes

func GetFirstPackageMetaDir

func GetFirstPackageMetaDir(libDir, pkgName string) string

func GetOffsetString

func GetOffsetString(offset int) string

func GetPythonBinDirectory

func GetPythonBinDirectory(version string) string

func GetPythonVersion

func GetPythonVersion(libDir string) string

python_version

func GetSysPlatform

func GetSysPlatform() string

sys_platform

func ParseDirectoryName

func ParseDirectoryName(dirName string) (string, string, string)

Returns name, version, format

func ParseFormat

func ParseFormat(dir string) string

func ParseOptions

func ParseOptions(args []string) ([]string, int)

Parse first arguments and returns options and position where options end

func ParsePythonVersion

func ParsePythonVersion(path string) string

func SelectOneDirectory

func SelectOneDirectory(baseDir string, versions []string) string

func ShowChoices

func ShowChoices(values []string) string

print beauty list of values and returns user choice

func ShowInput

func ShowInput(text string) string

func SplitOperators

func SplitOperators(name string) (string, [][]string)

Split name, operator and version. Returns [][]string{operator, version} if operator was split successful

Types

This section is empty.

Jump to

Keyboard shortcuts

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