class documentation

class Platform: (source)

View In Hierarchy

Gives us information about the platform we're running on.
Method __init__ Undocumented
Method get​Type Get platform type.
Method is​Docker Check if the current platform is Linux in a Docker container.
Method is​Known Do we know about this platform?
Method is​Linux Check if current platform is Linux.
Method is​Mac​OSX Check if current platform is macOS.
Method is​Vista Check if current platform is Windows Vista or Windows Server 2008.
Method is​Windows Are we running in Windows?
Method is​Win​NT Are we running in Windows NT?
Method supports​INotify Return True if we can use the inotify API on this platform.
Method supports​Threads Can threads be created?
Instance Variable seconds Undocumented
Instance Variable type Undocumented
Method _supports​Symlinks Check for symlink support usable for Twisted's purposes.
Instance Variable _platform Undocumented
def __init__(self, name=None, platform=None): (source)

Undocumented

Parameters
name:Optional[str]Undocumented
platform:Optional[str]Undocumented
def getType(self): (source)
Get platform type.
Returns
Optional[str]Either 'posix', 'win32' or 'java'
def isDocker(self, _initCGroupLocation='/proc/1/cgroup'): (source)
Check if the current platform is Linux in a Docker container.
Parameters
_init​CGroup​Location:strUndocumented
Returns
boolTrue if the current platform has been detected as Linux inside a Docker container.
def isKnown(self): (source)
Do we know about this platform?
Returns
boolBoolean indicating whether this is a known platform or not.
def isLinux(self): (source)
Check if current platform is Linux.
Returns
boolTrue if the current platform has been detected as Linux.
def isMacOSX(self): (source)
Check if current platform is macOS.
Returns
boolTrue if the current platform has been detected as macOS.
def isVista(self): (source)
Check if current platform is Windows Vista or Windows Server 2008.
Returns
boolTrue if the current platform has been detected as Vista
def isWindows(self): (source)
Are we running in Windows?
Returns
boolTrue if the current platform has been detected as Windows.
def isWinNT(self): (source)

Are we running in Windows NT?

This is deprecated and always returns True on win32 because Twisted only supports Windows NT-derived platforms at this point.

Returns
boolTrue if the current platform has been detected as Windows NT.
def supportsINotify(self): (source)
Return True if we can use the inotify API on this platform.
Returns
boolUndocumented
Present Since
10.1
def supportsThreads(self): (source)
Can threads be created?
Returns
boolTrue if the threads are supported on the current platform.
seconds = (source)

Undocumented

type = (source)

Undocumented

def _supportsSymlinks(self): (source)
Check for symlink support usable for Twisted's purposes.
Returns
boolTrue if symlinks are supported on the current platform, otherwise False.
_platform = (source)

Undocumented