Utilities for dealing with configuration files for BridgeDB.
loadConfig
(configFile=None, configCls=None)[source]¶Load configuration settings on top of the current settings.
All pathnames and filenames within settings in the configFile
will be
expanded, and their expanded values will be stored in the returned
configuration
object.
Note:
On the strange-looking use of:
exec compile(open(configFile).read(), '<string>', 'exec') in dict()
in this function…
The contents of the config file should be compiled first, and then passed
to exec()
– not execfile()
! – in order to get the contents of
the config file to exist within the scope of the configuration dictionary.
Otherwise, Python will default to executing the config file directly
within the globals()
scope.
Additionally, it’s roughly 20-30 times faster to use the compile()
builtin on a string (the contents of the file) before passing it to
exec()
, than using execfile()
directly on the file.
Variables: | itsSafeToUseLogging (bool) – This is called in
|
---|---|
Parameters: |
|
Returns: | A new |