Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
aal
studsoiger
Commits
62449f55
Commit
62449f55
authored
Oct 29, 2017
by
Kiste
Browse files
Catch non existing environment variable
parent
de7c4e4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
studsauger/studsauger.py
View file @
62449f55
...
...
@@ -23,10 +23,12 @@ def main():
else
:
print
(
'Die Konfigurationsdatei "'
+
args
.
config
+
'" existiert nicht!'
)
exit
(
1
)
elif
os
.
path
.
isfile
(
os
.
environ
[
'XDG_CONFIG_HOME'
]
+
'/studsauger/config.yaml'
):
configpath
=
os
.
environ
[
'XDG_CONFIG_HOME'
]
+
'/studsauger/config.yaml'
elif
os
.
path
.
isfile
(
os
.
environ
[
'HOME'
]
+
'/.config/studsauger/config.yaml'
):
configpath
=
os
.
environ
[
'HOME'
]
+
'/.config/studsauger/config.yaml'
elif
'XDG_CONFIG_HOME'
in
os
.
environ
:
if
os
.
path
.
isfile
(
os
.
environ
[
'XDG_CONFIG_HOME'
]
+
'/studsauger/config.yaml'
):
configpath
=
os
.
environ
[
'XDG_CONFIG_HOME'
]
+
'/studsauger/config.yaml'
elif
'HOME'
in
os
.
environ
:
if
os
.
path
.
isfile
(
os
.
environ
[
'HOME'
]
+
'/.config/studsauger/config.yaml'
):
configpath
=
os
.
environ
[
'HOME'
]
+
'/.config/studsauger/config.yaml'
if
configpath
:
with
open
(
configpath
,
'r'
)
as
stream
:
...
...
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