Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
senpy
senpy
Commits
e5662d48
Commit
e5662d48
authored
Jun 20, 2018
by
J. Fernando Sánchez
Browse files
Allow activation fails
parent
61181db1
Changes
5
Hide whitespace changes
Inline
Side-by-side
docker-compose.dev.yml
0 → 100644
View file @
e5662d48
version
:
'
3'
services
:
senpy
:
image
:
"
${IMAGENAME-gsiupm/senpy}:${VERSION-latest}"
entrypoint
:
[
"
/bin/bash"
]
working_dir
:
"
/senpy-plugins"
ports
:
-
5000:5000
volumes
:
-
"
.:/usr/src/app/"
docker-compose.test.yml
0 → 100644
View file @
e5662d48
version
:
'
3'
services
:
test
:
image
:
"
${IMAGENAME-gsiupm/senpy}:${VERSION-dev}"
entrypoint
:
[
"
py.test"
]
volumes
:
-
"
.:/usr/src/app/"
command
:
[]
docker-compose.yml
0 → 100644
View file @
e5662d48
version
:
'
3'
services
:
senpy
:
image
:
"
${IMAGENAME-gsiupm/senpy}:${VERSION-dev}"
build
:
context
:
.
dockerfile
:
Dockerfile${PYVERSION--2.7}
ports
:
-
5001:5000
volumes
:
-
"
./data:/data"
senpy/__main__.py
View file @
e5662d48
...
...
@@ -105,6 +105,12 @@ def main():
action
=
'store_true'
,
default
=
False
,
help
=
'Output the senpy version and exit'
)
parser
.
add_argument
(
'--allow-fail'
,
'--fail'
,
action
=
'store_true'
,
default
=
False
,
help
=
'Do not exit if some plugins fail to activate'
)
args
=
parser
.
parse_args
()
if
args
.
version
:
print
(
'Senpy version {}'
.
format
(
senpy
.
__version__
))
...
...
@@ -128,7 +134,7 @@ def main():
sp
.
install_deps
()
if
args
.
only_install
:
return
sp
.
activate_all
()
sp
.
activate_all
(
allow_fail
=
args
.
allow_fail
)
if
args
.
only_test
:
easy_test
(
sp
.
plugins
(),
debug
=
args
.
debug
)
return
...
...
senpy/extensions.py
View file @
e5662d48
...
...
@@ -318,10 +318,15 @@ class Senpy(object):
else
:
self
.
_default
=
self
.
_plugins
[
value
.
lower
()]
def
activate_all
(
self
,
sync
=
True
):
def
activate_all
(
self
,
sync
=
True
,
allow_fail
=
False
):
ps
=
[]
for
plug
in
self
.
_plugins
.
keys
():
ps
.
append
(
self
.
activate_plugin
(
plug
,
sync
=
sync
))
try
:
self
.
activate_plugin
(
plug
,
sync
=
sync
)
except
Exception
as
ex
:
if
not
allow_fail
:
raise
logger
.
error
(
'Could not activate {}: {}'
.
format
(
plug
,
ex
))
return
ps
def
deactivate_all
(
self
,
sync
=
True
):
...
...
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