manifest.py 973 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python3
  2. import argparse
  3. import time
  4. parser = argparse.ArgumentParser(description='Combine multiple manifests into a new manifest')
  5. parser.add_argument('-b', '--branch', default='stable', help='Branch name to set')
  6. parser.add_argument('-p', '--priority', type=int, default=0, help='Priority to set')
  7. parser.add_argument('manifest', nargs='+', help='Manifest files to include in output manifest')
  8. def main():
  9. args = parser.parse_args()
  10. print('BRANCH=%s' % args.branch)
  11. offset = time.strftime('%z')
  12. print('DATE=%s' % time.strftime('%Y-%m-%d %H:%M:%S') + '%s:%s' % (offset[:-2], offset[3:]))
  13. print('PRIORITY=%d' % args.priority)
  14. print()
  15. for manifest in args.manifest:
  16. with open(manifest) as mfile:
  17. for line in mfile:
  18. if '=' in line:
  19. continue
  20. l = line.strip()
  21. if l != '':
  22. print(l)
  23. if __name__ == '__main__':
  24. main()