Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
Wagtail Videos
Commits
69785b13
Commit
69785b13
authored
Aug 03, 2016
by
Seb
Browse files
Changed ffmpeg check to warning intead of error
parent
ef5f2449
Changes
2
Hide whitespace changes
Inline
Side-by-side
wagtailvideos/apps.py
View file @
69785b13
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
from
__future__
import
absolute_import
,
print_function
,
unicode_literals
from
django.apps
import
AppConfig
from
django.apps
import
AppConfig
from
django.core.checks
import
Error
,
register
from
django.core.checks
import
Warning
,
register
from
wagtailvideos.utils
import
which
from
wagtailvideos.utils
import
ffmpeg_installed
def
ffmpeg_check
(
app_configs
,
path
=
None
,
**
kwargs
):
def
ffmpeg_check
(
app_configs
,
path
=
None
,
**
kwargs
):
error
s
=
[]
message
s
=
[]
if
which
(
'ffmpeg'
,
path
=
path
)
is
None
:
if
not
ffmpeg_installed
(
path
=
path
):
error
s
.
append
(
message
s
.
append
(
Error
(
Warning
(
'ffmpeg could not be found on your system
, try installing it.
'
,
'ffmpeg could not be found on your system
. Transcoding will be disabled
'
,
hint
=
None
,
hint
=
None
,
obj
=
'SystemCheckError'
,
id
=
'wagtailvideos.W001'
,
id
=
'wagtailvideos.E001'
,
)
)
)
)
return
error
s
return
message
s
class
WagtailVideosApp
(
AppConfig
):
class
WagtailVideosApp
(
AppConfig
):
...
...
wagtailvideos/utils.py
View file @
69785b13
...
@@ -4,3 +4,9 @@ try:
...
@@ -4,3 +4,9 @@ try:
from
shutil
import
which
from
shutil
import
which
except
ImportError
:
except
ImportError
:
from
distutils.spawn
import
find_executable
as
which
from
distutils.spawn
import
find_executable
as
which
def
ffmpeg_installed
(
path
=
None
):
if
which
(
'ffmpeg'
,
path
=
path
)
is
None
:
return
False
return
True
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