file_manager: Use sys.executable to identify python env

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2020-07-14 07:39:05 -04:00
parent 6c58bba8c5
commit 1d1edf33c3

View File

@ -4,6 +4,7 @@
# #
# This file may be distributed under the terms of the GNU GPLv3 license. # This file may be distributed under the terms of the GNU GPLv3 license.
import os import os
import sys
import shutil import shutil
import time import time
import logging import logging
@ -12,7 +13,6 @@ from tornado.ioloop import IOLoop
from tornado.locks import Lock from tornado.locks import Lock
VALID_GCODE_EXTS = ['gcode', 'g', 'gco'] VALID_GCODE_EXTS = ['gcode', 'g', 'gco']
PYTHON_BIN = os.path.expanduser("~/moonraker-env/bin/python")
METADATA_SCRIPT = os.path.join( METADATA_SCRIPT = os.path.join(
os.path.dirname(__file__), "../../scripts/extract_metadata.py") os.path.dirname(__file__), "../../scripts/extract_metadata.py")
@ -239,7 +239,7 @@ class FileManager:
update_list.append(fname) update_list.append(fname)
self.gcode_metadata = exisiting_data self.gcode_metadata = exisiting_data
for fname in update_list: for fname in update_list:
cmd = " ".join([PYTHON_BIN, METADATA_SCRIPT, "-p", cmd = " ".join([sys.executable, METADATA_SCRIPT, "-p",
gc_path, "-f", fname]) gc_path, "-f", fname])
shell_command = self.server.lookup_plugin('shell_command') shell_command = self.server.lookup_plugin('shell_command')
scmd = shell_command.build_shell_command( scmd = shell_command.build_shell_command(