| 1 | # python-gphoto2 - Python interface to libgphoto2 |
| 2 | # http://github.com/jim-easterbrook/python-gphoto2 |
| 3 | # Copyright (C) 2021-23 Jim Easterbrook [email protected] |
| 4 | # |
| 5 | # This file is part of python-gphoto2. |
| 6 | # |
| 7 | # python-gphoto2 is free software: you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU Lesser General Public License as |
| 9 | # published by the Free Software Foundation, either version 3 of the |
| 10 | # License, or (at your option) any later version. |
| 11 | # |
| 12 | # python-gphoto2 is distributed in the hope that it will be useful, but |
| 13 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | # Lesser General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU Lesser General Public |
| 18 | # License along with python-gphoto2. If not, see |
| 19 | # <https://www.gnu.org/licenses/>. |
| 20 | |
| 21 | import argparse |
| 22 | import os |
| 23 | import sys |
| 24 | |
| 25 | import gphoto2 as gp |
| 26 | |
| 27 | |
| 28 | def main(): |
| 29 | parser = argparse.ArgumentParser() |
| 30 | parser.add_argument('-v', '--verbosity', help='increase output verbosity', |
| 31 | action='store_true') |
| 32 | args = parser.parse_args() |
| 33 | print('python-gphoto2 version:', gp.__version__) |
| 34 | verbosity = (gp.GP_VERSION_SHORT, gp.GP_VERSION_VERBOSE)[args.verbosity] |
| 35 | print('libgphoto2 version:', |
| 36 | ', '.join(gp.gp_library_version(verbosity))) |
| 37 | print('libgphoto2_port version:', |
| 38 | ', '.join(gp.gp_port_library_version(verbosity))) |
| 39 | print('python-gphoto2 examples:', |
| 40 | os.path.join(os.path.dirname(__file__), 'examples')) |
| 41 | |
| 42 | |
| 43 | if __name__ == "__main__": |
| 44 | sys.exit(main()) |