Commit 9076762b by willmcgugan

Improved error on fscp

parent 3f3138fe
...@@ -33,7 +33,6 @@ class FileOpThread(threading.Thread): ...@@ -33,7 +33,6 @@ class FileOpThread(threading.Thread):
else: else:
self.action(fs, path, self.dest_fs, dest_path, overwrite=True) self.action(fs, path, self.dest_fs, dest_path, overwrite=True)
except Exception, e: except Exception, e:
print e
self.on_error(e) self.on_error(e)
self.queue.task_done() self.queue.task_done()
break break
...@@ -183,6 +182,7 @@ Copy SOURCE to DESTINATION""" ...@@ -183,6 +182,7 @@ Copy SOURCE to DESTINATION"""
for thread in threads: for thread in threads:
thread.join() thread.join()
complete = True complete = True
if not any_error():
self.post_actions() self.post_actions()
dst_fs.close() dst_fs.close()
...@@ -190,7 +190,6 @@ Copy SOURCE to DESTINATION""" ...@@ -190,7 +190,6 @@ Copy SOURCE to DESTINATION"""
if self.action_errors: if self.action_errors:
for error in self.action_errors: for error in self.action_errors:
self.error(self.wrap_error(unicode(error)) + '\n') self.error(self.wrap_error(unicode(error)) + '\n')
sys.stdout.write('\n')
sys.stdout.flush() sys.stdout.flush()
else: else:
if complete and options.progress: if complete and options.progress:
...@@ -217,7 +216,6 @@ Copy SOURCE to DESTINATION""" ...@@ -217,7 +216,6 @@ Copy SOURCE to DESTINATION"""
self.lock.release() self.lock.release()
def on_error(self, e): def on_error(self, e):
print e
self.lock.acquire() self.lock.acquire()
try: try:
self.action_errors.append(e) self.action_errors.append(e)
...@@ -240,9 +238,7 @@ Copy SOURCE to DESTINATION""" ...@@ -240,9 +238,7 @@ Copy SOURCE to DESTINATION"""
done_steps = int(done * bar_width) done_steps = int(done * bar_width)
bar_steps = ('#' * done_steps).ljust(bar_width) bar_steps = ('#' * done_steps).ljust(bar_width)
msg = '%s %i%%' % (msg, int(done * 100.0)) msg = '%s %i%%' % (msg, int(done * 100.0))
msg = msg.ljust(20) msg = msg.ljust(20)
if total == remaining: if total == remaining:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment