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).
The term "config" is used ambiguously:
pyupdater.utils.config.Config
instance (which is adict
subclass)dict
representing either the"py_repo_config"
object or the"app_config"
object fromconfig.pyu
(where"app_config"
contains the data for theclient_config.py
file)This can be quite confusing. For example, PackageHandler.init gets a
config
argument, which receives aConfig
instance, which is not stored (only the value of"UPDATE_PATCHES"
is stored). The initializer also defines aself.config
attribute, but this has nothing to do with theconfig
argument: it becomes a dict with the content of"py_repo_config"
(in PackageHandler._load_config).Some other points:
"py_repo_config"
object fromconfig.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.Config
andConfigManager
by e.g. configparser from the standard library, that probably would help a lot (less maintenance).