wx.PlatformInformation¶
This class holds information about the operating system, the toolkit and the basic architecture bitness of the machine where the application is currently running.
This class does not only have getters for the information above, it also has setters. This allows you to e.g. save the current platform information in a data file (maybe in string form) so that when you later load it, you can easily retrieve (see the static getters for string.enum conversion functions) and store inside a PlatformInfo instance (using its setters) the signature of the system which generated it.
In general however you only need to use the static Get
function and then access the various information for the current platform:
wx.LogMessage("This application is running under %s." % wx.PlatformInformation.Get().GetOperatingSystemIdName())
See also
wx.GetOsVersion
, wx.IsPlatformLittleEndian
, wx.IsPlatform64Bit
, wx.AppTraits, Network, User and OS
Class Hierarchy¶
Methods Summary¶
Initializes the instance with the values corresponding to the currently running platform. |
|
Returns |
|
Returns |
|
Returns the global PlatformInfo object, initialized with the values for the currently running platform. |
|
Returns the architecture bitness |
|
Returns the name for the architecture bitness of this PlatformInfo instance. |
|
Returns the |
|
Returns the desktop environment associated with this PlatformInfo instance. |
|
Returns the endianness |
|
Returns the name for the endianness of this PlatformInfo instance. |
|
Returns the Linux distribution info associated with this PlatformInfo instance. |
|
Returns the native |
|
Returns the run-time major version of the OS associated with this PlatformInfo instance. |
|
Returns the run-time micro version of the OS associated with this PlatformInfo instance. |
|
Returns the run-time minor version of the OS associated with this PlatformInfo instance. |
|
Returns the description of the operating system of this PlatformInfo instance. |
|
Returns the operating system directory. |
|
Returns the operating system family name of the OS associated with this PlatformInfo instance. |
|
Returns the operating system |
|
Returns the operating system name of the OS associated with this PlatformInfo instance. |
|
Returns the wxWidgets port |
|
Returns the name of the wxWidgets port |
|
Returns the short name of the wxWidgets port |
|
Returns the run-time major version of the toolkit associated with this PlatformInfo instance. |
|
Returns the run-time micro version of the toolkit associated with this PlatformInfo instance. |
|
Returns the run-time minor version of the toolkit associated with this PlatformInfo instance. |
|
Returns |
|
Returns |
|
Sets the architecture bitness enum value associated with this PlatformInfo instance. |
|
Sets the desktop environment associated with this PlatformInfo instance. |
|
Sets the endianness enum value associated with this PlatformInfo instance. |
|
Sets the linux distribution info associated with this PlatformInfo instance. |
|
Sets the version of the operating system associated with this PlatformInfo instance. |
|
Sets the operating system description associated with this PlatformInfo instance. |
|
Sets the operating system associated with this PlatformInfo instance. |
|
Sets the wxWidgets port |
|
Sets the version of the toolkit associated with this PlatformInfo instance. |
|
Inequality operator. |
|
Equality operator. |
Properties Summary¶
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
Class API¶
- class wx.PlatformInformation(object)¶
PlatformInfo() . None PlatformInfo(pid, tkMajor=-1, tkMinor=-1, id=OS_UNKNOWN, osMajor=-1, osMinor=-1, bitness=BITNESS_INVALID, endian=ENDIAN_INVALID) . None
This class holds information about the operating system, the toolkit and the basic architecture bitness of the machine where the application is currently running.
Methods¶
- __init__(self, *args, **kw)¶
-
__init__ (self)
Initializes the instance with the values corresponding to the currently running platform.
This is a fast operation because it only requires to copy the values internally cached for the currently running platform.
- Return type:
None
See also
__init__ (self, pid, tkMajor=-1, tkMinor=-1, id=OS_UNKNOWN, osMajor=-1, osMinor=-1, bitness=BITNESS_INVALID, endian=ENDIAN_INVALID)
Initializes the object using given values.
- Parameters:
pid (PortId)
tkMajor (int)
tkMinor (int)
id (OperatingSystemId)
osMajor (int)
osMinor (int)
bitness (Bitness)
endian (Endianness)
- Return type:
None
- CheckOSVersion(self, major, minor, micro=0)¶
Returns
True
if the OS version is at leastmajor.minor.micro
.- Parameters:
major (int)
minor (int)
micro (int)
- Return type:
bool
See also
GetOSMajorVersion
,GetOSMinorVersion
,GetOSMicroVersion
,CheckToolkitVersion
- CheckToolkitVersion(self, major, minor, micro=0)¶
Returns
True
if the toolkit version is at leastmajor.minor.micro
.- Parameters:
major (int)
minor (int)
micro (int)
- Return type:
bool
- static Get()¶
Returns the global PlatformInfo object, initialized with the values for the currently running platform.
- Return type:
PlatformInfo
- static GetArch(arch)¶
- Parameters:
arch (string)
- Return type:
Deprecated
Use
GetBitness
instead.
- GetArchName(self)¶
- Return type:
str
Deprecated
Use
GetBitnessName
instead.
- GetArchitecture(self)¶
- Return type:
Deprecated
Use
GetBitness
instead.
- GetBitness(self)¶
Returns the architecture bitness
ID
of this PlatformInfo instance.- Return type:
Added in version 4.1/wxWidgets-3.1.5.
- GetBitnessName(self, *args, **kw)¶
-
GetBitnessName (self)
Returns the name for the architecture bitness of this PlatformInfo instance.
- Return type:
str
Added in version 4.1/wxWidgets-3.1.5.
GetBitnessName (bitness)
Returns the name for the given Bitness enumeration value.
- Parameters:
bitness (Bitness)
- Return type:
str
Added in version 4.1/wxWidgets-3.1.5.
- GetCpuArchitectureName(self)¶
Returns the
CPU
architecture name, if available.- Return type:
str
Added in version 4.1/wxWidgets-3.1.5.
- GetDesktopEnvironment(self)¶
Returns the desktop environment associated with this PlatformInfo instance.
See
wx.AppTraits.GetDesktopEnvironment
for more info.- Return type:
str
- GetEndianness(self)¶
Returns the endianness
ID
of this PlatformInfo instance.- Return type:
- GetEndiannessName(self)¶
Returns the name for the endianness of this PlatformInfo instance.
- Return type:
str
- GetLinuxDistributionInfo(self)¶
Returns the Linux distribution info associated with this PlatformInfo instance.
See wx.GetLinuxDistributionInfo for more info.
- Return type:
- GetNativeCpuArchitectureName(self)¶
Returns the native
CPU
architecture name, if available.- Return type:
str
Added in version 4.1/wxWidgets-3.1.6.
- GetOSMajorVersion(self)¶
Returns the run-time major version of the OS associated with this PlatformInfo instance.
- Return type:
int
See also
- GetOSMicroVersion(self)¶
Returns the run-time micro version of the OS associated with this PlatformInfo instance.
- Return type:
int
Added in version 4.1/wxWidgets-3.1.1.
See also
- GetOSMinorVersion(self)¶
Returns the run-time minor version of the OS associated with this PlatformInfo instance.
- Return type:
int
See also
- GetOperatingSystemDescription(self)¶
Returns the description of the operating system of this PlatformInfo instance.
See
wx.GetOsDescription
for more info.- Return type:
str
- static GetOperatingSystemDirectory()¶
Returns the operating system directory.
See
GetOSDirectory
for more info.- Return type:
str
- GetOperatingSystemFamilyName(self)¶
Returns the operating system family name of the OS associated with this PlatformInfo instance.
- Return type:
str
- GetOperatingSystemId(self)¶
Returns the operating system
ID
of this PlatformInfo instance.See
wx.GetOsVersion
for more info.- Return type:
- GetOperatingSystemIdName(self)¶
Returns the operating system name of the OS associated with this PlatformInfo instance.
- Return type:
str
- GetPortId(self)¶
Returns the wxWidgets port
ID
associated with this PlatformInfo instance.- Return type:
- GetPortIdName(self)¶
Returns the name of the wxWidgets port
ID
associated with this PlatformInfo instance.- Return type:
str
- GetPortIdShortName(self)¶
Returns the short name of the wxWidgets port
ID
associated with this PlatformInfo instance.- Return type:
str
- GetToolkitMajorVersion(self)¶
Returns the run-time major version of the toolkit associated with this PlatformInfo instance.
Note that if
GetPortId
returnsPORT_BASE
, then this value is zero (unless externally modified withSetToolkitVersion
); that is, no native toolkit is in use. Seewx.AppTraits.GetToolkitVersion
for more info.- Return type:
int
See also
- GetToolkitMicroVersion(self)¶
Returns the run-time micro version of the toolkit associated with this PlatformInfo instance.
Note that if
GetPortId
returnsPORT_BASE
, then this value is zero (unless externally modified withSetToolkitVersion
); that is, no native toolkit is in use. Seewx.AppTraits.GetToolkitVersion
for more info.- Return type:
int
Added in version 4.1/wxWidgets-3.1.1.
See also
- GetToolkitMinorVersion(self)¶
Returns the run-time minor version of the toolkit associated with this PlatformInfo instance.
Note that if
GetPortId
returnsPORT_BASE
, then this value is zero (unless externally modified withSetToolkitVersion
); that is, no native toolkit is in use. Seewx.AppTraits.GetToolkitVersion
for more info.- Return type:
int
See also
- IsOk(self)¶
Returns
True
if this instance is fully initialized with valid values.- Return type:
bool
- IsUsingUniversalWidgets(self)¶
Returns
True
if this PlatformInfo describes wxUniversal build.- Return type:
bool
- SetArchitecture(self, n)¶
- Parameters:
n (Architecture)
- Return type:
None
Deprecated
Use
SetBitness
instead.
- SetBitness(self, n)¶
Sets the architecture bitness enum value associated with this PlatformInfo instance.
- Parameters:
n (Bitness)
- Return type:
None
Added in version 4.1/wxWidgets-3.1.5.
- SetDesktopEnvironment(self, de)¶
Sets the desktop environment associated with this PlatformInfo instance.
- Parameters:
de (string)
- Return type:
None
- SetEndianness(self, n)¶
Sets the endianness enum value associated with this PlatformInfo instance.
- Parameters:
n (Endianness)
- Return type:
None
- SetLinuxDistributionInfo(self, di)¶
Sets the linux distribution info associated with this PlatformInfo instance.
- Parameters:
- Return type:
None
- SetOSVersion(self, major, minor, micro=0)¶
Sets the version of the operating system associated with this PlatformInfo instance.
- Parameters:
major (int)
minor (int)
micro (int)
- Return type:
None
- SetOperatingSystemDescription(self, desc)¶
Sets the operating system description associated with this PlatformInfo instance.
- Parameters:
desc (string)
- Return type:
None
- SetOperatingSystemId(self, n)¶
Sets the operating system associated with this PlatformInfo instance.
- Parameters:
- Return type:
None
- SetPortId(self, n)¶
Sets the wxWidgets port
ID
associated with this PlatformInfo instance.- Parameters:
n (PortId)
- Return type:
None
- SetToolkitVersion(self, major, minor, micro=0)¶
Sets the version of the toolkit associated with this PlatformInfo instance.
- Parameters:
major (int)
minor (int)
micro (int)
- Return type:
None
- __ne__(self, t)¶
Inequality operator.
Tests all class’ internal variables.
- Parameters:
t (PlatformInfo)
- Return type:
bool
- __eq__(self, t)¶
Equality operator.
Tests all class’ internal variables.
- Parameters:
t (PlatformInfo)
- Return type:
bool
Properties¶
- ArchName¶
See
GetArchName
- Architecture¶
See
GetArchitecture
andSetArchitecture
- Bitness¶
See
GetBitness
andSetBitness
- BitnessName¶
See
GetBitnessName
- CpuArchitectureName¶
- DesktopEnvironment¶
- Endianness¶
See
GetEndianness
andSetEndianness
- EndiannessName¶
- LinuxDistributionInfo¶
- NativeCpuArchitectureName¶
- OSMajorVersion¶
- OSMicroVersion¶
- OSMinorVersion¶
- OperatingSystemDescription¶
See
GetOperatingSystemDescription
andSetOperatingSystemDescription
- OperatingSystemFamilyName¶
- OperatingSystemId¶
- OperatingSystemIdName¶
- PortIdName¶
See
GetPortIdName
- PortIdShortName¶
- ToolkitMajorVersion¶
- ToolkitMicroVersion¶
- ToolkitMinorVersion¶