def _CheckPyTSK():
  """Checks the availability of pytsk.

  Returns:
    True if the pytsk Python module is available, False otherwise.
  """
  module_name = u'pytsk3'
  minimum_version_libtsk = u'4.1.2'
  minimum_version_pytsk = u'20140506'

  module_object = _ImportPythonModule(module_name)
  if not module_object:
    print(u'[FAILURE]\tmissing: {0:s}.'.format(module_name))
    return False

  module_version = module_object.TSK_VERSION_STR

  # Split the version string and convert every digit into an integer.
  # A string compare of both version strings will yield an incorrect result.
  module_version_map = list(map(int, module_version.split(u'.')))
  minimum_version_map = list(map(int, minimum_version_libtsk.split(u'.')))
  if module_version_map < minimum_version_map:
    print((
        u'[FAILURE]\tSleuthKit (libtsk) version: {0:s} is too old, {1:s} or '
        u'later required.').format(module_version, minimum_version_libtsk))
    return False

  print(u'[OK]\t\tSleuthKit version: {0:s}'.format(module_version))

  if not hasattr(module_object, u'get_version'):
    print(u'[FAILURE]\t{0:s} is too old, {1:s} or later required.'.format(
        module_name, minimum_version_pytsk))
    return False

  module_version = module_object.get_version()
  if module_version < minimum_version_pytsk:
    print((
        u'[FAILURE]\t{0:s} version: {1:s} is too old, {2:s} or later '
        u'required.').format(
            module_name, module_version, minimum_version_pytsk))
    return False

  print(u'[OK]\t\t{0:s} version: {1:s}'.format(module_name, module_version))

  return True
dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/dependencies.py/_CheckPyTSK/original