[Xfce4-commits] [apps/xfce4-panel-profiles] 28/162: Fix path joining for desktop files (LP #1484548), replace expanduser with GLib.get_home_dir
noreply at xfce.org
noreply at xfce.org
Fri Jul 13 13:08:47 CEST 2018
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfce4-panel-profiles.
commit 9a0f002890c3b9d54c642262fa4eb78d807f26ad
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Tue Sep 8 21:50:20 2015 -0400
Fix path joining for desktop files (LP #1484548), replace expanduser with GLib.get_home_dir
---
xfpanel-switch/panelconfig.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/xfpanel-switch/panelconfig.py b/xfpanel-switch/panelconfig.py
index c2b0907..d669cda 100644
--- a/xfpanel-switch/panelconfig.py
+++ b/xfpanel-switch/panelconfig.py
@@ -17,8 +17,6 @@ import io
import time
import os
-from os.path import expanduser
-
# yes, python 3.2 has exist_ok, but it will still fail if the mode is different
@@ -97,7 +95,7 @@ class PanelConfig(object):
def get_desktop_source_file(self, desktop):
if self.source is None:
path = os.path.join(
- expanduser("~"), '/.config/xfce4/panel/', desktop)
+ GLib.get_home_dir(), '.config/xfce4/panel/', desktop)
return open(path, 'rb')
else:
return self.source.extractfile(desktop)
@@ -136,7 +134,8 @@ class PanelConfig(object):
result = xfconf.call_sync('SetProperty', GLib.Variant(
'(ssv)', ('xfce4-panel', pp, pv)), 0, -1, None)
- panel_path = expanduser("~") + '/.config/xfce4/panel/'
+ panel_path = os.path.join(
+ GLib.get_home_dir(), '.config/xfce4/panel/')
for d in self.desktops:
bytes = self.get_desktop_source_file(d).read()
mkdir_p(panel_path + os.path.dirname(d))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list