Commit fcf82ba2 by Arthur Barrett

fixed pep8 violations for annotation module

parent 946af8e1
...@@ -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"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment