mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
Pylint cleanup (#74)
* Misc fixes * Misc cleanup * Add all_versions to blender_downloader.py * More cleanup * Fix issue with status not reporting engine info * Misc fixes * Misc cleanup * Add all_versions to blender_downloader.py * More cleanup * Fix issue with status not reporting engine info
This commit is contained in:
@@ -11,14 +11,27 @@ logger = logging.getLogger()
|
||||
|
||||
|
||||
def launch_url(url):
|
||||
if subprocess.run(['which', 'xdg-open'], capture_output=True).returncode == 0:
|
||||
subprocess.run(['xdg-open', url]) # linux
|
||||
elif subprocess.run(['which', 'open'], capture_output=True).returncode == 0:
|
||||
subprocess.run(['open', url]) # macos
|
||||
elif subprocess.run(['which', 'start'], capture_output=True).returncode == 0:
|
||||
subprocess.run(['start', url]) # windows - need to validate this works
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
if shutil.which('xdg-open'):
|
||||
opener = 'xdg-open'
|
||||
elif shutil.which('open'):
|
||||
opener = 'open'
|
||||
elif shutil.which('cmd'):
|
||||
opener = 'start'
|
||||
else:
|
||||
logger.error(f"No valid launchers found to launch url: {url}")
|
||||
error_message = f"No valid launchers found to launch URL: {url}"
|
||||
logger.error(error_message)
|
||||
raise OSError(error_message)
|
||||
|
||||
try:
|
||||
if opener == 'start':
|
||||
# For Windows, use 'cmd /c start'
|
||||
subprocess.run(['cmd', '/c', 'start', url], shell=False)
|
||||
else:
|
||||
subprocess.run([opener, url])
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to launch URL: {url}. Error: {e}")
|
||||
|
||||
|
||||
def file_exists_in_mounts(filepath):
|
||||
|
||||
Reference in New Issue
Block a user