Merge lp:~ploum-deactivatedaccount/serpentine/xdg_folders into lp:serpentine

Proposed by Lionel Dricot
Status: Needs review
Proposed branch: lp:~ploum-deactivatedaccount/serpentine/xdg_folders
Merge into: lp:serpentine
Diff against target: None lines
To merge this branch: bzr merge lp:~ploum-deactivatedaccount/serpentine/xdg_folders
Reviewer Review Type Date Requested Status
Tiago Cogumbreiro Needs Fixing
Review via email: mp+9324@code.launchpad.net

This proposal supersedes a proposal from 2009-07-23.

To post a comment you must log in.
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote : Posted in a previous version of this proposal

This patch changes the config dir from .serpentine to $XDG_CONFIG_HOME.

As no critical informations are in the current .serpentine, there's no migration plan involved, I think it's a bit overkill to have a migration plan only for the playlist.xml.

Revision history for this message
Tiago Cogumbreiro (cogumbreiro) wrote : Posted in a previous version of this proposal

> This patch changes the config dir from .serpentine to $XDG_CONFIG_HOME.
>
> As no critical informations are in the current .serpentine, there's no
> migration plan involved, I think it's a bit overkill to have a migration plan
> only for the playlist.xml.

In this project we try to make dependencies optional when feasible.

If the import of 'xdg.BaseDirectory' fails, then I would like the algorithm to fall back to the old method.

Could you do that?

review: Needs Resubmitting
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

I don't think that a linux distribution without python-xdg still exists but, anyway, I did make the dependancies optionnal.

Revision history for this message
Tiago Cogumbreiro (cogumbreiro) wrote :

Thanks for the alteration.

The code should follow PEP 008. This means the test is wrong and the code style of that if has an extra white space before the colon.

Could you please fix that?

review: Needs Fixing

Unmerged revisions

166. By Lionel Dricot

oops, wrong folder

165. By Lionel Dricot

xdg is now optionnal

164. By Lionel Dricot

playlist are now in XDG folder

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'serpentine/preferences.py'
2--- serpentine/preferences.py 2008-03-03 18:30:50 +0000
3+++ serpentine/preferences.py 2009-07-27 15:19:08 +0000
4@@ -25,6 +25,10 @@
5 from os import path
6 from types import StringType
7 from gettext import gettext as _
8+try :
9+ from xdg.BaseDirectory import xdg_data_home, xdg_config_home
10+except :
11+ xdg_config_home = None
12
13 # Local imports
14 import gaw
15@@ -312,7 +316,10 @@
16
17 ############
18 # configDir
19- __config_dir = path.join (path.expanduser ("~"), ".serpentine")
20+ if xdg_config_home :
21+ __config_dir = path.join (xdg_config_home, "serpentine/")
22+ else :
23+ __config_dir = path.join (path.expanduser ("~"), ".serpentine")
24 def getConfigDir (self):
25 return self.__config_dir
26

Subscribers

No one subscribed via source and target branches