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 1QrLt9-0006uJ-Ok for garchives@archives.gentoo.org; Thu, 11 Aug 2011 03:24:56 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E79D221C051; Thu, 11 Aug 2011 03:24:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9526821C051 for ; Thu, 11 Aug 2011 03:24:38 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EA1A61B4066 for ; Thu, 11 Aug 2011 03:24:37 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 420B780043 for ; Thu, 11 Aug 2011 03:24:37 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: Subject: [gentoo-commits] proj/layman:master commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/api.py layman/argsparser.py layman/cli.py layman/dbbase.py layman/debug.py layman/output.py layman/version.py X-VCS-Directories: layman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: e9742ba56ea23e9d61505a41e9a5cdda60bbfc99 Date: Thu, 11 Aug 2011 03:24:37 +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: X-Archives-Hash: eb3552451e88b92021b865d976dffcca commit: e9742ba56ea23e9d61505a41e9a5cdda60bbfc99 Author: dol-sen gmail com> AuthorDate: Tue Aug 9 23:44:32 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Tue Aug 9 23:44:32 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3De9742ba5 Revert "migrate to print()" to restore py-2.5 compatibility. This reverts commit e14906b88ec2da99dba82d565d88ed5ca1d40099. Conflicts: layman/api.py layman/cli.py layman/dbbase.py layman/output.py --- layman/api.py | 12 ++++------ layman/argsparser.py | 2 +- layman/cli.py | 18 ++++++-------- layman/dbbase.py | 6 +--- layman/debug.py | 59 +++++++++++++++++++++++---------------------= ----- layman/output.py | 17 ++++++------- layman/version.py | 4 +-- 7 files changed, 53 insertions(+), 65 deletions(-) diff --git a/layman/api.py b/layman/api.py index 69baddd..80b927f 100755 --- a/layman/api.py +++ b/layman/api.py @@ -13,8 +13,6 @@ # Brian Dolbec # =20 -from __future__ import print_function - from sys import stderr import os =20 @@ -256,10 +254,10 @@ class LaymanAPI(object): continue try: overlay =3D db.select(ovl) - #print("overlay =3D ", ovl) - #print("!!!", overlay) - except UnknownOverlayException as error: - #print("ERRORS", str(error)) + #print "overlay =3D ", ovl + #print "!!!", overlay + except UnknownOverlayException, error: + #print "ERRORS", str(error) self._error(error) result[ovl] =3D ('', False, False) else: @@ -505,7 +503,7 @@ class LaymanAPI(object): self._error_messages.append(message) self.output.debug("API._error(); _error_messages =3D %s" % str(s= elf._error_messages), 4) if self.report_errors: - print(message, file=3Dself.config['stderr']) + print >>self.config['stderr'], message =20 =20 def get_errors(self): diff --git a/layman/argsparser.py b/layman/argsparser.py index 93f11d6..af95901 100644 --- a/layman/argsparser.py +++ b/layman/argsparser.py @@ -242,7 +242,7 @@ class ArgsParser(BareConfig): # Parse the command line first since we need to get the config # file option. if len(args) =3D=3D 1: - print('Usage:%s' % _USAGE) + print >> self.std_out, 'Usage:%s' % _USAGE sys.exit(0) =20 (self.options, remain_args) =3D self.parser.parse_args(args) diff --git a/layman/cli.py b/layman/cli.py index fde52c3..53d81c6 100644 --- a/layman/cli.py +++ b/layman/cli.py @@ -19,8 +19,6 @@ # ''' Provides the command line actions that can be performed by layman.''= ' =20 -from __future__ import print_function - __version__ =3D "$Id: cli.py 2011-01-15 23:52 PST Brian Dolbec$" =20 =20 @@ -50,12 +48,12 @@ class ListPrinter(object): self.my_lister =3D self.short_list =20 def print_shortdict(self, info, complain): - #print("ListPrinter.print_shortdict()",info, "\n\n") + #print "ListPrinter.print_shortdict()",info, "\n\n" overlays =3D sorted(info) - #print("ids =3D=3D=3D=3D=3D=3D=3D>", overlays, "\n") + #print "ids =3D=3D=3D=3D=3D=3D=3D>", overlays, "\n" for ovl in overlays: overlay =3D info[ovl] - #print("overlay =3D", overlay) + #print "overlay =3D", overlay summary, supported, official =3D overlay self.print_overlay(summary, supported, official, complain) =20 @@ -66,10 +64,10 @@ class ListPrinter(object): =20 def print_fulldict(self, info, complain): ids =3D sorted(info) - #print("ids =3D=3D=3D=3D=3D=3D=3D>", ids, "\n") + #print "ids =3D=3D=3D=3D=3D=3D=3D>", ids, "\n" for ovl in ids: overlay =3D info[ovl] - #print(overlay) + #print overlay self.print_overlay(self.my_lister(overlay), overlay['supported'], overlay['official'], @@ -105,7 +103,7 @@ class ListPrinter(object): =20 def short_list(self, overlay): ''' - >>> print(short_list(overlay)) + >>> print short_list(overlay) wrobel [Subversion] (https://o.g.o/svn/dev/wr= obel ) ''' name =3D pad(overlay['name'], 25) @@ -131,7 +129,7 @@ class Main(object): =20 def __init__(self, config): self.config =3D config - #print("config.keys()", config.keys()) + #print "config.keys()", config.keys() self.output =3D config['output'] self.api =3D LaymanAPI(config, report_errors=3DFalse, @@ -311,7 +309,7 @@ class Main(object): def ListLocal(self): ''' Lists the local overlays. ''' - #print("ListLocal()") + #print "ListLocal()" self.output.debug('Printing installed overlays.', 6) list_printer =3D ListPrinter(self.config) =20 diff --git a/layman/dbbase.py b/layman/dbbase.py index dfe6ec8..8eafbf7 100644 --- a/layman/dbbase.py +++ b/layman/dbbase.py @@ -20,8 +20,6 @@ # '''Main handler for overlays.''' =20 -from __future__ import print_function - __version__ =3D "$Id: overlay.py 273 2006-12-30 15:54:50Z wrobel $" =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=3D=3D= =3D=3D=3D=3D=3D @@ -257,7 +255,7 @@ class DbBase(object): >>> config =3D {'output': output, 'svn_command': '/usr/bin/svn',= 'rsync_command':'/usr/bin/rsync'} >>> a =3D DbBase(config, [here + '/tests/testfiles/global-overla= ys.xml', ]) >>> for i in a.list(verbose=3DTrue): - ... print(i[0]) + ... print i[0] wrobel ~~~~~~ Source : https://overlays.gentoo.org/svn/dev/wrobel @@ -280,7 +278,7 @@ class DbBase(object): =20 >>> for i in a.list(verbose=3DFalse, width=3D80): - ... print(i[0]) + ... print i[0] wrobel [Subversion] (https://o.g.o/svn/dev/wr= obel ) wrobel-stable [Rsync ] (rsync://gunnarwrobel.de/= wrobel-stable) ''' diff --git a/layman/debug.py b/layman/debug.py index ab04f40..f5c247b 100644 --- a/layman/debug.py +++ b/layman/debug.py @@ -6,8 +6,6 @@ # Copyright 2005 - 2008 Gunnar Wrobel # Distributed under the terms of the GNU General Public License v2 =20 -from __future__ import print_function - __version__ =3D "$Id: debug.py 153 2006-06-05 06:03:16Z wrobel $" =20 ########################################################################= ######### @@ -103,7 +101,7 @@ class DebugMessage(Message): =20 def cli_opts(self, parser): =20 - #print("Parsing debug opts") + #print "Parsing debug opts" =20 group =3D OptionGroup(parser, '', @@ -329,11 +327,11 @@ class DebugMessage(Message): if lines > 0: for j in range(lines): ## Print line with continuation marker - print(ls + '// ' + x[0:60] + ' \\', file=3Dself.debu= g_out) + print >> self.debug_out, ls + '// ' + x[0:60] + ' \\= ' ## Remove printed characters from output x =3D x[60:] ## Print final line - print(ls + '// ' + x, file=3Dself.debug_out) + print >> self.debug_out, ls + '// ' + x =20 if self.debug_vrb =3D=3D 1: # Top line indicates class and method @@ -342,61 +340,60 @@ class DebugMessage(Message): c +=3D 'Class: ' + str(callerobject.__class__.__name__) = + ' | ' if callermethod: c +=3D 'Method: ' + str(callermethod) - print('// ' + c, file=3Dself.debug_out) + print >> self.debug_out, '// ' + c # Selected variables follow if callerlocals: for i,j in callerlocals.items(): - print('// ' + self.maybe_color('turquoise', - str(i)) + ':' + str(j), file=3Dself.debug_out) + print >> self.debug_out, '// ' = \ + + self.maybe_color('turquoise', str(i)) + ':' = + str(j) # Finally the message - print(self.maybe_color('yellow', message), file=3Dself.debug= _out) + print >> self.debug_out, self.maybe_color('yellow', message) return =20 if self.debug_vrb =3D=3D 3: - print(ls + '/////////////////////////////////' + \ - '////////////////////////////////', file=3Dself.debug_= out) + print >> self.debug_out, ls + '/////////////////////////////= ////' + \ + '////////////////////////////////' =20 # General information about what is being debugged #(module name or similar) - print(ls + '// ' + self.debug_env, file=3Dself.debug_out) - print(ls + '//-----------------------------------' + \ - '----------------------------', file=3Dself.debug_out) + print >> self.debug_out, ls + '// ' + self.debug_env + print >> self.debug_out, ls + '//-------------------------------= ----' + \ + '----------------------------' =20 ## If the caller is a class print the name here if callerobject: - print(ls + '// Object Class: ' + - str(callerobject.__class__.__name__), file=3Dself.debug_= out) + print >> self.debug_out, ls + = \ + '// Object Class: ' + str(callerobject.__class__.__nam= e__) =20 ## If the method has been extracted print it here if callermethod: - print(ls + '// ' + self.maybe_color('green', 'Method: ') - + str(callermethod), file=3Dself.debug_out) + print >> self.debug_out, ls + '// ' = \ + + self.maybe_color('green', 'Method: ') + str(callerme= thod) if self.debug_vrb =3D=3D 3: - print(ls + '//---------------------------' + \ - '------------------------------------', file=3Dself.= debug_out) + print >> self.debug_out, ls + '//-----------------------= ----' + \ + '------------------------------------' =20 ## Print the information on all available local variables if callerlocals: if self.debug_vrb =3D=3D 3: - print(ls + '//', file=3Dself.debug_out) - print(ls + '// VALUES ', file=3Dself.debug_out) + print >> self.debug_out, ls + '//' + print >> self.debug_out, ls + '// VALUES ' for i,j in callerlocals.items(): - print(ls + '// ------------------> ' \ - + self.maybe_color('turquoise', str(i)) + ':', - file=3Dself.debug_out) + print >> self.debug_out, ls + '// ------------------> ' = \ + + self.maybe_color('turquoise', str(i)) + ':' breaklines(str(j)) if self.debug_vrb =3D=3D 3: - print(ls + '//------------------------------'\ - '---------------------------------', file=3Dself.d= ebug_out) + print >> self.debug_out, ls + '//-----------------------= -------'\ + '---------------------------------' =20 # Finally print the message breaklines(self.maybe_color('yellow', message)) =20 if self.debug_vrb =3D=3D 3: - print(ls + '//-------------------------------' + \ - '--------------------------------', file=3Dself.debug_= out) - print(ls + '/////////////////////////////////' + \ - '////////////////////////////////', file=3Dself.debug_= out) + print >> self.debug_out, ls + '//---------------------------= ----' + \ + '--------------------------------' + print >> self.debug_out, ls + '/////////////////////////////= ////' + \ + '////////////////////////////////' =20 ## gloabal message handler OUT =3D Message('layman') diff --git a/layman/output.py b/layman/output.py index 3e82305..c900a31 100644 --- a/layman/output.py +++ b/layman/output.py @@ -6,7 +6,6 @@ Distributed under the terms of the GNU General Public License v2 """ =20 -from __future__ import print_function =20 __version__ =3D "0.1" =20 @@ -117,11 +116,11 @@ class Message(MessageBase): return =20 for i in info.split('\n'): - print(self.color_func('yellow', 'DEBUG: ') + i, file=3Dself.= std_out) + print >> self.std_out, self.color_func('yellow', 'DEBUG: ')= + i =20 =20 def notice (self, note): - print(note, file=3Dself.std_out) + print >> self.std_out, note =20 =20 def info (self, info, level =3D INFO_LEVEL): @@ -133,7 +132,7 @@ class Message(MessageBase): return =20 for i in info.split('\n'): - print(self.color_func('green', ' * ') + i, file=3Dself.std_o= ut) + print >> self.std_out, self.color_func('green', ' * ') + i =20 =20 def status (self, message, status, info =3D 'ignored'): @@ -147,7 +146,7 @@ class Message(MessageBase): return =20 for i in lines[0:-1]: - print(self.color_func('green', ' * ') + i, file=3Dself.std_o= ut) + print >> self.std_out, self.color_func('green', ' * ') + i =20 i =3D lines[-1] =20 @@ -161,8 +160,8 @@ class Message(MessageBase): else: result =3D '[' + self.color_func('yellow', info) + ']' =20 - print(self.color_func('green', ' * ') + i + ' ' + \ - '.' * (58 - len(i)) + ' ' + result, file=3Dself.std_out) + print >> self.color_func('green', ' * ') + i + ' ' + \ + '.' * (58 - len(i)) + ' ' + result =20 =20 def warn (self, warn, level =3D WARN_LEVEL): @@ -174,7 +173,7 @@ class Message(MessageBase): return =20 for i in warn.split('\n'): - print(self.color_func('yellow', ' * ') + i, file=3Dself.std_= out) + print >> self.std_out, self.color_func('yellow', ' * ') + i =20 =20 def error (self, error): @@ -188,7 +187,7 @@ class Message(MessageBase): # "layman -L |& less". sys.stdout.flush() self.error_out.flush() - print(self.color_func('red', ' * ') + i, file=3Dself.std_out= ) + print >> self.std_out, self.color_func('red', ' * ') + i sys.stdout.flush() self.do_error_callback(error) =20 diff --git a/layman/version.py b/layman/version.py index 6fadd2a..90c7412 100644 --- a/layman/version.py +++ b/layman/version.py @@ -19,12 +19,10 @@ # Brian Dolbec # =20 -from __future__ import print_function - __version__ =3D "$Id: version.py 309 2007-04-09 16:23:38Z wrobel $" =20 =20 VERSION =3D '2.0.0-git' =20 if __name__ =3D=3D '__main__': - print(VERSION) + print VERSION