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
93000af7
Commit
93000af7
authored
Feb 14, 2013
by
Vasyl Nakvasiuk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix problem with mutable default value in `VideoAlphaModule._get_source`
parent
26094a04
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
common/lib/xmodule/xmodule/videoalpha_module.py
+8
-10
No files found.
common/lib/xmodule/xmodule/videoalpha_module.py
View file @
93000af7
...
...
@@ -69,10 +69,10 @@ class VideoAlphaModule(XModule):
if
'position'
in
state
:
self
.
position
=
int
(
float
(
state
[
'position'
]))
def
_get_source
(
self
,
xmltree
,
ext
ensions
=
[
'mp4'
,
'ogv'
,
'avi'
,
'webm'
]
):
"""Find the first valid source, which ends with one of
`extensions`."""
condition
=
lambda
src
:
any
([
src
.
endswith
(
ext
)
for
ext
in
ext
ensions
])
def
_get_source
(
self
,
xmltree
,
ext
=
None
):
"""Find the first valid source, which ends with one of
`ext`."""
ext
=
[
'mp4'
,
'ogv'
,
'avi'
,
'webm'
]
if
ext
is
None
else
ext
condition
=
lambda
src
:
any
([
src
.
endswith
(
ext
)
for
ext
in
ext
])
return
self
.
_get_first_external
(
xmltree
,
'source'
,
condition
)
def
_get_track
(
self
,
xmltree
):
...
...
@@ -110,11 +110,10 @@ class VideoAlphaModule(XModule):
return
parse_time
(
xmltree
.
get
(
'from'
)),
parse_time
(
xmltree
.
get
(
'to'
))
def
handle_ajax
(
self
,
dispatch
,
get
):
'''
Handle ajax calls to this video.
TODO (vshnayder): This is not being called right now, so the position
is not being saved.
'''
"""Handle ajax calls to this video.
TODO (vshnayder): This is not being called right now, so the
position is not being saved.
"""
log
.
debug
(
u"GET {0}"
.
format
(
get
))
log
.
debug
(
u"DISPATCH {0}"
.
format
(
dispatch
))
if
dispatch
==
'goto_position'
:
...
...
@@ -124,7 +123,6 @@ class VideoAlphaModule(XModule):
raise
Http404
()
def
get_instance_state
(
self
):
#log.debug(u"STATE POSITION {0}".format(self.position))
return
json
.
dumps
({
'position'
:
self
.
position
})
def
get_html
(
self
):
...
...
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