Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
1 #!/usr/bin/python
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from optparse import OptionParser
8 from datetime import datetime
9 import time
10 import sys
11 import os
13 o = OptionParser()
14 o.add_option("--buildid", dest="buildid")
15 o.add_option("--print-buildid", action="store_true", dest="print_buildid")
16 o.add_option("--print-timestamp", action="store_true", dest="print_timestamp")
17 o.add_option("--sourcestamp", dest="sourcestamp")
18 o.add_option("--sourcerepo", dest="sourcerepo")
20 (options, args) = o.parse_args()
22 if options.print_timestamp:
23 print int(time.time())
24 sys.exit(0)
26 if options.print_buildid:
27 print datetime.now().strftime('%Y%m%d%H%M%S')
28 sys.exit(0)
30 if not options.buildid:
31 print >>sys.stderr, "--buildid is required"
32 sys.exit(1)
34 (milestoneFile,) = args
35 for line in open(milestoneFile, 'r'):
36 if line[0] == '#':
37 continue
39 line = line.strip()
40 if line == '':
41 continue
43 milestone = line
45 print """[Build]
46 BuildID=%s
47 Milestone=%s""" % (options.buildid, milestone)
48 if options.sourcestamp:
49 print "SourceStamp=%s" % options.sourcestamp
50 if options.sourcerepo:
51 print "SourceRepository=%s" % options.sourcerepo