This class holds informations about the operating system, the toolkit and the basic architecture of the machine where the application is currently running.
This class does not only have getters for the informations above, it also has setters. This allows you to e.g. save the current platform informations 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 informations for the current platform:
wx.LogMessage("This application is running under %s." % wx.PlatformInfo.Get().GetOperatingSystemIdName())
See also
GetOsVersion, IsPlatformLittleEndian, IsPlatform64Bit, AppTraits,
__init__ | Initializes the instance with the values corresponding to the currently running platform. |
CheckOSVersion | Returns True if the OS version is at least major.minor . |
CheckToolkitVersion | Returns True if the toolkit version is at least major.minor . |
Get | Returns the global PlatformInfo object, initialized with the values for the currently running platform. |
GetArch | Converts the given string to a Architecture enum value or to ARCH_INVALID if the given string is not a valid architecture string (i.e. |
GetArchName | Returns the name for the architecture of this PlatformInfo instance. |
GetArchitecture | Returns the architecture ID of this PlatformInfo instance. |
GetDesktopEnvironment | Returns the desktop environment associated with this PlatformInfo instance. |
GetEndianness | Returns the endianness ID of this PlatformInfo instance. |
GetEndiannessName | Returns the name for the endianness of this PlatformInfo instance. |
GetLinuxDistributionInfo | Returns the Linux distribution info associated with this PlatformInfo instance. |
GetOSMajorVersion | Returns the run-time major version of the OS associated with this PlatformInfo instance. |
GetOSMinorVersion | Returns the run-time minor version of the OS associated with this PlatformInfo instance. |
GetOperatingSystemDescription | Returns the description of the operating system of this PlatformInfo instance. |
GetOperatingSystemDirectory | Returns the operating system directory. |
GetOperatingSystemFamilyName | Returns the operating system family name of the OS associated with this PlatformInfo instance. |
GetOperatingSystemId | Returns the operating system ID of this PlatformInfo instance. |
GetOperatingSystemIdName | Returns the operating system name of the OS associated with this PlatformInfo instance. |
GetPortId | Returns the wxWidgets port ID associated with this PlatformInfo instance. |
GetPortIdName | Returns the name of the wxWidgets port ID associated with this PlatformInfo instance. |
GetPortIdShortName | Returns the short name of the wxWidgets port ID associated with this PlatformInfo instance. |
GetToolkitMajorVersion | Returns the run-time major version of the toolkit associated with this PlatformInfo instance. |
GetToolkitMinorVersion | Returns the run-time minor version of the toolkit associated with this PlatformInfo instance. |
IsOk | Returns True if this instance is fully initialized with valid values. |
IsUsingUniversalWidgets | Returns True if this PlatformInfo describes wxUniversal build. |
SetArchitecture | Sets the architecture enum value associated with this PlatformInfo instance. |
SetDesktopEnvironment | Sets the desktop environment associated with this PlatformInfo instance. |
SetEndianness | Sets the endianness enum value associated with this PlatformInfo instance. |
SetLinuxDistributionInfo | Sets the linux distribution info associated with this PlatformInfo instance. |
SetOSVersion | Sets the version of the operating system associated with this PlatformInfo instance. |
SetOperatingSystemDescription | Sets the operating system description associated with this PlatformInfo instance. |
SetOperatingSystemId | Sets the operating system associated with this PlatformInfo instance. |
SetPortId | Sets the wxWidgets port ID associated with this PlatformInfo instance. |
SetToolkitVersion | Sets the version of the toolkit associated with this PlatformInfo instance. |
__ne__ | Inequality operator. |
__eq__ | Equality operator. |
This class holds informations about the operating system, the toolkit and the basic architecture of the machine where the application is currently running.
Possible constructors:
PlatformInfo()
PlatformInfo(pid, tkMajor=-1, tkMinor=-1, id=OS_UNKNOWN, osMajor=-1,
osMinor=-1, arch=ARCH_INVALID, endian=ENDIAN_INVALID)
Overloaded Implementations:
__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, arch=ARCH_INVALID, endian=ENDIAN_INVALID)
Initializes the object using given values.
Parameters: |
|
---|
Returns True if the OS version is at least major.minor .
Parameters: |
|
---|---|
Return type: | bool |
See also
Returns True if the toolkit version is at least major.minor .
Parameters: |
|
---|---|
Return type: | bool |
See also
GetToolkitMajorVersion , GetToolkitMinorVersion , CheckOSVersion
Returns the global PlatformInfo object, initialized with the values for the currently running platform.
Return type: | PlatformInfo |
---|
Converts the given string to a Architecture enum value or to ARCH_INVALID if the given string is not a valid architecture string (i.e.
does not contain nor 32 nor 64 strings).
Parameters: | arch (string) – |
---|---|
Return type: | Architecture |
Returns the name for the architecture of this PlatformInfo instance.
Returns the architecture ID of this PlatformInfo instance.
Return type: | Architecture |
---|
Returns the desktop environment associated with this PlatformInfo instance.
See AppTraits.GetDesktopEnvironment for more info.
Return type: | string |
---|
Returns the endianness ID of this PlatformInfo instance.
Returns the name for the endianness of this PlatformInfo instance.
Returns the Linux distribution info associated with this PlatformInfo instance.
See GetLinuxDistributionInfo for more info.
Return type: | LinuxDistributionInfo |
---|
Returns the run-time major version of the OS associated with this PlatformInfo instance.
Return type: | int |
---|
See also
Returns the run-time minor version of the OS associated with this PlatformInfo instance.
Return type: | int |
---|
See also
Returns the description of the operating system of this PlatformInfo instance.
See GetOSDescription() for more info.
Return type: | string |
---|
Returns the operating system directory.
See GetOSDirectory for more info.
Return type: | string |
---|
Returns the operating system family name of the OS associated with this PlatformInfo instance.
Returns the operating system ID of this PlatformInfo instance.
See GetOsVersion for more info.
Returns the operating system name of the OS associated with this PlatformInfo instance.
Returns the wxWidgets port ID associated with this PlatformInfo instance.
Returns the name of the wxWidgets port ID associated with this PlatformInfo instance.
Returns the short name of the wxWidgets port ID associated with this PlatformInfo instance.
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 AppTraits.GetToolkitVersion for more info.
Return type: | int |
---|
See also
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 AppTraits.GetToolkitVersion for more info.
Return type: | int |
---|
See also
Returns True if this instance is fully initialized with valid values.
Return type: | bool |
---|
Returns True if this PlatformInfo describes wxUniversal build.
Return type: | bool |
---|
Sets the architecture enum value associated with this PlatformInfo instance.
Parameters: | n (Architecture) – |
---|
Sets the desktop environment associated with this PlatformInfo instance.
Parameters: | de (string) – |
---|
Sets the endianness enum value associated with this PlatformInfo instance.
Parameters: | n (Endianness) – |
---|
Sets the linux distribution info associated with this PlatformInfo instance.
Parameters: | di (LinuxDistributionInfo) – |
---|
Sets the version of the operating system associated with this PlatformInfo instance.
Parameters: |
|
---|
Sets the operating system description associated with this PlatformInfo instance.
Parameters: | desc (string) – |
---|
Sets the operating system associated with this PlatformInfo instance.
Parameters: | n (OperatingSystemId) – |
---|
Sets the wxWidgets port ID associated with this PlatformInfo instance.
Parameters: | n (PortId) – |
---|
Sets the version of the toolkit associated with this PlatformInfo instance.
Parameters: |
|
---|
Inequality operator.
Tests all class’ internal variables.
Parameters: | t (PlatformInfo) – |
---|
Equality operator.
Tests all class’ internal variables.
Parameters: | t (PlatformInfo) – |
---|
See GetArchName
See GetArchitecture and SetArchitecture
See GetEndianness and SetEndianness
See GetOperatingSystemDescription and SetOperatingSystemDescription
See GetPortIdName