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
=== modified file 'serpentine/preferences.py'
--- serpentine/preferences.py 2008-03-03 18:30:50 +0000
+++ serpentine/preferences.py 2009-07-27 15:19:08 +0000
@@ -25,6 +25,10 @@
25from os import path25from os import path
26from types import StringType26from types import StringType
27from gettext import gettext as _27from gettext import gettext as _
28try :
29 from xdg.BaseDirectory import xdg_data_home, xdg_config_home
30except :
31 xdg_config_home = None
2832
29# Local imports33# Local imports
30import gaw34import gaw
@@ -312,7 +316,10 @@
312 316
313 ############317 ############
314 # configDir318 # configDir
315 __config_dir = path.join (path.expanduser ("~"), ".serpentine")319 if xdg_config_home :
320 __config_dir = path.join (xdg_config_home, "serpentine/")
321 else :
322 __config_dir = path.join (path.expanduser ("~"), ".serpentine")
316 def getConfigDir (self):323 def getConfigDir (self):
317 return self.__config_dir324 return self.__config_dir
318 325

Subscribers

No one subscribed via source and target branches