Call os.chdir() before importing vlc, only if we are running from source. Restore the original current dir after that. Changed wx.NewId() calls to wx.ID_ANY

This commit is contained in:
Jose Manuel Delicado 2018-08-12 14:50:58 +02:00
parent f4e20f8ed4
commit 83612b6a3c
2 changed files with 6 additions and 4 deletions

View File

@ -47,9 +47,6 @@ if system == "Windows":
arch="x64"
os.environ['PYTHON_VLC_MODULE_PATH']=os.path.abspath(paths.app_path("..", "windows-dependencies", arch))
os.environ['PYTHON_VLC_LIB_PATH']=os.path.abspath(paths.app_path("..", "windows-dependencies", arch, "libvlc.dll"))
# I don't know why libvlccore.dll needs to be loaded first, but it works when doing it
from ctypes import CDLL
CDLL(os.path.abspath(paths.app_path("..", "windows-dependencies", arch, "libvlccore.dll")))
#the final log files have been opened succesfully, let's close the temporary files
stdout_temp.close()
stderr_temp.close()

View File

@ -11,8 +11,13 @@ import subprocess
import platform
import output
import youtube_utils
import vlc
system = platform.system()
if system=="Windows" and not hasattr(sys, 'frozen'): # We are running from source on Windows
current_dir=os.getcwd()
os.chdir(os.environ['PYTHON_VLC_MODULE_PATH'])
import vlc
if system=="Windows" and not hasattr(sys, 'frozen'): # Restore the original folder
os.chdir(current_dir)
from mysc.repeating_timer import RepeatingTimer
from mysc.thread_utils import call_threaded
import application