dbusdeviation package

dbusdeviation.interfacecomparator module

Module providing a InterfaceComparator object for comparing two D-Bus APIs (provided as abstract syntax trees from the introspection XML), to determine if they differ in API-incompatible ways.

class dbusdeviation.interfacecomparator.InterfaceComparator(old_interfaces, new_interfaces, enabled_warnings=None, disabled_warnings=None, new_filename=None)[source]

Bases: object

Compare two D-Bus interface descriptions and determine how they differ.

Differences are given different severity levels, depending on whether they affect

  • nothing, and are purely decorative; for example, changing the name of a method argument
  • forwards compatibility, where code written against the new interface may not work against the old interface; for example, because it uses a newly added method
  • backwards compatibility, where code written against the old interface may not work against the new interface; for example, because it changes the type of a property
OUTPUT_BACKWARDS_INCOMPATIBLE = 'backwards-compatibility'
OUTPUT_FORWARDS_INCOMPATIBLE = 'forwards-compatibility'
OUTPUT_INFO = 'info'
compare()[source]

Compare the two interfaces and store the results.

Returns:
The list of relevant warnings to output; an empty list otherwise. The return value is affected by the categories of enabled warnings.
get_output()[source]

Return all the log messages generated by the latest call to compare().

Disabled warnings will not be returned.

static get_output_codes()[source]

Return a list of all possible output codes.