Merge branch '2.x/feature/photoshop_prehook' into release/2.10.0

This commit is contained in:
Milan Kolar 2020-06-18 15:09:52 +02:00
commit 997cdb9be3

View file

@ -0,0 +1,23 @@
import pype.lib
from pype.api import Logger
class PhotoshopPrelaunch(pype.lib.PypeHook):
"""This hook will check for the existence of PyWin
PyWin is a requirement for the Photoshop integration.
"""
project_code = None
def __init__(self, logger=None):
if not logger:
self.log = Logger().get_logger(self.__class__.__name__)
else:
self.log = logger
self.signature = "( {} )".format(self.__class__.__name__)
def execute(self, *args, env: dict = None) -> bool:
output = pype.lib._subprocess(["pip", "install", "pywin32==227"])
self.log.info(output)
return True