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
fcf82ba2
Commit
fcf82ba2
authored
Mar 11, 2013
by
Arthur Barrett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed pep8 violations for annotation module
parent
946af8e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
common/lib/xmodule/xmodule/annotatable_module.py
+6
-7
No files found.
common/lib/xmodule/xmodule/annotatable_module.py
View file @
fcf82ba2
...
@@ -11,13 +11,13 @@ from xmodule.contentstore.content import StaticContent
...
@@ -11,13 +11,13 @@ from xmodule.contentstore.content import StaticContent
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
class
AnnotatableModule
(
XModule
):
class
AnnotatableModule
(
XModule
):
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/javascript_loader.coffee'
),
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/javascript_loader.coffee'
),
resource_string
(
__name__
,
'js/src/collapsible.coffee'
),
resource_string
(
__name__
,
'js/src/collapsible.coffee'
),
resource_string
(
__name__
,
'js/src/html/display.coffee'
),
resource_string
(
__name__
,
'js/src/html/display.coffee'
),
resource_string
(
__name__
,
'js/src/annotatable/display.coffee'
)],
resource_string
(
__name__
,
'js/src/annotatable/display.coffee'
)],
'js'
:
[]
'js'
:
[]}
}
js_module_name
=
"Annotatable"
js_module_name
=
"Annotatable"
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/annotatable/display.scss'
)]}
css
=
{
'scss'
:
[
resource_string
(
__name__
,
'css/annotatable/display.scss'
)]}
icon_class
=
'annotatable'
icon_class
=
'annotatable'
...
@@ -34,11 +34,11 @@ class AnnotatableModule(XModule):
...
@@ -34,11 +34,11 @@ class AnnotatableModule(XModule):
if
color
is
not
None
:
if
color
is
not
None
:
if
color
in
self
.
highlight_colors
:
if
color
in
self
.
highlight_colors
:
cls
.
append
(
'highlight-'
+
color
)
cls
.
append
(
'highlight-'
+
color
)
attr
[
'_delete'
]
=
highlight_key
attr
[
'_delete'
]
=
highlight_key
attr
[
'value'
]
=
' '
.
join
(
cls
)
attr
[
'value'
]
=
' '
.
join
(
cls
)
return
{
'class'
:
attr
}
return
{
'class'
:
attr
}
def
_get_annotation_data_attr
(
self
,
index
,
el
):
def
_get_annotation_data_attr
(
self
,
index
,
el
):
""" Returns a dict in which the keys are the HTML data attributes
""" Returns a dict in which the keys are the HTML data attributes
...
@@ -58,7 +58,7 @@ class AnnotatableModule(XModule):
...
@@ -58,7 +58,7 @@ class AnnotatableModule(XModule):
if
xml_key
in
el
.
attrib
:
if
xml_key
in
el
.
attrib
:
value
=
el
.
get
(
xml_key
,
''
)
value
=
el
.
get
(
xml_key
,
''
)
html_key
=
attrs_map
[
xml_key
]
html_key
=
attrs_map
[
xml_key
]
data_attrs
[
html_key
]
=
{
'value'
:
value
,
'_delete'
:
xml_key
}
data_attrs
[
html_key
]
=
{
'value'
:
value
,
'_delete'
:
xml_key
}
return
data_attrs
return
data_attrs
...
@@ -76,7 +76,6 @@ class AnnotatableModule(XModule):
...
@@ -76,7 +76,6 @@ class AnnotatableModule(XModule):
delete_key
=
attr
[
key
][
'_delete'
]
delete_key
=
attr
[
key
][
'_delete'
]
del
el
.
attrib
[
delete_key
]
del
el
.
attrib
[
delete_key
]
def
_render_content
(
self
):
def
_render_content
(
self
):
""" Renders annotatable content with annotation spans and returns HTML. """
""" Renders annotatable content with annotation spans and returns HTML. """
xmltree
=
etree
.
fromstring
(
self
.
content
)
xmltree
=
etree
.
fromstring
(
self
.
content
)
...
@@ -123,9 +122,9 @@ class AnnotatableModule(XModule):
...
@@ -123,9 +122,9 @@ class AnnotatableModule(XModule):
self
.
element_id
=
self
.
location
.
html_id
()
self
.
element_id
=
self
.
location
.
html_id
()
self
.
highlight_colors
=
[
'yellow'
,
'orange'
,
'purple'
,
'blue'
,
'green'
]
self
.
highlight_colors
=
[
'yellow'
,
'orange'
,
'purple'
,
'blue'
,
'green'
]
class
AnnotatableDescriptor
(
RawDescriptor
):
class
AnnotatableDescriptor
(
RawDescriptor
):
module_class
=
AnnotatableModule
module_class
=
AnnotatableModule
stores_state
=
True
stores_state
=
True
template_dir_name
=
"annotatable"
template_dir_name
=
"annotatable"
mako_template
=
"widgets/raw-edit.html"
mako_template
=
"widgets/raw-edit.html"
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