Commit c119e2f4 authored by Louis's avatar Louis

Correction de bug si la variable d'environnement HOME n'est pas définie

parent f03a4494
Pipeline #63340 passed with stage
in 38 seconds
......@@ -8,14 +8,12 @@ import pkg_resources
DATADIR = pkg_resources.resource_filename("pyromaths", "data")
EXODIR = os.path.join(DATADIR, "exercices")
LOCALEDIR = os.path.join(DATADIR, "locale")
HOME = os.path.expanduser("~")
if os.name == 'nt': # Windows
HOME = os.environ['USERPROFILE']
CONFIGDIR = os.path.join(os.environ['APPDATA'], "pyromaths")
elif sys.platform == "darwin": # Mac OS X
HOME = os.environ['HOME']
CONFIGDIR = os.path.join(HOME, "Library", "Application Support", "Pyromaths")
else: # Linux (et autres ?)
HOME = os.environ['HOME']
CONFIGDIR = os.path.join(HOME, ".config", "pyromaths")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment