Skip to content

Commit

Permalink
scrip to pack general reports
Browse files Browse the repository at this point in the history
  • Loading branch information
guanlisheng committed Jul 26, 2014
1 parent 66ecd6e commit adf49b3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
language: python
script:
- python check_gm.py
- python pack_gm.py
23 changes: 23 additions & 0 deletions pack_gm.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit adf49b3

Please sign in to comment.