On 02/13/2013 12:10 PM, Ales Kozumplik wrote:
On 02/12/2013 06:34 PM, James Antill wrote:
  Trying to be much shorter, the problem that two objects solves is that
you have API users which look like:

yb = YumBase()
yb.preconf.installroot = "/myinstallroot"
print yb.conf.whatever

...so you need a way to set a subset of the available configuration
before the "rest" of the configuration is loaded.

Ah, that's true. The DNF approach approach towards the API users is:

- if it's something that is essential for how the config loading
(logging, root override) happens, make sure to specify it before the
given action takes place
- read_conf_file() is what loads the configuration, it just puts the
loaded values directly into the conf object.
- if the api user doesn't like that read_conf_file() overrides some of
his previous configuration he can change it back later. This is
inconvenient, but very transparent


(sent too early)

The point is: there should only be one conf object that looks simple and predictable from the outside. Let the trickery be hidden inside.

Ales
_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to