Set an option programmatically within the ‘main’ section.
This overrides whatever was in the .ini file.
Parameters:
name – name of the value
value¶ – the value. Note that this value is passed to ConfigParser.set, which supports variable interpolation using pyformat (e.g. %(some_value)s). A raw percent sign not part of an interpolation symbol must therefore be escaped, e.g. %%. The given value may refer to another value already in the file using the interpolation format.
From https:/ /git.launchpad. net/glance/ tree/glance/ db/sqlalchemy/ alembic_ migrations/ __init_ _.py master bracnh line 37.
config. set_main_ option( 'sqlalchemy. url', str(engine.url))
This indeed an expected behaviour, quoting to alembic documentation (http:// alembic. zzzcomputing. com/en/ latest/ api/config. html).
set_main_ option( name, value)
Set an option programmatically within the ‘main’ section.
This overrides whatever was in the .ini file.
Parameters:
name – name of the value
value¶ – the value. Note that this value is passed to ConfigParser.set, which supports variable interpolation using pyformat (e.g. %(some_value)s). A raw percent sign not part of an interpolation symbol must therefore be escaped, e.g. %%. The given value may refer to another value already in the file using the interpolation format.