make configuration queries more fault-tolerant
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3574 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
		
							parent
							
								
									6eba456319
								
							
						
					
					
						commit
						a9cf186875
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -1,5 +1,5 @@ | |||
| # | ||||
| #  Copyright (c) 2008 Helmut Merz helmutm@cy55.de | ||||
| #  Copyright (c) 2009 Helmut Merz helmutm@cy55.de | ||||
| # | ||||
| #  This program is free software; you can redistribute it and/or modify | ||||
| #  it under the terms of the GNU General Public License as published by | ||||
|  | @ -37,7 +37,7 @@ class Options(AutoNamespace): | |||
|     def __call__(self, key, default=None): | ||||
|         value = self | ||||
|         for part in key.split('.'): | ||||
|             value = getattr(value, part) | ||||
|             value = getattr(value, part, None) | ||||
|         if isinstance(value, Element): | ||||
|             value = default | ||||
|         return value | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 helmutm
						helmutm