Store data in XDG user directories
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Recipe Manager |
Fix Committed
|
High
|
Jeff Fortin Tam |
Bug Description
As this project's still young/obscure at the moment, I guess now is the time to make sure that we get the user data directory locations "done right" from the start. What I'm referring to is this Freedesktop spec: http://
Especially: http://
I first heard about the xdg desktop dirs thing through this post, which does a good job at explaining the issue/challenges that this spec addresses: http://
See also: http://
In our case, I think the only data we write is the recipes themselves (preferences are done in gconf). Thus, we could store recipes in $XDG_DATA_
... with their respective fallbacks (as described in the specs), of course. Here is an example implementation in Python, which tries to use the environment variables and falls back on hardcoded paths otherwise (I don't know if there's a more elegant way):
http://
(the get_path method, between lines 53 and 91).
Related branches
- Daniel G. Taylor: Approve
-
Diff: 144 lines (+37/-11) (has conflicts)6 files modifiedlibrecipemanager/edit_dialog.py (+5/-2)
librecipemanager/globals.py (+10/-2)
librecipemanager/main_window.py (+5/-0)
librecipemanager/recipe.py (+1/-1)
librecipemanager/recipe_cell_renderer.py (+6/-2)
librecipemanager/utils.py (+10/-4)
Changed in recipe-manager: | |
milestone: | none → 0.4 |
Changed in recipe-manager: | |
status: | In Progress → Fix Committed |
I have implemented it (ridiculously easy with python-xdg), but then the use of default.jpg all over the place in the code is causing problems with the fact that it "expects" it to be present in the same directory as the user's photos data...
I'll have to figure out a way to cleanly point to a different path in case the user has not specified a photo.