Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Config confusion #323

Closed
dennisvang opened this issue Jan 6, 2022 · 0 comments
Closed

Config confusion #323

dennisvang opened this issue Jan 6, 2022 · 0 comments

Comments

@dennisvang
Copy link

dennisvang commented Jan 6, 2022

The term "config" is used ambiguously:

  • it may be a pyupdater.utils.config.Config instance (which is a dict subclass)
  • it may be a normal dict representing either the "py_repo_config" object or the "app_config" object from config.pyu (where "app_config" contains the data for the client_config.py file)

This can be quite confusing. For example, PackageHandler.init gets a config argument, which receives a Config instance, which is not stored (only the value of "UPDATE_PATCHES" is stored). The initializer also defines a self.config attribute, but this has nothing to do with the config argument: it becomes a dict with the content of "py_repo_config" (in PackageHandler._load_config).

Some other points:

  • the "py_repo_config" object from config.pyu looks like it is only used to keep a patch count. There is a PackageHandler._add_package_to_config method which is called, which adds a "package" member, but I cannot find where that is ever used. Patch only uses the "patches" member.
  • The way config is initialized in PyUpdater.init, etc. also looks like it can be simplified.
  • If we could replace the custom Config and ConfigManager by e.g. configparser from the standard library, that probably would help a lot (less maintenance).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants