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
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 given Bitness enumeration value. |
|
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. |
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
wx.
PlatformInformation
(object)¶PlatformInfo() PlatformInfo(pid, tkMajor=-1, tkMinor=-1, id=OS_UNKNOWN, osMajor=-1, osMinor=-1, bitness=BITNESS_INVALID, endian=ENDIAN_INVALID)
This class holds information about the operating system, the toolkit and the basic architecture bitness of the machine where the application is currently running.
__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.
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.
pid (PortId) –
tkMajor (int) –
tkMinor (int) –
id (OperatingSystemId) –
osMajor (int) –
osMinor (int) –
bitness (Bitness) –
endian (Endianness) –
CheckOSVersion
(self, major, minor, micro=0)¶Returns True
if the OS version is at least major.minor.micro
.
major (int) –
minor (int) –
micro (int) –
bool
See also
GetOSMajorVersion
, GetOSMinorVersion
, GetOSMicroVersion
, CheckToolkitVersion
CheckToolkitVersion
(self, major, minor, micro=0)¶Returns True
if the toolkit version is at least major.minor.micro
.
major (int) –
minor (int) –
micro (int) –
bool
Get
()¶Returns the global PlatformInfo object, initialized with the values for the currently running platform.
PlatformInfo
GetArch
(arch)¶arch (string) –
Deprecated
Use GetBitness
instead.
GetArchName
(self)¶string
Deprecated
Use GetBitnessName
instead.
GetArchitecture
(self)¶Deprecated
Use GetBitness
instead.
GetBitness
(self)¶Returns the architecture bitness ID
of this PlatformInfo instance.
New in version 4.1/wxWidgets-3.1.5.
GetBitnessName
(*args, **kw)¶GetBitnessName (bitness)
Returns the name for the given Bitness enumeration value.
bitness (Bitness) –
string
New in version 4.1/wxWidgets-3.1.5.
GetBitnessName (self)
Returns the name for the architecture bitness of this PlatformInfo instance.
string
New in version 4.1/wxWidgets-3.1.5.
GetCpuArchitectureName
(self)¶Returns the CPU
architecture name, if available.
string
New 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.
string
GetEndianness
(self)¶Returns the endianness ID
of this PlatformInfo instance.
GetEndiannessName
(self)¶Returns the name for the endianness of this PlatformInfo instance.
string
GetLinuxDistributionInfo
(self)¶Returns the Linux distribution info associated with this PlatformInfo instance.
See wx.GetLinuxDistributionInfo for more info.
GetNativeCpuArchitectureName
(self)¶Returns the native CPU
architecture name, if available.
string
New in version 4.1/wxWidgets-3.1.6.
GetOSMajorVersion
(self)¶Returns the run-time major version of the OS associated with this PlatformInfo instance.
int
See also
GetOSMicroVersion
(self)¶Returns the run-time micro version of the OS associated with this PlatformInfo instance.
int
New 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.
int
See also
GetOperatingSystemDescription
(self)¶Returns the description of the operating system of this PlatformInfo instance.
See wx.GetOsDescription
for more info.
string
GetOperatingSystemDirectory
()¶Returns the operating system directory.
See GetOSDirectory
for more info.
string
GetOperatingSystemFamilyName
(self)¶Returns the operating system family name of the OS associated with this PlatformInfo instance.
string
GetOperatingSystemId
(self)¶Returns the operating system ID
of this PlatformInfo instance.
See wx.GetOsVersion
for more info.
GetOperatingSystemIdName
(self)¶Returns the operating system name of the OS associated with this PlatformInfo instance.
string
GetPortId
(self)¶Returns the wxWidgets port ID
associated with this PlatformInfo instance.
GetPortIdName
(self)¶Returns the name of the wxWidgets port ID
associated with this PlatformInfo instance.
string
GetPortIdShortName
(self)¶Returns the short name of the wxWidgets port ID
associated with this PlatformInfo instance.
string
GetToolkitMajorVersion
(self)¶Returns the run-time major version of the toolkit associated with this PlatformInfo instance.
Note that if GetPortId
returns PORT_BASE
, then this value is zero (unless externally modified with SetToolkitVersion
); that is, no native toolkit is in use. See wx.AppTraits.GetToolkitVersion
for more info.
int
See also
GetToolkitMicroVersion
(self)¶Returns the run-time micro version of the toolkit associated with this PlatformInfo instance.
Note that if GetPortId
returns PORT_BASE
, then this value is zero (unless externally modified with SetToolkitVersion
); that is, no native toolkit is in use. See wx.AppTraits.GetToolkitVersion
for more info.
int
New 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
returns PORT_BASE
, then this value is zero (unless externally modified with SetToolkitVersion
); that is, no native toolkit is in use. See wx.AppTraits.GetToolkitVersion
for more info.
int
See also
IsOk
(self)¶Returns True
if this instance is fully initialized with valid values.
bool
IsUsingUniversalWidgets
(self)¶Returns True
if this PlatformInfo describes wxUniversal build.
bool
SetArchitecture
(self, n)¶n (Architecture) –
Deprecated
Use SetBitness
instead.
SetBitness
(self, n)¶Sets the architecture bitness enum value associated with this PlatformInfo instance.
n (Bitness) –
New in version 4.1/wxWidgets-3.1.5.
SetDesktopEnvironment
(self, de)¶Sets the desktop environment associated with this PlatformInfo instance.
de (string) –
SetEndianness
(self, n)¶Sets the endianness enum value associated with this PlatformInfo instance.
n (Endianness) –
SetLinuxDistributionInfo
(self, di)¶Sets the linux distribution info associated with this PlatformInfo instance.
di (wx.LinuxDistributionInfo) –
SetOSVersion
(self, major, minor, micro=0)¶Sets the version of the operating system associated with this PlatformInfo instance.
major (int) –
minor (int) –
micro (int) –
SetOperatingSystemDescription
(self, desc)¶Sets the operating system description associated with this PlatformInfo instance.
desc (string) –
SetOperatingSystemId
(self, n)¶Sets the operating system associated with this PlatformInfo instance.
n (OperatingSystemId) –
SetPortId
(self, n)¶Sets the wxWidgets port ID
associated with this PlatformInfo instance.
n (PortId) –
SetToolkitVersion
(self, major, minor, micro=0)¶Sets the version of the toolkit associated with this PlatformInfo instance.
major (int) –
minor (int) –
micro (int) –
__ne__
(self)¶Inequality operator.
Tests all class’ internal variables.
t (PlatformInfo) –
__eq__
(self)¶Equality operator.
Tests all class’ internal variables.
t (PlatformInfo) –
ArchName
¶See GetArchName
Architecture
¶See GetArchitecture
and SetArchitecture
Bitness
¶See GetBitness
and SetBitness
BitnessName
¶See GetBitnessName
CpuArchitectureName
¶DesktopEnvironment
¶Endianness
¶See GetEndianness
and SetEndianness
EndiannessName
¶LinuxDistributionInfo
¶NativeCpuArchitectureName
¶OSMajorVersion
¶OSMicroVersion
¶OSMinorVersion
¶OperatingSystemDescription
¶See GetOperatingSystemDescription
and SetOperatingSystemDescription
OperatingSystemFamilyName
¶OperatingSystemId
¶OperatingSystemIdName
¶PortIdName
¶See GetPortIdName
PortIdShortName
¶ToolkitMajorVersion
¶ToolkitMicroVersion
¶ToolkitMinorVersion
¶