Merge lp:~cristiklein/usb-creator/use-xdg into lp:usb-creator

Proposed by Cristian Klein
Status: Rejected
Rejected by: Dimitri John Ledkov
Proposed branch: lp:~cristiklein/usb-creator/use-xdg
Merge into: lp:usb-creator
Diff against target: 16 lines (+4/-2)
1 file modified
usbcreator/misc.py (+4/-2)
To merge this branch: bzr merge lp:~cristiklein/usb-creator/use-xdg
Reviewer Review Type Date Requested Status
Dimitri John Ledkov Needs Fixing
Review via email: mp+15081@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Cristian Klein (cristiklein) wrote :

It is not "polite" to dump the user's home dir with .usb-creator.log. Instead, usb-creator should respect the XDG Base Directory Specification [1] and put this file in $XDG_CACHE_HOME/usbcreator/usbcreator.log.

[1] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

There are a few places where we reffer to that log file, e.g. the most important one that I have found is the apport hook. So this needs further fixing. I will look into that in a few weeks =) I'm fan of XDG-basedir spec so this will be done in the upcoming releases.

review: Needs Fixing

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'usbcreator/misc.py'
2--- usbcreator/misc.py 2009-10-13 09:53:07 +0000
3+++ usbcreator/misc.py 2009-11-20 10:15:22 +0000
4@@ -40,8 +40,10 @@
5 log = logging.getLogger('')
6 # usb-creator used to write ~/.usb-creator.log as root (whoops!), so lets
7 # use a different name here.
8- log_dir = os.path.expanduser('~')
9- log_file = os.path.join(log_dir, '.usbcreator.log')
10+ cache_dir = os.getenv('XDG_CACHE_HOME', os.path.expanduser('~/.cache'))
11+ log_dir = os.path.join(cache_dir, 'usbcreator')
12+ os.makedirs(log_dir)
13+ log_file = os.path.join(log_dir, 'usbcreator.log')
14 handler = None
15 try:
16 handler = logging.handlers.RotatingFileHandler(log_file,

Subscribers

People subscribed via source and target branches