Skip to content

Commit

Permalink
Fix filename wildcard expansion on Windows
Browse files Browse the repository at this point in the history
The Windows shell expects us to expand wildcards ourselves.
  • Loading branch information
bgilbert committed Dec 28, 2014
1 parent dac6a5c commit cd69f36
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions anonymize-slide.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from __future__ import division
from ConfigParser import RawConfigParser
from cStringIO import StringIO
from glob import glob
from optparse import OptionParser
import os
import string
Expand All @@ -34,7 +35,7 @@
PROG_DESCRIPTION = '''
Delete the slide label from an SVS or NDPI whole-slide image.
'''.strip()
PROG_VERSION = '1.1'
PROG_VERSION = '1.1.1'
DEBUG = False

# TIFF types
Expand Down Expand Up @@ -531,8 +532,16 @@ def _main():
parser.error('specify a file')
DEBUG = opts.debug

if sys.platform == 'win32':
# The shell expects us to do wildcard expansion
filenames = []
for arg in args:
filenames.extend(glob(arg) or [arg])
else:
filenames = args

exit_code = 0
for filename in args:
for filename in filenames:
try:
for handler in format_handlers:
try:
Expand Down

0 comments on commit cd69f36

Please sign in to comment.