From 596fed78f1013146836d0ba7fb5b96cd89452684 Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Tue, 20 Aug 2013 22:45:37 -0400 Subject: [PATCH] add docstrings --- common/lib/xmodule/xmodule/contentstore/content.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/lib/xmodule/xmodule/contentstore/content.py b/common/lib/xmodule/xmodule/contentstore/content.py index 8d5bb3f1d5..69a2d6a5ef 100644 --- a/common/lib/xmodule/xmodule/contentstore/content.py +++ b/common/lib/xmodule/xmodule/contentstore/content.py @@ -60,10 +60,17 @@ class StaticContent(object): @staticmethod def is_c4x_path(path_string): + """ + Returns a boolean if a path is believed to be a c4x link based on the leading element + """ return path_string.startswith('/{0}/'.format(XASSET_LOCATION_TAG)) @staticmethod def renamespace_c4x_path(path_string, target_location): + """ + Returns an updated string which incorporates a new org/course in order to remap an asset path + to a new namespace + """ location = StaticContent.get_location_from_path(path_string) location = location.replace(org=target_location.org, course=target_location.course) return StaticContent.get_url_path_from_location(location)