This commit is contained in:
恍兮惚兮 2024-12-01 12:50:28 +08:00
parent e05c29e205
commit 80c691a578

View File

@ -48,15 +48,9 @@ def grabwindow(app="PNG", callback_origin=None, tocliponly=False):
os.makedirs(dirname, exist_ok=True) os.makedirs(dirname, exist_ok=True)
fname = os.path.join(dirname, tmsp) fname = os.path.join(dirname, tmsp)
except: except:
fnamebase = "cache/screenshot" fname = gobject.getcachedir(
if not os.path.exists(fnamebase): "screenshot/{}/{}".format(exename, tmsp), abspath=False
fnamebase = windows.SHGetFolderPathW(windows.CSIDL_MYPICTURES) )
if not (fnamebase and os.path.exists(fnamebase)):
fnamebase = "cache/screenshot"
else:
fnamebase = os.path.join(fnamebase, "LunaTranslator")
fname = os.path.join(fnamebase, exename, tmsp)
os.makedirs(os.path.join(fnamebase, exename), exist_ok=True)
def callback_1(callback_origin, uid, tocliponly, p: QPixmap, fn): def callback_1(callback_origin, uid, tocliponly, p: QPixmap, fn):
if p.isNull(): if p.isNull():