DataSourceRegistry should have GetDataSourceForId method
Bug #691690 reported by
Jeremy Whiting
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zeitgeist Framework |
Fix Released
|
Low
|
Siegfried Gevatter |
Bug Description
DataSourceRegistry should have a way to get a DataSource from it's id especially because the DataSourceEnabled signal only sends an id rather than a DataSource in the signal.
Related branches
lp:~jplacerda/zeitgeist/691690
- Manish Sinha (मनीष सिन्हा): Needs Information
- Seif Lotfy: Pending requested
-
Diff: 101 lines (+40/-5)2 files modified_zeitgeist/engine/extensions/datasource_registry.py (+26/-3)
test/remote-test.py (+14/-2)
Changed in zeitgeist: | |
status: | New → Confirmed |
milestone: | none → 0.7.0 |
Changed in zeitgeist: | |
assignee: | nobody → Siegfried Gevatter (rainct) |
status: | Confirmed → In Progress |
Changed in zeitgeist: | |
status: | New → Confirmed |
Changed in zeitgeist: | |
milestone: | 0.7.0 → 0.8.0 |
Changed in zeitgeist: | |
status: | Confirmed → Fix Committed |
Changed in zeitgeist: | |
milestone: | 0.8.0 → 0.8.1 |
Changed in zeitgeist: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
OK, so as I see it there are various ways to fix this:
a) Not a bug - If they care about data-sources they should keep track of them (GetDataSources at start and DataSourceRegis tered after that). However, what should be fixed is the DataSourceDisco nnected signal, it is currently sending the whole data-source information while just the unique id should be enough.
b) Change DataSourceEnabled to send the whole data-source, so it's consistent with DataSourceRegis tered and DataSourceDisco nnected.
c) Leave DataSourceEnabled as it is, fix DataSourceDisco nnected to only return the unique id (see A) and add a GetDataSourceForId method.
Personally I don't see what a) or b) would bring us. If you're a data-source yourself you'll probably just want to check whether the ID is yours to know what happened to you. If you're a data-source management GUI, which wants to update the information when something is enabled/disabled, you'll be keep track of all data-sources anyway, through a GetDataSources call at startup and successive updates thanks to DataSourceRegis tered signals. This means that when you get a DataSourceEnabled signal you already have the information about the event, and getting a full copy of it won't make your work any easier than just having the unique ID.