Advanced configuration file parser in Python