Commit ab5834fb by cahrens

Pylint cleanup.

parent e6dfa8e8
...@@ -69,7 +69,7 @@ class CapaFields(object): ...@@ -69,7 +69,7 @@ class CapaFields(object):
max_attempts = StringyInteger( max_attempts = StringyInteger(
display_name="Maximum Attempts", display_name="Maximum Attempts",
help="Defines the number of times a student can try to answer this problem. If the value is not set, infinite attempts are allowed.", help="Defines the number of times a student can try to answer this problem. If the value is not set, infinite attempts are allowed.",
values = {"min" : 1 }, scope=Scope.settings values={"min": 1}, scope=Scope.settings
) )
due = Date(help="Date that this problem is due by", scope=Scope.settings) due = Date(help="Date that this problem is due by", scope=Scope.settings)
graceperiod = Timedelta(help="Amount of time after the due date that submissions will be accepted", scope=Scope.settings) graceperiod = Timedelta(help="Amount of time after the due date that submissions will be accepted", scope=Scope.settings)
...@@ -103,7 +103,7 @@ class CapaFields(object): ...@@ -103,7 +103,7 @@ class CapaFields(object):
weight = StringyFloat( weight = StringyFloat(
display_name="Problem Weight", display_name="Problem Weight",
help="Defines the number of points each problem is worth. If the value is not set, each response field in the problem is worth one point.", help="Defines the number of points each problem is worth. If the value is not set, each response field in the problem is worth one point.",
values = {"min" : 0 , "step": .1}, values={"min": 0, "step": .1},
scope=Scope.settings scope=Scope.settings
) )
markdown = String(help="Markdown source of this module", scope=Scope.settings) markdown = String(help="Markdown source of this module", scope=Scope.settings)
......
...@@ -37,14 +37,14 @@ class WordCloudFields(object): ...@@ -37,14 +37,14 @@ class WordCloudFields(object):
help="Number of text boxes available for students to input words/sentences.", help="Number of text boxes available for students to input words/sentences.",
scope=Scope.settings, scope=Scope.settings,
default=5, default=5,
values = {"min" : 1 } values={"min": 1}
) )
num_top_words = StringyInteger( num_top_words = StringyInteger(
display_name="Maximum Words", display_name="Maximum Words",
help="Maximum number of words to be displayed in generated word cloud.", help="Maximum number of words to be displayed in generated word cloud.",
scope=Scope.settings, scope=Scope.settings,
default=250, default=250,
values = {"min" : 1 } values={"min": 1}
) )
display_student_percents = StringyBoolean( display_student_percents = StringyBoolean(
display_name="Show Percents", display_name="Show Percents",
......
...@@ -76,7 +76,7 @@ class HTMLSnippet(object): ...@@ -76,7 +76,7 @@ class HTMLSnippet(object):
""" """
raise NotImplementedError( raise NotImplementedError(
"get_html() must be provided by specific modules - not present in {0}" "get_html() must be provided by specific modules - not present in {0}"
.format(self.__class__)) .format(self.__class__))
class XModuleFields(object): class XModuleFields(object):
...@@ -358,7 +358,7 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock): ...@@ -358,7 +358,7 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
metadata_translations = { metadata_translations = {
'slug': 'url_name', 'slug': 'url_name',
'name': 'display_name', 'name': 'display_name',
} }
# ============================= STRUCTURAL MANIPULATION =================== # ============================= STRUCTURAL MANIPULATION ===================
def __init__(self, def __init__(self,
...@@ -460,7 +460,6 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock): ...@@ -460,7 +460,6 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
""" """
return False return False
# ================================= JSON PARSING =========================== # ================================= JSON PARSING ===========================
@staticmethod @staticmethod
def load_from_json(json_data, system, default_class=None): def load_from_json(json_data, system, default_class=None):
...@@ -525,10 +524,10 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock): ...@@ -525,10 +524,10 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
# ================================= XML PARSING ============================ # ================================= XML PARSING ============================
@staticmethod @staticmethod
def load_from_xml(xml_data, def load_from_xml(xml_data,
system, system,
org=None, org=None,
course=None, course=None,
default_class=None): default_class=None):
""" """
This method instantiates the correct subclass of XModuleDescriptor based This method instantiates the correct subclass of XModuleDescriptor based
on the contents of xml_data. on the contents of xml_data.
...@@ -543,7 +542,7 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock): ...@@ -543,7 +542,7 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
class_ = XModuleDescriptor.load_class( class_ = XModuleDescriptor.load_class(
etree.fromstring(xml_data).tag, etree.fromstring(xml_data).tag,
default_class default_class
) )
# leave next line, commented out - useful for low-level debugging # leave next line, commented out - useful for low-level debugging
# log.debug('[XModuleDescriptor.load_from_xml] tag=%s, class_=%s' % ( # log.debug('[XModuleDescriptor.load_from_xml] tag=%s, class_=%s' % (
# etree.fromstring(xml_data).tag,class_)) # etree.fromstring(xml_data).tag,class_))
...@@ -665,11 +664,11 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock): ...@@ -665,11 +664,11 @@ class XModuleDescriptor(XModuleFields, HTMLSnippet, ResourceTemplates, XBlock):
type = "Integer" type = "Integer"
elif isinstance(field, Float): elif isinstance(field, Float):
type = "Float" type = "Float"
metadata_fields[field.name] = {'field_name' : field.name, metadata_fields[field.name] = {'field_name': field.name,
'type' : type, 'type': type,
'display_name' : field.display_name, 'display_name': field.display_name,
'value': field.to_json(value), 'value': field.to_json(value),
'options' : values, 'options': values,
'default_value': field.to_json(default_value), 'default_value': field.to_json(default_value),
'inheritable': inheritable, 'inheritable': inheritable,
'explicitly_set': explicitly_set, 'explicitly_set': explicitly_set,
...@@ -768,7 +767,7 @@ class ModuleSystem(object): ...@@ -768,7 +767,7 @@ class ModuleSystem(object):
s3_interface=None, s3_interface=None,
cache=None, cache=None,
can_execute_unsafe_code=None, can_execute_unsafe_code=None,
): ):
''' '''
Create a closure around the system environment. Create a closure around the system environment.
......
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