+class CompressionMethod(object):
+ def __init__(self, keyword, extension, command):
+ self.keyword = keyword
+ self.extension = extension
+ self.command = command
+
+_compression_methods = (
+ CompressionMethod('bzip2', '.bz2', ['bzip2', '-9']),
+ CompressionMethod('gzip', '.gz', ['gzip', '-9cn', '--rsyncable']),
+ CompressionMethod('xz', '.xz', ['xz', '-c']),
+ # 'none' must be the last compression method as BaseFileWriter
+ # handling it will remove the input file for other compressions
+ CompressionMethod('none', '', None),
+)
+