From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id DB8D31381F3 for ; Wed, 29 May 2013 03:53:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 758F3E0ADC; Wed, 29 May 2013 03:53:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E18D0E0ADC for ; Wed, 29 May 2013 03:53:12 +0000 (UTC) Received: from [192.168.1.210] (S010600222de111ff.vc.shawcable.net [96.49.5.156]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id A079F33E109 for ; Wed, 29 May 2013 03:53:11 +0000 (UTC) Message-ID: <1369799589.3446.106.camel@big_daddy.dol-sen.ca> Subject: Re: [gentoo-catalyst] PKGCACHE_PATH and os.makedirs() usage From: Brian Dolbec To: gentoo-catalyst@lists.gentoo.org Date: Tue, 28 May 2013 20:53:09 -0700 In-Reply-To: <201305282317.42617.vapier@gentoo.org> References: <1369793318.3446.100.camel@big_daddy.dol-sen.ca> <201305282317.42617.vapier@gentoo.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Archives-Salt: bc4b7181-1a70-46a3-83cc-67464ec353d7 X-Archives-Hash: ea9924fb7ee23ba51124bc6f39c87dc9 On Tue, 2013-05-28 at 23:17 -0400, Mike Frysinger wrote: > On Tuesday 28 May 2013 22:08:38 Brian Dolbec wrote: > > Further investigation of the use of os.makedirs() reveals that none of > > it's frequent use does any error checking or exception escaping. > > I propose to move this common code to either a utility function or > > possibly a FileOps class that the main classes can then subclass or > > create an instance of. I need to investigate what method will be best. > > That way, exceptions can be controlled for the type of failure desired. > > As well as proper shutdown procedures to run for a failure. > > i get the feeling that catalyst really needs to get away from implementing > everything itself (either open coding it, or generating its own util libs). > there are perfectly fine drop in util libs like snakeoil. > http://docs.snakeoil.googlecode.com/git/index.html > osutils.ensure_dirs() > -mike yeah, good idea. I keep forgetting all what snakeoil offers, but moving to using some of it at least was on my TODO.