Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pyromaths
pyromaths
Commits
c119e2f4
Commit
c119e2f4
authored
Jul 19, 2018
by
Louis
Browse files
Correction de bug si la variable d'environnement HOME n'est pas définie
parent
f03a4494
Pipeline
#63340
passed with stage
in 38 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
pyromaths/directories.py
View file @
c119e2f4
...
...
@@ -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"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment