comparison martini/config.py @ 20:93c198d9bf84

syntax
author Jeff Hammel <k0scist@gmail.com>
date Tue, 24 Nov 2020 14:49:30 -0800
parents 81e0743dbe53
children
comparison
equal deleted inserted replaced
19:81e0743dbe53 20:93c198d9bf84
66 return an object with __getitem__ defined appropriately 66 return an object with __getitem__ defined appropriately
67 to allow referencing like self['foo']['bar'] 67 to allow referencing like self['foo']['bar']
68 """ 68 """
69 return OrderedDict(self.items(section)) 69 return OrderedDict(self.items(section))
70 70
71 def get(self, section, option, default=None, **kw) 71 def get(self, section, option, default=None, **kw):
72 try: 72 try:
73 value = ConfigParser.get(self, section, option, **kw) 73 value = ConfigParser.get(self, section, option, **kw)
74 except NoOptionError: 74 except NoOptionError:
75 return default 75 return default
76 return value 76 return value