Skip to content

Commit

Permalink
style: Linter errors are fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
myhailo-chernyshov-rg committed Jan 7, 2025
1 parent 33aa620 commit e24e7cd
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 33 deletions.
12 changes: 6 additions & 6 deletions src/cc2olx/content_parsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from cc2olx.content_parsers.video import VideoContentParser

__all__ = [
'AbstractContentParser',
'DiscussionContentParser',
'HtmlContentParser',
'LtiContentParser',
'QtiContentParser',
'VideoContentParser',
"AbstractContentParser",
"DiscussionContentParser",
"HtmlContentParser",
"LtiContentParser",
"QtiContentParser",
"VideoContentParser",
]
14 changes: 6 additions & 8 deletions src/cc2olx/content_parsers/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ def _parse_content(self, idref: Optional[str]) -> Dict[str, str]:
content = self._parse_webcontent(idref, resource)
elif web_link_content := self._parse_web_link_content(resource):
content = self._transform_web_link_content_to_html(web_link_content)
elif (
any(
re.match(resource_type, resource["type"]) for resource_type
in (
CommonCartridgeResourceType.LTI_LINK,
CommonCartridgeResourceType.QTI_ASSESSMENT,
CommonCartridgeResourceType.DISCUSSION_TOPIC,
)
elif any(
re.match(resource_type, resource["type"])
for resource_type in (
CommonCartridgeResourceType.LTI_LINK,
CommonCartridgeResourceType.QTI_ASSESSMENT,
CommonCartridgeResourceType.DISCUSSION_TOPIC,
)
):
content = self.DEFAULT_CONTENT
Expand Down
12 changes: 6 additions & 6 deletions src/cc2olx/olx_generators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
from cc2olx.olx_generators.video import VideoOlxGenerator

__all__ = [
'AbstractOlxGenerator',
'DiscussionOlxGenerator',
'HtmlOlxGenerator',
'LtiOlxGenerator',
'QtiOlxGenerator',
'VideoOlxGenerator',
"AbstractOlxGenerator",
"DiscussionOlxGenerator",
"HtmlOlxGenerator",
"LtiOlxGenerator",
"QtiOlxGenerator",
"VideoOlxGenerator",
]
2 changes: 1 addition & 1 deletion src/cc2olx/olx_generators/discussion.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def create_nodes(self, content: dict) -> List[xml.dom.minidom.Element]:
"display_name": "",
"discussion_category": content["title"],
"discussion_target": content["title"],
}
},
)

return [html_node, discussion_node]
2 changes: 1 addition & 1 deletion src/cc2olx/olx_generators/lti.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ def create_nodes(self, content: dict) -> List[xml.dom.minidom.Element]:
"modal_width": content["width"],
"xblock-family": "xblock.v1",
"lti_id": content["lti_id"],
}
},
)
return [lti_consumer_node]
10 changes: 3 additions & 7 deletions src/cc2olx/olx_generators/qti.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,8 @@ def _create_essay_problem(
el(
"assessments",
[
el(
"assessment",
None,
attributes={"name": "staff-assessment", "required": "True"}
),
]
el("assessment", None, attributes={"name": "staff-assessment", "required": "True"}),
],
),
el(
"prompts",
Expand All @@ -290,7 +286,7 @@ def _create_essay_problem(
"url_name": problem_data["ident"],
"text_response": "required",
"prompts_type": "html",
}
},
)

# if a sample solution exists add on top of ora, because
Expand Down
5 changes: 1 addition & 4 deletions src/cc2olx/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,4 @@ def import_string(dotted_path: str) -> Type:
try:
return cached_import(module_path, class_name)
except AttributeError as err:
raise ImportError(
'Module "%s" does not define a "%s" attribute/class'
% (module_path, class_name)
) from err
raise ImportError('Module "%s" does not define a "%s" attribute/class' % (module_path, class_name)) from err

0 comments on commit e24e7cd

Please sign in to comment.