+ # internal helper function to compress output
+ def compress(self, cmd, suffix, path):
+ in_filename = "{0}.new".format(path)
+ out_filename = "{0}.{1}.new".format(path, suffix)
+ with open(in_filename, 'r') as in_fh, open(out_filename, 'w') as out_fh:
+ check_call(cmd, stdin=in_fh, stdout=out_fh)
+ self.rename("{0}.{1}".format(path, suffix))
+