From 97dabf2db622a4ac40b1bc08ef0232f8b9177ea6 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Wed, 15 Feb 2012 12:25:41 +0400 Subject: [PATCH] Fix progressbar. (Fail on close). --- pym/client/progressbar.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pym/client/progressbar.py b/pym/client/progressbar.py index a559dbf..69599de 100644 --- a/pym/client/progressbar.py +++ b/pym/client/progressbar.py @@ -61,7 +61,8 @@ class GProgressBar(NoneProgressBar): title = re.sub("<[^>]+>", "", title) self.title = title if os.system('which Xdialog &>/dev/null') == 0: - pipe = subprocess.Popen('/usr/bin/Xdialog --progress "%s" 6 80'\ + pipe = subprocess.Popen( + '/usr/bin/Xdialog --title="" --progress "%s" 6 80'\ %(self.title), stdin=subprocess.PIPE, stdout=subprocess.PIPE, @@ -83,8 +84,11 @@ class GProgressBar(NoneProgressBar): def _set(self,value): if self.pipein: - self.pipein.write("%02d\n"%value) - self.pipein.flush() + try: + self.pipein.write("%02d\n"%value) + self.pipein.flush() + except: + pass def setValue(self,value): '''Установить текущее значения для прогресса'''