Use os.path.expanduser("~") instead of os.environ
This commit is contained in:
parent
e5061e1285
commit
01e7d1c28d
@ -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")
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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):
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user