[packages/wicd] - added python-urwid-1.1.0 compatibility patches (LP#1075399) - rel 2

baggins baggins at pld-linux.org
Wed Mar 20 12:51:03 CET 2013


commit 21926e8eb6c0f5d6cf5060432dd23932829dc9fe
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed Mar 20 12:50:36 2013 +0100

    - added python-urwid-1.1.0 compatibility patches (LP#1075399)
    - rel 2

 urwid-fix1.patch | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 urwid-fix2.patch | 43 ++++++++++++++++++++++++++++++++++++
 wicd.spec        |  6 +++++-
 3 files changed, 114 insertions(+), 1 deletion(-)
---
diff --git a/wicd.spec b/wicd.spec
index 13139ef..9ca9197 100644
--- a/wicd.spec
+++ b/wicd.spec
@@ -10,7 +10,7 @@ Summary(hu.UTF-8):	Vezeték és vezeték néklküli hálózati menedzser
 Summary(pl.UTF-8):	Zarządca sieci przewodowych i bezprzewodowych
 Name:		wicd
 Version:	1.7.2.4
-Release:	1
+Release:	2
 License:	GPL v2+
 Group:		X11/Applications/Networking
 Source0:	https://launchpad.net/wicd/1.7/%{version}/+download/wicd-%{version}.tar.gz
@@ -22,6 +22,8 @@ Patch0:		%{name}-init_status.patch
 Patch1:		bashism.patch
 Patch2:		%{name}-desktop.patch
 Patch3:		install_kde.patch
+Patch4:		urwid-fix1.patch
+Patch5:		urwid-fix2.patch
 URL:		http://www.wicd.net/
 BuildRequires:	gettext-devel
 # /etc/pld-release used to detect platform
@@ -149,6 +151,8 @@ Skrypt wicd dla pm-utils.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p0
+%patch4 -p0
+%patch5 -p0
 
 mv po/{ar_EG,ar}.po
 rm po/ast.po
diff --git a/urwid-fix1.patch b/urwid-fix1.patch
new file mode 100644
index 0000000..63eba2e
--- /dev/null
+++ b/urwid-fix1.patch
@@ -0,0 +1,66 @@
+=== modified file 'curses/curses_misc.py'
+--- curses/curses_misc.py	2012-05-06 15:16:15 +0000
++++ curses/curses_misc.py	2012-11-15 09:26:21 +0000
+@@ -349,7 +349,10 @@
+         # We need this to pick our keypresses
+         self.use_enter = use_enter
+ 
+-        self.focus = focus
++        if urwid.VERSION < (1, 1, 0):
++            self.focus = focus
++        else:
++            self.focus_position = focus
+ 
+         self.callback = callback
+         self.user_args = user_args
+@@ -362,7 +365,11 @@
+         self.list = list
+ 
+     def set_focus(self,index):
+-        self.focus = index
++        if urwid.VERSION < (1, 1, 0):
++            self.focus = index
++        else:
++            self.focus_position = index
++
+         # API changed between urwid 0.9.8.4 and 0.9.9
+         try:
+             self.cbox.set_w(SelText(self.list[index]+self.DOWN_ARROW))
+@@ -376,16 +383,21 @@
+     def build_combobox(self,parent,ui,row):
+         str,trash =  self.label.get_text()
+ 
+-        self.cbox = DynWrap(SelText([self.list[self.focus]+self.DOWN_ARROW]),
++        if urwid.VERSION < (1, 1, 0):
++            index = self.focus
++        else:
++            index = self.focus_position
++
++        self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]),
+                 attrs=self.attrs,focus_attr=self.focus_attr)
+         if str != '':
+             w = urwid.Columns([('fixed',len(str),self.label),self.cbox],
+                     dividechars=1)
+-            self.overlay = self.ComboSpace(self.list,parent,ui,self.focus,
++            self.overlay = self.ComboSpace(self.list,parent,ui,index,
+                     pos=(len(str)+1,row))
+         else:
+             w = urwid.Columns([self.cbox])
+-            self.overlay = self.ComboSpace(self.list,parent,ui,self.focus,
++            self.overlay = self.ComboSpace(self.list,parent,ui,index,
+                     pos=(0,row))
+ 
+         self._w = w
+@@ -419,7 +431,10 @@
+         if self.overlay:
+             return self.overlay._listbox.get_focus()
+         else:
+-            return None,self.focus
++            if urwid.VERSION < (1, 1, 0):
++                return None, self.focus
++            else:
++                return None, self.focus_position
+ 
+     def get_sensitive(self):
+         return self.cbox.get_sensitive()
+
diff --git a/urwid-fix2.patch b/urwid-fix2.patch
new file mode 100644
index 0000000..9a0bae6
--- /dev/null
+++ b/urwid-fix2.patch
@@ -0,0 +1,43 @@
+=== modified file 'curses/curses_misc.py'
+--- curses/curses_misc.py	2012-11-15 09:26:21 +0000
++++ curses/curses_misc.py	2012-11-16 09:22:47 +0000
+@@ -352,7 +352,7 @@
+         if urwid.VERSION < (1, 1, 0):
+             self.focus = focus
+         else:
+-            self.focus_position = focus
++            self._w.focus_position = focus
+ 
+         self.callback = callback
+         self.user_args = user_args
+@@ -368,7 +368,10 @@
+         if urwid.VERSION < (1, 1, 0):
+             self.focus = index
+         else:
+-            self.focus_position = index
++            try:
++                self._w.focus_position = index
++            except IndexError:
++                pass
+ 
+         # API changed between urwid 0.9.8.4 and 0.9.9
+         try:
+@@ -386,7 +389,7 @@
+         if urwid.VERSION < (1, 1, 0):
+             index = self.focus
+         else:
+-            index = self.focus_position
++            index = self._w.focus_position
+ 
+         self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]),
+                 attrs=self.attrs,focus_attr=self.focus_attr)
+@@ -434,7 +437,7 @@
+             if urwid.VERSION < (1, 1, 0):
+                 return None, self.focus
+             else:
+-                return None, self.focus_position
++                return None, self._w.focus_position
+ 
+     def get_sensitive(self):
+         return self.cbox.get_sensitive()
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/wicd.git/commitdiff/21926e8eb6c0f5d6cf5060432dd23932829dc9fe



More information about the pld-cvs-commit mailing list