Skip to content

Commit

Permalink
Fix dumb bug
Browse files Browse the repository at this point in the history
  • Loading branch information
epall committed Dec 3, 2010
1 parent a68ff3c commit 1b37595
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dripbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@ def update_file(event):
remote_path = remote_root + truncated_path
if mask & fsevents.IN_DELETE:
log.info("Deleting %s" % full_path)
if os.path.isdir(full_path):
sftp_client.rmdir(remote_path)
else:
sftp_client.remove(remote_path)
try:
if os.path.isdir(full_path):
sftp_client.rmdir(remote_path)
else:
sftp_client.remove(remote_path)
except IOError:
log.info("File was already deleted")
else:
if os.path.isdir(full_path):
log.info("Creating directory %s" % remote_path)
Expand Down

0 comments on commit 1b37595

Please sign in to comment.