enthought / enthought/traitsui

Refactor BaseEditor (of EnumEditor) from toolkit specific packages

Open
#857 0 comments 0 reactions 0 assignees View on GitHub
type: refactor
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

Currently both Qt and Wx implementations of the `EnumEditor` (and similar friends) use a base class for mapping and the inverse mapping of values, and the base class contains logic that is in fact toolkit agnostic.
See:
https://github.com/enthought/traitsui/blob/649dbd38a744ec5c0602aec807584ec49fc6bc5f/traitsui/qt4/enum_editor.py#L44-L46

https://github.com/enthought/traitsui/blob/649dbd38a744ec5c0602aec807584ec49fc6bc5f/traitsui/wx/enum_editor.py#L54-L56

These two base classes have exactly the same purpose. They are repeated just so that they can inherit from the toolkit specific `Editor`. It should be possible to refactor this into a mixin class so that the logic is more reusable and changes to these logics don't have to happen twice (or more times if we had more toolkits).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.