Skip to content

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

@kitchoi

Description

@kitchoi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions