diff --git a/exiftool.py b/exiftool.py index 8a11daa..4f3aeb9 100644 --- a/exiftool.py +++ b/exiftool.py @@ -148,7 +148,8 @@ class ExifTool(object): associated with a running subprocess. """ - def __init__(self, executable_=None): + def __init__(self, executable_=None, shell=True): + self.shell = shell if executable_ is None: self.executable = executable else: @@ -167,11 +168,16 @@ def start(self): warnings.warn("ExifTool already running; doing nothing.") return with open(os.devnull, "w") as devnull: + startupInfo = subprocess.STARTUPINFO() + if not self.shell: + # Adding enum 11 (SW_FORCEMINIMIZE in win32api speak) will + # keep it from throwing up a DOS shell when it launches. + startupInfo.dwFlags |= 11 self._process = subprocess.Popen( [self.executable, "-stay_open", "True", "-@", "-", "-common_args", "-G", "-n"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=devnull) + stderr=devnull, startupinfo=startupInfo) self.running = True def terminate(self): diff --git a/setup.py b/setup.py index 03e9436..fac724f 100644 --- a/setup.py +++ b/setup.py @@ -17,12 +17,12 @@ from distutils.core import setup setup(name="PyExifTool", - version="0.1", + version="0.1.1.post1", description="Python wrapper for exiftool", license="GPLv3+", author="Sven Marnach", author_email="sven@marnach.net", - url="http://github.com/smarnach/pyexiftool", + url="https://github.com/blurstudio/pyexiftool/tree/shell-option", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers",