From 451fd7234f862ed7174958180b8af91dae7b1f06 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 15 Oct 2011 15:13:15 +0200 Subject: [PATCH] [entropy.transceivers.{ssh,ftp}] respect silent mode if enabled --- .../uri_handlers/plugins/interfaces/ftp_plugin.py | 6 ++++-- .../uri_handlers/plugins/interfaces/ssh_plugin.py | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/entropy/transceivers/uri_handlers/plugins/interfaces/ftp_plugin.py b/libraries/entropy/transceivers/uri_handlers/plugins/interfaces/ftp_plugin.py index 39efd9d31..ad697f8a2 100644 --- a/libraries/entropy/transceivers/uri_handlers/plugins/interfaces/ftp_plugin.py +++ b/libraries/entropy/transceivers/uri_handlers/plugins/interfaces/ftp_plugin.py @@ -286,7 +286,9 @@ class EntropyFtpUriHandler(EntropyUriHandler): self.__transfersize += buf_len def _update_progress(self, force = False): - + if self._silent: + # stfu ! + return upload_percent = 100.0 upload_size = round(self.__filekbcount, 1) @@ -671,4 +673,4 @@ class EntropyFtpUriHandler(EntropyUriHandler): def close(self): """ just call our disconnect method """ - self._disconnect() \ No newline at end of file + self._disconnect() diff --git a/libraries/entropy/transceivers/uri_handlers/plugins/interfaces/ssh_plugin.py b/libraries/entropy/transceivers/uri_handlers/plugins/interfaces/ssh_plugin.py index d5e29f65c..bbd85500e 100644 --- a/libraries/entropy/transceivers/uri_handlers/plugins/interfaces/ssh_plugin.py +++ b/libraries/entropy/transceivers/uri_handlers/plugins/interfaces/ssh_plugin.py @@ -136,6 +136,9 @@ class EntropySshUriHandler(EntropyUriHandler): self.output(current_txt, back = True, header = " ") def _update_progress(self, std_r): + if self._silent: + # stfu ! + return read_buf = "" try: char = std_r.read(1)