From cf8a4628e83952ac6dca7242fb24edaf70a30efc Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Jan 23 2013 16:18:13 +0000 Subject: Correcting patch --- diff --git a/printrun-pull-318.patch b/printrun-pull-318.patch index 540e1e3..054c635 100644 --- a/printrun-pull-318.patch +++ b/printrun-pull-318.patch @@ -1,7 +1,7 @@ From f942c1a00724a87ef0d115cc237bf48f8c837a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 15 Jan 2013 21:22:56 +0100 -Subject: [PATCH 1/2] Tell the user, there was an error while connecting +Subject: [PATCH 1/4] Tell the user, there was an error while connecting Before, when there was an error while connecting, user didn't know, when Pronterface wasn't launched from the terminal. @@ -84,7 +84,7 @@ index 476ffb9..c13b8f7 100755 From ee386e00919210991775550ff2f0a23887f042f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 23 Jan 2013 16:55:38 +0100 -Subject: [PATCH 2/2] Adding UTF-8 decoding back +Subject: [PATCH 2/4] Adding UTF-8 decoding back --- pronterface.py | 2 +- @@ -105,3 +105,61 @@ index c13b8f7..87a18a3 100755 -- 1.7.10 + + +From 064974b7336f02856fd5929eff63a6781892071b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Wed, 23 Jan 2013 17:11:08 +0100 +Subject: [PATCH 3/4] Handle UTF encoding better + +--- + pronterface.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/pronterface.py b/pronterface.py +index 87a18a3..add45e1 100755 +--- a/pronterface.py ++++ b/pronterface.py +@@ -73,7 +73,11 @@ def write(self, data): + self.target(data) + except: + pass +- self.stdout.write(data.encode("utf-8")) ++ try: ++ data = data.encode("utf-8") ++ except: ++ pass ++ self.stdout.write(data) + def flush(self): + self.stdout.flush() + +-- +1.7.10 + + +From 354bfb090fefa9577c36cf8fbb1127e0aaf6f3a6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Wed, 23 Jan 2013 17:12:01 +0100 +Subject: [PATCH 4/4] Do not rise, but end the scope + +--- + pronterface.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pronterface.py b/pronterface.py +index add45e1..89536eb 100755 +--- a/pronterface.py ++++ b/pronterface.py +@@ -1436,8 +1436,8 @@ def connect(self, event): + print _("You might need to add yourself to the dialout group.") + else: + print e +- # Kill the thread anyway +- raise ++ # Kill the scope anyway ++ return + self.statuscheck = True + if port != self.settings.port: + self.set("port", port) +-- +1.7.10 diff --git a/printrun.spec b/printrun.spec index 6b493d8..ce8b11e 100644 --- a/printrun.spec +++ b/printrun.spec @@ -3,7 +3,7 @@ %global snapshot 20130113git%{shortcommit} Name: printrun Version: 0.0 -Release: 20.%{snapshot}%{?dist} +Release: 21.%{snapshot}%{?dist} Summary: RepRap printer interface and tools License: GPLv3+ Group: Applications/Engineering @@ -152,6 +152,9 @@ cd - %doc README* COPYING %changelog +* Wed Jan 23 2013 Miro Hrončok - 0.0-21.20130113git5897fbc +- Handle UTF-8 encode better in patch + * Wed Jan 23 2013 Miro Hrončok - 0.0-20.20130113git5897fbc - Removing UTF-8 removal from patch