wok diff wicd/stuff/831_830.patch @ rev 19392

Up vmtouch (1.1.0)
author Paul Issott <paul@slitaz.org>
date Sat Aug 27 20:53:04 2016 +0100 (2016-08-27)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/wicd/stuff/831_830.patch	Sat Aug 27 20:53:04 2016 +0100
     1.3 @@ -0,0 +1,66 @@
     1.4 +=== modified file 'curses/curses_misc.py'
     1.5 +--- curses/curses_misc.py	2012-05-06 15:16:15 +0000
     1.6 ++++ curses/curses_misc.py	2012-11-15 09:26:21 +0000
     1.7 +@@ -349,7 +349,10 @@
     1.8 +         # We need this to pick our keypresses
     1.9 +         self.use_enter = use_enter
    1.10 + 
    1.11 +-        self.focus = focus
    1.12 ++        if urwid.VERSION < (1, 1, 0):
    1.13 ++            self.focus = focus
    1.14 ++        else:
    1.15 ++            self.focus_position = focus
    1.16 + 
    1.17 +         self.callback = callback
    1.18 +         self.user_args = user_args
    1.19 +@@ -362,7 +365,11 @@
    1.20 +         self.list = list
    1.21 + 
    1.22 +     def set_focus(self,index):
    1.23 +-        self.focus = index
    1.24 ++        if urwid.VERSION < (1, 1, 0):
    1.25 ++            self.focus = index
    1.26 ++        else:
    1.27 ++            self.focus_position = index
    1.28 ++
    1.29 +         # API changed between urwid 0.9.8.4 and 0.9.9
    1.30 +         try:
    1.31 +             self.cbox.set_w(SelText(self.list[index]+self.DOWN_ARROW))
    1.32 +@@ -376,16 +383,21 @@
    1.33 +     def build_combobox(self,parent,ui,row):
    1.34 +         str,trash =  self.label.get_text()
    1.35 + 
    1.36 +-        self.cbox = DynWrap(SelText([self.list[self.focus]+self.DOWN_ARROW]),
    1.37 ++        if urwid.VERSION < (1, 1, 0):
    1.38 ++            index = self.focus
    1.39 ++        else:
    1.40 ++            index = self.focus_position
    1.41 ++
    1.42 ++        self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]),
    1.43 +                 attrs=self.attrs,focus_attr=self.focus_attr)
    1.44 +         if str != '':
    1.45 +             w = urwid.Columns([('fixed',len(str),self.label),self.cbox],
    1.46 +                     dividechars=1)
    1.47 +-            self.overlay = self.ComboSpace(self.list,parent,ui,self.focus,
    1.48 ++            self.overlay = self.ComboSpace(self.list,parent,ui,index,
    1.49 +                     pos=(len(str)+1,row))
    1.50 +         else:
    1.51 +             w = urwid.Columns([self.cbox])
    1.52 +-            self.overlay = self.ComboSpace(self.list,parent,ui,self.focus,
    1.53 ++            self.overlay = self.ComboSpace(self.list,parent,ui,index,
    1.54 +                     pos=(0,row))
    1.55 + 
    1.56 +         self._w = w
    1.57 +@@ -419,7 +431,10 @@
    1.58 +         if self.overlay:
    1.59 +             return self.overlay._listbox.get_focus()
    1.60 +         else:
    1.61 +-            return None,self.focus
    1.62 ++            if urwid.VERSION < (1, 1, 0):
    1.63 ++                return None, self.focus
    1.64 ++            else:
    1.65 ++                return None, self.focus_position
    1.66 + 
    1.67 +     def get_sensitive(self):
    1.68 +         return self.cbox.get_sensitive()
    1.69 +