from gluon.contrib.appconfig import AppConfig
myconfig = AppConfig('/private/appconfig.ini', reload=False)

does not cause an exception even when loading the default ini below, which 
has an empty value (last one):
; App configuration

; db configuration
[db]
uri       = sqlite://storage.sqlite
migrate   = 1
pool_size = 1

; smtp address and credentials
[smtp]
server = smtp.gmail.com:587
sender = y...@gmail.com
login  = username:password


; form styling
[forms]
formstyle = bootstrap3_inline
separator =

Can you post an example of what you are doing and the error?.

Denes



On Saturday, October 24, 2015 at 8:31:45 PM UTC-4, Donald McClymont wrote:
>
> I like the appconfig file approach however I am not clear if there is a 
> recommended approach to handling missing values in the file.  It seems 
> reasonable and convenient that you might want to update the code and the 
> appconfig separately and use a default value if the key isn't present. 
>  However at present a missing value seems to raise a BaseException error 
> which isn't ideal for try... except type structures.
>
> Can someone recommend how to handle or if this situation should just be 
> avoided?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to