From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Skap0-000839-43 for garchives@archives.gentoo.org; Fri, 29 Jun 2012 13:01:14 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 24649E0534; Fri, 29 Jun 2012 13:00:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id DCA5FE04D2 for ; Fri, 29 Jun 2012 13:00:46 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 299491B4090 for ; Fri, 29 Jun 2012 13:00:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id DFEC6E5432 for ; Fri, 29 Jun 2012 13:00:44 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1340974224.df1ee77098fbb7eda685ffbea88dca9fea18adfd.blueness@gentoo> Subject: [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/ X-VCS-Repository: proj/webapp-config X-VCS-Files: WebappConfig/config.py WebappConfig/db.py WebappConfig/debug.py WebappConfig/server.py WebappConfig/version.py X-VCS-Directories: WebappConfig/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: df1ee77098fbb7eda685ffbea88dca9fea18adfd X-VCS-Branch: master Date: Fri, 29 Jun 2012 13:00:44 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: f52a7b9b-5064-4551-b51c-ee27f96a0576 X-Archives-Hash: b67b5707e3ad82fd7587f6c547442f6f commit: df1ee77098fbb7eda685ffbea88dca9fea18adfd Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Thu Jun 28 23:13:53 2012 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Fri Jun 29 12:50:24 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/webapp-config= .git;a=3Dcommit;h=3Ddf1ee770 Use print() function for compatibility with Python 3. Signed-off-by: Anthony G. Basile gentoo.org> --- WebappConfig/config.py | 4 +- WebappConfig/db.py | 2 +- WebappConfig/debug.py | 69 ++++++++++++++++++++++++-----------------= ------ WebappConfig/server.py | 2 +- WebappConfig/version.py | 2 +- 5 files changed, 40 insertions(+), 39 deletions(-) diff --git a/WebappConfig/config.py b/WebappConfig/config.py index 9ac303e..371602e 100644 --- a/WebappConfig/config.py +++ b/WebappConfig/config.py @@ -1055,9 +1055,9 @@ class Config: for i in self.config.options('USER'): if not i in ['pn', 'pvr']: try: - print i.upper() + '=3D"' + self.config.get('USER= ', i) + '"' + print(i.upper() + '=3D"' + self.config.get('USER= ', i) + '"') except InterpolationSyntaxError: - print '# Failed to evaluate: ' + i.upper() + print('# Failed to evaluate: ' + i.upper()) =20 sys.exit(0) =20 diff --git a/WebappConfig/db.py b/WebappConfig/db.py index aa78c24..fc221bf 100644 --- a/WebappConfig/db.py +++ b/WebappConfig/db.py @@ -456,7 +456,7 @@ class WebappDB(AppHierarchy): OUT.info(' ' + i[3].strip(), 1) else: # This is a simplified form for the webapp.eclass - print i[3].strip() + print(i[3].strip()) =20 # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # Handler for /usr/share/webapps diff --git a/WebappConfig/debug.py b/WebappConfig/debug.py index c3a5c47..7236e27 100644 --- a/WebappConfig/debug.py +++ b/WebappConfig/debug.py @@ -5,6 +5,7 @@ # Copyright 2005 Gunnar Wrobel # Distributed under the terms of the GNU General Public License v2 =20 +from __future__ import print_function __version__ =3D "$Id: debug.py 159 2005-11-10 09:48:25Z wrobel $" =20 ########################################################################= ######### @@ -294,7 +295,7 @@ class Message: ## Output Functions =20 def notice (self, note): - print note + print(note) =20 def info (self, info, level =3D 4): =20 @@ -304,7 +305,7 @@ class Message: return =20 for i in info.split('\n'): - print self.maybe_color('green', '* ') + i + print(self.maybe_color('green', '* ') + i) =20 def status (self, message, status, info =3D 'ignored'): =20 @@ -316,7 +317,7 @@ class Message: return =20 for i in lines[0:-1]: - print self.maybe_color('green', '* ') + i + print(self.maybe_color('green', '* ') + i) =20 i =3D lines[-1] =20 @@ -330,8 +331,8 @@ class Message: else: result =3D '[' + self.maybe_color('yellow', info) + ']' =20 - print self.maybe_color('green', '* ') + i + ' ' + '.' * (58 - le= n(i)) \ - + ' ' + result + print(self.maybe_color('green', '* ') + i + ' ' + '.' * (58 - le= n(i)) \ + + ' ' + result) =20 def warn (self, warn, level =3D 4): =20 @@ -341,14 +342,14 @@ class Message: return =20 for i in warn.split('\n'): - print self.maybe_color('yellow', '* ') + i + print(self.maybe_color('yellow', '* ') + i) =20 def error (self, error): =20 error =3D str(error) =20 for i in error.split('\n'): - print >> self.error_out, self.maybe_color('red', '* ') + i + print(self.maybe_color('red', '* ') + i, file=3Dself.error_o= ut) self.has_error =3D True =20 def die (self, error): @@ -429,11 +430,11 @@ class Message: if lines > 0: for j in range(lines): ## Print line with continuation marker - print >> self.debug_out, ls + '// ' + x[0:60] + ' \\= ' + print(ls + '// ' + x[0:60] + ' \\', file=3Dself.debu= g_out) ## Remove printed characters from output x =3D x[60:] ## Print final line - print >> self.debug_out, ls + '// ' + x=20 + print(ls + '// ' + x, file=3Dself.debug_out)=20 =20 if self.debug_vrb =3D=3D 1: # Top line indicates class and method @@ -442,60 +443,60 @@ class Message: c +=3D 'Class: ' + str(callerobject.__class__.__name__) = + ' | ' if callermethod: c +=3D 'Method: ' + str(callermethod) - print >> self.debug_out, '// ' + c + print('// ' + c, file=3Dself.debug_out) # Selected variables follow if callerlocals: for i,j in callerlocals.items(): - print >> self.debug_out, '// ' = \ - + self.maybe_color('turquoise', str(i)) + ':' = + str(j) + print('// ' \ + + self.maybe_color('turquoise', str(i)) + ':' = + str(j), file=3Dself.debug_out) # Finally the message - print >> self.debug_out, self.maybe_color('yellow', message) + print(self.maybe_color('yellow', message), file=3Dself.debug= _out) return =20 if self.debug_vrb =3D=3D 3: - print >> self.debug_out, ls + '/////////////////////////////= ////' + \ - '////////////////////////////////' + print(ls + '/////////////////////////////////' + \ + '////////////////////////////////', file=3Dself.debug_= out) =20 # General information about what is being debugged #(module name or similar) - print >> self.debug_out, ls + '// ' + self.debug_env - print >> self.debug_out, ls + '//-------------------------------= ----' + \ - '----------------------------' + print(ls + '// ' + self.debug_env, file=3Dself.debug_out) + print(ls + '//-----------------------------------' + \ + '----------------------------', file=3Dself.debug_out) =20 ## If the caller is a class print the name here if callerobject: - print >> self.debug_out, ls + = \ - '// Object Class: ' + str(callerobject.__class__.__nam= e__) + print(ls + \ + '// Object Class: ' + str(callerobject.__class__.__nam= e__), file=3Dself.debug_out) =20 ## If the method has been extracted print it here if callermethod: - print >> self.debug_out, ls + '// ' = \ - + self.maybe_color('green', 'Method: ') + str(callerme= thod) + print(ls + '// ' \ + + self.maybe_color('green', 'Method: ') + str(callerme= thod), file=3Dself.debug_out) if self.debug_vrb =3D=3D 3: - print >> self.debug_out, ls + '//-----------------------= ----' + \ - '------------------------------------' + print(ls + '//---------------------------' + \ + '------------------------------------', file=3Dsel= f.debug_out) =20 ## Print the information on all available local variables if callerlocals: if self.debug_vrb =3D=3D 3: - print >> self.debug_out, ls + '//' - print >> self.debug_out, ls + '// VALUES ' + print(ls + '//', file=3Dself.debug_out) + print(ls + '// VALUES ', file=3Dself.debug_out) for i,j in callerlocals.items(): - print >> self.debug_out, ls + '// ------------------> ' = \ - + self.maybe_color('turquoise', str(i)) + ':' + print(ls + '// ------------------> ' \ + + self.maybe_color('turquoise', str(i)) + ':', fil= e=3Dself.debug_out) breaklines(str(j)) if self.debug_vrb =3D=3D 3: - print >> self.debug_out, ls + '//-----------------------= -------'\ - '---------------------------------' + print(ls + '//------------------------------'\ + '---------------------------------', file=3Dself.d= ebug_out) =20 # Finally print the message breaklines(self.maybe_color('yellow', message)) =20 if self.debug_vrb =3D=3D 3: - print >> self.debug_out, ls + '//---------------------------= ----' + \ - '--------------------------------' - print >> self.debug_out, ls + '/////////////////////////////= ////' + \ - '////////////////////////////////' + print(ls + '//-------------------------------' + \ + '--------------------------------', file=3Dself.debug_= out) + print(ls + '/////////////////////////////////' + \ + '////////////////////////////////', file=3Dself.debug_= out) =20 ## gloabal message handler OUT =3D Message('webapp-config') diff --git a/WebappConfig/server.py b/WebappConfig/server.py index 2272d76..f67ecdb 100644 --- a/WebappConfig/server.py +++ b/WebappConfig/server.py @@ -49,7 +49,7 @@ class Basic: pm): =20 if self.dep and not self.supported(pm): - print self.dep + print(self.dep) OUT.die('Your configuration file sets the server type "' + s= elf.name + '"\nbut the corresponding package does not seem to= be ' 'installed!\nPlease "emerge ' + self.dep + '" or cor= rect ' diff --git a/WebappConfig/version.py b/WebappConfig/version.py index c09a903..ddf6c9d 100644 --- a/WebappConfig/version.py +++ b/WebappConfig/version.py @@ -16,4 +16,4 @@ WCVERSION =3D '1.50.18' =20 if __name__ =3D=3D '__main__': - print WCVERSION + print(WCVERSION)