1.1 --- a/micropython/table.py Sat Jan 12 18:38:34 2013 +0100
1.2 +++ b/micropython/table.py Sun Jan 13 01:19:41 2013 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Preparation of run-time attribute lookup tables.
1.6
1.7 -Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -233,6 +233,18 @@
1.13 except KeyError:
1.14 raise TableError, "Name %r is not registered as an attribute in the table." % attrname
1.15
1.16 + def has(self, objname):
1.17 +
1.18 + "Return whether the table has a definition for 'objname'."
1.19 +
1.20 + return self.table.has_key(objname)
1.21 +
1.22 + def get(self, objname):
1.23 +
1.24 + "Return the attributes for 'objname'."
1.25 +
1.26 + return self.table[objname]
1.27 +
1.28 def add(self, objname, attributes):
1.29
1.30 "For the given 'objname' add the given 'attributes' to the table."