Use os.path.expanduser("~") instead of os.environ

This commit is contained in:
gm10 2019-02-11 14:25:28 +01:00
parent e5061e1285
commit 01e7d1c28d
No known key found for this signature in database
GPG Key ID: A981D4EA8CF993A9
5 changed files with 6 additions and 6 deletions

View File

@ -70,7 +70,7 @@ class MainWindow(object):
self.window.stick()
plugindir = os.path.join(os.environ["HOME"], ".linuxmint/mintMenu/plugins")
plugindir = os.path.join(os.path.expanduser("~"), ".linuxmint/mintMenu/plugins")
sys.path.append(plugindir)
self.panelSettings = Gio.Settings.new("org.mate.panel")

View File

@ -21,7 +21,7 @@ from plugins.easygsettings import EasyGSettings
# i18n
gettext.install("mintmenu", "/usr/share/linuxmint/locale")
home = os.environ.get("HOME")
home = os.path.expanduser("~")
class PackageDescriptor():
def __init__(self, name, summary, description):

View File

@ -274,7 +274,7 @@ class ApplicationLauncher(easyButton):
self.appComment = self.appComment.strip()
basename = os.path.basename(self.desktopFile)
self.startupFilePath = os.path.join(os.environ['HOME'], ".config/autostart", basename)
self.startupFilePath = os.path.join(os.path.expanduser("~"), ".config/autostart", basename)
if self.startupMonitorId:
filemonitor.removeMonitor(self.startupMonitorId )
if os.path.exists(self.startupFilePath):
@ -384,7 +384,7 @@ class ApplicationLauncher(easyButton):
os.remove(self.startupFilePath)
def addToFavourites(self):
favouritesDir = os.path.join(os.environ['HOME'], ".linuxmint/mintMenu/applications")
favouritesDir = os.path.join(os.path.expanduser("~"), ".linuxmint/mintMenu/applications")
if not os.path.exists(favouritesDir):
os.makedirs(favouritesDir)

View File

@ -17,7 +17,7 @@ from plugins.execute import Execute
# i18n
gettext.install("mintmenu", "/usr/share/linuxmint/locale")
home = os.environ.get("HOME")
home = os.path.expanduser("~")
class pluginclass(object):

View File

@ -8,7 +8,7 @@ from gi.repository import Gtk
from plugins.easybuttons import ApplicationLauncher
home = os.environ.get("HOME")
home = os.path.expanduser("~")
recentApps = []
mintMenuWin = None
recentAppBox = None