Commit 5b1aca1d5a
Unsigned
Layout: unified · split
curd.py +8 −1
| @@ -15,6 +15,7 @@ import subprocess | ||
| 15 | 15 | import time |
| 16 | 16 | import curses |
| 17 | 17 | import argparse |
| 18 | import traceback | |
| 18 | 19 | import requests |
| 19 | 20 | import csv |
| 20 | 21 | import socket |
| @@ -494,7 +495,7 @@ def start_video(link, salt:str, args:list=[]): | ||
| 494 | 495 | |
| 495 | 496 | subprocess.Popen(command, shell=True) |
| 496 | 497 | |
| 497 | def send_command(ipc_socket_path, command): | |
| 498 | def mpv_send_command(ipc_socket_path, command): | |
| 498 | 499 | """ |
| 499 | 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 | 636 | # ----------------------------------------------- Curd Functions ---------------------------------------- |
| 636 | 637 | |
| 638 | def print_error(message): | |
| 639 | """Print error message with full traceback.""" | |
| 640 | print(f"ERROR: {message}") | |
| 641 | print("Traceback:") | |
| 642 | traceback.print_exc() | |
| 643 | ||
| 637 | 644 | def get_contents_of(tmp_file_name): |
| 638 | 645 | with open(f"/tmp/curd/curd_{tmp_file_name}", "r") as temp_file: |
| 639 | 646 | return temp_file.read() |