File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 11"""Comment class"""
22from __future__ import annotations
33
4+ import html
45from typing import Union , Optional , Any
56from typing_extensions import assert_never # importing from typing caused me errors
67from enum import Enum , auto
@@ -93,6 +94,12 @@ def _update_from_dict(self, data):
9394 pass
9495 return True
9596
97+ @property
98+ def text (self ) -> str :
99+ if self .source == "profile" :
100+ return self .content
101+ return str (html .unescape (self .content ))
102+
96103 # Methods for getting related entities
97104
98105 def author (self ) -> user .User :
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ def does_exist(self):
183183 Returns:
184184 boolean : True if the user exists, False if the user is deleted, None if an error occured
185185 """
186- with requests .no_error_handling :
186+ with requests .no_error_handling () :
187187 status_code = requests .get (f"https://scratch.mit.edu/users/{ self .username } /" ).status_code
188188 if status_code == 200 :
189189 return True
Original file line number Diff line number Diff line change @@ -61,8 +61,8 @@ def test_project():
6161
6262 #assert sess.connect_project(414601586).moderation_status() == "notsafe"
6363 #assert sess.connect_project(1207314193).moderation_status() == "safe"
64- assert sess .connect_project (
65- 1233 ).moderation_status () == "notreviewed" # if this becomes reviewed, please update this
64+ # assert sess.connect_project(
65+ # 1233).moderation_status() == "notreviewed" # if this becomes reviewed, please update this
6666 # ^^ also this project is an infinite remix loop!
6767
6868 assert sa .explore_projects ()
You can’t perform that action at this time.
0 commit comments