Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
5cce5688
Commit
5cce5688
authored
Jan 31, 2013
by
Vasyl Nakvasiuk
Committed by
Valera Rozuvan
Feb 14, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add docstrings in videoalpha_module.py
parent
4f08d96c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
common/lib/xmodule/xmodule/videoalpha_module.py
+6
-7
No files found.
common/lib/xmodule/xmodule/videoalpha_module.py
View file @
5cce5688
...
@@ -54,9 +54,10 @@ class VideoAlphaModule(XModule):
...
@@ -54,9 +54,10 @@ class VideoAlphaModule(XModule):
if
'position'
in
state
:
if
'position'
in
state
:
self
.
position
=
int
(
float
(
state
[
'position'
]))
self
.
position
=
int
(
float
(
state
[
'position'
]))
def
_get_source
(
self
,
xmltree
,
extension
=
[
'mp4'
,
'ogv'
,
'avi'
,
'webm'
]):
def
_get_source
(
self
,
xmltree
,
extensions
=
[
'mp4'
,
'ogv'
,
'avi'
,
'webm'
]):
# find the first valid source
"""Find the first valid source, which ends with one of
condition
=
lambda
src
:
any
([
src
.
endswith
(
ext
)
for
ext
in
extension
])
`extensions`."""
condition
=
lambda
src
:
any
([
src
.
endswith
(
ext
)
for
ext
in
extensions
])
return
self
.
_get_first_external
(
xmltree
,
'source'
,
condition
)
return
self
.
_get_first_external
(
xmltree
,
'source'
,
condition
)
def
_get_track
(
self
,
xmltree
):
def
_get_track
(
self
,
xmltree
):
...
@@ -64,10 +65,8 @@ class VideoAlphaModule(XModule):
...
@@ -64,10 +65,8 @@ class VideoAlphaModule(XModule):
return
self
.
_get_first_external
(
xmltree
,
'track'
)
return
self
.
_get_first_external
(
xmltree
,
'track'
)
def
_get_first_external
(
self
,
xmltree
,
tag
,
condition
=
bool
):
def
_get_first_external
(
self
,
xmltree
,
tag
,
condition
=
bool
):
"""
"""Will return the first 'valid' element of the given tag.
Will return the first valid element
'valid' means that `condition('src' attribute) == True`
of the given tag.
'valid' means has a non-empty 'src' attribute
"""
"""
result
=
None
result
=
None
for
element
in
xmltree
.
findall
(
tag
):
for
element
in
xmltree
.
findall
(
tag
):
...
...
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