Back to index

enigmail  1.4.3
make-platformini.py
Go to the documentation of this file.
00001 #!/usr/bin/python
00002 
00003 from optparse import OptionParser
00004 from datetime import datetime
00005 import sys
00006 import os
00007 
00008 o = OptionParser()
00009 o.add_option("--buildid", dest="buildid")
00010 o.add_option("--print-buildid", action="store_true", dest="print_buildid")
00011 o.add_option("--sourcestamp", dest="sourcestamp")
00012 o.add_option("--sourcerepo", dest="sourcerepo")
00013 
00014 (options, args) = o.parse_args()
00015 
00016 if options.print_buildid:
00017     print datetime.now().strftime('%Y%m%d%H%M%S')
00018     sys.exit(0)
00019 
00020 if not options.buildid:
00021     print >>sys.stderr, "--buildid is required"
00022     sys.exit(1)
00023 
00024 (milestoneFile,) = args
00025 for line in open(milestoneFile, 'r'):
00026     if line[0] == '#':
00027         continue
00028 
00029     line = line.strip()
00030     if line == '':
00031         continue
00032 
00033     milestone = line
00034 
00035 print """[Build]
00036 BuildID=%s
00037 Milestone=%s""" % (options.buildid, milestone)
00038 if options.sourcestamp:
00039     print "SourceStamp=%s" % options.sourcestamp
00040 if options.sourcerepo:
00041     print "SourceRepository=%s" % options.sourcerepo