From 609a64acedf6ec4697bf129b29f3c1187ae5d7e9 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 30 Mar 2012 16:16:02 +0100 Subject: Add indexing access to the various commands in build systems --- morphlib/buildsystem.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'morphlib/buildsystem.py') diff --git a/morphlib/buildsystem.py b/morphlib/buildsystem.py index 759693d2..ba6d8998 100644 --- a/morphlib/buildsystem.py +++ b/morphlib/buildsystem.py @@ -36,6 +36,10 @@ class BuildSystem(object): self.build_commands = [] self.test_commands = [] self.install_commands = [] + + def __getitem__(self, key): + key = '_'.join(key.split('-')) + return getattr(self, key) def used_by_project(self, srcdir): '''Does project at ``srcdir`` use this build system?''' -- cgit v1.2.1