enthought / apptools

Other
37 stars 24 forks source link

Avoid writing to preferences on helper creation #343

Closed mdickinson closed 2 months ago

mdickinson commented 2 months ago

This PR fixes the PreferencesHelper to avoid writing to the preferences the first time a helper is created for a given Preferences object.

The issue was that on creation, PreferencesHelper._initialize was being called twice: once with notify=False and again with notify=True, as a result of the listener to the preferences trait. This PR avoids the second call by making that listener only run post creation (using post_init=True).

Closes #342 Closes #74

Checklist

mdickinson commented 2 months ago

@flongford Would you be able to review?