Abstract

The ‘platformids‘ package provides the abstract enumeration of runtime platforms. This extends the standard Python facilities by

  • more specific canonical platform enumerations
  • provides additional hierarchical bitmasks for faster processing
  • provides mapping of string and numeric representation for human display
  • provides a boolean flag V3K for Python3
  • provides a bitmask Vxyz for the complete Python version for faster operations

The supported platforms are:

  • Linux, BSD, Unix, OS-X, Cygwin, and Windows
  • Python2.7+, Python3.5+

Cockpit

API

Component Shortcuts API
platformids platformids platformids.__init__

Documents

Artifacts Shortcuts
Concepts and Design Development Documents
Programming Interfaces platformids

Blueprint

The ‘platformids’ package provides the hierarchical enumeration of runtime data source and target platform IDs. The platfom runtime system is therefore logically split into categories, sets, and members of specific operating system types and distributions. In addition the Python version is packed into a bit-array, what reduces the required code for example for the adaptation of current changes of Python3.x.y on subversion-level.

The following figure depicts a subset only of the current supported platform variants.

platformidsblueprint zoom

  • V3K

    The flag for the Python3 version [platformids]:

    1
    2
    3
    4
    5
    if V3K == True:
       # do sth....
    
    else:
       # do th. else...
    
  • PYVxyz

    The more granular combined bit-mask-flag of the Python version PythonX.Y and release PythonX.Y(Z) is provided by the variable Vxyz [PYVxyz]:

    1
    2
    3
    4
    5
    PYVxyz := 0bxxxyyyyyzzzzzzzz
    
    xxx:     3 bits / 0-7   for major version, e.g. 3       for 3.6.5  or e.g. future 4.0.2
    yyyyy:   5 bits / 0-31  for minor version, e.g. 6       for 3.6.5  or e.g. future 3.14.3
    zzzzzz:  8 bits / 0-255 for the release build, e.g. 14  for 2.7.14 or e.g. future 2.7.23
    

    See also [getPYVxyz].

  • getPYVxyz

    Dynamic version evaluation by compressed bitmasks as single integer values by the slim and fast function interface [getPYVxyz].

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    PYV32 = getPYVxyz(3, 2)        # integer
    myPYVxyz = getPYVxyz(3, 6, 5)  # integer
    
    for x in range(1000000000):
    
       if PYVxyz & myPYVxyz:   # pure integer comparison
          callFunction0(x)
    
       elif PYV32 > myPYVxyz:   # pure integer comparison
          callFunction1(x)
    
  • ISSTR and unicode

    The simplified portability of encodings for Python2 and Python3 is supported by the adapted type ISSTR and the conditional unicode alias [platformids]:

    1
    2
    3
    4
    5
    6
    if V3K:
       unicode = str
       ISSTR = (str, bytes,)
    
    else:
       ISSTR = (str, unicode,)
    

Resources

Project Data

  • PROJECT=platformids
  • MISSION=Support advanced enumerations for the multi-platform development.
  • AUTHOR=Arno-Can Uestuensoez
  • COPYRIGHT=Copyright (C) 2010,2011,2015-2018 Arno-Can Uestuensoez @Ingenieurbuero Arno-Can Uestuensoez
  • LICENSE=Artistic-License-2.0 + Forced-Fairplay-Constraints
  • VERSION=0.1.28
  • RELEASE=0.1.28
  • STATUS=alpha

Home

Online Documents

Licenses

Runtime Repository

Downloads