[python-cmd2/f18] Fix silent editor check patch.

Martin Mágr mmagr at fedoraproject.org
Wed Feb 20 13:47:18 UTC 2013


commit 2a318d5a558c4119f0b5a98b50bb33aabb9b29d4
Author: Martin Magr <mmagr at redhat.com>
Date:   Wed Feb 20 14:41:19 2013 +0100

    Fix silent editor check patch.

 python-cmd2.spec          |    5 ++++-
 silent-editor-check.patch |   15 +++++++++------
 2 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/python-cmd2.spec b/python-cmd2.spec
index 5240d49..9688299 100644
--- a/python-cmd2.spec
+++ b/python-cmd2.spec
@@ -6,7 +6,7 @@
 
 Name:             python-cmd2
 Version:          0.6.4
-Release:          5%{?dist}
+Release:          6%{?dist}
 Summary:          Extra features for standard library's cmd module
 
 Group:            Development/Libraries
@@ -136,6 +136,9 @@ popd
 
 
 %changelog
+* Wed Feb 20 2013 Martin Magr <mmagr at redhat.com> - 0.6.4-6
+- Fixed silent editor check patch
+
 * Mon Feb 04 2013 Martin Magr <mmagr at redhat.com> - 0.6.4-5
 - Added silent editor check patch (https://bitbucket.org/catherinedevlin/cmd2/issue/1/silent-editor-check)
 
diff --git a/silent-editor-check.patch b/silent-editor-check.patch
index 3c02f3f..be4ddb8 100644
--- a/silent-editor-check.patch
+++ b/silent-editor-check.patch
@@ -1,25 +1,28 @@
-From 3e10ae189e2ccf7fcdaaa1aaebfe4d0293a8bb6c Mon Sep 17 00:00:00 2001
+From 590a9dfd32fa729d05d474ac81bccc7eebf6b9bd Mon Sep 17 00:00:00 2001
 From: Martin Magr <mmagr at redhat.com>
 Date: Tue, 29 Jan 2013 13:54:15 +0100
 Subject: [PATCH] Added vi as possible editor and made editor check silent.
 
 Fixes: rhbz#889774
 ---
- cmd2.py | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
+ cmd2.py | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/cmd2.py b/cmd2.py
-index ba7fab8..eff65f8 100755
+index ba7fab8..85ad9c8 100755
 --- a/cmd2.py
 +++ b/cmd2.py
-@@ -420,9 +420,11 @@ class Cmd(cmd.Cmd):
+@@ -420,9 +420,14 @@ class Cmd(cmd.Cmd):
          if sys.platform[:3] == 'win':
              editor = 'notepad'
          else:
 -            for editor in ['gedit', 'kate', 'vim', 'emacs', 'nano', 'pico']:
 -                if subprocess.Popen(['which', editor], stdout=subprocess.PIPE).communicate()[0]:
 +            for editor in ['gedit', 'kate', 'vim', 'vi', 'emacs', 'nano', 'pico']:
-+                if subprocess.Popen(['which', editor]).communicate()[0]:
++                _proc = subprocess.Popen(['which', editor],
++                                         stdout=subprocess.PIPE,
++                                         stderr=subprocess.STDOUT)
++                if _proc.communicate()[0]:
                      break
 +            else:
 +                editor = None


More information about the scm-commits mailing list