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()
|
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)
|
sys.path.append(plugindir)
|
||||||
|
|
||||||
self.panelSettings = Gio.Settings.new("org.mate.panel")
|
self.panelSettings = Gio.Settings.new("org.mate.panel")
|
||||||
|
@ -21,7 +21,7 @@ from plugins.easygsettings import EasyGSettings
|
|||||||
|
|
||||||
# i18n
|
# i18n
|
||||||
gettext.install("mintmenu", "/usr/share/linuxmint/locale")
|
gettext.install("mintmenu", "/usr/share/linuxmint/locale")
|
||||||
home = os.environ.get("HOME")
|
home = os.path.expanduser("~")
|
||||||
|
|
||||||
class PackageDescriptor():
|
class PackageDescriptor():
|
||||||
def __init__(self, name, summary, description):
|
def __init__(self, name, summary, description):
|
||||||
|
@ -274,7 +274,7 @@ class ApplicationLauncher(easyButton):
|
|||||||
self.appComment = self.appComment.strip()
|
self.appComment = self.appComment.strip()
|
||||||
|
|
||||||
basename = os.path.basename(self.desktopFile)
|
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:
|
if self.startupMonitorId:
|
||||||
filemonitor.removeMonitor(self.startupMonitorId )
|
filemonitor.removeMonitor(self.startupMonitorId )
|
||||||
if os.path.exists(self.startupFilePath):
|
if os.path.exists(self.startupFilePath):
|
||||||
@ -384,7 +384,7 @@ class ApplicationLauncher(easyButton):
|
|||||||
os.remove(self.startupFilePath)
|
os.remove(self.startupFilePath)
|
||||||
|
|
||||||
def addToFavourites(self):
|
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):
|
if not os.path.exists(favouritesDir):
|
||||||
os.makedirs(favouritesDir)
|
os.makedirs(favouritesDir)
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ from plugins.execute import Execute
|
|||||||
|
|
||||||
# i18n
|
# i18n
|
||||||
gettext.install("mintmenu", "/usr/share/linuxmint/locale")
|
gettext.install("mintmenu", "/usr/share/linuxmint/locale")
|
||||||
home = os.environ.get("HOME")
|
home = os.path.expanduser("~")
|
||||||
|
|
||||||
class pluginclass(object):
|
class pluginclass(object):
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ from gi.repository import Gtk
|
|||||||
|
|
||||||
from plugins.easybuttons import ApplicationLauncher
|
from plugins.easybuttons import ApplicationLauncher
|
||||||
|
|
||||||
home = os.environ.get("HOME")
|
home = os.path.expanduser("~")
|
||||||
recentApps = []
|
recentApps = []
|
||||||
mintMenuWin = None
|
mintMenuWin = None
|
||||||
recentAppBox = None
|
recentAppBox = None
|
||||||
|
Loading…
Reference in New Issue
Block a user