[Merge] lp:~vorlon/update-notifier/lp.876298 into lp:update-notifier

Michael Vogt michael.vogt at ubuntu.com
Fri Mar 23 08:36:20 UTC 2012


Thanks a bunch, I don't have a strong opinion about the glob, here is the full alternative that we could
use, but either way is fine I think:
-	res = []
-	regexp = re.compile(r"(.*).permanent-failure$")
-	for file in os.listdir(STAMPDIR):
-		match = regexp.match(file)
-		if match:
-			res.append(match.group(1))
-	return res		
+        files = glob.glob(os.path.join(STAMPDIR, "*.permanent-failure"))
+        return [os.path.splitext(os.path.basename(path))[0] for path in files]

I work on lp:~mvo/update-notifier/lp.876298/ now to add some small tests and I did include this
change but feel free to not merge it if you like the previous version better, both work fine.
-- 
https://code.launchpad.net/~vorlon/update-notifier/lp.876298/+merge/98487
Your team Ubuntu Core Development Team is requested to review the proposed merge of lp:~vorlon/update-notifier/lp.876298 into lp:update-notifier.



More information about the Ubuntu-reviews mailing list