From 20ae20cc4205fcdc744b841d550fa1628d3a9771 Mon Sep 17 00:00:00 2001 From: ckruse Date: Tue, 26 Feb 2013 22:49:13 +0100 Subject: [PATCH 1/2] fix: place config file under ~/.config/bungloo --- Linux/Bungloo.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Linux/Bungloo.py b/Linux/Bungloo.py index 43a9920..de1b5d8 100755 --- a/Linux/Bungloo.py +++ b/Linux/Bungloo.py @@ -4,6 +4,8 @@ import os, sys, pickle, subprocess from PyQt4 import QtCore, QtGui, QtWebKit import Windows, Helper +import shutil + class Bungloo: def __init__(self): @@ -63,11 +65,16 @@ class Controller(QtCore.QObject): def __init__(self, app): QtCore.QObject.__init__(self) self.app = app + self.config_path = os.path.expanduser('~/.config/bungloo/bungloo.cfg') - if not os.path.exists(os.path.expanduser("~/.bungloo/")): - os.makedirs(os.path.expanduser("~/.bungloo/")) + if not os.path.exists(os.path.expanduser("~/.config/bungloo/")): + os.makedirs(os.path.expanduser("~/.config/bungloo/")) + + oldpath = os.path.expanduser('~/.bungloo/bungloo.cfg') + if os.path.isfile(oldpath): + shutil.copyfile(oldpath, self.config_path) + shutil.rmtree(os.path.expanduser('~/.bungloo/')) - self.config_path = os.path.expanduser('~/.bungloo/bungloo.cfg') if os.access(self.config_path, os.R_OK): with open(self.config_path, 'r') as f: self.config = pickle.load(f) From 7c6d9566bb0af196881bb768566271ac51c0187b Mon Sep 17 00:00:00 2001 From: ckruse Date: Tue, 26 Feb 2013 23:24:00 +0100 Subject: [PATCH 2/2] fix: move whole tree --- Linux/Bungloo.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Linux/Bungloo.py b/Linux/Bungloo.py index de1b5d8..b8f6e75 100755 --- a/Linux/Bungloo.py +++ b/Linux/Bungloo.py @@ -65,15 +65,16 @@ class Controller(QtCore.QObject): def __init__(self, app): QtCore.QObject.__init__(self) self.app = app - self.config_path = os.path.expanduser('~/.config/bungloo/bungloo.cfg') + + oldpath = os.path.expanduser('~/.bungloo/') + if os.path.isdir(oldpath): + shutil.copytree(oldpath, os.path.expanduser('~/.config/bungloo/')) + shutil.rmtree(os.path.expanduser('~/.bungloo/')) if not os.path.exists(os.path.expanduser("~/.config/bungloo/")): os.makedirs(os.path.expanduser("~/.config/bungloo/")) - oldpath = os.path.expanduser('~/.bungloo/bungloo.cfg') - if os.path.isfile(oldpath): - shutil.copyfile(oldpath, self.config_path) - shutil.rmtree(os.path.expanduser('~/.bungloo/')) + self.config_path = os.path.expanduser('~/.config/bungloo/bungloo.cfg') if os.access(self.config_path, os.R_OK): with open(self.config_path, 'r') as f: