enthought / pyface

pyface: traits-capable windowing framework
Other
105 stars 55 forks source link

Move schemas and related code out of Tasks #1076

Closed corranwebster closed 2 years ago

corranwebster commented 2 years ago

Schemas are generic, this PR moves the Schema code out of pyface.tasks and into pyface.action, making it available for use outside of tasks. Additionally a version of ActionManagerBuilder is included to provide a Tasks-independent way of assembling the Schemas into action managers, which fixes #658.

Additionally, the code is slightly modified so that it does not import toolkit code as a side-effect.

The old locations are kept so imports should still work. They will be removed at some yet-to-be-determined future point.

corranwebster commented 2 years ago

Note that while there is a more immediate need of this change, this opens up the possibility of using Schemas in TraitsUI instead of directly creating pyface.action objects.

corranwebster commented 2 years ago

Only thing I notice is that we still have aInstance("pyface.tasks.action.schema_addition.SchemaAddition") in tasks_application.py which could instead be Instance("pyface.action.schema.schema_addition.SchemaAddition")

Good catch - my search only looked for imports.

Corrected, and I will merge after this.