1- """ Video Block Static Content, class copied from StaticContent class in edx-platform/xmodule/contentstore/content.py """
1+ """
2+ Video Block Static Content.
3+
4+ Class copied from StaticContent class in edx-platform/xmodule/contentstore/content.py
5+ """
26from opaque_keys import InvalidKeyError
37from opaque_keys .edx .keys import AssetKey
48from opaque_keys .edx .locator import AssetLocator
59
6- class VideoBlockStaticContent : # lint-amnesty, pylint: disable=missing-class-docstring
7- def __init__ (self , loc , name , content_type , data , last_modified_at = None , thumbnail_location = None , import_path = None ,
8- length = None , locked = False , content_digest = None ):
10+
11+ class VideoBlockStaticContent :
12+ """
13+ Represents static content associated with a video block (such as video files or related assets).
14+ """
15+ def __init__ ( # pylint: disable=too-many-positional-arguments
16+ self , loc , name , content_type , data , last_modified_at = None ,
17+ thumbnail_location = None , import_path = None , length = None , locked = False , content_digest = None
18+ ):
919 self .location = loc
10- self .name = name # a display string which can be edited, and thus not part of the location which needs to be fixed # lint-amnesty, pylint: disable=line-too-long
20+ # a display string which can be edited, and thus not part of the location which needs to be fixed
21+ self .name = name
1122 self .content_type = content_type
1223 self ._data = data
1324 self .length = length
@@ -20,7 +31,7 @@ def __init__(self, loc, name, content_type, data, last_modified_at=None, thumbna
2031 self .content_digest = content_digest
2132
2233 @staticmethod
23- def compute_location (course_key , path , revision = None , is_thumbnail = False ): # lint-amnesty, pylint: disable=unused-argument
34+ def compute_location (course_key , path , revision = None , is_thumbnail = False ): # pylint: disable=unused-argument
2435 """
2536 Constructs a location object for static content.
2637
@@ -48,6 +59,7 @@ def get_location_from_path(path):
4859 if path .startswith ('/' ) or path .endswith ('/' ):
4960 # try stripping off the leading slash and try again
5061 return AssetKey .from_string (path .strip ('/' ))
62+ return None
5163
5264 @staticmethod
5365 def serialize_asset_key_with_slash (asset_key ):
0 commit comments