algoo / preview-generator

generates previews of files with cache management
https://pypi.org/project/preview-generator/
MIT License
235 stars 51 forks source link

Add ordering weight to builder to force strict ordering of builder #237

Closed inkhey closed 3 years ago

inkhey commented 3 years ago

Current code load builders in an order related to the import order which make ordering not really clear and make possible ordering issue, like https://github.com/algoo/preview-generator/issues/235.

This issue is about having a weight parameter to builders and order builder with it.

Original comment: https://github.com/algoo/preview-generator/issues/235#issuecomment-865909389

There are other couple of builder which support same format like svg file (supported by both cairosvg and inkscape).

This is not a problem: the support may be different and one be better in some cases and the other in other cases. The right thing to do for these cases is (for the future):

* explicitly define load order

* allow user to adjust the order

I think the right way to do so is to implement something like a priority weight which would be resolved at load time. This way, it also allows users to define there own builders.

inkhey commented 3 years ago

fixed by #238. The mecanism may be improved later depending on architectural decision.