Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions exiftool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down