From adf49b378ffa6f207826afc95ce3e96be912d447 Mon Sep 17 00:00:00 2001 From: guanlisheng Date: Sat, 26 Jul 2014 11:42:57 +0800 Subject: [PATCH] scrip to pack general reports --- .travis.yml | 1 + pack_gm.py | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100755 pack_gm.py diff --git a/.travis.yml b/.travis.yml index 399db34..7032da2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ language: python script: - python check_gm.py + - python pack_gm.py diff --git a/pack_gm.py b/pack_gm.py new file mode 100755 index 0000000..935ac5a --- /dev/null +++ b/pack_gm.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python +# vi:tabstop=4:expandtab:shiftwidth=4:softtabstop=4:autoindent:smarttab + +import os +import zipfile + +def pack_report(report): + print 'packing %s' % report + f = zipfile.ZipFile(report + '.zip', 'w') + for item in os.listdir(report): + f.write(os.path.join(report, item)) + f.close() + print 'done %s' % report + +if __name__ == '__main__': + for report in os.listdir('.'): + if not report.startswith('.') and os.path.isdir(report): + try: + pack_report(report) + except: + exit(1) + exit(0) +