diff options
author | Marien Zwart <marien.zwart@gmail.com> | 2010-02-11 16:01:30 +0100 |
---|---|---|
committer | Marien Zwart <marien.zwart@gmail.com> | 2010-02-11 16:01:30 +0100 |
commit | d2a73506a58d28db9b654d85d2024407fdf211e1 (patch) | |
tree | dfd5d8575ded47bfe4f15fdcd2f61bd0e7bfa9bc /urwid | |
parent | 5274f22a02e93be5e8b5ab5f872a4de06efb7606 (diff) | |
download | urwid-d2a73506a58d28db9b654d85d2024407fdf211e1.tar.gz |
Remove unused local variables (do not merge blindly! perhaps some of them *should* be used?)
Diffstat (limited to 'urwid')
-rw-r--r-- | urwid/canvas.py | 2 | ||||
-rwxr-xr-x | urwid/container.py | 3 | ||||
-rwxr-xr-x | urwid/graphics.py | 1 | ||||
-rw-r--r-- | urwid/listbox.py | 3 | ||||
-rwxr-xr-x | urwid/main_loop.py | 1 | ||||
-rw-r--r-- | urwid/raw_display.py | 4 | ||||
-rw-r--r-- | urwid/util.py | 1 | ||||
-rwxr-xr-x | urwid/web_display.py | 8 |
8 files changed, 7 insertions, 16 deletions
diff --git a/urwid/canvas.py b/urwid/canvas.py index c0a9ae1..e2e1307 100644 --- a/urwid/canvas.py +++ b/urwid/canvas.py @@ -952,7 +952,6 @@ def shards_trim_rows(shards, keep_rows): """ assert keep_rows >= 0, keep_rows - shard_tail = [] new_shards = [] done_rows = 0 for num_rows, cviews in shards: @@ -1157,7 +1156,6 @@ def CanvasJoin(l): def apply_text_layout(text, attr, ls, maxcol): - utext = type(text)==type(u"") t = [] a = [] c = [] diff --git a/urwid/container.py b/urwid/container.py index fef340a..e2fd7a8 100755 --- a/urwid/container.py +++ b/urwid/container.py @@ -888,7 +888,6 @@ class Pile(Widget): # either FlowWidget or BoxWidget """Pass the keypress to the widget in focus. Unhandled 'up' and 'down' keys may cause a focus change.""" - maxcol = size[0] item_rows = None if len(size)==2: item_rows = self.get_item_rows( size, focus=True ) @@ -914,7 +913,6 @@ class Pile(Widget): # either FlowWidget or BoxWidget continue self._update_pref_col_from_focus(size) - old_focus = self.focus_item self.set_focus(j) if not hasattr(self.focus_item,'move_cursor_to_coords'): return @@ -1107,7 +1105,6 @@ class Columns(Widget): # either FlowWidget or BoxWidget weighted = [] shared = maxcol + self.dividechars - growable = 0 i = 0 for t, width in col_types: diff --git a/urwid/graphics.py b/urwid/graphics.py index 2bdb263..dc66e90 100755 --- a/urwid/graphics.py +++ b/urwid/graphics.py @@ -568,7 +568,6 @@ def calculate_bargraph_display( bardata, top, bar_widths, maxrow ): maxcol = sum(bar_widths) # build intermediate data structure - bars = len(bardata) rows = [None]*maxrow def add_segment( seg_num, col, row, width, rows=rows ): if rows[row]: diff --git a/urwid/listbox.py b/urwid/listbox.py index 09e1c06..1955a7a 100644 --- a/urwid/listbox.py +++ b/urwid/listbox.py @@ -219,7 +219,7 @@ class ListBox(BoxWidget): focus_widget, focus_pos = self.body.get_focus() if focus_widget is None: #list box is empty? return None,None,None - top_pos = bottom_pos = focus_pos + top_pos = focus_pos offset_rows, inset_rows = self.get_focus_offset_inset( (maxcol,maxrow)) @@ -276,7 +276,6 @@ class ListBox(BoxWidget): next, pos = self.body.get_next( pos ) if next is None: # run out of widgets below? break - bottom_pos = pos n_rows = next.rows( (maxcol,) ) fill_below.append( (next, pos, n_rows) ) diff --git a/urwid/main_loop.py b/urwid/main_loop.py index b2c8f43..67c82ea 100755 --- a/urwid/main_loop.py +++ b/urwid/main_loop.py @@ -663,7 +663,6 @@ class GLibEventLoop(object): ... ZeroDivisionError: integer division or modulo by zero """ - context = self._loop.get_context() try: self._loop.run() finally: diff --git a/urwid/raw_display.py b/urwid/raw_display.py index d324df6..f194b08 100644 --- a/urwid/raw_display.py +++ b/urwid/raw_display.py @@ -522,7 +522,7 @@ class Screen(BaseScreen, RealTerminal): self._term_output_file.write(escape.DESIGNATE_G1_SPECIAL) self._term_output_file.flush() break - except IOError, e: + except IOError: pass self._setup_G1_done = True @@ -845,7 +845,7 @@ class Screen(BaseScreen, RealTerminal): modify = ["%d;rgb:%02x/%02x/%02x" % (index, red, green, blue) for index, red, green, blue in entries] - seq = self._term_output_file.write("\x1b]4;"+";".join(modify)+"\x1b\\") + self._term_output_file.write("\x1b]4;"+";".join(modify)+"\x1b\\") self._term_output_file.flush() diff --git a/urwid/util.py b/urwid/util.py index 999925e..b02e292 100644 --- a/urwid/util.py +++ b/urwid/util.py @@ -186,7 +186,6 @@ def calc_trim_text( text, start_offs, end_offs, start_col, end_col ): pad_left -- 0 for no pad or 1 for one space to be added pad_right -- 0 for no pad or 1 for one space to be added """ - l = [] spos = start_offs pad_left = pad_right = 0 if start_col > 0: diff --git a/urwid/web_display.py b/urwid/web_display.py index 2c9ce4f..5dc18c7 100755 --- a/urwid/web_display.py +++ b/urwid/web_display.py @@ -749,7 +749,7 @@ class Screen: signal.alarm( 0 ) try: s, addr = self.server_socket.accept() - except socket.timeout, e: + except socket.timeout: sys.exit(0) send = s.sendall else: @@ -856,7 +856,7 @@ class Screen: try: s, addr = self.server_socket.accept() s.close() - except socket.timeout, e: + except socket.timeout: sys.exit(0) else: # send empty update @@ -998,7 +998,7 @@ def handle_short_request(): sys.stdout.write(data) data = s.recv(BUF_SZ) return True - except socket.error,e: + except socket.error: sys.stdout.write("Status: 404 Not Found\r\n\r\n") return True @@ -1008,7 +1008,7 @@ def handle_short_request(): try: fd = os.open((os.path.join(_prefs.pipe_dir, "urwid"+urwid_id+".in")), os.O_WRONLY) - except OSError,e: + except OSError: sys.stdout.write("Status: 404 Not Found\r\n\r\n") return True |