Skip to content

Commit

Permalink
Fix for os.startfile compatibilty for MacOS #29
Browse files Browse the repository at this point in the history
  • Loading branch information
DilanBoskan committed Nov 21, 2020
1 parent 8b43f9a commit 7b56437
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions VocalRemover.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import pathlib
import sys
import os
import subprocess
from collections import defaultdict
# Used for live text displaying
import queue
Expand All @@ -37,7 +38,7 @@

instrumentalModels_dir = os.path.join(base_path, 'models')
stackedModels_dir = os.path.join(base_path, 'models')
logo_path = os.path.join(base_path, 'img', 'UVR-logo.png')
banner_path = os.path.join(base_path, 'img', 'UVR-banner.png')
refresh_path = os.path.join(base_path, 'img', 'refresh.png')
DEFAULT_DATA = {
'export_path': '',
Expand Down Expand Up @@ -266,7 +267,7 @@ def __init__(self):
self.update()

# --Variables--
self.logo_img = open_image(path=logo_path,
self.logo_img = open_image(path=banner_path,
size=(self.winfo_width(), 9999))
self.refresh_img = open_image(path=refresh_path,
size=(20, 20))
Expand Down Expand Up @@ -617,7 +618,13 @@ def open_export_filedialog(self):

def open_newModel_filedialog(self):
"""Let user paste a ".pth" model to use for the vocal seperation"""
os.startfile('models')
filename = 'models'

if sys.platform == "win32":
os.startfile(filename)
else:
opener = "open" if sys.platform == "darwin" else "xdg-open"
subprocess.call([opener, filename])

def start_conversion(self):
"""
Expand Down

0 comments on commit 7b56437

Please sign in to comment.