diff --git a/files/classes/comment.py b/files/classes/comment.py index cb532df6b..913c1b231 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -419,10 +419,6 @@ class Comment(Base): return censor_slurs(body, v) - def print(self): - print(f'post: {self.id}, comment: {self.author_id}', flush=True) - return '' - @lazy def collapse_for_user(self, v, path): if v and self.author_id == v.id: return False diff --git a/files/classes/submission.py b/files/classes/submission.py index 84daea59d..d5434b5ad 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -444,10 +444,6 @@ class Submission(Base): return body - def print(self): - print(f'post: {self.id}, author: {self.author_id}', flush=True) - return '' - @lazy def realtitle(self, v): if self.club and not (v and (v.paid_dues or v.id == self.author_id)): diff --git a/files/helpers/media.py b/files/helpers/media.py index d3c7c200f..47ba0f420 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -28,7 +28,7 @@ def process_video(file): else: spider = os.system(f'ffmpeg -y -loglevel warning -i {name} -map_metadata -1 -c:v copy -c:a copy {name}.mp4') - if spider: print(f'ffmpeg returned {spider}') + if spider: print(f'ffmpeg returned {spider}', flush=True) os.remove(name) with open(f"{name}.mp4", 'rb') as f: diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 30f4e078c..2a51f6f20 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -99,7 +99,7 @@ def callback(attrs, new=False): def handler(signum, frame): - print("Timeout!") + print("Timeout!", flush=True) raise Exception("Timeout") def render_emoji(html, regexp, edit, marseys_used=set(), b=False): diff --git a/files/routes/admin.py b/files/routes/admin.py index c25e936c5..6931d7cfa 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -419,7 +419,7 @@ def monthly(v): u.procoins += procoins g.db.add(u) send_repeatable_notification(u.id, f"@{v.username} has given you {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).") - else: print(u.username) + else: print(u.username, flush=True) if request.host == 'pcmemes.net': u = g.db.query(User).filter_by(id=KIPPY_ID).one() diff --git a/files/routes/settings.py b/files/routes/settings.py index 3e3f57955..f7af375fb 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -850,7 +850,7 @@ def settings_song_change(v): with youtube_dl.YoutubeDL(ydl_opts) as ydl: try: ydl.download([f"https://youtube.com/watch?v={id}"]) except Exception as e: - print(e) + print(e, flush=True) return render_template("settings_profile.html", v=v, error="Age-restricted videos aren't allowed.") diff --git a/files/routes/users.py b/files/routes/users.py index 89299d64d..4c57b32e9 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -1218,11 +1218,11 @@ def saved_comments(v, username): def fp(v, fp): v.fp = fp users = g.db.query(User).filter(User.fp == fp, User.id != v.id).all() - if users: print(f'{v.username}: fp') + if users: print(f'{v.username}: fp', flush=True) if v.email and v.is_activated: alts = g.db.query(User).filter(User.email == v.email, User.is_activated, User.id != v.id).all() if alts: - print(f'{v.username}: email') + print(f'{v.username}: email', flush=True) users += alts for u in users: li = [v.id, u.id] @@ -1231,7 +1231,7 @@ def fp(v, fp): new_alt = Alt(user1=v.id, user2=u.id) g.db.add(new_alt) g.db.flush() - print(v.username + ' + ' + u.username) + print(v.username + ' + ' + u.username, flush=True) g.db.add(v) g.db.commit() return '', 204 \ No newline at end of file diff --git a/files/tests/test_e2e.py b/files/tests/test_e2e.py index 865184d00..9ba6b76f7 100644 --- a/files/tests/test_e2e.py +++ b/files/tests/test_e2e.py @@ -30,7 +30,7 @@ def test_signup(): "formkey": formkey, "now": form_timestamp }) - print(f"Signing up as {username}") + print(f"Signing up as {username}", flush=True) assert signup_post_response.status_code == 302 assert "error" not in signup_post_response.location diff --git a/run_tests.py b/run_tests.py index 80e6114a3..c3a976218 100755 --- a/run_tests.py +++ b/run_tests.py @@ -18,9 +18,9 @@ was_running = docker_inspect == "running" # update containers, just in case they're out of date if was_running: - print("Updating containers . . .") + print("Updating containers . . .", flush=True) else: - print("Starting containers . . .") + print("Starting containers . . .", flush=True) subprocess.run([ "docker-compose", "up", @@ -31,7 +31,7 @@ subprocess.run([ ) # run the test -print("Running test . . .") +print("Running test . . .", flush=True) result = subprocess.run([ "docker", "exec", @@ -41,7 +41,7 @@ result = subprocess.run([ if not was_running: # shut down, if we weren't running in the first place - print("Shutting down containers . . .") + print("Shutting down containers . . .", flush=True) subprocess.run([ "docker-compose", "stop",