mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
- sending protocol - uorb event message & template methods for argument packing - libevents submodule to send common events and handle json files - cmake maintains a list of all (PX4) source files for the current build (PX4 modules + libs), which is used to extract event metadata and generate a json file
21 lines
536 B
Python
Executable File
21 lines
536 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import argparse
|
|
import lzma
|
|
|
|
parser = argparse.ArgumentParser(description="""Compress a file with xz""")
|
|
parser.add_argument('filename', metavar='file', help='Input file (output: file.xz)')
|
|
|
|
args = parser.parse_args()
|
|
filename = args.filename
|
|
|
|
def save_compressed(filename):
|
|
#create xz compressed version
|
|
xz_filename=filename+'.xz'
|
|
with lzma.open(xz_filename, 'wt', preset=9) as f:
|
|
with open(filename, 'r') as content_file:
|
|
f.write(content_file.read())
|
|
|
|
save_compressed(filename)
|
|
|