Merge lp:~nacl/wicd/1.6-urwid-0.9.9-compat into lp:wicd/1.6
- 1.6-urwid-0.9.9-compat
- Merge into experimental
Status: | Rejected |
---|---|
Rejected by: | Adam Blackburn |
Proposed branch: | lp:~nacl/wicd/1.6-urwid-0.9.9-compat |
Merge into: | lp:wicd/1.6 |
Diff against target: |
1050 lines (+450/-205) 6 files modified
curses/curses_misc.py (+1/-1) curses/netentry_curses.py (+4/-7) curses/popup.py (+312/-0) curses/prefs_curses.py (+19/-16) curses/wicd-curses.py (+113/-181) setup.py (+1/-0) |
To merge this branch: | bzr merge lp:~nacl/wicd/1.6-urwid-0.9.9-compat |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Adam Blackburn | Disapprove | ||
Review via email: mp+15096@code.launchpad.net |
Commit message
Description of the change
Andrew Psaltis (nacl) wrote : | # |
- 353. By Andrew Psaltis
-
Added support for the new and improved DropDown that is based on Ian Ward's PopUpTarget.
- 354. By Andrew Psaltis
-
Trimmed some stuff.
- 355. By Andrew Psaltis
-
Pad the wpa driver DropDown correctly.
- 356. By Andrew Psaltis
-
Moved the padding code over to the DropDown itself and cleaned up some stuff.
- 357. By Andrew Psaltis
-
Added callback support to the DropDown and replaced the remaining ComboBoxes
in the big dialogs. - 358. By Andrew Psaltis
-
Fix bug preventing mouse from working with the OptCols.
Andrew Psaltis (nacl) wrote : | # |
> These are changes to wicd 1.6 that make wicd-curses more compatible with urwid
> 0.9.9. These changes break compatibility with urwid 0.9.8.*, and should be
> included in mainline once urwid 0.9.9 is mainstream in all major
> distributions.
This code went unstable the last time I modified it, so don't even try to merge it until
the new DropDowns are implemented.
Adam Blackburn (adamblackburn) wrote : | # |
Didn't look at the code, but we've decided not to merge this for 1.7.
Unmerged revisions
- 358. By Andrew Psaltis
-
Fix bug preventing mouse from working with the OptCols.
- 357. By Andrew Psaltis
-
Added callback support to the DropDown and replaced the remaining ComboBoxes
in the big dialogs. - 356. By Andrew Psaltis
-
Moved the padding code over to the DropDown itself and cleaned up some stuff.
- 355. By Andrew Psaltis
-
Pad the wpa driver DropDown correctly.
- 354. By Andrew Psaltis
-
Trimmed some stuff.
- 353. By Andrew Psaltis
-
Added support for the new and improved DropDown that is based on Ian Ward's PopUpTarget.
- 352. By Andrew Psaltis
-
Fixed up the optcols, apparently, I dropped something. :P
- 351. By Andrew Psaltis
-
Merge mainline r463.
- 350. By Andrew Psaltis
-
Merge local formatting/print statement removal changes that didn't seem to make it.
- 349. By Andrew Psaltis
-
Merge r461 of mainline, providing some bugfixes (some wicd-curses stuff ignored).
Preview Diff
1 | === modified file 'curses/curses_misc.py' | |||
2 | --- curses/curses_misc.py 2009-09-29 16:38:11 +0000 | |||
3 | +++ curses/curses_misc.py 2009-11-21 05:36:12 +0000 | |||
4 | @@ -547,7 +547,7 @@ | |||
5 | 547 | def mouse_event(self,size,event,button,x,y,focus): | 547 | def mouse_event(self,size,event,button,x,y,focus): |
6 | 548 | if event == "mouse press": | 548 | if event == "mouse press": |
7 | 549 | # The keypress dealie in wicd-curses.py expects a list of keystrokes | 549 | # The keypress dealie in wicd-curses.py expects a list of keystrokes |
9 | 550 | self.callback([self.args]) | 550 | self.callback([self.args],size=None) |
10 | 551 | 551 | ||
11 | 552 | # htop-style menu menu-bar on the bottom of the screen | 552 | # htop-style menu menu-bar on the bottom of the screen |
12 | 553 | class OptCols(urwid.WidgetWrap): | 553 | class OptCols(urwid.WidgetWrap): |
13 | 554 | 554 | ||
14 | === modified file 'curses/netentry_curses.py' | |||
15 | --- curses/netentry_curses.py 2009-07-19 02:18:21 +0000 | |||
16 | +++ curses/netentry_curses.py 2009-11-21 05:36:12 +0000 | |||
17 | @@ -23,6 +23,7 @@ | |||
18 | 23 | 23 | ||
19 | 24 | import urwid | 24 | import urwid |
20 | 25 | from curses_misc import TextDialog,DynWrap,MaskingEdit,ComboBox,error | 25 | from curses_misc import TextDialog,DynWrap,MaskingEdit,ComboBox,error |
21 | 26 | from popup import DropDown | ||
22 | 26 | import wicd.misc as misc | 27 | import wicd.misc as misc |
23 | 27 | from wicd.misc import noneToString, stringToNone, noneToBlankString, to_bool | 28 | from wicd.misc import noneToString, stringToNone, noneToBlankString, to_bool |
24 | 28 | 29 | ||
25 | @@ -95,7 +96,6 @@ | |||
26 | 95 | 96 | ||
27 | 96 | 97 | ||
28 | 97 | self._listbox = urwid.ListBox(walker) | 98 | self._listbox = urwid.ListBox(walker) |
29 | 98 | #self._frame = urwid.Frame(self._listbox) | ||
30 | 99 | self._frame = urwid.Frame(self._listbox) | 99 | self._frame = urwid.Frame(self._listbox) |
31 | 100 | self.__super.__init__(self._frame) | 100 | self.__super.__init__(self._frame) |
32 | 101 | 101 | ||
33 | @@ -207,7 +207,6 @@ | |||
34 | 207 | AdvancedSettingsDialog.save_settings(self) | 207 | AdvancedSettingsDialog.save_settings(self) |
35 | 208 | if self.set_default.get_state(): | 208 | if self.set_default.get_state(): |
36 | 209 | wired.UnsetWiredDefault() | 209 | wired.UnsetWiredDefault() |
37 | 210 | print self.set_default.get_state() | ||
38 | 211 | if self.set_default.get_state(): | 210 | if self.set_default.get_state(): |
39 | 212 | bool = True | 211 | bool = True |
40 | 213 | else: | 212 | else: |
41 | @@ -236,7 +235,7 @@ | |||
42 | 236 | 235 | ||
43 | 237 | self.global_settings_chkbox = urwid.CheckBox(global_settings_t) | 236 | self.global_settings_chkbox = urwid.CheckBox(global_settings_t) |
44 | 238 | self.encryption_chkbox = urwid.CheckBox(encryption_t,on_state_change=self.encryption_toggle) | 237 | self.encryption_chkbox = urwid.CheckBox(encryption_t,on_state_change=self.encryption_toggle) |
46 | 239 | self.encryption_combo = ComboBox(callback=self.combo_on_change) | 238 | self.encryption_combo = DynWrap(DropDown(callback=self.combo_on_change))#ComboBox(callback=self.combo_on_change) |
47 | 240 | self.autoconnect_chkbox = urwid.CheckBox(autoconnect_t) | 239 | self.autoconnect_chkbox = urwid.CheckBox(autoconnect_t) |
48 | 241 | self.pile_encrypt = None | 240 | self.pile_encrypt = None |
49 | 242 | # _w is a Frame, _w.body is a ListBox, _w.body.body is the ListWalker :-) | 241 | # _w is a Frame, _w.body is a ListBox, _w.body.body is the ListWalker :-) |
50 | @@ -255,7 +254,7 @@ | |||
51 | 255 | self.encryption_combo.set_sensitive(new_state) | 254 | self.encryption_combo.set_sensitive(new_state) |
52 | 256 | self.pile_encrypt.set_sensitive(new_state) | 255 | self.pile_encrypt.set_sensitive(new_state) |
53 | 257 | 256 | ||
55 | 258 | def combo_on_change(self,combobox,new_index,user_data=None): | 257 | def combo_on_change(self,lb,user_data=None): |
56 | 259 | self.change_encrypt_method() | 258 | self.change_encrypt_method() |
57 | 260 | 259 | ||
58 | 261 | def set_values(self): | 260 | def set_values(self): |
59 | @@ -318,7 +317,6 @@ | |||
60 | 318 | def save_settings(self): | 317 | def save_settings(self): |
61 | 319 | # Check encryption info | 318 | # Check encryption info |
62 | 320 | if self.encryption_chkbox.get_state(): | 319 | if self.encryption_chkbox.get_state(): |
63 | 321 | #print "setting encryption info..." | ||
64 | 322 | encrypt_info = self.encryption_info | 320 | encrypt_info = self.encryption_info |
65 | 323 | encrypt_methods = self.encrypt_types | 321 | encrypt_methods = self.encrypt_types |
66 | 324 | self.set_net_prop("enctype", | 322 | self.set_net_prop("enctype", |
67 | @@ -395,10 +393,9 @@ | |||
68 | 395 | # Make this into a listbox? | 393 | # Make this into a listbox? |
69 | 396 | self.pile_encrypt = DynWrap(urwid.Pile(theList),attrs=('editbx','editnfc')) | 394 | self.pile_encrypt = DynWrap(urwid.Pile(theList),attrs=('editbx','editnfc')) |
70 | 397 | self._w.body.body.insert(self._w.body.body.__len__(),self.pile_encrypt) | 395 | self._w.body.body.insert(self._w.body.body.__len__(),self.pile_encrypt) |
71 | 398 | #self._w.body.body.append(self.pile_encrypt) | ||
72 | 399 | 396 | ||
73 | 400 | def ready_widgets(self,ui,body): | 397 | def ready_widgets(self,ui,body): |
74 | 401 | self.ui = ui | 398 | self.ui = ui |
75 | 402 | self.body = body | 399 | self.body = body |
77 | 403 | self.encryption_combo.build_combobox(body,ui,14) | 400 | #self.encryption_combo.build_combobox(body,ui,14) |
78 | 404 | self.change_encrypt_method() | 401 | self.change_encrypt_method() |
79 | 405 | 402 | ||
80 | === added file 'curses/popup.py' | |||
81 | --- curses/popup.py 1970-01-01 00:00:00 +0000 | |||
82 | +++ curses/popup.py 2009-11-21 05:36:12 +0000 | |||
83 | @@ -0,0 +1,312 @@ | |||
84 | 1 | #!/usr/bin/env python | ||
85 | 2 | |||
86 | 3 | # Much of this code has been placed into the public domain by its original | ||
87 | 4 | # author and urwid maintainer, Ian Ward. A very big thanks to him for making | ||
88 | 5 | # this available to me, it's going to make greatly simplify the wicd-curses | ||
89 | 6 | # code and make things easier for wicd-curses 2.0 when I actually start working | ||
90 | 7 | # on it. Urwid in general is fun to work with, and has proven to be a very | ||
91 | 8 | # robust library. | ||
92 | 9 | # | ||
93 | 10 | # ~ Andrew | ||
94 | 11 | |||
95 | 12 | # NOTE: | ||
96 | 13 | # While much of this file is in the PUBLIC DOMAIN, the DropDown class is | ||
97 | 14 | # licensed under the GNU General Public License, Version 2 or higher. | ||
98 | 15 | # | ||
99 | 16 | # Standard License statement follows: | ||
100 | 17 | # Copyright (C) 2009 Andrew Psaltis | ||
101 | 18 | |||
102 | 19 | # This file is a part of wicd. | ||
103 | 20 | # | ||
104 | 21 | # Wicd is free software; you can redistribute it and/or modify | ||
105 | 22 | # it under the terms of the GNU General Public License as published by | ||
106 | 23 | # the Free Software Foundation; either version 2 of the License, or | ||
107 | 24 | # (at your option) any later version. | ||
108 | 25 | # | ||
109 | 26 | # This program is distributed in the hope that it will be useful, | ||
110 | 27 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
111 | 28 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
112 | 29 | # GNU General Public License for more details. | ||
113 | 30 | # | ||
114 | 31 | # You should have received a copy of the GNU General Public License | ||
115 | 32 | # along with this program; if not, write to the Free Software | ||
116 | 33 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
117 | 34 | # MA 02110-1301, USA. | ||
118 | 35 | |||
119 | 36 | import urwid | ||
120 | 37 | import urwid.raw_display | ||
121 | 38 | import sys | ||
122 | 39 | from curses_misc import SelText | ||
123 | 40 | |||
124 | 41 | ### BEGIN PUBLIC DOMAIN CODE ### | ||
125 | 42 | class PopUpTarget(urwid.WidgetWrap): | ||
126 | 43 | def __init__(self, original_widget): | ||
127 | 44 | self.__super.__init__(original_widget) | ||
128 | 45 | self._pop_up = None | ||
129 | 46 | self._current_widget = self._w | ||
130 | 47 | |||
131 | 48 | def render(self, size, focus=False): | ||
132 | 49 | canv = self._current_widget.render(size, focus=focus) | ||
133 | 50 | if 'pop_up' in canv.coords: | ||
134 | 51 | x, y, (w, h, widget, set_close) = canv.coords['pop_up'] | ||
135 | 52 | if not self._pop_up: | ||
136 | 53 | self._open_pop_up(x, y, w, h, widget) | ||
137 | 54 | set_close(self.close_pop_up) | ||
138 | 55 | else: | ||
139 | 56 | self._update_pop_up(x, y, w, h) | ||
140 | 57 | canv = self._current_widget.render(size, focus=focus) | ||
141 | 58 | |||
142 | 59 | return canv | ||
143 | 60 | |||
144 | 61 | def _open_pop_up(self, x, y, w, h, widget): | ||
145 | 62 | assert not self._pop_up | ||
146 | 63 | self._pop_up = widget | ||
147 | 64 | self._update_pop_up(x, y, w, h) | ||
148 | 65 | |||
149 | 66 | def _update_pop_up(self, x, y, w, h): | ||
150 | 67 | self._current_widget = urwid.Overlay(self._pop_up, self._w, | ||
151 | 68 | ('fixed left', x), w, ('fixed top', y), h) | ||
152 | 69 | |||
153 | 70 | def close_pop_up(self): | ||
154 | 71 | if self._pop_up: | ||
155 | 72 | self._pop_up = None | ||
156 | 73 | self._current_widget = self._w | ||
157 | 74 | self._invalidate() | ||
158 | 75 | |||
159 | 76 | # use our current widget's methods | ||
160 | 77 | selectable = property(lambda self:self._current_widget.selectable) | ||
161 | 78 | get_cursor_coords = property(lambda self:self._current_widget.get_cursor_coords) | ||
162 | 79 | get_pref_col = property(lambda self:self._current_widget.get_pref_col) | ||
163 | 80 | keypress = property(lambda self:self._current_widget.keypress) | ||
164 | 81 | move_cursor_to_coords = property(lambda self:self._current_widget.move_cursor_to_coords) | ||
165 | 82 | mouse_event = property(lambda self:self._current_widget.mouse_event) | ||
166 | 83 | sizing = property(lambda self:self._current_widget.sizing) | ||
167 | 84 | |||
168 | 85 | ### BEGIN GPL CODE ### | ||
169 | 86 | class DropDown(urwid.WidgetWrap): | ||
170 | 87 | def __init__(self,items=[],show_indicator=True,popup_attr='body',popup_f_attr='focus',callback=None,user_args=None): | ||
171 | 88 | self._popup_attr = popup_attr | ||
172 | 89 | self._popup_f_attr = popup_f_attr | ||
173 | 90 | self.callback = callback | ||
174 | 91 | self.user_args = user_args | ||
175 | 92 | self.set_list(items,init=True) | ||
176 | 93 | self.lb = urwid.ListBox(self._walker) | ||
177 | 94 | |||
178 | 95 | if len(self._walker) != 0: | ||
179 | 96 | self.text = self.lb.get_focus()[0].base_widget | ||
180 | 97 | else: | ||
181 | 98 | self.text = SelText("") | ||
182 | 99 | self._open_pop_up = False | ||
183 | 100 | if show_indicator: | ||
184 | 101 | self._cols = urwid.Columns([self.text,('fixed',3,urwid.Padding(urwid.Text('[V]'),'right',3))],dividechars=1) | ||
185 | 102 | self.__super.__init__(urwid.Padding(self._cols,'left',self._maxlen+4)) | ||
186 | 103 | else: | ||
187 | 104 | self._cols = urwid.Columns([self.text]) | ||
188 | 105 | self.__super.__init__(urwid.Padding(self._cols,'left',self._maxlen)) | ||
189 | 106 | |||
190 | 107 | def get_popup_attr(self): | ||
191 | 108 | return self._popup_attr | ||
192 | 109 | def get_popup_f_attr(self): | ||
193 | 110 | return self._popup_f_attr | ||
194 | 111 | |||
195 | 112 | def set_popup_attr(self,attr): | ||
196 | 113 | self._popup_attr = attr | ||
197 | 114 | def set_popup_f_attr(self,attr): | ||
198 | 115 | self._popup_f_attr = attr | ||
199 | 116 | |||
200 | 117 | def remove(self,text): | ||
201 | 118 | """ | ||
202 | 119 | Remove the first item with text "text" from the DropDown. | ||
203 | 120 | |||
204 | 121 | Returns the text if it's in the DropDown, None otherwise | ||
205 | 122 | |||
206 | 123 | >>> d = DropDown(['one','rediculously','long','string']) | ||
207 | 124 | >>> d._maxlen | ||
208 | 125 | 12 | ||
209 | 126 | >>> len('rediculously') | ||
210 | 127 | 12 | ||
211 | 128 | >>> d.remove('rediculously') | ||
212 | 129 | 'rediculously' | ||
213 | 130 | >>> d._maxlen | ||
214 | 131 | 6 | ||
215 | 132 | >>> d.remove('rediculously') | ||
216 | 133 | None | ||
217 | 134 | """ | ||
218 | 135 | swap_out = False | ||
219 | 136 | for txt in self._walker: | ||
220 | 137 | if txt.text == text: | ||
221 | 138 | if self.lb.get_focus()[0] == txt: | ||
222 | 139 | swap_out = True | ||
223 | 140 | self._walker.remove(txt) | ||
224 | 141 | if txt.base_widget.pack()[0] == self._maxlen: | ||
225 | 142 | self._adjust_and_align() | ||
226 | 143 | if swap_out: | ||
227 | 144 | self._cols.widget_list[0] = self.lb.get_focus()[0].base_widget | ||
228 | 145 | return text | ||
229 | 146 | return None | ||
230 | 147 | |||
231 | 148 | def _align(self): | ||
232 | 149 | self._maxlen = 0 | ||
233 | 150 | #print >> sys.stderr, "len walker:",len(self._walker) | ||
234 | 151 | for i in self._walker: | ||
235 | 152 | #print >>sys.stderr, i.base_widget.pack()[0] | ||
236 | 153 | if self._maxlen < i.base_widget.pack()[0]: | ||
237 | 154 | #print >>sys.stderr, "New maxlen is '%s'" % i.text | ||
238 | 155 | self._maxlen = i.base_widget.pack()[0] | ||
239 | 156 | |||
240 | 157 | def _adjust_and_align(self): | ||
241 | 158 | #print >> sys.stderr, "ADJUST_AND_ALIGN" | ||
242 | 159 | #print >> sys.stderr, "width is", self._w.width | ||
243 | 160 | self._w.width -= self._maxlen | ||
244 | 161 | #print >> sys.stderr, "maxlen is", self._maxlen | ||
245 | 162 | #print >> sys.stderr, "width is", self._w.width | ||
246 | 163 | self._align() | ||
247 | 164 | self._w.width += self._maxlen | ||
248 | 165 | #print >> sys.stderr, "width is", self._w.width | ||
249 | 166 | |||
250 | 167 | def get_focus(self): | ||
251 | 168 | """ | ||
252 | 169 | Get the current focus of the widget. | ||
253 | 170 | |||
254 | 171 | """ | ||
255 | 172 | return self.lb.get_focus() | ||
256 | 173 | def set_focus(self,idx): | ||
257 | 174 | self.lb.set_focus(idx) | ||
258 | 175 | focus = property(get_focus,set_focus) | ||
259 | 176 | |||
260 | 177 | def size(self): | ||
261 | 178 | return len(self._walker) | ||
262 | 179 | |||
263 | 180 | def set_list(self,l,init=False): | ||
264 | 181 | itexts = [urwid.AttrWrap(SelText(i),self._popup_attr,self._popup_f_attr) for i in l] | ||
265 | 182 | self._walker = urwid.SimpleListWalker(itexts) | ||
266 | 183 | if init: | ||
267 | 184 | self._align() | ||
268 | 185 | # Do additional stuff if this is not called from the constructor | ||
269 | 186 | else: | ||
270 | 187 | #print >>sys.stderr,"ddown says", self._w.width | ||
271 | 188 | self.lb.body = self._walker | ||
272 | 189 | self._adjust_and_align() | ||
273 | 190 | if len(self._walker) != 0: | ||
274 | 191 | self._cols.widget_list[0] = self.lb.get_focus()[0].base_widget | ||
275 | 192 | else: | ||
276 | 193 | self._cols.widget_list[0] = SelText("") | ||
277 | 194 | #print >>sys.stderr,"ddown says", self._w.width | ||
278 | 195 | |||
279 | 196 | |||
280 | 197 | def append_list(self,l): | ||
281 | 198 | for i in l: | ||
282 | 199 | self.append_item(i) | ||
283 | 200 | return True | ||
284 | 201 | |||
285 | 202 | def append_item(self,text): | ||
286 | 203 | return self.insert_item(text,len(self._walker)) | ||
287 | 204 | |||
288 | 205 | def insert_item(self,text,idx): | ||
289 | 206 | """ | ||
290 | 207 | Inserts a new item with text 'text' at index 'idx' by calling the | ||
291 | 208 | 'insert' method of the DropDown's ListWalker. | ||
292 | 209 | |||
293 | 210 | This raises an IndexError if 'idx' is greater than the length of the | ||
294 | 211 | list, but negative indices are accepted (and are actually used as the | ||
295 | 212 | default value for idx). Be careful! | ||
296 | 213 | |||
297 | 214 | This also raises a TypeError if idx is not an integer | ||
298 | 215 | |||
299 | 216 | Return value: True | ||
300 | 217 | """ | ||
301 | 218 | if idx > len(self._walker): | ||
302 | 219 | raise IndexError("Index '%d' out of listwalker bounds" % idx) | ||
303 | 220 | if type(idx) != type(0): | ||
304 | 221 | raise TypeError("Index is of type %s, not an integer" % type(idx)) | ||
305 | 222 | wid = SelText(text) | ||
306 | 223 | self._walker.insert(idx,urwid.AttrWrap(wid,self._popup_attr,self._popup_f_attr)) | ||
307 | 224 | if len(self._walker) == 1: | ||
308 | 225 | self._cols.widget_list[0] = self.lb.get_focus()[0].base_widget | ||
309 | 226 | if wid.pack()[0] > self._maxlen: | ||
310 | 227 | self._w.width -= self._maxlen | ||
311 | 228 | self._maxlen = wid.pack()[0] | ||
312 | 229 | self._w.width += self._maxlen | ||
313 | 230 | |||
314 | 231 | return True | ||
315 | 232 | |||
316 | 233 | def _create_pop_up(self): | ||
317 | 234 | class CPane(urwid.Frame): | ||
318 | 235 | def __init__(self,body,callback): | ||
319 | 236 | self.callback = callback | ||
320 | 237 | self.__super.__init__(urwid.LineBox(body)) | ||
321 | 238 | def keypress(self,size,key): | ||
322 | 239 | self.get_body().keypress(size,key) | ||
323 | 240 | if key in [ 'enter' ]: | ||
324 | 241 | self.do_close() | ||
325 | 242 | self.callback() | ||
326 | 243 | if key in [ 'esc' ]: | ||
327 | 244 | self.do_close() | ||
328 | 245 | self.callback(False) | ||
329 | 246 | def callback(save=True): | ||
330 | 247 | if save: | ||
331 | 248 | self.sel_item,self.sel_index = self.lb.get_focus() | ||
332 | 249 | self._cols.widget_list[0] = self.sel_item | ||
333 | 250 | if self.callback != None: | ||
334 | 251 | self.callback(self.lb,self.user_args) | ||
335 | 252 | self._open_pop_up = False | ||
336 | 253 | self._invalidate() | ||
337 | 254 | popup_frame = CPane(self.lb,callback) | ||
338 | 255 | |||
339 | 256 | def set_close(fn): | ||
340 | 257 | popup_frame.do_close = fn | ||
341 | 258 | return (self._maxlen+2,len(self._walker)+2,popup_frame,set_close) | ||
342 | 259 | |||
343 | 260 | def render(self, size, focus=False): | ||
344 | 261 | canv = self.__super.render(size, focus) | ||
345 | 262 | if self._open_pop_up: | ||
346 | 263 | canv = urwid.CompositeCanvas(canv) | ||
347 | 264 | # same left column, one line below ourselves | ||
348 | 265 | canv.coords['pop_up'] = (0, 1, self._pop_up_window) | ||
349 | 266 | return canv | ||
350 | 267 | |||
351 | 268 | def keypress(self,size,key): | ||
352 | 269 | if key in [ "enter", ' ' ]: | ||
353 | 270 | self._pop_up_window = self._create_pop_up() | ||
354 | 271 | self._open_pop_up = True | ||
355 | 272 | self._invalidate() | ||
356 | 273 | return key | ||
357 | 274 | |||
358 | 275 | ui = urwid.raw_display.Screen() | ||
359 | 276 | ui.register_palette([('popbg', 'white', 'dark blue'), | ||
360 | 277 | ('body','light gray','black'), | ||
361 | 278 | ('focus','black','light gray')]) | ||
362 | 279 | |||
363 | 280 | def run(): | ||
364 | 281 | size = ui.get_cols_rows() | ||
365 | 282 | l = ['zero','one','two','three','really_long_item'] | ||
366 | 283 | #d = DropDown(l) | ||
367 | 284 | d = urwid.AttrWrap(DropDown(l),'body','popbg') | ||
368 | 285 | #d = DropDown() | ||
369 | 286 | fill = urwid.Filler(urwid.Padding(urwid.Columns([urwid.Text("Press space:"),d]), 'center', 40)) | ||
370 | 287 | #fill = urwid.Filler(ComboBox()) | ||
371 | 288 | target = PopUpTarget(fill) | ||
372 | 289 | #print >>sys.stderr, d._maxlen | ||
373 | 290 | #print >>sys.stderr, d._w.width | ||
374 | 291 | i = 4 | ||
375 | 292 | while True: | ||
376 | 293 | canvas = target.render(size, True) | ||
377 | 294 | ui.draw_screen(size, canvas) | ||
378 | 295 | |||
379 | 296 | keys = ui.get_input() | ||
380 | 297 | if "c" in keys: | ||
381 | 298 | d.remove(l[i]) | ||
382 | 299 | i-=1 | ||
383 | 300 | for k in keys: | ||
384 | 301 | target.keypress(size, k) | ||
385 | 302 | if "window resize" in keys: | ||
386 | 303 | size = ui.get_cols_rows() | ||
387 | 304 | |||
388 | 305 | |||
389 | 306 | if __name__ == '__main__': | ||
390 | 307 | if len(sys.argv) > 1 and sys.argv[1] == "test": | ||
391 | 308 | import doctest | ||
392 | 309 | doctest.testmod() | ||
393 | 310 | else: | ||
394 | 311 | ui.run_wrapper(run) | ||
395 | 312 | ### END GPL CODE ### | ||
396 | 0 | 313 | ||
397 | === modified file 'curses/prefs_curses.py' | |||
398 | --- curses/prefs_curses.py 2009-10-31 03:52:30 +0000 | |||
399 | +++ curses/prefs_curses.py 2009-11-21 05:36:12 +0000 | |||
400 | @@ -21,7 +21,9 @@ | |||
401 | 21 | 21 | ||
402 | 22 | import urwid | 22 | import urwid |
403 | 23 | import urwid.curses_display | 23 | import urwid.curses_display |
404 | 24 | from popup import DropDown | ||
405 | 24 | 25 | ||
406 | 26 | import sys | ||
407 | 25 | from wicd import misc | 27 | from wicd import misc |
408 | 26 | from wicd import dbusmanager | 28 | from wicd import dbusmanager |
409 | 27 | from curses_misc import SelText,DynWrap,DynRadioButton,ComboBox,TabColumns | 29 | from curses_misc import SelText,DynWrap,DynRadioButton,ComboBox,TabColumns |
410 | @@ -216,11 +218,15 @@ | |||
411 | 216 | 218 | ||
412 | 217 | #### Advanced settings | 219 | #### Advanced settings |
413 | 218 | self.wpa_cat = urwid.Text(wpa_cat_t) | 220 | self.wpa_cat = urwid.Text(wpa_cat_t) |
415 | 219 | self.wpa_cbox = ComboBox(wpa_t) | 221 | self.wpa_ddown = DropDown() |
416 | 222 | wpa_txt = urwid.Text(wpa_t) | ||
417 | 223 | self.wpa_cols = urwid.Columns([('fixed',wpa_txt.pack()[0],wpa_txt),urwid.AttrWrap(self.wpa_ddown,'body','focus')]) | ||
418 | 220 | self.wpa_warn = urwid.Text(wpa_warn_t) | 224 | self.wpa_warn = urwid.Text(wpa_warn_t) |
419 | 221 | 225 | ||
420 | 222 | self.backend_cat = urwid.Text(backend_cat_t) | 226 | self.backend_cat = urwid.Text(backend_cat_t) |
422 | 223 | self.backend_cbox = ComboBox(backend_t) | 227 | self.backend_ddown = DropDown() |
423 | 228 | backend_txt = urwid.Text(backend_t) | ||
424 | 229 | self.backend_cols = urwid.Columns([('fixed',backend_txt.pack()[0],backend_txt),urwid.AttrWrap(self.backend_ddown,'body','focus')]) | ||
425 | 224 | 230 | ||
426 | 225 | self.debug_cat = urwid.Text(debug_cat_t) | 231 | self.debug_cat = urwid.Text(debug_cat_t) |
427 | 226 | self.debug_mode_checkb = urwid.CheckBox(debug_mode_t) | 232 | self.debug_mode_checkb = urwid.CheckBox(debug_mode_t) |
428 | @@ -230,9 +236,9 @@ | |||
429 | 230 | 236 | ||
430 | 231 | 237 | ||
431 | 232 | advancedLB = urwid.ListBox([self.wpa_cat, | 238 | advancedLB = urwid.ListBox([self.wpa_cat, |
433 | 233 | self.wpa_cbox,self.wpa_warn,_blank, | 239 | self.wpa_cols,self.wpa_warn,_blank, |
434 | 234 | self.backend_cat, | 240 | self.backend_cat, |
436 | 235 | self.backend_cbox,_blank, | 241 | self.backend_cols,_blank, |
437 | 236 | self.debug_cat, | 242 | self.debug_cat, |
438 | 237 | self.debug_mode_checkb, _blank, | 243 | self.debug_mode_checkb, _blank, |
439 | 238 | self.wless_cat, | 244 | self.wless_cat, |
440 | @@ -298,23 +304,24 @@ | |||
441 | 298 | self.wpadrivers.append("ralink_legacy") | 304 | self.wpadrivers.append("ralink_legacy") |
442 | 299 | # Same as above with the dbus.String | 305 | # Same as above with the dbus.String |
443 | 300 | self.thedrivers = [unicode(w) for w in self.wpadrivers] | 306 | self.thedrivers = [unicode(w) for w in self.wpadrivers] |
445 | 301 | self.wpa_cbox.set_list(self.thedrivers) | 307 | self.wpa_ddown.set_list(self.thedrivers) |
446 | 302 | 308 | ||
447 | 303 | # Pick where to begin first: | 309 | # Pick where to begin first: |
448 | 304 | def_driver = daemon.GetWPADriver() | 310 | def_driver = daemon.GetWPADriver() |
449 | 305 | try: | 311 | try: |
451 | 306 | self.wpa_cbox.set_focus(self.wpadrivers.index(def_driver)) | 312 | self.wpa_ddown.set_focus(self.wpadrivers.index(def_driver)) |
452 | 307 | except ValueError: | 313 | except ValueError: |
454 | 308 | pass # It defaults to 0 anyway (I hope) | 314 | self.wpa_ddown.set_focus(0) |
455 | 315 | #self.wpa_cols._invalidate() | ||
456 | 309 | 316 | ||
457 | 310 | self.backends = daemon.GetBackendList() | 317 | self.backends = daemon.GetBackendList() |
458 | 311 | self.thebackends= [unicode(w) for w in self.backends] | 318 | self.thebackends= [unicode(w) for w in self.backends] |
460 | 312 | self.backend_cbox.set_list(self.thebackends) | 319 | self.backend_ddown.set_list(self.thebackends) |
461 | 313 | cur_backend = daemon.GetSavedBackend() | 320 | cur_backend = daemon.GetSavedBackend() |
462 | 314 | try: | 321 | try: |
464 | 315 | self.backend_cbox.set_focus(self.thebackends.index(cur_backend)) | 322 | self.backend_ddown.set_focus(self.thebackends.index(cur_backend)) |
465 | 316 | except ValueError: | 323 | except ValueError: |
467 | 317 | self.backend_cbox.set_focus(0) | 324 | self.backend_ddown.set_focus(0) |
468 | 318 | 325 | ||
469 | 319 | # Two last checkboxes | 326 | # Two last checkboxes |
470 | 320 | self.debug_mode_checkb.set_state(daemon.GetDebugMode()) | 327 | self.debug_mode_checkb.set_state(daemon.GetDebugMode()) |
471 | @@ -334,7 +341,7 @@ | |||
472 | 334 | self.search_dom.get_edit_text()) | 341 | self.search_dom.get_edit_text()) |
473 | 335 | daemon.SetWirelessInterface(self.wless_edit.get_edit_text()) | 342 | daemon.SetWirelessInterface(self.wless_edit.get_edit_text()) |
474 | 336 | daemon.SetWiredInterface(self.wired_edit.get_edit_text()) | 343 | daemon.SetWiredInterface(self.wired_edit.get_edit_text()) |
476 | 337 | daemon.SetWPADriver(self.wpadrivers[self.wpa_cbox.get_focus()[1]]) | 344 | daemon.SetWPADriver(self.wpadrivers[self.wpa_ddown.get_focus()[1]]) |
477 | 338 | daemon.SetAlwaysShowWiredInterface(self.always_show_wired_checkb.get_state()) | 345 | daemon.SetAlwaysShowWiredInterface(self.always_show_wired_checkb.get_state()) |
478 | 339 | daemon.SetAutoReconnect(self.auto_reconn_checkb.get_state()) | 346 | daemon.SetAutoReconnect(self.auto_reconn_checkb.get_state()) |
479 | 340 | daemon.SetDebugMode(self.debug_mode_checkb.get_state()) | 347 | daemon.SetDebugMode(self.debug_mode_checkb.get_state()) |
480 | @@ -347,7 +354,7 @@ | |||
481 | 347 | else: | 354 | else: |
482 | 348 | daemon.SetWiredAutoConnectMethod(1) | 355 | daemon.SetWiredAutoConnectMethod(1) |
483 | 349 | 356 | ||
485 | 350 | daemon.SetBackend(self.backends[self.backend_cbox.get_focus()[1]]) | 357 | daemon.SetBackend(self.backends[self.backend_ddown.get_focus()[1]]) |
486 | 351 | 358 | ||
487 | 352 | # External Programs Tab | 359 | # External Programs Tab |
488 | 353 | if self.dhcp0.get_state(): | 360 | if self.dhcp0.get_state(): |
489 | @@ -382,7 +389,3 @@ | |||
490 | 382 | def global_dns_trigger(self,check_box,new_state,user_data=None): | 389 | def global_dns_trigger(self,check_box,new_state,user_data=None): |
491 | 383 | for w in self.dns1,self.dns2,self.dns3,self.dns_dom,self.search_dom: | 390 | for w in self.dns1,self.dns2,self.dns3,self.dns_dom,self.search_dom: |
492 | 384 | w.set_sensitive(new_state) | 391 | w.set_sensitive(new_state) |
493 | 385 | |||
494 | 386 | def ready_widgets(self,ui,body): | ||
495 | 387 | self.wpa_cbox.build_combobox(body,ui,4) | ||
496 | 388 | self.backend_cbox.build_combobox(body,ui,8) | ||
497 | 389 | 392 | ||
498 | === modified file 'curses/wicd-curses.py' | |||
499 | --- curses/wicd-curses.py 2009-09-29 16:38:11 +0000 | |||
500 | +++ curses/wicd-curses.py 2009-11-21 05:36:12 +0000 | |||
501 | @@ -59,6 +59,7 @@ | |||
502 | 59 | from curses_misc import * | 59 | from curses_misc import * |
503 | 60 | from prefs_curses import PrefsDialog | 60 | from prefs_curses import PrefsDialog |
504 | 61 | import netentry_curses | 61 | import netentry_curses |
505 | 62 | from popup import DropDown, PopUpTarget | ||
506 | 62 | 63 | ||
507 | 63 | from netentry_curses import WirelessSettingsDialog, WiredSettingsDialog,AdvancedSettingsDialog | 64 | from netentry_curses import WirelessSettingsDialog, WiredSettingsDialog,AdvancedSettingsDialog |
508 | 64 | 65 | ||
509 | @@ -78,47 +79,10 @@ | |||
510 | 78 | from wicd.translations import language | 79 | from wicd.translations import language |
511 | 79 | for i in language.keys(): | 80 | for i in language.keys(): |
512 | 80 | language[i] = language[i].decode('utf8') | 81 | language[i] = language[i].decode('utf8') |
554 | 81 | 82 | # Dummies | |
555 | 82 | ######################################## | 83 | def handle_exit(f): |
556 | 83 | ##### SUPPORT CLASSES | 84 | return f |
557 | 84 | ######################################## | 85 | loop = None |
517 | 85 | # Yay for decorators! | ||
518 | 86 | def wrap_exceptions(func): | ||
519 | 87 | def wrapper(*args, **kargs): | ||
520 | 88 | try: | ||
521 | 89 | return func(*args, **kargs) | ||
522 | 90 | except KeyboardInterrupt: | ||
523 | 91 | #gobject.source_remove(redraw_tag) | ||
524 | 92 | loop.quit() | ||
525 | 93 | ui.stop() | ||
526 | 94 | print >> sys.stderr, "\n"+language['terminated'] | ||
527 | 95 | #raise | ||
528 | 96 | except DBusException: | ||
529 | 97 | #gobject.source_remove(redraw_tag) | ||
530 | 98 | loop.quit() | ||
531 | 99 | ui.stop() | ||
532 | 100 | print >> sys.stderr,"\n"+language['dbus_fail'] | ||
533 | 101 | raise | ||
534 | 102 | except : | ||
535 | 103 | # Quit the loop | ||
536 | 104 | #if 'loop' in locals(): | ||
537 | 105 | loop.quit() | ||
538 | 106 | # Zap the screen | ||
539 | 107 | ui.stop() | ||
540 | 108 | # Print out standard notification: | ||
541 | 109 | print >> sys.stderr, "\n" + language['exception'] | ||
542 | 110 | # Flush the buffer so that the notification is always above the | ||
543 | 111 | # backtrace | ||
544 | 112 | sys.stdout.flush() | ||
545 | 113 | # Raise the exception | ||
546 | 114 | #sleep(2) | ||
547 | 115 | raise | ||
548 | 116 | |||
549 | 117 | wrapper.__name__ = func.__name__ | ||
550 | 118 | wrapper.__module__ = func.__module__ | ||
551 | 119 | wrapper.__dict__ = func.__dict__ | ||
552 | 120 | wrapper.__doc__ = func.__doc__ | ||
553 | 121 | return wrapper | ||
558 | 122 | 86 | ||
559 | 123 | ######################################## | 87 | ######################################## |
560 | 124 | ##### SUPPORT FUNCTIONS | 88 | ##### SUPPORT FUNCTIONS |
561 | @@ -126,7 +90,7 @@ | |||
562 | 126 | 90 | ||
563 | 127 | # Look familiar? These two functions are clones of functions found in wicd's | 91 | # Look familiar? These two functions are clones of functions found in wicd's |
564 | 128 | # gui.py file, except that now set_status is a function passed to them. | 92 | # gui.py file, except that now set_status is a function passed to them. |
566 | 129 | @wrap_exceptions | 93 | @handle_exit |
567 | 130 | def check_for_wired(wired_ip,set_status): | 94 | def check_for_wired(wired_ip,set_status): |
568 | 131 | """ Determine if wired is active, and if yes, set the status. """ | 95 | """ Determine if wired is active, and if yes, set the status. """ |
569 | 132 | if wired_ip and wired.CheckPluggedIn(): | 96 | if wired_ip and wired.CheckPluggedIn(): |
570 | @@ -135,7 +99,7 @@ | |||
571 | 135 | else: | 99 | else: |
572 | 136 | return False | 100 | return False |
573 | 137 | 101 | ||
575 | 138 | @wrap_exceptions | 102 | @handle_exit |
576 | 139 | def check_for_wireless(iwconfig, wireless_ip, set_status): | 103 | def check_for_wireless(iwconfig, wireless_ip, set_status): |
577 | 140 | """ Determine if wireless is active, and if yes, set the status. """ | 104 | """ Determine if wireless is active, and if yes, set the status. """ |
578 | 141 | if not wireless_ip: | 105 | if not wireless_ip: |
579 | @@ -485,9 +449,9 @@ | |||
580 | 485 | self.key_edit.set_sensitive(new_state) | 449 | self.key_edit.set_sensitive(new_state) |
581 | 486 | 450 | ||
582 | 487 | def unhandled_key(self, size, k): | 451 | def unhandled_key(self, size, k): |
584 | 488 | if k in ('up','page up'): | 452 | if k in ('up', 'page up'): |
585 | 489 | self.frame.set_focus('body') | 453 | self.frame.set_focus('body') |
587 | 490 | if k in ('down','page down'): | 454 | if k in ('down', 'page down'): |
588 | 491 | self.frame.set_focus('footer') | 455 | self.frame.set_focus('footer') |
589 | 492 | if k == 'enter': | 456 | if k == 'enter': |
590 | 493 | # pass enter to the "ok" button | 457 | # pass enter to the "ok" button |
591 | @@ -508,15 +472,14 @@ | |||
592 | 508 | ##### APPLICATION INTERFACE CLASS | 472 | ##### APPLICATION INTERFACE CLASS |
593 | 509 | ######################################## | 473 | ######################################## |
594 | 510 | # The Whole Shebang | 474 | # The Whole Shebang |
596 | 511 | class appGUI(): | 475 | class appGUI(urwid.WidgetWrap): |
597 | 512 | """The UI itself, all glory belongs to it!""" | 476 | """The UI itself, all glory belongs to it!""" |
598 | 513 | def __init__(self): | 477 | def __init__(self): |
599 | 514 | global loop | 478 | global loop |
600 | 515 | self.size = ui.get_cols_rows() | ||
601 | 516 | # Happy screen saying that you can't do anything because we're scanning | 479 | # Happy screen saying that you can't do anything because we're scanning |
602 | 517 | # for networks. :-) | 480 | # for networks. :-) |
605 | 518 | self.screen_locker = urwid.Filler(urwid.Text(('important',language['scanning_stand_by']), align='center')) | 481 | self.screen_locker = urwid.Filler(urwid.Text(('important', language['scanning_stand_by']), align='center')) |
606 | 519 | self.no_wlan = urwid.Filler(urwid.Text(('important',language['no_wireless_networks_found']), align='center')) | 482 | self.no_wlan = urwid.Filler(urwid.Text(('important', language['no_wireless_networks_found']), align='center')) |
607 | 520 | self.TITLE = language['wicd_curses'] | 483 | self.TITLE = language['wicd_curses'] |
608 | 521 | self.WIRED_IDX = 1 | 484 | self.WIRED_IDX = 1 |
609 | 522 | self.WLESS_IDX = 3 | 485 | self.WLESS_IDX = 3 |
610 | @@ -544,16 +507,16 @@ | |||
611 | 544 | 507 | ||
612 | 545 | # Keymappings proposed by nanotube in #wicd | 508 | # Keymappings proposed by nanotube in #wicd |
613 | 546 | keys = [ | 509 | keys = [ |
614 | 547 | ('H' ,'Help' ,None), | ||
615 | 548 | ('right','Config',None), | ||
616 | 549 | #(' ',' ',None), | 510 | #(' ',' ',None), |
624 | 550 | ('C' ,'Connect',None), | 511 | ('H' ,'Help' , None), |
625 | 551 | ('D' ,'Disconn',None), | 512 | ('right','Config', None), |
626 | 552 | ('R' ,'Refresh',None), | 513 | ('C', 'Connect', None), |
627 | 553 | ('P' ,'Prefs',None), | 514 | ('D', 'Disconn', None), |
628 | 554 | ('I' ,'Hidden',None), | 515 | ('R', 'Refresh', None), |
629 | 555 | ('A' ,'About',None), | 516 | ('P', 'Prefs', None), |
630 | 556 | ('Q' ,'Quit',loop.quit) | 517 | ('I', 'Hidden', None), |
631 | 518 | ('A', 'About', None), | ||
632 | 519 | ('Q', 'Quit', None) | ||
633 | 557 | ] | 520 | ] |
634 | 558 | 521 | ||
635 | 559 | self.primaryCols = OptCols(keys,self.handle_keys) | 522 | self.primaryCols = OptCols(keys,self.handle_keys) |
636 | @@ -572,11 +535,13 @@ | |||
637 | 572 | self.init_other_optcols() | 535 | self.init_other_optcols() |
638 | 573 | 536 | ||
639 | 574 | self.frame.set_body(self.thePile) | 537 | self.frame.set_body(self.thePile) |
640 | 538 | self.target = PopUpTarget(self.frame) | ||
641 | 539 | urwid.WidgetWrap.__init__(self,self.target) | ||
642 | 575 | # Booleans gallore! | 540 | # Booleans gallore! |
643 | 576 | self.prev_state = False | 541 | self.prev_state = False |
644 | 577 | self.connecting = False | 542 | self.connecting = False |
645 | 578 | self.screen_locked = False | 543 | self.screen_locked = False |
647 | 579 | self.do_diag_lock = False #Whether the screen is locked beneath a dialog | 544 | self.do_diag_lock = False # Whether the screen is locked beneath a dialog |
648 | 580 | self.diag_type = 'none' # The type of dialog that is up | 545 | self.diag_type = 'none' # The type of dialog that is up |
649 | 581 | self.scanning = False | 546 | self.scanning = False |
650 | 582 | 547 | ||
651 | @@ -584,19 +549,17 @@ | |||
652 | 584 | 549 | ||
653 | 585 | self.update_status() | 550 | self.update_status() |
654 | 586 | 551 | ||
655 | 587 | #self.max_wait = ui.max_wait | ||
656 | 588 | |||
657 | 589 | def doScan(self, sync=False): | 552 | def doScan(self, sync=False): |
658 | 590 | self.scanning = True | 553 | self.scanning = True |
659 | 591 | wireless.Scan(False) | 554 | wireless.Scan(False) |
660 | 592 | 555 | ||
661 | 593 | def init_other_optcols(self): | 556 | def init_other_optcols(self): |
662 | 594 | # The "tabbed" preferences dialog | 557 | # The "tabbed" preferences dialog |
668 | 595 | self.prefCols = OptCols( [ ('f10','OK'), | 558 | self.prefCols = OptCols( [ ('f10','OK'), |
669 | 596 | ('page up','Tab Left',), | 559 | ('page up','Tab Left',), |
670 | 597 | ('page down', 'Tab Right'), | 560 | ('page down', 'Tab Right'), |
671 | 598 | ('esc','Cancel') ], self.handle_keys) | 561 | ('esc','Cancel') ], self.handle_keys) |
672 | 599 | self.confCols = OptCols( [ ('f10','OK'), | 562 | self.confCols = OptCols( [ ('f10','OK'), |
673 | 600 | ('esc','Cancel') ],self.handle_keys) | 563 | ('esc','Cancel') ],self.handle_keys) |
674 | 601 | 564 | ||
675 | 602 | # Does what it says it does | 565 | # Does what it says it does |
676 | @@ -619,8 +582,9 @@ | |||
677 | 619 | self.update_ui() | 582 | self.update_ui() |
678 | 620 | 583 | ||
679 | 621 | def raise_hidden_network_dialog(self): | 584 | def raise_hidden_network_dialog(self): |
682 | 622 | dialog = InputDialog(('header',language["select_hidden_essid"]),7,30,language['scan']) | 585 | dialog = InputDialog( |
683 | 623 | exitcode,hidden = dialog.run(ui,self.frame) | 586 | ('header', language["select_hidden_essid"]), 7, 30, language['scan']) |
684 | 587 | exitcode,hidden = dialog.run(ui, self.frame) | ||
685 | 624 | if exitcode != -1: | 588 | if exitcode != -1: |
686 | 625 | # That dialog will sit there for a while if I don't get rid of it | 589 | # That dialog will sit there for a while if I don't get rid of it |
687 | 626 | self.update_ui() | 590 | self.update_ui() |
688 | @@ -641,13 +605,11 @@ | |||
689 | 641 | where = None | 605 | where = None |
690 | 642 | else: | 606 | else: |
691 | 643 | where = self.thePile.get_focus().get_focus()[1] | 607 | where = self.thePile.get_focus().get_focus()[1] |
692 | 644 | #where = self.wlessLB.get_focus()[1] | ||
693 | 645 | self.focusloc = [wlessorwired,where] | 608 | self.focusloc = [wlessorwired,where] |
694 | 646 | 609 | ||
695 | 647 | # Be clunky until I get to a later stage of development. | ||
696 | 648 | # Update the list of networks. Usually called by DBus. | 610 | # Update the list of networks. Usually called by DBus. |
699 | 649 | @wrap_exceptions | 611 | @handle_exit |
700 | 650 | def update_netlist(self,state=None, x=None, force_check=False,firstrun=False): | 612 | def update_netlist(self, state=None, x=None, force_check=False, firstrun=False): |
701 | 651 | # Don't even try to do this if we are running a dialog | 613 | # Don't even try to do this if we are running a dialog |
702 | 652 | if self.diag: | 614 | if self.diag: |
703 | 653 | return | 615 | return |
704 | @@ -663,7 +625,7 @@ | |||
705 | 663 | wiredL,wlessL = gen_network_list() | 625 | wiredL,wlessL = gen_network_list() |
706 | 664 | 626 | ||
707 | 665 | self.wiredCB.get_body().set_list(wiredL) | 627 | self.wiredCB.get_body().set_list(wiredL) |
709 | 666 | self.wiredCB.get_body().build_combobox(self.frame,ui,3) | 628 | self.wiredCB.get_body().build_combobox(self.frame, ui, 3) |
710 | 667 | if len(wlessL) != 0: | 629 | if len(wlessL) != 0: |
711 | 668 | if self.wlessLB == self.no_wlan: | 630 | if self.wlessLB == self.no_wlan: |
712 | 669 | self.wlessLB = urwid.ListBox(wlessL) | 631 | self.wlessLB = urwid.ListBox(wlessL) |
713 | @@ -688,7 +650,7 @@ | |||
714 | 688 | else: | 650 | else: |
715 | 689 | self.thePile.set_focus(self.wiredCB) | 651 | self.thePile.set_focus(self.wiredCB) |
716 | 690 | else: | 652 | else: |
718 | 691 | self.thePile = urwid.Pile([('fixed',2,self.wlessH),self.wlessLB] ) | 653 | self.thePile = urwid.Pile([('fixed',2,self.wlessH), self.wlessLB] ) |
719 | 692 | if not firstrun: | 654 | if not firstrun: |
720 | 693 | self.frame.body = self.thePile | 655 | self.frame.body = self.thePile |
721 | 694 | if self.focusloc[1] == None: | 656 | if self.focusloc[1] == None: |
722 | @@ -705,7 +667,7 @@ | |||
723 | 705 | 667 | ||
724 | 706 | # Update the footer/status bar | 668 | # Update the footer/status bar |
725 | 707 | conn_status = False | 669 | conn_status = False |
727 | 708 | @wrap_exceptions | 670 | @handle_exit |
728 | 709 | def update_status(self): | 671 | def update_status(self): |
729 | 710 | wired_connecting = wired.CheckIfWiredConnecting() | 672 | wired_connecting = wired.CheckIfWiredConnecting() |
730 | 711 | wireless_connecting = wireless.CheckIfWirelessConnecting() | 673 | wireless_connecting = wireless.CheckIfWirelessConnecting() |
731 | @@ -715,10 +677,10 @@ | |||
732 | 715 | if self.connecting: | 677 | if self.connecting: |
733 | 716 | if not self.conn_status: | 678 | if not self.conn_status: |
734 | 717 | self.conn_status = True | 679 | self.conn_status = True |
736 | 718 | gobject.timeout_add(250,self.set_connecting_status,fast) | 680 | gobject.timeout_add(250, self.set_connecting_status, fast) |
737 | 719 | return True | 681 | return True |
738 | 720 | else: | 682 | else: |
740 | 721 | if check_for_wired(wired.GetWiredIP(''),self.set_status): | 683 | if check_for_wired(wired.GetWiredIP(''), self.set_status): |
741 | 722 | return True | 684 | return True |
742 | 723 | if not fast: | 685 | if not fast: |
743 | 724 | iwconfig = wireless.GetIwconfig() | 686 | iwconfig = wireless.GetIwconfig() |
744 | @@ -777,20 +739,17 @@ | |||
745 | 777 | self.tcount+=1 | 739 | self.tcount+=1 |
746 | 778 | toAppend=self.twirl[self.tcount % 4] | 740 | toAppend=self.twirl[self.tcount % 4] |
747 | 779 | self.status_label.set_text(text+' '+toAppend) | 741 | self.status_label.set_text(text+' '+toAppend) |
749 | 780 | self.update_ui() | 742 | if loop is not None: |
750 | 743 | self.update_ui() | ||
751 | 781 | return True | 744 | return True |
752 | 782 | 745 | ||
758 | 783 | # Make sure the screen is still working by providing a pretty counter. | 746 | #@handle_exit |
759 | 784 | # Not necessary in the end, but I will be using footer1 for stuff in | 747 | def update_time(self,loop,data): |
755 | 785 | # the long run, so I might as well put something there. | ||
756 | 786 | #@wrap_exceptions | ||
757 | 787 | def update_time(self): | ||
760 | 788 | self.time_label.set_text(strftime('%H:%M:%S')) | 748 | self.time_label.set_text(strftime('%H:%M:%S')) |
762 | 789 | self.update_ui() | 749 | loop.set_alarm_in(0.5, self.update_time) |
763 | 790 | return True | 750 | return True |
764 | 791 | 751 | ||
767 | 792 | # Yeah, I'm copying code. Anything wrong with that? | 752 | #@handle_exit |
766 | 793 | #@wrap_exceptions | ||
768 | 794 | def dbus_scan_finished(self): | 753 | def dbus_scan_finished(self): |
769 | 795 | # I'm pretty sure that I'll need this later. | 754 | # I'm pretty sure that I'll need this later. |
770 | 796 | #if not self.connecting: | 755 | #if not self.connecting: |
771 | @@ -798,8 +757,7 @@ | |||
772 | 798 | self.unlock_screen() | 757 | self.unlock_screen() |
773 | 799 | self.scanning = False | 758 | self.scanning = False |
774 | 800 | 759 | ||
777 | 801 | # Same, same, same, same, same, same | 760 | #@handle_exit |
776 | 802 | #@wrap_exceptions | ||
778 | 803 | def dbus_scan_started(self): | 761 | def dbus_scan_started(self): |
779 | 804 | self.scanning = True | 762 | self.scanning = True |
780 | 805 | if self.diag_type == 'conf': | 763 | if self.diag_type == 'conf': |
781 | @@ -817,11 +775,14 @@ | |||
782 | 817 | self.frame.set_footer(urwid.Pile([self.primaryCols,self.footer2])) | 775 | self.frame.set_footer(urwid.Pile([self.primaryCols,self.footer2])) |
783 | 818 | self.update_ui() | 776 | self.update_ui() |
784 | 819 | 777 | ||
786 | 820 | def handle_keys(self,keys): | 778 | def keypress(self,size,key): |
787 | 779 | self.handle_keys([key],size) | ||
788 | 780 | return key | ||
789 | 781 | def handle_keys(self,keys,size=None): | ||
790 | 821 | if not self.diag: | 782 | if not self.diag: |
791 | 822 | # Handle keystrokes | 783 | # Handle keystrokes |
792 | 823 | if "f8" in keys or 'Q' in keys or 'q' in keys: | 784 | if "f8" in keys or 'Q' in keys or 'q' in keys: |
794 | 824 | loop.quit() | 785 | raise urwid.ExitMainLoop() |
795 | 825 | #return False | 786 | #return False |
796 | 826 | if "f5" in keys or 'R' in keys: | 787 | if "f5" in keys or 'R' in keys: |
797 | 827 | self.lock_screen() | 788 | self.lock_screen() |
798 | @@ -849,12 +810,12 @@ | |||
799 | 849 | focus = self.frame.body.get_focus() | 810 | focus = self.frame.body.get_focus() |
800 | 850 | if focus == self.wiredCB: | 811 | if focus == self.wiredCB: |
801 | 851 | self.special = focus | 812 | self.special = focus |
803 | 852 | self.connect("wired",0) | 813 | self.connect("wired", 0) |
804 | 853 | else: | 814 | else: |
805 | 854 | # wless list only other option, if it is around | 815 | # wless list only other option, if it is around |
806 | 855 | if self.wlessLB != self.no_wlan: | 816 | if self.wlessLB != self.no_wlan: |
807 | 856 | wid,pos = self.thePile.get_focus().get_focus() | 817 | wid,pos = self.thePile.get_focus().get_focus() |
809 | 857 | self.connect("wireless",pos) | 818 | self.connect("wireless", pos) |
810 | 858 | if "esc" in keys: | 819 | if "esc" in keys: |
811 | 859 | # Force disconnect here if connection in progress | 820 | # Force disconnect here if connection in progress |
812 | 860 | if self.connecting: | 821 | if self.connecting: |
813 | @@ -863,11 +824,10 @@ | |||
814 | 863 | daemon.SetForcedDisconnect(True) | 824 | daemon.SetForcedDisconnect(True) |
815 | 864 | if "P" in keys: | 825 | if "P" in keys: |
816 | 865 | if not self.pref: | 826 | if not self.pref: |
818 | 866 | self.pref = PrefsDialog(self.frame,(0,1),ui, | 827 | self.pref = PrefsDialog(self.frame, (0,1), ui, |
819 | 867 | dbusmanager.get_dbus_ifaces()) | 828 | dbusmanager.get_dbus_ifaces()) |
820 | 868 | self.pref.load_settings() | 829 | self.pref.load_settings() |
823 | 869 | self.pref.ready_widgets(ui,self.frame) | 830 | self.frame.set_footer(urwid.Pile([self.prefCols, self.footer2])) |
822 | 870 | self.frame.set_footer(urwid.Pile([self.prefCols,self.footer2])) | ||
824 | 871 | self.diag = self.pref | 831 | self.diag = self.pref |
825 | 872 | self.diag_type = 'pref' | 832 | self.diag_type = 'pref' |
826 | 873 | self.frame.set_body(self.diag) | 833 | self.frame.set_body(self.diag) |
827 | @@ -890,9 +850,9 @@ | |||
828 | 890 | else: | 850 | else: |
829 | 891 | nettype = 'wireless' | 851 | nettype = 'wireless' |
830 | 892 | netname = str(self.wlessLB.get_focus()[1]) | 852 | netname = str(self.wlessLB.get_focus()[1]) |
832 | 893 | run_configscript(self.frame,netname,nettype) | 853 | run_configscript(self.frame, netname, nettype) |
833 | 894 | if "O" in keys: | 854 | if "O" in keys: |
835 | 895 | exitcode,data = AdHocDialog().run(ui,self.frame) | 855 | exitcode,data = AdHocDialog().run(ui, self.frame) |
836 | 896 | #data = (essid,ip,channel,use_ics,use_encrypt,key_edit) | 856 | #data = (essid,ip,channel,use_ics,use_encrypt,key_edit) |
837 | 897 | if exitcode == 1: | 857 | if exitcode == 1: |
838 | 898 | wireless.CreateAdHocNetwork(data[0], | 858 | wireless.CreateAdHocNetwork(data[0], |
839 | @@ -901,53 +861,36 @@ | |||
840 | 901 | data[5], | 861 | data[5], |
841 | 902 | data[4], False) | 862 | data[4], False) |
842 | 903 | 863 | ||
853 | 904 | for k in keys: | 864 | if size is not None: |
854 | 905 | if urwid.is_mouse_event(k): | 865 | for k in keys: |
855 | 906 | event, button, col, row = k | 866 | if urwid.is_mouse_event(k): |
856 | 907 | self.frame.mouse_event( self.size, | 867 | event, button, col, row = k |
857 | 908 | event, button, col, row, | 868 | self.frame.mouse_event(size, |
858 | 909 | focus=True) | 869 | event, button, col, row, |
859 | 910 | continue | 870 | focus=True) |
860 | 911 | k = self.frame.keypress(self.size,k) | 871 | continue |
861 | 912 | if self.diag: | 872 | k = self.target.keypress(size, k) |
862 | 913 | if k == 'esc' or k == 'q' or k == 'Q': | 873 | elif self.diag: |
863 | 874 | for k in keys: | ||
864 | 875 | # Hackish -> vvvvvvvvvvvvv | ||
865 | 876 | k = self.target.keypress(ui.get_cols_rows(), k) | ||
866 | 877 | if self.diag: | ||
867 | 878 | for k in keys: | ||
868 | 879 | if k == 'esc' or k == 'q' or k == 'Q': | ||
869 | 914 | self.restore_primary() | 880 | self.restore_primary() |
870 | 915 | break | 881 | break |
871 | 916 | if k == 'f10': | 882 | if k == 'f10': |
872 | 917 | self.diag.save_settings() | 883 | self.diag.save_settings() |
873 | 918 | self.restore_primary() | 884 | self.restore_primary() |
874 | 919 | break | 885 | break |
875 | 920 | if k == "window resize": | ||
876 | 921 | self.size = ui.get_cols_rows() | ||
877 | 922 | continue | ||
878 | 923 | |||
879 | 924 | def call_update_ui(self,source,cb_condition): | ||
880 | 925 | self.update_ui(True) | ||
881 | 926 | return True | ||
882 | 927 | 886 | ||
883 | 928 | # Redraw the screen | 887 | # Redraw the screen |
906 | 929 | @wrap_exceptions | 888 | @handle_exit |
907 | 930 | def update_ui(self,from_key=False): | 889 | def update_ui(self, from_key=True, from_alarm=False): |
908 | 931 | if not ui._started: | 890 | global loop |
909 | 932 | return False | 891 | if not loop: |
910 | 933 | canvas = self.frame.render( (self.size),True ) | 892 | loop._update() |
911 | 934 | 893 | return True | |
890 | 935 | # Update the screen | ||
891 | 936 | ui.draw_screen((self.size),canvas) | ||
892 | 937 | # Get the input data | ||
893 | 938 | input_data = ui.get_input_nonblocking() | ||
894 | 939 | max_wait = input_data[0] | ||
895 | 940 | keys = input_data[1] | ||
896 | 941 | |||
897 | 942 | # Resolve any "alarms" in the waiting | ||
898 | 943 | if self.update_tag != None: | ||
899 | 944 | gobject.source_remove(self.update_tag) | ||
900 | 945 | if from_key: | ||
901 | 946 | max_wait = 20 | ||
902 | 947 | self.update_tag = gobject.timeout_add(max_wait, \ | ||
903 | 948 | self.update_ui,True) | ||
904 | 949 | self.handle_keys(keys) | ||
905 | 950 | return False | ||
912 | 951 | 894 | ||
913 | 952 | def connect(self, nettype, networkid, networkentry=None): | 895 | def connect(self, nettype, networkid, networkentry=None): |
914 | 953 | """ Initiates the connection process in the daemon. """ | 896 | """ Initiates the connection process in the daemon. """ |
915 | @@ -961,12 +904,8 @@ | |||
916 | 961 | wired.ConnectWired() | 904 | wired.ConnectWired() |
917 | 962 | self.update_status() | 905 | self.update_status() |
918 | 963 | 906 | ||
919 | 964 | ######################################## | ||
920 | 965 | ##### INITIALIZATION FUNCTIONS | ||
921 | 966 | ######################################## | ||
922 | 967 | |||
923 | 968 | def main(): | 907 | def main(): |
925 | 969 | global ui, dlogger | 908 | global ui, loop, dloggger, handle_exit, palette |
926 | 970 | # We are _not_ python. | 909 | # We are _not_ python. |
927 | 971 | misc.RenameProcess('wicd-curses') | 910 | misc.RenameProcess('wicd-curses') |
928 | 972 | 911 | ||
929 | @@ -980,17 +919,11 @@ | |||
930 | 980 | import urwid.curses_display | 919 | import urwid.curses_display |
931 | 981 | ui = urwid.curses_display.Screen() | 920 | ui = urwid.curses_display.Screen() |
932 | 982 | 921 | ||
933 | 983 | #if options.debug: | ||
934 | 984 | # dlogger = logging.getLogger("Debug") | ||
935 | 985 | # dlogger.setLevel(logging.DEBUG) | ||
936 | 986 | # dlogger.debug("wicd-curses debug logging started") | ||
937 | 987 | |||
938 | 988 | # Default Color scheme. | 922 | # Default Color scheme. |
939 | 989 | # Other potential color schemes can be found at: | 923 | # Other potential color schemes can be found at: |
940 | 990 | # http://excess.org/urwid/wiki/RecommendedPalette | 924 | # http://excess.org/urwid/wiki/RecommendedPalette |
941 | 991 | |||
942 | 992 | # Thanks to nanotube on #wicd for helping with this | 925 | # Thanks to nanotube on #wicd for helping with this |
944 | 993 | ui.register_palette([ | 926 | palette = [ |
945 | 994 | ('body','default','default'), | 927 | ('body','default','default'), |
946 | 995 | ('focus','black','light gray'), | 928 | ('focus','black','light gray'), |
947 | 996 | ('header','light blue','default'), | 929 | ('header','light blue','default'), |
948 | @@ -1009,43 +942,45 @@ | |||
949 | 1009 | ('green','dark green','default'), | 942 | ('green','dark green','default'), |
950 | 1010 | ('blue','light blue','default'), | 943 | ('blue','light blue','default'), |
951 | 1011 | ('red','dark red','default'), | 944 | ('red','dark red','default'), |
955 | 1012 | ('bold','white','black','bold')]) | 945 | ('bold','white','black','bold')] |
956 | 1013 | # This is a wrapper around a function that calls another a function that | 946 | |
954 | 1014 | # is a wrapper around a infinite loop. Fun. | ||
957 | 1015 | urwid.set_encoding('utf8') | 947 | urwid.set_encoding('utf8') |
961 | 1016 | ui.run_wrapper(run) | 948 | try: |
962 | 1017 | 949 | ui.run_wrapper(run) | |
963 | 1018 | @wrap_exceptions | 950 | except KeyboardInterrupt: |
964 | 951 | #gobject.source_remove(redraw_tag) | ||
965 | 952 | ui.stop() | ||
966 | 953 | print >> sys.stderr, language['terminated'] | ||
967 | 954 | except DBusException: | ||
968 | 955 | #gobject.source_remove(redraw_tag) | ||
969 | 956 | ui.stop() | ||
970 | 957 | print >> sys.stderr, language['dbus_fail']+"\n" | ||
971 | 958 | raise | ||
972 | 959 | except : | ||
973 | 960 | print >> sys.stderr, language['exception']+"\n" | ||
974 | 961 | sys.stdout.flush() | ||
975 | 962 | raise | ||
976 | 1019 | def run(): | 963 | def run(): |
981 | 1020 | global loop | 964 | global ui, loop, dloggger, handle_exit, palette |
978 | 1021 | loop = gobject.MainLoop() | ||
979 | 1022 | |||
980 | 1023 | ui.set_mouse_tracking() | ||
982 | 1024 | app = appGUI() | 965 | app = appGUI() |
986 | 1025 | 966 | loop = urwid.MainLoop(app, palette, ui, | |
987 | 1026 | 967 | event_loop=urwid.GLibEventLoop()) | |
988 | 1027 | # Connect signals and whatnot to UI screen control functions | 968 | |
989 | 1028 | bus.add_signal_receiver(app.dbus_scan_finished, 'SendEndScanSignal', | 969 | bus.add_signal_receiver(app.dbus_scan_finished, 'SendEndScanSignal', |
990 | 1029 | 'org.wicd.daemon.wireless') | 970 | 'org.wicd.daemon.wireless') |
991 | 1030 | bus.add_signal_receiver(app.dbus_scan_started, 'SendStartScanSignal', | 971 | bus.add_signal_receiver(app.dbus_scan_started, 'SendStartScanSignal', |
992 | 1031 | 'org.wicd.daemon.wireless') | 972 | 'org.wicd.daemon.wireless') |
993 | 1032 | # I've left this commented out many times. | ||
994 | 1033 | bus.add_signal_receiver(app.update_netlist, 'StatusChanged', | 973 | bus.add_signal_receiver(app.update_netlist, 'StatusChanged', |
995 | 1034 | 'org.wicd.daemon') | 974 | 'org.wicd.daemon') |
999 | 1035 | # Update what the interface looks like as an idle function | 975 | #loop.add |
997 | 1036 | #gobject.idle_add(app.update_ui) | ||
998 | 1037 | # Update the connection status on the bottom every 1.5 s. | ||
1000 | 1038 | gobject.timeout_add(2000,app.update_status) | 976 | gobject.timeout_add(2000,app.update_status) |
1001 | 1039 | # This will make sure that it is updated on the second. | 977 | # This will make sure that it is updated on the second. |
1009 | 1040 | gobject.timeout_add(500,app.update_time) | 978 | loop.set_alarm_in(0.5,app.update_time) |
1010 | 1041 | 979 | handle_exit = loop.event_loop.handle_exit | |
1004 | 1042 | app.update_ui() | ||
1005 | 1043 | # Get input file descriptors and add callbacks to the ui-updating function | ||
1006 | 1044 | fds = ui.get_input_descriptors() | ||
1007 | 1045 | for fd in fds: | ||
1008 | 1046 | gobject.io_add_watch(fd, gobject.IO_IN,app.call_update_ui) | ||
1011 | 1047 | loop.run() | 980 | loop.run() |
1012 | 1048 | 981 | ||
1013 | 982 | |||
1014 | 983 | |||
1015 | 1049 | # Mostly borrowed from gui.py | 984 | # Mostly borrowed from gui.py |
1016 | 1050 | def setup_dbus(force=True): | 985 | def setup_dbus(force=True): |
1017 | 1051 | global bus, daemon, wireless, wired, DBUS_AVAIL | 986 | global bus, daemon, wireless, wired, DBUS_AVAIL |
1018 | @@ -1082,14 +1017,11 @@ | |||
1019 | 1082 | sys.exit(1) | 1017 | sys.exit(1) |
1020 | 1083 | else: | 1018 | else: |
1021 | 1084 | raise | 1019 | raise |
1028 | 1085 | parser.set_defaults(screen='raw',debug=False) | 1020 | parser.set_defaults(screen='raw', debug=False) |
1029 | 1086 | parser.add_option("-r", "--raw-screen",action="store_const",const='raw' | 1021 | parser.add_option("-r", "--raw-screen", action="store_const", const='raw' |
1030 | 1087 | ,dest='screen',help="use urwid's raw screen controller (default)") | 1022 | ,dest='screen', help="use urwid's raw screen controller (default)") |
1031 | 1088 | parser.add_option("-c", "--curses-screen",action="store_const",const='curses',dest='screen',help="use urwid's curses screen controller") | 1023 | parser.add_option("-c", "--curses-screen", action="store_const",const='curses',dest='screen', help="use urwid's curses screen controller") |
1032 | 1089 | parser.add_option("-d", "--debug",action="store_true" | 1024 | #parser.add_option("-d", "--debug",action="store_true" |
1033 | 1090 | ,dest='debug',help="enable logging of wicd-curses (currently does nothing)") | 1025 | # ,dest='debug',help="enable logging of wicd-curses (currently does nothing)") |
1034 | 1091 | (options,args) = parser.parse_args() | 1026 | (options,args) = parser.parse_args() |
1035 | 1092 | main() | 1027 | main() |
1036 | 1093 | # Make sure that the terminal does not try to overwrite the last line of | ||
1037 | 1094 | # the program, so that everything looks pretty. | ||
1038 | 1095 | #print "" | ||
1039 | 1096 | 1028 | ||
1040 | === modified file 'setup.py' | |||
1041 | --- setup.py 2009-07-28 02:09:18 +0000 | |||
1042 | +++ setup.py 2009-11-21 05:36:12 +0000 | |||
1043 | @@ -502,6 +502,7 @@ | |||
1044 | 502 | data.append((wpath.lib, ['curses/wicd-curses.py'])) | 502 | data.append((wpath.lib, ['curses/wicd-curses.py'])) |
1045 | 503 | data.append((wpath.lib, ['curses/netentry_curses.py'])) | 503 | data.append((wpath.lib, ['curses/netentry_curses.py'])) |
1046 | 504 | data.append((wpath.lib, ['curses/configscript_curses.py'])) | 504 | data.append((wpath.lib, ['curses/configscript_curses.py'])) |
1047 | 505 | data.append((wpath.lib, ['curses/popup.py'])) | ||
1048 | 505 | data.append((wpath.bin, ['scripts/wicd-curses'])) | 506 | data.append((wpath.bin, ['scripts/wicd-curses'])) |
1049 | 506 | if not wpath.no_install_man: | 507 | if not wpath.no_install_man: |
1050 | 507 | data.append(( wpath.mandir + 'man8/', ['man/wicd-curses.8'])) | 508 | data.append(( wpath.mandir + 'man8/', ['man/wicd-curses.8'])) |
These are changes to wicd 1.6 that make wicd-curses more compatible with urwid 0.9.9. These changes break compatibility with urwid 0.9.8.*, and should be included in mainline once urwid 0.9.9 is mainstream in all major distributions.