pytracesuite

Python interface to TRACE and POST.

tracesuite.api_version = <Version('0.1')>

Current pytracesuite API version.

It is recommended in any script importing pytracesuite to check for the correct API version. This allows for early error messages and warnings if the interface did change. api_version does have a major (the first number) and a minor part (the second number). These are accessible as attribute as well.

The minor part is changed, when there is new functionality in the API, that means there are new classes, functions or new optional arguments to one of the former.

A change in the major version number indicates a broken backwards compatibility. Some functions were removed from the API or some arguments changed their meaning or were removed.

#!/usr/bin/env python3
import tracesuite

assert(1 <= tracesuite.api_version.major <= 2)  # only allow API version 1 or 2

print(f"Using pytracesuite API {tracesuite.api_version}")

post = tracesuite.post.POST()

if tracesuite.api_version.major == 1:
    post.version_1_function()
else:
    assert(tracesuite.api_version.major == 2)
    post.version_1_function(changed_args)
    post.version_2_function()
    if tracesuite.api_version.minor >= 3:
        post.function_new_in_2_3()