Merge lp:~rafalcieslak256/ubuntu-accomplishments-daemon/NewAPI into lp:ubuntu-accomplishments-daemon
Status: | Merged |
---|---|
Merged at revision: | 45 |
Proposed branch: | lp:~rafalcieslak256/ubuntu-accomplishments-daemon/NewAPI |
Merge into: | lp:ubuntu-accomplishments-daemon |
Diff against target: | 0 lines |
To merge this branch: | bzr merge lp:~rafalcieslak256/ubuntu-accomplishments-daemon/NewAPI |
Related bugs: | |
Related blueprints: |
Reorganizing Accomplishments API
(Medium)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jono Bacon | Pending | ||
Review via email: mp+106229@code.launchpad.net |
Description of the change
This branch fully implements the changes for the new API.
It, thus, removes many functions from the API, and adds a lot of new ones, according to specification.
Instead of passing file paths around, the accomIDs are now a basic data form that functions exchange - more details in the spec wiki page.
* The new API introduces a lot of atomic functions, and rest of code makes use of them whenever it is possible.
* The self.accDB is used to store all data concerning accomplishments in memory, for easier processing. It's a dictionary, that maps accomIDs to their data. It also stores information about collections (collection name as the key) and sets (key: "collection:set").
* Pre-loading all data into accDB also reads ABOUT and extrainformation files, to store default lang in memory, for easier further usage (e.g. in get_all_
* Apart from the new API, this branch also does some clean-up. I removed unnecessary, unused variables, groped common code into single functions (for e.g. displaying bubbles).
* log.msg calls in __init__ changed to print, because __init__ happens before the logger is ready to work, and thus such messages were never displayed.
* Caching images is not slightly simplified.
* self.accomplish
* "Scripts path" is now abandoned, as it can be in many different places. Instead, accDB stores 'script-path' for each accomplishment.
* get_extra_
* 'author' fields (if present) are loaded and stored in collection data - one can use 'get_collection
* The DBus API was accordingly updated.
* Trophy files now contain an 'id' field, that stores accomplishment ID for the trophy, instead of using separate application and accomplishment fields.