Skip to content

Commit ad37782

Browse files
committed
Merge branch 'master' of github.com:lra/mackup
2 parents fa1589d + 9cc265e commit ad37782

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

mackup/appsdb.py

+15-19
Original file line numberDiff line numberDiff line change
@@ -57,25 +57,21 @@ def __init__(self):
5757
home = os.path.expanduser('~/')
5858
failobj = "{}.config".format(home)
5959
xdg_config_home = os.environ.get('XDG_CONFIG_HOME', failobj)
60-
if xdg_config_home:
61-
if not os.path.exists(xdg_config_home):
62-
raise ValueError('$XDG_CONFIG_HOME: {} does not exist'
63-
.format(xdg_config_home))
64-
if not xdg_config_home.startswith(home):
65-
raise ValueError('$XDG_CONFIG_HOME: {} must be '
66-
'somewhere within your home '
67-
'directory: {}'
68-
.format(xdg_config_home, home))
69-
if config.has_section('xdg_configuration_files'):
70-
for path in config.options('xdg_configuration_files'):
71-
if path.startswith('/'):
72-
raise ValueError('Unsupported absolute path: '
73-
'{}'
74-
.format(path))
75-
path = os.path.join(xdg_config_home, path)
76-
path = path.replace(home, '')
77-
(self.apps[app_name]['configuration_files']
78-
.add(path))
60+
if not xdg_config_home.startswith(home):
61+
raise ValueError('$XDG_CONFIG_HOME: {} must be '
62+
'somewhere within your home '
63+
'directory: {}'
64+
.format(xdg_config_home, home))
65+
if config.has_section('xdg_configuration_files'):
66+
for path in config.options('xdg_configuration_files'):
67+
if path.startswith('/'):
68+
raise ValueError('Unsupported absolute path: '
69+
'{}'
70+
.format(path))
71+
path = os.path.join(xdg_config_home, path)
72+
path = path.replace(home, '')
73+
(self.apps[app_name]['configuration_files']
74+
.add(path))
7975

8076
@staticmethod
8177
def get_config_files():

0 commit comments

Comments
 (0)