Top Description Fields Constructors Methods
org.python.modules.posix

pack-priv final Enum OS

extends Enum<OS>
Class Inheritance
Imports
java.util.Locale, org.python.core.Options, .PySystemState, .RegistryKey

A Marker tagging what OS we're running on, with some accompanying information about that platform.

Field Summary

Modifier and TypeField and Description
public static final OS
public static final OS
private final String
pattern

Name to match against os.name System property for identification (os.name.startswith(pattern)).

public static final OS
private final String[][]
shellCommands

An array of potential shell commands this platform may use.

Constructor Summary

AccessConstructor and Description
private
OS(String pattern, String[]... shellCommands)

private
OS(String[]... shellCommands)

Method Summary

Modifier and TypeMethod and Description
private static String

Returns:

the corresponding value or defaultValue.
getenv
(String
to access in the environment.
name
,
String
to return if name is not defined or "" or access is forbidden.
defaultValue
)

Get the value of an environment variable, or return the given default if the variable is undefined or the security environment prevents access.

pack-priv String
pack-priv static OS
getOS()

Return the OS we're running on.

pack-priv String[][]
public static OS
public static OS[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

IBMiback to summary
public static final OS IBMi
NTback to summary
public static final OS NT
patternback to summary
private final String pattern

Name to match against os.name System property for identification (os.name.startswith(pattern)). Defaults to name().

POSIXback to summary
public static final OS POSIX
shellCommandsback to summary
private final String[][] shellCommands

An array of potential shell commands this platform may use.

Constructor Detail

OSback to summary
private OS(String pattern, String[]... shellCommands)
OSback to summary
private OS(String[]... shellCommands)

Method Detail

getenvback to summary
private static String getenv(String name, String defaultValue)

Get the value of an environment variable, or return the given default if the variable is undefined or the security environment prevents access. An empty string value from the environment is treated as undefined.

This accesses the read-only Java copy of the system environment directly, not os.environ so that it is safe to use before the os module is available.

Parameters
name:String

to access in the environment.

defaultValue:String

to return if name is not defined or "" or access is forbidden.

Returns:String

the corresponding value or defaultValue.

getModuleNameback to summary
pack-priv String getModuleName()
getOSback to summary
pack-priv static OS getOS()

Return the OS we're running on.

getShellCommandsback to summary
pack-priv String[][] getShellCommands()
valueOfback to summary
public static OS valueOf(String name)
valuesback to summary
public static OS[] values()