Added advance menu option to UI

This commit is contained in:
David Maisonave
2024-11-05 19:01:13 -05:00
parent f6a03afd28
commit ffd0dfec84
6 changed files with 59 additions and 39 deletions

View File

@@ -62,17 +62,17 @@ def installModule(moduleName):
# Note: Linux may first need : sudo apt install python3-pip
# if error starts with "Command 'pip' not found"
# or includes "No module named pip"
results = os.popen(f"pip --version").read()
results = os.popen(f"pip --disable-pip-version-check --version").read()
if results.find("Command 'pip' not found") != -1 or results.find("No module named pip") != -1:
results = os.popen(f"sudo apt install python3-pip").read()
results = os.popen(f"pip --version").read()
results = os.popen(f"pip --disable-pip-version-check --version").read()
if results.find("Command 'pip' not found") != -1 or results.find("No module named pip") != -1:
return -1
if isFreeBSD():
print("Warning: installModule may NOT work on freebsd")
pipArg = ""
pipArg = " --disable-pip-version-check"
if isDocker():
pipArg = " --break-system-packages"
pipArg += " --break-system-packages"
results = os.popen(f"{sys.executable} -m pip install {moduleName}{pipArg}").read() # May need to be f"{sys.executable} -m pip install {moduleName}"
results = results.strip("\n")
if results.find("Requirement already satisfied:") > -1:

View File

@@ -2,13 +2,15 @@
# By David Maisonave (aka Axter) Jul-2024 (https://www.axter.com/)
# Get the latest developers version from following link: https://github.com/David-Maisonave/Axter-Stash/tree/main/plugins/RenameFile
# Based on source code from https://github.com/Serechops/Serechops-Stash/tree/main/plugins/Renamer
try:
import ModulesValidate
ModulesValidate.modulesInstalled(["stashapp-tools", "requests"])
except Exception as e:
import traceback, sys
tb = traceback.format_exc()
print(f"ModulesValidate Exception. Error: {e}\nTraceBack={tb}", file=sys.stderr)
# To automatically install missing modules, uncomment the following lines of code.
# try:
# import ModulesValidate
# ModulesValidate.modulesInstalled(["stashapp-tools", "requests"])
# except Exception as e:
# import traceback, sys
# tb = traceback.format_exc()
# print(f"ModulesValidate Exception. Error: {e}\nTraceBack={tb}", file=sys.stderr)
import os, sys, shutil, json, hashlib, pathlib, logging, time, traceback
from pathlib import Path
@@ -100,7 +102,7 @@ if len(tag_whitelist) > 0:
handleExe = stash.pluginConfig['handleExe']
openedfile = None
if handleExe != None and handleExe != "" and os.path.isfile(handleExe):
ModulesValidate.modulesInstalled(["psutil"], silent=True)
# ModulesValidate.modulesInstalled(["psutil"], silent=True)
from openedFile import openedFile
openedfile = openedFile(handleExe, stash)