Merge branch 'main' into zdy
This commit is contained in:
@@ -4,9 +4,9 @@ import platform
|
||||
import subprocess
|
||||
import requests
|
||||
|
||||
#import Xlib.display
|
||||
# import Xlib.display
|
||||
import pyautogui
|
||||
#from PIL import ImageGrab, Image
|
||||
# from PIL import ImageGrab, Image
|
||||
from PIL import Image
|
||||
from flask import Flask, request, jsonify, send_file
|
||||
|
||||
@@ -47,7 +47,6 @@ def capture_screen_with_cursor():
|
||||
# Ensure the screenshots directory exists
|
||||
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
||||
|
||||
|
||||
# fixme: This is a temporary fix for the cursor not being captured on Windows and Linux
|
||||
if user_platform == "Windows" or user_platform == "Linux":
|
||||
def _download_image(url, path):
|
||||
@@ -191,10 +190,10 @@ def open_file():
|
||||
return f"File not found: {path}", 404
|
||||
|
||||
try:
|
||||
if platform.system()=="Windows":
|
||||
if platform.system() == "Windows":
|
||||
os.startfile(path)
|
||||
else:
|
||||
open_cmd: str = "open" if platform.system()=="Darwin" else "xdg-open"
|
||||
open_cmd: str = "open" if platform.system() == "Darwin" else "xdg-open"
|
||||
subprocess.Popen([open_cmd, str(path)])
|
||||
return "File opened successfully"
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user