comparison test/tx_Source_detector.py @ 5376:64b05e24dbd8

Python 3 preparation: convert print to a function. Tool-assisted patch. It is possible that some "from __future__ import print_function" are not in fact needed, if a file only uses print() with a single string as an argument and so would work fine in Python 2 without that import.
author Joseph Myers <jsm@polyomino.org.uk>
date Tue, 24 Jul 2018 09:54:52 +0000
parents 6e9b9743de89
children 9938c40e03bc
comparison
equal deleted inserted replaced
5375:1ad46057ae4a 5376:64b05e24dbd8
12 # tx_SourceCheckReact(3) post db.tx_Source: cgi 12 # tx_SourceCheckReact(3) post db.tx_Source: cgi
13 # 13 #
14 # Note that the calls are interleaved, but the proper 14 # Note that the calls are interleaved, but the proper
15 # tx_Source is associated with the same ticket. 15 # tx_Source is associated with the same ticket.
16 16
17 from __future__ import print_function
17 import time as time 18 import time as time
18 19
19 def tx_SourceCheckAudit(db, cl, nodeid, newvalues): 20 def tx_SourceCheckAudit(db, cl, nodeid, newvalues):
20 ''' An auditor to print the value of the source of the 21 ''' An auditor to print the value of the source of the
21 transaction that trigger this change. The sleep call 22 transaction that trigger this change. The sleep call
29 "email" - reported when using an unautheticated email based technique 30 "email" - reported when using an unautheticated email based technique
30 "email-sig-openpgp" - reported when email with a valid pgp 31 "email-sig-openpgp" - reported when email with a valid pgp
31 signature is used 32 signature is used
32 ''' 33 '''
33 if __debug__ and False: 34 if __debug__ and False:
34 print "\n tx_SourceCheckAudit(%s) db.tx_Source: %s"%(nodeid, db.tx_Source) 35 print("\n tx_SourceCheckAudit(%s) db.tx_Source: %s"%(nodeid, db.tx_Source))
35 36
36 newvalues['tx_Source'] = db.tx_Source 37 newvalues['tx_Source'] = db.tx_Source
37 38
38 # example use for real to prevent a change from happening if it's 39 # example use for real to prevent a change from happening if it's
39 # submited via email 40 # submited via email
55 "email-sig-openpgp" - reported when email with a valid pgp 56 "email-sig-openpgp" - reported when email with a valid pgp
56 signature is used 57 signature is used
57 ''' 58 '''
58 59
59 if __debug__ and False: 60 if __debug__ and False:
60 print " tx_SourceCheckReact(%s) db.tx_Source: %s"%(nodeid, db.tx_Source) 61 print(" tx_SourceCheckReact(%s) db.tx_Source: %s"%(nodeid, db.tx_Source))
61 62
62 63
63 64
64 def init(db): 65 def init(db):
65 db.issue.audit('create', tx_SourceCheckAudit) 66 db.issue.audit('create', tx_SourceCheckAudit)

Roundup Issue Tracker: http://roundup-tracker.org/