code: def copy_fixed_headers(directory, xml):
      '''copy the fixed protocol headers to the target directory'''
      import shutil
      hlist = [ 'Parser.java', 'Messages/MAVLinkMessage.java', 'Messages/MAVLinkPayload.java', 'Messages/MAVLinkStats.java' ]
      basepath = os.path.dirname(os.path.realpath(__file__))
      srcpath = os.path.join(basepath, 'java/lib')
      print("Copying fixed headers")
      for h in hlist:
          src = os.path.realpath(os.path.join(srcpath, h))
          dest = os.path.realpath(os.path.join(directory, h))
          if src == dest:
              continue
          destdir = os.path.realpath(os.path.join(directory, 'Messages'))
          try:
              os.makedirs(destdir)
          except:
              print("Not re-creating Messages directory")
          shutil.copy(src, destf copy_fixed_headers(directory, xml):
      '''copy the fixed protocol headers to the target directory'''
      import shutil
      hlist = [ 'Parser.java', 'Messages/MAVLinkMessage.java', 'Messages/MAVLinkPayload.java', 'Messages/MAVLinkStats.java' ]
      basepath = os.path.dirname(os.path.realpath(__file__))
      srcpath = os.path.join(basepath, 'java/lib')
      print("Copying fixed headers")
      for h in hlist:
          src = os.path.realpath(os.path.join(srcpath, h))
          dest = os.path.realpath(os.path.join(directory, h))
          if src == dest:
              continue
          destdir = os.path.realpath(os.path.join(directory, 'Messages'))
          try:
              os.makedirs(destdir)
          except:
              print("Not re-creating Messages directory")
          shutil.copy(src, dest)
docs: copy the fixed protocol headers to the target directory