Skip to content

Commit 4f693ae

Browse files
committed
Challenge Completed!
1 parent 486c85e commit 4f693ae

File tree

3 files changed

+325
-25
lines changed

3 files changed

+325
-25
lines changed

python/src/video.py

+21
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ def __init__(self, video_title: str, video_id: str, video_tags: Sequence[str]):
1515
# in case the caller changes the 'video_tags' they passed to us
1616
self._tags = tuple(video_tags)
1717

18+
# custom property: flag
19+
self._flag = None
20+
21+
def __str__(self):
22+
"""Custom String Representation"""
23+
return "{title} ({id}) [{tags}]".format(title=self._title, id=self._video_id, tags=" ".join(self._tags))
24+
1825
@property
1926
def title(self) -> str:
2027
"""Returns the title of a video."""
@@ -29,3 +36,17 @@ def video_id(self) -> str:
2936
def tags(self) -> Sequence[str]:
3037
"""Returns the list of tags of a video."""
3138
return self._tags
39+
40+
# Custom property: flag
41+
@property
42+
def flag(self) -> str:
43+
"""Returns the flag of a video."""
44+
return self._flag
45+
46+
# Custom flag video method
47+
def action_flag(self, reason):
48+
self._flag = reason
49+
50+
# Custom flag removal method
51+
def remove_flag(self):
52+
self._flag = None

0 commit comments

Comments
 (0)