Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Fachschaftsrat Physik TUKL
Protokoll
protokoll_skript
Commits
f86a658d
Commit
f86a658d
authored
Aug 07, 2018
by
Lorenz Steinert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return error and dont exit
parent
89f3b497
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
bin/module/esme.py
bin/module/esme.py
+8
-7
No files found.
bin/module/esme.py
View file @
f86a658d
...
...
@@ -29,6 +29,8 @@ class Error(Flag):
NO_FILE
=
auto
()
LDAP_FAIL
=
auto
()
NO_DEFAULT_FILE
=
auto
()
NO_DIR
=
auto
()
NO_DEFAULT_DIR
=
auto
()
def
current_user
():
...
...
@@ -305,18 +307,17 @@ def get_share(rundir, config=None, sharedir=None):
if
os
.
path
.
isdir
(
sharedir
):
return
sharedir
logging
.
warning
(
sharedir
+
': Not a Directory'
)
sys
.
exit
(
2
)
return
Error
.
NO_DIR
elif
config
:
if
os
.
path
.
isdir
(
config
[
'PROTOKOLL'
][
'share'
]):
return
config
[
'PROTOKOLL'
][
'share'
]
logging
.
warning
(
config
[
'PROTOKOLL'
][
'share'
]
+
': Not a Directory'
)
sys
.
exit
(
2
)
return
Error
.
NO_DIR
elif
os
.
path
.
isdir
(
os
.
path
.
join
(
rundir
,
'../share'
)):
return
os
.
path
.
join
(
rundir
,
'../share'
)
logging
.
warning
(
'No share Directory found at '
+
os
.
path
.
abspath
(
os
.
path
.
join
(
rundir
,
'../share'
)))
sys
.
exit
(
1
)
return
Error
.
NO_DEFAULT_DIR
def
get_path
(
rundir
,
config
=
None
,
path
=
None
):
"""get the location of the protokoll directory"""
...
...
@@ -324,17 +325,17 @@ def get_path(rundir, config=None, path=None):
if
os
.
path
.
isdir
(
path
):
return
path
logging
.
warning
(
path
+
': Not a Directory'
)
sys
.
exit
(
2
)
return
Error
.
NO_DIR
elif
config
:
if
os
.
path
.
isdir
(
config
[
'PROTOKOLL'
][
'path'
]):
return
config
[
'PROTOKOLL'
][
'path'
]
logging
.
warning
(
config
[
'PROTOKOLL'
][
'path'
]
+
': Not a Directory'
)
sys
.
exit
(
2
)
return
Error
.
NO_DIR
elif
os
.
path
.
isdir
(
os
.
path
.
join
(
rundir
,
'../..'
)):
return
os
.
path
.
join
(
rundir
,
'../..'
)
logging
.
warning
(
'No Protokoll Directory found at '
+
os
.
path
.
abspath
(
os
.
path
.
join
(
rundir
,
'../..'
)))
sys
.
exit
(
1
)
return
Error
.
NO_DEFAULT_DIR
def
get_ldap_server
(
config
=
None
,
server
=
None
):
...
...
Write
Preview
Markdown
is supported
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