From 50b249f55f11de79dabd9877bfea35f554280892 Mon Sep 17 00:00:00 2001 From: silviana amethyst <1388063+ofloveandhate@users.noreply.github.com> Date: Fri, 19 Jul 2024 10:05:41 -0500 Subject: [PATCH 1/2] more clarity in docstrings --- markdown2canvas/canvas_objects.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/markdown2canvas/canvas_objects.py b/markdown2canvas/canvas_objects.py index 1b4494c..6108894 100644 --- a/markdown2canvas/canvas_objects.py +++ b/markdown2canvas/canvas_objects.py @@ -34,7 +34,9 @@ def find_local_images(html): """ - constructs a map of local url's : Images + returns a dictionary of local url's to markdown2canvas.Images + + works by assuming that local url's don't start with http or https, as those should be online. """ from bs4 import BeautifulSoup @@ -56,7 +58,7 @@ def find_local_images(html): def find_local_files(html): """ - constructs a list of BareFiles, so that they can later be replaced with a url to a canvas thing + constructs a dictionary of markdown2canvas.BareFiles, so that they can later be replaced with a url to a canvas thing after upload """ from bs4 import BeautifulSoup @@ -241,7 +243,7 @@ def publish_linked_content_and_adjust_html(self,course,overwrite=False): def _construct_dict_of_props(self): """ - construct a dictionary of properties, such that it can be used to `edit` a canvas object. + construct an empty dictionary of properties, such that it can be used to `edit` a canvas object. """ d = {} return d @@ -249,9 +251,9 @@ def _construct_dict_of_props(self): def ensure_in_modules(self, course): """ - makes sure this item is listed in the Module on Canvas. If it's not, it's added to the bottom. There's not currently any way to control order. + makes sure this item is listed in the Modules listed (by name) in self.modules, on Canvas. If it's not, it's added to the bottom. There's not currently any way to control order. - If the item doesn't already exist, this function will raise. Be sure to actually publish the content first. + If the item doesn't already exist, this function will raise `DoesntExist`. Be sure to actually publish the content first. """ if not self.canvas_obj: From d4967ae3925e9defd2dec131f8367d4ccac19e62 Mon Sep 17 00:00:00 2001 From: silviana amethyst <1388063+ofloveandhate@users.noreply.github.com> Date: Fri, 19 Jul 2024 10:06:08 -0500 Subject: [PATCH 2/2] clearer imports, and __all__ --- markdown2canvas/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/markdown2canvas/__init__.py b/markdown2canvas/__init__.py index 9e53524..97294dc 100644 --- a/markdown2canvas/__init__.py +++ b/markdown2canvas/__init__.py @@ -36,21 +36,22 @@ __version__ = '0.' __author__ = 'silviana amethyst, Mckenzie West, Allison Beemer' - +__all__ = ['logging','exception','translation_functions','canvas2markdown','tool'] import markdown2canvas.logging import markdown2canvas.exception -from markdown2canvas.setup_functions import * +from .setup_functions import * + import markdown2canvas.translation_functions -from markdown2canvas.course_interaction_functions import * +from .course_interaction_functions import * ################## classes -from markdown2canvas.canvas_objects import CanvasObject, Document, Page, Assignment, Image, File, BareFile, Link +from .canvas_objects import CanvasObject, Document, Page, Assignment, Image, File, BareFile, Link import markdown2canvas.canvas2markdown