Commit 5b1aca1d5a

5b1aca1d5abd8fcacf5232c336a8288567f208de

parent: a41f6592de

Unsigned

Wraient <wraient.911@gmail.com> · 2024-09-25 13:02 UTC

print error function added

Layout: unified · split

curd.py +8 −1
@@ -15,6 +15,7 @@ import subprocess
15import time 15import time
16import curses 16import curses
17import argparse 17import argparse
18import traceback
18import requests 19import requests
19import csv 20import csv
20import socket 21import socket
@@ -494,7 +495,7 @@ def start_video(link, salt:str, args:list=[]):
494 495
495 subprocess.Popen(command, shell=True) 496 subprocess.Popen(command, shell=True)
496 497
497def send_command(ipc_socket_path, command): 498def mpv_send_command(ipc_socket_path, command):
498 """ 499 """
499 Sends a command to the MPV IPC socket and returns the response. 500 Sends a command to the MPV IPC socket and returns the response.
500 """ 501 """
@@ -634,6 +635,12 @@ def find_anime(anime_list, anilist_id=-1, allanime_id=-1):
634 635
635# ----------------------------------------------- Curd Functions ---------------------------------------- 636# ----------------------------------------------- Curd Functions ----------------------------------------
636 637
638def print_error(message):
639 """Print error message with full traceback."""
640 print(f"ERROR: {message}")
641 print("Traceback:")
642 traceback.print_exc()
643
637def get_contents_of(tmp_file_name): 644def get_contents_of(tmp_file_name):
638 with open(f"/tmp/curd/curd_{tmp_file_name}", "r") as temp_file: 645 with open(f"/tmp/curd/curd_{tmp_file_name}", "r") as temp_file:
639 return temp_file.read() 646 return temp_file.read()