def search_photos(picturepath):
assert picturepath, "picturepath not supplied"
logger.debug('picturepath<%s>' % picturepath)
newsearch = []
for directory, __dirs, files in os.walk(picturepath):
for filename in files:
if re.fullmatch('|'.join(PICTURE_TYPES), os.path.splitext(filename)[1][1:], re.IGNORECASE):
newsearch.append({
'directory' : directory
, 'filename' : filename
})
logger.debug("Number of photos found: %d" % len(newsearch))
return newsearch
评论列表
文章目录