mirror of
https://github.com/kennethreitz-archive/bpython-gist.git
synced 2026-06-05 07:36:12 +00:00
Fix some warnings, allow easier checking with pychecker.
This commit is contained in:
committed by
Bob Farrell
parent
e615100cd9
commit
9e34f05959
@@ -0,0 +1 @@
|
||||
*.pyc
|
||||
@@ -0,0 +1 @@
|
||||
blacklist = ['pyparsing', 'code', 'pygments/lexer']
|
||||
+22
-20
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user