Skip to content

Commit 6ac9991

Browse files
authored
Merge pull request #1 from blurstudio/shell-option
Add "shell" keyword argument to ExifTool initialization
2 parents 235ef84 + cd140fa commit 6ac9991

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

exiftool.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ class ExifTool(object):
149149
associated with a running subprocess.
150150
"""
151151

152-
def __init__(self, executable_=None):
152+
def __init__(self, executable_=None, shell=True):
153+
self.shell = shell
153154
if executable_ is None:
154155
self.executable = executable
155156
else:
@@ -168,11 +169,16 @@ def start(self):
168169
warnings.warn("ExifTool already running; doing nothing.")
169170
return
170171
with open(os.devnull, "w") as devnull:
172+
startupInfo = subprocess.STARTUPINFO()
173+
if not self.shell:
174+
# Adding enum 11 (SW_FORCEMINIMIZE in win32api speak) will
175+
# keep it from throwing up a DOS shell when it launches.
176+
startupInfo.dwFlags |= 11
171177
self._process = subprocess.Popen(
172178
[self.executable, "-stay_open", "True", "-@", "-",
173179
"-common_args", "-G", "-n"],
174180
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
175-
stderr=devnull)
181+
stderr=devnull, startupinfo=startupInfo)
176182
self.running = True
177183

178184
def terminate(self):

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
from distutils.core import setup
1818

1919
setup(name="PyExifTool",
20-
version="0.1",
20+
version="0.1.1.post1",
2121
description="Python wrapper for exiftool",
2222
license="GPLv3+",
2323
author="Sven Marnach",
2424
author_email="[email protected]",
25-
url="http://github.com/smarnach/pyexiftool",
25+
url="https://github.com/blurstudio/pyexiftool/tree/shell-option",
2626
classifiers=[
2727
"Development Status :: 3 - Alpha",
2828
"Intended Audience :: Developers",

0 commit comments

Comments
 (0)