Merge branch '2.2.x' into 2.2.x-saas

This commit is contained in:
Martin Konecny 2012-12-03 17:08:49 -05:00
commit fc09e8cd74
1 changed files with 4 additions and 2 deletions

View File

@ -154,6 +154,9 @@ def walk_supported(directory, clean_empties=False):
that support the extensions we are considering. When clean_empties that support the extensions we are considering. When clean_empties
is True we recursively delete empty directories left over in is True we recursively delete empty directories left over in
directory after the walk. """ directory after the walk. """
if directory is None:
return
for root, dirs, files in os.walk(directory): for root, dirs, files in os.walk(directory):
full_paths = ( os.path.join(root, name) for name in files full_paths = ( os.path.join(root, name) for name in files
if is_file_supported(name) ) if is_file_supported(name) )
@ -162,8 +165,7 @@ def walk_supported(directory, clean_empties=False):
def file_locked(path): def file_locked(path):
cmd = "lsof %s" % path f = Popen(["lsof", path], stdout=PIPE).stdout
f = Popen(cmd, shell=True, stdout=PIPE).stdout
return bool(f.readlines()) return bool(f.readlines())
def magic_move(old, new, after_dir_make=lambda : None): def magic_move(old, new, after_dir_make=lambda : None):