pydoit / doit

CLI task management & automation tool
http://pydoit.org
MIT License
1.84k stars 175 forks source link

create class variable to hold config file entries prefix #419

Open castalheiro opened 2 years ago

castalheiro commented 2 years ago

I intend to customize the configuration file entries prefix (e.g.tool.myapp.tasks.make_cookies instead of tool.doit.tasks.make_cookies). However, there is no global setting to replace all "doit" references with my own application name. Therefore i ended up creating a class variable that i can later modify without having to subclass DoitMain and DoitConfig classes.

This documentation page (https://pydoit.org/configuration.html#tool-doit-tasks) provides an example of the default setting.

schettino72 commented 2 years ago

Hey, this is a good use-case.

Right now the code assumes tool.doit prefix for pyproject.toml and no prefix for other names of TOML files... Since we are making the prefix configurable it would be better to make it configurable on every case (whatever TOML file name).

Are you sub-classing DoitMain? I would think it makes more sense to make the configuration by changes in DoitMain instead of DoitConfig.