Fix some warnings, allow easier checking with pychecker.

This commit is contained in:
Jørgen P. Tjernø
2008-08-20 14:03:24 +02:00
committed by Bob Farrell
parent e615100cd9
commit 9e34f05959
3 changed files with 24 additions and 20 deletions
+1
View File
@@ -0,0 +1 @@
*.pyc
+1
View File
@@ -0,0 +1 @@
blacklist = ['pyparsing', 'code', 'pygments/lexer']
+22 -20
View File
@@ -29,11 +29,9 @@ import os
import sys
import curses
import code
import codeop
import traceback
import re
import time
import math
import urllib
import rlcompleter
import inspect
@@ -61,6 +59,8 @@ from pyparsing import Forward, Suppress, QuotedString, dblQuotedString, \
alphas, alphanums, printables, ParseException
OPTS.arg_spec = True
DO_RESIZE = False
# TODO:
#
# C-l doesn't repaint the screen yet.
@@ -200,6 +200,7 @@ class Repl( object ):
self.tablen = None
self.s = ''
self.list_win_visible = False
self._C = {}
if not OPTS.arg_spec:
return
@@ -1487,23 +1488,24 @@ def main( scr ):
repl.repl()
return repl.getstdout()
tb = None
try:
o = curses.wrapper( main )
except:
tb = traceback.format_exc()
# I don't know why this is necessary; without it the wrapper doesn't always
# do its job.
if stdscr is not None:
stdscr.keypad(0)
curses.echo()
curses.nocbreak()
curses.endwin()
if __name__ == '__main__':
tb = None
try:
o = curses.wrapper( main )
except:
tb = traceback.format_exc()
# I don't know why this is necessary; without it the wrapper doesn't always
# do its job.
if stdscr is not None:
stdscr.keypad(0)
curses.echo()
curses.nocbreak()
curses.endwin()
sys.stdout = sys.__stdout__
if tb:
print tb
sys.exit(1)
sys.stdout = sys.__stdout__
if tb:
print tb
sys.exit(1)
sys.stdout.write( o ) # Fake stdout data so everything's still visible after exiting
sys.stdout.flush()
sys.stdout.write( o ) # Fake stdout data so everything's still visible after exiting
sys.stdout.flush()