pysys.utils.misc

Miscellanous utilities such as pysys.utils.misc.compareVersions and pysys.utils.misc.setInstanceVariablesFromDict.

compareVersions

pysys.utils.misc.compareVersions(v1, v2)[source]

Compares two alphanumeric dotted version strings to see which is more recent.

See pysys.process.user.ProcessUser.compareVersions for more details.

setInstanceVariablesFromDict

pysys.utils.misc.setInstanceVariablesFromDict(obj, d, errorOnMissingVariables=False)[source]

Sets an instance variable for each item in the specified dictionary, with automatic conversion of bool/int/float/list[str] values from strings if a default value of that type was provided as a static variable on the object.

New in version 1.6.0.

Parameters
  • obj (object) – Any Python object.

  • d (dict[str,str]) – The properties to set

  • errorOnMissingVariables (bool) – Set this to True if you want an exception to be raised if the dictionary contains a key for which is there no corresponding variable on obj.