diff --git a/pgn.py b/pgn.py index 91cd9a58..3f4458d2 100644 --- a/pgn.py +++ b/pgn.py @@ -26,6 +26,7 @@ import requests import chess # type: ignore import chess.pgn # type: ignore +import subprocess from email import encoders from email.mime.multipart import MIMEMultipart @@ -487,6 +488,11 @@ def _save_and_email_pgn(self, message): pgn_game.accept(exporter) self.emailer.send("Game PGN", str(pgn_game), self.file_name) + + try: + subprocess.run(['python3', '/home/pi/drupebox/drupebox.py']) + except FileNotFoundError: + pass def _save_pgn(self, message): l_file_name = "games" + os.sep + message.pgn_filename @@ -497,7 +503,12 @@ def _save_pgn(self, message): with open(l_file_name, "w") as file: exporter = chess.pgn.FileExporter(file) pgn_game.accept(exporter) - + + try: + subprocess.run(['python3', '/home/pi/drupebox/drupebox.py']) + except FileNotFoundError: + pass + logger.debug("molli: save pgn finished") def _process_message(self, message):