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 1QrnUz-00037M-Q5 for garchives@archives.gentoo.org; Fri, 12 Aug 2011 08:53:50 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8778D21C168; Fri, 12 Aug 2011 08:53:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 51F1B21C168 for ; Fri, 12 Aug 2011 08:53:41 +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 C27841B406E for ; Fri, 12 Aug 2011 08:53:40 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id E030180040 for ; Fri, 12 Aug 2011 08:53:39 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <48089976d08152f09bcb49c90b02d80ec66d7616.mgorny@gentoo> Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/ X-VCS-Repository: proj/gentoopm X-VCS-Files: gentoopm/querycli.py X-VCS-Directories: gentoopm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 48089976d08152f09bcb49c90b02d80ec66d7616 Date: Fri, 12 Aug 2011 08:53:39 +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: e0d506ac983a4c857554492b3b3d3790 commit: 48089976d08152f09bcb49c90b02d80ec66d7616 Author: Micha=C5=82 G=C3=B3rny gentoo org> AuthorDate: Fri Aug 12 08:54:47 2011 +0000 Commit: Micha=C5=82 G=C3=B3rny gentoo org> CommitDate: Fri Aug 12 08:54:47 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoopm.git;= a=3Dcommit;h=3D48089976 Support fallback to standard Python console. --- gentoopm/querycli.py | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gentoopm/querycli.py b/gentoopm/querycli.py index c2ab2f0..16909e0 100644 --- a/gentoopm/querycli.py +++ b/gentoopm/querycli.py @@ -108,12 +108,16 @@ class PMQueryCommands(object): =20 try: from IPython import embed + raise ImportError except ImportError: try: from IPython.Shell import IPShellEmbed + raise ImportError except ImportError: - self._arg.error('IPython required for shell') - return 1 + print('For better user experience, install IPython.') + from code import InteractiveConsole + embed =3D InteractiveConsole({'pm': pm}).interact + kwargs['banner'] =3D welc else: embed =3D IPShellEmbed() embed.set_banner(embed.IP.BANNER + '\n\n' + welc)