Skip to content

Commit b24d2cf

Browse files
committed
updated validate_multimedia.py
1 parent 9c7d6c9 commit b24d2cf

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

validate_multimedia.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
sys.exit(4)
6060

6161
__author__ = 'Hari Sekhon'
62-
__version__ = '0.7.6'
62+
__version__ = '0.7.7'
6363

6464
class MediaValidatorTool(CLI):
6565

@@ -124,7 +124,10 @@ def run(self):
124124
else:
125125
die("path '%s' could not be determined as either a file or directory" % arg)
126126
for arg in args:
127-
self.check_path(arg)
127+
try:
128+
self.check_path(arg)
129+
except OSError as _:
130+
print(_)
128131
if self.failed:
129132
sys.exit(2)
130133

@@ -134,7 +137,13 @@ def check_path(self, path):
134137
# if self.regex and self.regex.search(path):
135138
self.check_media_file(path)
136139
elif os.path.isdir(path):
137-
for item in os.listdir(path):
140+
listing = []
141+
try:
142+
listing = os.listdir(path)
143+
listing = [x for x in listing if x[0] != '.']
144+
except OSError as _:
145+
print(_)
146+
for item in listing:
138147
subpath = os.path.join(path, item)
139148
if os.path.isdir(subpath):
140149
self.check_path(subpath)

0 commit comments

Comments
 (0)