added exceptions for .DS_Store and Thumbs.db in mirror_dir
This commit is contained in:
12
googlemap.py
12
googlemap.py
@@ -35,9 +35,17 @@ def mirror_dir(src, dst, entities=None):
|
||||
if not os.path.exists(dst):
|
||||
os.mkdir(dst)
|
||||
if entities and type(entities) != list: raise Exception("Expected a list, got a %r instead" % type(entities))
|
||||
|
||||
|
||||
# files which are problematic and should not be copied
|
||||
# usually, generated by the OS
|
||||
skip_files = ['Thumbs.db', '.DS_Store']
|
||||
|
||||
for entry in os.listdir(src):
|
||||
if entities and entry not in entities: continue
|
||||
if entry in skip_files:
|
||||
continue
|
||||
if entities and entry not in entities:
|
||||
continue
|
||||
|
||||
if os.path.isdir(os.path.join(src,entry)):
|
||||
mirror_dir(os.path.join(src, entry), os.path.join(dst, entry))
|
||||
elif os.path.isfile(os.path.join(src,entry)):
|
||||
|
||||
Reference in New Issue
Block a user