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 1PorXP-0005BN-Ge for garchives@archives.gentoo.org; Mon, 14 Feb 2011 06:03:55 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 477E2E09D9; Mon, 14 Feb 2011 06:00:37 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 06FE8E09D9 for ; Mon, 14 Feb 2011 06:00:31 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7CA251B411B for ; Mon, 14 Feb 2011 06:00:31 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id E7A618005E for ; Mon, 14 Feb 2011 06:00:30 +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: <6780f08f787642bb3e1620a0909d96a7e43abb0d.dol-sen@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/cli.py X-VCS-Directories: layman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 6780f08f787642bb3e1620a0909d96a7e43abb0d Date: Mon, 14 Feb 2011 06:00:30 +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: 67b53b08bcfe73559959fc829d141205 commit: 6780f08f787642bb3e1620a0909d96a7e43abb0d Author: Brian Dolbec gmail com> AuthorDate: Tue Jan 18 07:57:18 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sun Feb 13 03:48:34 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3D6780f08f add missing output statements, debug all the new actions --- layman/cli.py | 43 ++++++++++++++++++++++++++----------------- 1 files changed, 26 insertions(+), 17 deletions(-) diff --git a/layman/cli.py b/layman/cli.py index 29b6989..dca6bb6 100644 --- a/layman/cli.py +++ b/layman/cli.py @@ -47,11 +47,11 @@ class ListPrinter(object): self.my_lister =3D self.short_list =20 def print_shortdict(self, info, complain): - #print "ListPrinter.print_tuple()",info - ids =3D sorted(info) - #print "ids =3D=3D=3D=3D=3D=3D=3D>", ids, "\n" - for _id in ids: - overlay =3D info[_id] + #print "ListPrinter.print_shortdict()",info, "\n\n" + overlays =3D sorted(info) + #print "ids =3D=3D=3D=3D=3D=3D=3D>", overlays, "\n" + for ovl in overlays: + overlay =3D info[ovl] #print "overlay =3D", overlay summary, supported, official =3D overlay self.print_overlay(summary, supported, official, complain) @@ -187,7 +187,15 @@ class Main(object): def Fetch(self): ''' Fetches the overlay listing. ''' - return self.api.fetch_remote_list() + self.output.info("Fetching remote list,...", 2) + result =3D self.api.fetch_remote_list() + if result: + self.output.info('Ok', 2) + else: + errors =3D self.api.get_errors() + self.output.warn('Download failed.\nError was: ' + + str('\n'.join(errors)), 2) + return result =20 =20 def Add(self): @@ -212,6 +220,7 @@ class Main(object): def Sync(self): ''' Syncs the selected overlays. ''' + # Note api.sync() defaults to printing results selection =3D decode_selection(self.config['sync']) if self.config['sync_all'] or 'ALL' in selection: selection =3D self.api.get_installed() @@ -243,15 +252,15 @@ class Main(object): selection =3D decode_selection(self.config['info']) if 'ALL' in selection: selection =3D self.api.get_available() - info =3D self.api.get_info_str(selection) - - for overlay in info: - # Is the overlay supported? - self.output.info(overlay[0], 1) - if not overlay[1]: - self.output.warn(NOT_OFFICIAL_MSG, 1) - if not overlay[2]: - self.output.error(NOT_SUPPORTED_MSG) + + list_printer =3D ListPrinter(self.config) + _complain =3D self.config['nocheck'] or self.config['verbose'] + + info =3D self.api.get_info_str(selection, local=3DFalse, + verbose=3DTrue, width=3Dlist_printer.width) + #print "info =3D", info + list_printer.print_shortdict(info, complain=3D_complain) + return info !=3D {} =20 =20 @@ -261,10 +270,10 @@ class Main(object): =20 self.output.debug('Printing remote overlays.', 6) list_printer =3D ListPrinter(self.config) - width =3D list_printer.width =20 _complain =3D self.config['nocheck'] or self.config['verbose'] - info =3D self.api.get_info_list(local=3DFalse, verbose=3Dself.co= nfig['verbose'], width=3Dwidth) + info =3D self.api.get_info_list(local=3DFalse, + verbose=3Dself.config['verbose'], width=3Dlist_printer.width= ) list_printer.print_shortlist(info, complain=3D_complain) =20 return info !=3D {}