mavparmdiff.py 707 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env python
  2. '''
  3. compare two MAVLink parameter files
  4. '''
  5. from pymavlink import mavparm
  6. from argparse import ArgumentParser
  7. parser = ArgumentParser(description=__doc__)
  8. parser.add_argument("file1", metavar="FILE1")
  9. parser.add_argument("file2", metavar="FILE2")
  10. parser.add_argument("--full-diff",
  11. help="include volatile and similar parameters",
  12. default=True,
  13. action='store_false',
  14. dest='use_excludes')
  15. args = parser.parse_args()
  16. file1 = args.file1
  17. file2 = args.file2
  18. p1 = mavparm.MAVParmDict()
  19. p2 = mavparm.MAVParmDict()
  20. p1.load(file2, use_excludes=args.use_excludes)
  21. p1.diff(file1, use_excludes=args.use_excludes)