From 31fda6e95d41590fe579ce6d4f42c017e03eb37b Mon Sep 17 00:00:00 2001 From: jeremy Date: Sat, 25 Apr 2020 21:40:24 +0200 Subject: [PATCH] english is better --- data/scenario_resource.py | 4 ++-- term_utils.py | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/data/scenario_resource.py b/data/scenario_resource.py index e12e299..210f7b9 100644 --- a/data/scenario_resource.py +++ b/data/scenario_resource.py @@ -5,10 +5,10 @@ intro_text = "\n>$ You have been hacked\n>$ try to escape from the bad virus\n>$ random_text = [ "\n>$ All your base are belong to us\n>$ ", "\n>$ The Answer to the Ultimate Question of Life, the Universe, and Everything is 42\n>$ ", - "\n>$ Que la force soit avec toi\n>$ ", + "\n>$ May the force be with you\n>$ ", "\n>$ YOU SHALL NOT PASS!\n>$ ", "\n>$ It's a trap!\n>$ ", "\n>$ rm -rf /\n>$ ", "\n>$ poweroff\n>$ ", - "\n>$ userdel $LOGNAME" + "\n>$ userdel $LOGNAME\n>$ " ] diff --git a/term_utils.py b/term_utils.py index 0eb79e6..e4e3e04 100644 --- a/term_utils.py +++ b/term_utils.py @@ -45,11 +45,14 @@ class Term: return False def print_creepy(self, msg): - with open(self.tty, "w") as file: - for char in msg: - file.write(char) - file.flush() - time.sleep(random.uniform(0, 0.2)) + try: + with open(self.tty, "w") as file: + for char in msg: + file.write(char) + file.flush() + time.sleep(random.uniform(0, 0.2)) + except PermissionError: + return False @staticmethod def print_all_creepy(msg):