#!/usr/bin/env python # -*- python-mode -*- """Takes care of starting the main function.""" from __future__ import absolute_import import sys def init_paths(): """Make the app work in the source tree.""" import sys import os.path as _path src_lib = _path.normpath(_path.join(_path.realpath(sys.path[0]), '..', 'src')) init_py = _path.join(src_lib, 'hidapi', '__init__.py') if _path.exists(init_py): sys.path[0] = src_lib if __name__ == '__main__': if sys.version_info >= (2, 8): sys.exit("Python 3 is not supported by hidconsole.") init_paths() from hidapi import hidconsole hidconsole.main()