Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PreferencesHelper does not exclude events from being set on Preferences #195

Open
kitchoi opened this issue Nov 6, 2020 · 0 comments
Open

Comments

@kitchoi
Copy link
Contributor

kitchoi commented Nov 6, 2020

Currently if a PreferencesHelper has an event trait and if the event has been fired, the value is also saved in the preferences.

I am not sure this is a desirable behaviour.

e.g.

from apptools.preferences.api import Preferences, PreferencesHelper
from traits.api import Event, Str

class MyPreferencesHelper(PreferencesHelper):
    preferences_path = Str('my_section')

    an_event = Event()

pref = Preferences(filename="tmp.ini")
helper = MyPreferencesHelper(preferences=pref)
helper.an_event = 1
pref.save()

Will create output like this:

[my_section]
an_event = 1

Expected no output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant