Skip to content

Commit fc0cff1

Browse files
committed
refactor: Rename LibraryElementKey to LibraryItemKey
1 parent 2419bd7 commit fc0cff1

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 2.12.0
22

3-
* Refactor: Rename LibraryCollectionKey to LibraryElementKey.
3+
* Refactor: Rename LibraryCollectionKey to LibraryItemKey.
44
* Added LibraryContainerLocator.
55

66
# 2.11.0

opaque_keys/edx/keys.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@ def make_asset_key(self, asset_type: str, path: str) -> AssetKey: # pragma: no
9393
raise NotImplementedError()
9494

9595

96-
class LibraryElementKey(OpaqueKey):
96+
class LibraryItemKey(OpaqueKey):
9797
"""
98-
An :class:`opaque_keys.OpaqueKey` identifying a particular element in a library
99-
that is not an Xblock.
98+
An :class:`opaque_keys.OpaqueKey` identifying a particular item in a library.
10099
"""
101100
KEY_TYPE = 'library_element_key'
102101
library_key: LibraryLocatorV2

opaque_keys/edx/locator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from opaque_keys import OpaqueKey, InvalidKeyError
1818
from opaque_keys.edx.keys import AssetKey, CourseKey, DefinitionKey, \
19-
LearningContextKey, UsageKey, UsageKeyV2, LibraryElementKey
19+
LearningContextKey, UsageKey, UsageKeyV2, LibraryItemKey
2020

2121
log = logging.getLogger(__name__)
2222

@@ -1623,7 +1623,7 @@ def html_id(self) -> str:
16231623
return str(self)
16241624

16251625

1626-
class LibraryCollectionLocator(CheckFieldMixin, LibraryElementKey):
1626+
class LibraryCollectionLocator(CheckFieldMixin, LibraryItemKey):
16271627
"""
16281628
When serialized, these keys look like:
16291629
lib-collection:org:lib:collection-id
@@ -1654,7 +1654,7 @@ def __init__(self, library_key: LibraryLocatorV2, collection_id: str):
16541654
@property
16551655
def org(self) -> str | None: # pragma: no cover
16561656
"""
1657-
The organization that this object belongs to.
1657+
The organization that this Collection belongs to.
16581658
"""
16591659
return self.library_key.org
16601660

@@ -1677,7 +1677,7 @@ def _from_string(cls, serialized: str) -> Self:
16771677
raise InvalidKeyError(cls, serialized) from error
16781678

16791679

1680-
class LibraryContainerLocator(CheckFieldMixin, LibraryElementKey):
1680+
class LibraryContainerLocator(CheckFieldMixin, LibraryItemKey):
16811681
"""
16821682
When serialized, these keys look like:
16831683
lct:org:lib:ct-type:ct-id
@@ -1711,7 +1711,7 @@ def __init__(self, library_key: LibraryLocatorV2, container_type: str, container
17111711
@property
17121712
def org(self) -> str | None: # pragma: no cover
17131713
"""
1714-
The organization that this object belongs to.
1714+
The organization that this Container belongs to.
17151715
"""
17161716
return self.library_key.org
17171717

0 commit comments

Comments
 (0)