From 6afaeb757af0dbd8508a0f2352ade61e41bec84c Mon Sep 17 00:00:00 2001 From: Collin Winter Date: Fri, 3 Aug 2007 17:06:41 +0000 Subject: Convert print statements to function calls in Tools/. --- Tools/faqwiz/faqwiz.py | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'Tools/faqwiz/faqwiz.py') diff --git a/Tools/faqwiz/faqwiz.py b/Tools/faqwiz/faqwiz.py index d8b8cd5559..6bfe354e3d 100644 --- a/Tools/faqwiz/faqwiz.py +++ b/Tools/faqwiz/faqwiz.py @@ -158,8 +158,8 @@ def send_my_cookie(ui): then = now + COOKIE_LIFETIME gmt = time.gmtime(then) path = os.environ.get('SCRIPT_NAME', '/cgi-bin/') - print "Set-Cookie: %s=%s; path=%s;" % (name, value, path), - print time.strftime("expires=%a, %d-%b-%y %X GMT", gmt) + print("Set-Cookie: %s=%s; path=%s;" % (name, value, path), end=' ') + print(time.strftime("expires=%a, %d-%b-%y %X GMT", gmt)) class MagicDict: @@ -273,22 +273,22 @@ class FaqEntry: raw = 0 continue if raw: - print line + print(line) continue if not line.strip(): if pre: - print '' + print('') pre = 0 else: - print '

' + print('

') else: if not line[0].isspace(): if pre: - print '' + print('') pre = 0 else: if not pre: - print '

'
+                        print('
')
                         pre = 1
                 if '/' in line or '@' in line:
                     line = translate(line, pre)
@@ -296,16 +296,16 @@ class FaqEntry:
                     line = escape(line)
                 if not pre and '*' in line:
                     line = emphasize(line)
-                print line
+                print(line)
         if pre:
-            print '
' + print('
') pre = 0 if edit: - print '

' + print('

') emit(ENTRY_FOOTER, self) if self.last_changed_date: emit(ENTRY_LOGINFO, self) - print '

' + print('

') class FaqDir: @@ -377,7 +377,7 @@ class FaqWizard: self.dir = FaqDir() def go(self): - print 'Content-type: text/html' + print('Content-type: text/html') req = self.ui.req or 'home' mname = 'do_%s' % req try: @@ -493,7 +493,7 @@ class FaqWizard: mtime = mtime = entry.getmtime() if mtime > latest: latest = mtime - print time.strftime(LAST_CHANGED, time.localtime(latest)) + print(time.strftime(LAST_CHANGED, time.localtime(latest))) emit(EXPLAIN_MARKS) def format_all(self, files, edit=1, headers=1): @@ -637,7 +637,7 @@ class FaqWizard: rev = line[9:].split() mami = revparse(rev) if not mami: - print line + print(line) else: emit(REVISIONLINK, entry, rev=rev, line=line) if mami[1] > 1: @@ -647,7 +647,7 @@ class FaqWizard: emit(DIFFLINK, entry, prev=rev, rev=headrev) else: headrev = rev - print + print() athead = 0 else: athead = 0 @@ -656,8 +656,8 @@ class FaqWizard: athead = 1 sys.stdout.write('


') else: - print line - print '' + print(line) + print('') def do_revision(self): entry = self.dir.open(self.ui.file) @@ -686,8 +686,8 @@ class FaqWizard: def shell(self, command): output = os.popen(command).read() sys.stdout.write('
')
-        print escape(output)
-        print '
' + print(escape(output)) + print('') def do_new(self): entry = self.dir.new(section=int(self.ui.section)) @@ -759,9 +759,9 @@ class FaqWizard: def cantcommit(self): self.prologue(T_CANTCOMMIT) - print CANTCOMMIT_HEAD + print(CANTCOMMIT_HEAD) self.errordetail() - print CANTCOMMIT_TAIL + print(CANTCOMMIT_TAIL) def errordetail(self): if PASSWORD and self.ui.password != PASSWORD: @@ -827,7 +827,7 @@ class FaqWizard: else: self.error(T_COMMITFAILED) emit(COMMITFAILED, sts=sts) - print '
%s
' % escape(output) + print('
%s
' % escape(output)) try: os.unlink(tf.name) -- cgit v1.2.1