1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2024-10-31 22:05:58 +00:00

Reveal in Explorer / Finder, close #895

This commit is contained in:
Andrew Senetar 2021-08-18 20:51:45 -05:00
parent 2fff1a3436
commit 6b8f85e39a
Signed by: arsenetar
GPG Key ID: C63300DCE48AB2F1

View File

@ -70,7 +70,8 @@ except ImportError:
from PyQt5.QtGui import QDesktopServices
from qtlib.util import getAppData
from core.util import executable_folder
from hscommon.plat import ISWINDOWS
from hscommon.plat import ISWINDOWS, ISOSX
import subprocess
def _open_url(url):
QDesktopServices.openUrl(QUrl(url))
@ -80,6 +81,11 @@ except ImportError:
QDesktopServices.openUrl(url)
def _reveal_path(path):
if ISWINDOWS:
subprocess.run(["explorer", "/select,", op.abspath(path)])
elif ISOSX:
subprocess.run(["open", "-R", op.abspath(path)])
else:
_open_path(op.dirname(str(path)))
def _special_folder_path(special_folder, appname=None, portable=False):