example_aiogps_run 663 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # Copyright (c) 2019 Grand Joldes (grandwork2@yahoo.com).
  4. #
  5. # This file is Copyright (c) 2019 by the GPSD project
  6. #
  7. # SPDX-License-Identifier: BSD-2-clause
  8. # This code runs compatibly under Python 2 and 3.x for x >= 2.
  9. """
  10. Script that runs the aiogps example. On Python versions that can not run the
  11. example it displays a message and exits.
  12. """
  13. import sys
  14. if __name__ == "__main__":
  15. # aiogps only available on Python >= 3.6
  16. if sys.version_info >= (3, 6):
  17. import example_aiogps
  18. example_aiogps.run()
  19. else:
  20. sys.exit("Sorry, aiogps is only available for Python versions >= 3.6")