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 1PorVd-0004cK-LZ for garchives@archives.gentoo.org; Mon, 14 Feb 2011 06:02:05 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3F7BAE09DE; Mon, 14 Feb 2011 06:00:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0B173E09C2 for ; Mon, 14 Feb 2011 06:00:27 +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 A976B1B40D3 for ; Mon, 14 Feb 2011 06:00:23 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 178B98006E for ; Mon, 14 Feb 2011 06:00:23 +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: <8c0b76134494339ff75bb5c3e8332c69f257838a.dol-sen@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/utils.py X-VCS-Directories: layman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 8c0b76134494339ff75bb5c3e8332c69f257838a Date: Mon, 14 Feb 2011 06:00:23 +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: 7d2b3b9a8ab35e1c6f321fb615026231 commit: 8c0b76134494339ff75bb5c3e8332c69f257838a Author: Brian Dolbec gmail com> AuthorDate: Wed Jul 7 00:21:17 2010 +0000 Commit: Brian Dolbec gmail com> CommitDate: Fri Feb 11 10:46:03 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3D8c0b7613 Add an input parameter, 'output' to delete_empty_directory so that it can= be overriden if desired --- layman/utils.py | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/layman/utils.py b/layman/utils.py index 62014d9..18bf442 100644 --- a/layman/utils.py +++ b/layman/utils.py @@ -103,20 +103,20 @@ def path(path_elements): =20 return pathname =20 -def delete_empty_directory(mdir): +def delete_empty_directory(mdir, output=3DOUT): if os.path.exists(mdir) and not os.listdir(mdir): # Check for sufficient privileges if os.access(mdir, os.W_OK): - OUT.info('Deleting _empty_ directory "%s"' % mdir, 2) + output.info('Deleting _empty_ directory "%s"' % mdir, 2) try: os.rmdir(mdir) except OSError, error: - OUT.warn(str(error)) + output.warn(str(error)) else: - OUT.warn('Insufficient permissions to delete _empty_ folder = "%s".' % mdir) + output.warn('Insufficient permissions to delete _empty_ fold= er "%s".' % mdir) import getpass if getpass.getuser() !=3D 'root': - OUT.warn('Hint: You are not root.') + output.warn('Hint: You are not root.') =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 #