/usr/lib64/python2.7/idlelib
NameSizeModeActions
Icons/-0755rm
idle_test/-0755rm
aboutDialog.py70140644editdlrm
aboutDialog.pyc68480644editdlrm
aboutDialog.pyo68480644editdlrm
AutoComplete.py89640644editdlrm
AutoComplete.pyc80120644editdlrm
AutoComplete.pyo80120644editdlrm
AutoCompleteWindow.py173180644editdlrm
AutoCompleteWindow.pyc124800644editdlrm
AutoCompleteWindow.pyo124210644editdlrm
AutoExpand.py33950644editdlrm
AutoExpand.pyc35020644editdlrm
AutoExpand.pyo35020644editdlrm
Bindings.py29760644editdlrm
Bindings.pyc46950644editdlrm
Bindings.pyo46950644editdlrm
CallTips.py77400644editdlrm
CallTips.pyc81330644editdlrm
CallTips.pyo81330644editdlrm
CallTipWindow.py60650644editdlrm
CallTipWindow.pyc61360644editdlrm
CallTipWindow.pyo61360644editdlrm
ChangeLog563930644editdlrm
ClassBrowser.py69990644editdlrm
ClassBrowser.pyc95000644editdlrm
ClassBrowser.pyo95000644editdlrm
CodeContext.py83420644editdlrm
CodeContext.pyc66580644editdlrm
CodeContext.pyo66140644editdlrm
ColorDelegator.py97620644editdlrm
ColorDelegator.pyc88980644editdlrm
ColorDelegator.pyo88980644editdlrm
config-extensions.def29650644editdlrm
config-highlight.def25150644editdlrm
config-keys.def77770644editdlrm
config-main.def25610644editdlrm
configDialog.py659580644editdlrm
configDialog.pyc532910644editdlrm
configDialog.pyo532910644editdlrm
configHandler.py324850644editdlrm
configHandler.pyc293610644editdlrm
configHandler.pyo293610644editdlrm
configHelpSourceEdit.py66860644editdlrm
configHelpSourceEdit.pyc65950644editdlrm
configHelpSourceEdit.pyo65950644editdlrm
configSectionNameDialog.py40400644editdlrm
configSectionNameDialog.pyc44190644editdlrm
configSectionNameDialog.pyo44190644editdlrm
CREDITS.txt18660644editdlrm
Debugger.py182360644editdlrm
Debugger.pyc175460644editdlrm
Debugger.pyo175460644editdlrm
Delegator.py6650644editdlrm
Delegator.pyc12680644editdlrm
Delegator.pyo12680644editdlrm
dynOptionMenuWidget.py19840644editdlrm
dynOptionMenuWidget.pyc27900644editdlrm
dynOptionMenuWidget.pyo27900644editdlrm
EditorWindow.py654980644editdlrm
EditorWindow.pyc568580644editdlrm
EditorWindow.pyo567560644editdlrm
extend.txt36420644editdlrm
FileList.py37180644editdlrm
FileList.pyc40250644editdlrm
FileList.pyo39920644editdlrm
FormatParagraph.py72870644editdlrm
FormatParagraph.pyc71420644editdlrm
FormatParagraph.pyo71420644editdlrm
GrepDialog.py51450644editdlrm
GrepDialog.pyc64250644editdlrm
GrepDialog.pyo64250644editdlrm
help.html424140644editdlrm
help.py110350644editdlrm
help.pyc122700644editdlrm
help.pyo122700644editdlrm
help.txt121440644editdlrm
HISTORY.txt103170644editdlrm
HyperParser.py104970644editdlrm
HyperParser.pyc66730644editdlrm
HyperParser.pyo66730644editdlrm
idle.py4530644editdlrm
idle.pyc4100644editdlrm
idle.pyo4100644editdlrm
idle.pyw5630644editdlrm
IdleHistory.py40520644editdlrm
IdleHistory.pyc40600644editdlrm
IdleHistory.pyo40600644editdlrm
idlever.py4150644editdlrm
idlever.pyc5780644editdlrm
idlever.pyo5780644editdlrm
IOBinding.py219110644editdlrm
IOBinding.pyc185350644editdlrm
IOBinding.pyo185350644editdlrm
keybindingDialog.py124680644editdlrm
keybindingDialog.pyc121730644editdlrm
keybindingDialog.pyo121730644editdlrm
macosxSupport.py84350644editdlrm
macosxSupport.pyc83510644editdlrm
macosxSupport.pyo82130644editdlrm
MultiCall.py177010644editdlrm
MultiCall.pyc163510644editdlrm
MultiCall.pyo162770644editdlrm
MultiStatusBar.py13480644editdlrm
MultiStatusBar.pyc22790644editdlrm
MultiStatusBar.pyo22790644editdlrm
NEWS.txt472470644editdlrm
ObjectBrowser.py43760644editdlrm
ObjectBrowser.pyc70670644editdlrm
ObjectBrowser.pyo70670644editdlrm
OutputWindow.py45760644editdlrm
OutputWindow.pyc52320644editdlrm
OutputWindow.pyo52320644editdlrm
ParenMatch.py67140644editdlrm
ParenMatch.pyc71290644editdlrm
ParenMatch.pyo71290644editdlrm
PathBrowser.py30090644editdlrm
PathBrowser.pyc44860644editdlrm
PathBrowser.pyo44860644editdlrm
Percolator.py32220644editdlrm
Percolator.pyc46080644editdlrm
Percolator.pyo44240644editdlrm
PyParse.py195100644editdlrm
PyParse.pyc100050644editdlrm
PyParse.pyo95670644editdlrm
PyShell.py588620755editdlrm
PyShell.pyc528260644editdlrm
PyShell.pyo527240644editdlrm
README.txt78900644editdlrm
RemoteDebugger.py116320644editdlrm
RemoteDebugger.pyc163250644editdlrm
RemoteDebugger.pyo161710644editdlrm
RemoteObjectBrowser.py9420644editdlrm
RemoteObjectBrowser.pyc21500644editdlrm
RemoteObjectBrowser.pyo21500644editdlrm
ReplaceDialog.py66390644editdlrm
ReplaceDialog.pyc77560644editdlrm
ReplaceDialog.pyo77560644editdlrm
rpc.py201500644editdlrm
rpc.pyc217280644editdlrm
rpc.pyo216220644editdlrm
RstripExtension.py10500644editdlrm
RstripExtension.pyc16130644editdlrm
RstripExtension.pyo16130644editdlrm
run.py129170644editdlrm
run.pyc134190644editdlrm
run.pyo133610644editdlrm
ScriptBinding.py84590644editdlrm
ScriptBinding.pyc82010644editdlrm
ScriptBinding.pyo82010644editdlrm
ScrolledList.py43730644editdlrm
ScrolledList.pyc64820644editdlrm
ScrolledList.pyo64820644editdlrm
SearchDialog.py26300644editdlrm
SearchDialog.pyc39830644editdlrm
SearchDialog.pyo39830644editdlrm
SearchDialogBase.py70940644editdlrm
SearchDialogBase.pyc84620644editdlrm
SearchDialogBase.pyo84620644editdlrm
SearchEngine.py74630644editdlrm
SearchEngine.pyc83020644editdlrm
SearchEngine.pyo83020644editdlrm
StackViewer.py44310644editdlrm
StackViewer.pyc64040644editdlrm
StackViewer.pyo64040644editdlrm
tabbedpages.py184390644editdlrm
tabbedpages.pyc185610644editdlrm
tabbedpages.pyo185610644editdlrm
textView.py35200644editdlrm
textView.pyc40250644editdlrm
textView.pyo40250644editdlrm
TODO.txt84780644editdlrm
ToolTip.py31730644editdlrm
ToolTip.pyc46690644editdlrm
ToolTip.pyo46690644editdlrm
TreeWidget.py150370644editdlrm
TreeWidget.pyc176940644editdlrm
TreeWidget.pyo176940644editdlrm
UndoDelegator.py107870644editdlrm
UndoDelegator.pyc135550644editdlrm
UndoDelegator.pyo135550644editdlrm
WidgetRedirector.py69060644editdlrm
WidgetRedirector.pyc77690644editdlrm
WidgetRedirector.pyo77690644editdlrm
WindowList.py24730644editdlrm
WindowList.pyc36360644editdlrm
WindowList.pyo36360644editdlrm
ZoomHeight.py13000644editdlrm
ZoomHeight.pyc16460644editdlrm
ZoomHeight.pyo16460644editdlrm
__init__.py2880644editdlrm
__init__.pyc4310644editdlrm
__init__.pyo4310644editdlrm
Edit: /usr/lib64/python2.7/idlelib/run.py (12917B)
import sys import linecache import time import socket import traceback import thread import threading import Queue from idlelib import CallTips from idlelib import AutoComplete from idlelib import RemoteDebugger from idlelib import RemoteObjectBrowser from idlelib import StackViewer from idlelib import rpc from idlelib import PyShell from idlelib import IOBinding import __main__ LOCALHOST = '127.0.0.1' import warnings def idle_showwarning_subproc( message, category, filename, lineno, file=None, line=None): """Show Idle-format warning after replacing warnings.showwarning. The only difference is the formatter called. """ if file is None: file = sys.stderr try: file.write(PyShell.idle_formatwarning( message, category, filename, lineno, line)) except IOError: pass # the file (probably stderr) is invalid - this warning gets lost. _warnings_showwarning = None def capture_warnings(capture): "Replace warning.showwarning with idle_showwarning_subproc, or reverse." global _warnings_showwarning if capture: if _warnings_showwarning is None: _warnings_showwarning = warnings.showwarning warnings.showwarning = idle_showwarning_subproc else: if _warnings_showwarning is not None: warnings.showwarning = _warnings_showwarning _warnings_showwarning = None capture_warnings(True) # Thread shared globals: Establish a queue between a subthread (which handles # the socket) and the main thread (which runs user code), plus global # completion, exit and interruptable (the main thread) flags: exit_now = False quitting = False interruptable = False def main(del_exitfunc=False): """Start the Python execution server in a subprocess In the Python subprocess, RPCServer is instantiated with handlerclass MyHandler, which inherits register/unregister methods from RPCHandler via the mix-in class SocketIO. When the RPCServer 'server' is instantiated, the TCPServer initialization creates an instance of run.MyHandler and calls its handle() method. handle() instantiates a run.Executive object, passing it a reference to the MyHandler object. That reference is saved as attribute rpchandler of the Executive instance. The Executive methods have access to the reference and can pass it on to entities that they command (e.g. RemoteDebugger.Debugger.start_debugger()). The latter, in turn, can call MyHandler(SocketIO) register/unregister methods via the reference to register and unregister themselves. """ global exit_now global quitting global no_exitfunc no_exitfunc = del_exitfunc #time.sleep(15) # test subprocess not responding try: assert(len(sys.argv) > 1) port = int(sys.argv[-1]) except: print>>sys.stderr, "IDLE Subprocess: no IP port passed in sys.argv." return capture_warnings(True) sys.argv[:] = [""] sockthread = threading.Thread(target=manage_socket, name='SockThread', args=((LOCALHOST, port),)) sockthread.setDaemon(True) sockthread.start() while 1: try: if exit_now: try: exit() except KeyboardInterrupt: # exiting but got an extra KBI? Try again! continue try: seq, request = rpc.request_queue.get(block=True, timeout=0.05) except Queue.Empty: continue method, args, kwargs = request ret = method(*args, **kwargs) rpc.response_queue.put((seq, ret)) except KeyboardInterrupt: if quitting: exit_now = True continue except SystemExit: capture_warnings(False) raise except: type, value, tb = sys.exc_info() try: print_exception() rpc.response_queue.put((seq, None)) except: # Link didn't work, print same exception to __stderr__ traceback.print_exception(type, value, tb, file=sys.__stderr__) exit() else: continue def manage_socket(address): for i in range(3): time.sleep(i) try: server = MyRPCServer(address, MyHandler) break except socket.error as err: print>>sys.__stderr__,"IDLE Subprocess: socket error: "\ + err.args[1] + ", retrying...." else: print>>sys.__stderr__, "IDLE Subprocess: Connection to "\ "IDLE GUI failed, exiting." show_socket_error(err, address) global exit_now exit_now = True return server.handle_request() # A single request only def show_socket_error(err, address): import Tkinter import tkMessageBox root = Tkinter.Tk() fix_scaling(root) root.withdraw() if err.args[0] == 61: # connection refused msg = "IDLE's subprocess can't connect to %s:%d. This may be due "\ "to your personal firewall configuration. It is safe to "\ "allow this internal connection because no data is visible on "\ "external ports." % address tkMessageBox.showerror("IDLE Subprocess Error", msg, parent=root) else: tkMessageBox.showerror("IDLE Subprocess Error", "Socket Error: %s" % err.args[1], parent=root) root.destroy() def print_exception(): import linecache linecache.checkcache() flush_stdout() efile = sys.stderr typ, val, tb = excinfo = sys.exc_info() sys.last_type, sys.last_value, sys.last_traceback = excinfo tbe = traceback.extract_tb(tb) print>>efile, '\nTraceback (most recent call last):' exclude = ("run.py", "rpc.py", "threading.py", "Queue.py", "RemoteDebugger.py", "bdb.py") cleanup_traceback(tbe, exclude) traceback.print_list(tbe, file=efile) lines = traceback.format_exception_only(typ, val) for line in lines: print>>efile, line, def cleanup_traceback(tb, exclude): "Remove excluded traces from beginning/end of tb; get cached lines" orig_tb = tb[:] while tb: for rpcfile in exclude: if tb[0][0].count(rpcfile): break # found an exclude, break for: and delete tb[0] else: break # no excludes, have left RPC code, break while: del tb[0] while tb: for rpcfile in exclude: if tb[-1][0].count(rpcfile): break else: break del tb[-1] if len(tb) == 0: # exception was in IDLE internals, don't prune! tb[:] = orig_tb[:] print>>sys.stderr, "** IDLE Internal Exception: " rpchandler = rpc.objecttable['exec'].rpchandler for i in range(len(tb)): fn, ln, nm, line = tb[i] if nm == '?': nm = "-toplevel-" if fn.startswith(" 1.4: for name in tkFont.names(root): font = tkFont.Font(root=root, name=name, exists=True) size = int(font['size']) if size < 0: font['size'] = int(round(-0.75*size)) class MyRPCServer(rpc.RPCServer): def handle_error(self, request, client_address): """Override RPCServer method for IDLE Interrupt the MainThread and exit server if link is dropped. """ global quitting try: raise except SystemExit: raise except EOFError: global exit_now exit_now = True thread.interrupt_main() except: erf = sys.__stderr__ print>>erf, '\n' + '-'*40 print>>erf, 'Unhandled server exception!' print>>erf, 'Thread: %s' % threading.currentThread().getName() print>>erf, 'Client Address: ', client_address print>>erf, 'Request: ', repr(request) traceback.print_exc(file=erf) print>>erf, '\n*** Unrecoverable, server exiting!' print>>erf, '-'*40 quitting = True thread.interrupt_main() class MyHandler(rpc.RPCHandler): def handle(self): """Override base method""" executive = Executive(self) self.register("exec", executive) self.console = self.get_remote_proxy("console") sys.stdin = PyShell.PseudoInputFile(self.console, "stdin", IOBinding.encoding) sys.stdout = PyShell.PseudoOutputFile(self.console, "stdout", IOBinding.encoding) sys.stderr = PyShell.PseudoOutputFile(self.console, "stderr", IOBinding.encoding) # Keep a reference to stdin so that it won't try to exit IDLE if # sys.stdin gets changed from within IDLE's shell. See issue17838. self._keep_stdin = sys.stdin self.interp = self.get_remote_proxy("interp") rpc.RPCHandler.getresponse(self, myseq=None, wait=0.05) def exithook(self): "override SocketIO method - wait for MainThread to shut us down" time.sleep(10) def EOFhook(self): "Override SocketIO method - terminate wait on callback and exit thread" global quitting quitting = True thread.interrupt_main() def decode_interrupthook(self): "interrupt awakened thread" global quitting quitting = True thread.interrupt_main() class Executive(object): def __init__(self, rpchandler): self.rpchandler = rpchandler self.locals = __main__.__dict__ self.calltip = CallTips.CallTips() self.autocomplete = AutoComplete.AutoComplete() def runcode(self, code): global interruptable try: self.usr_exc_info = None interruptable = True try: exec code in self.locals finally: interruptable = False except SystemExit: # Scripts that raise SystemExit should just # return to the interactive prompt pass except: self.usr_exc_info = sys.exc_info() if quitting: exit() print_exception() jit = self.rpchandler.console.getvar("<>") if jit: self.rpchandler.interp.open_remote_stack_viewer() else: flush_stdout() def interrupt_the_server(self): if interruptable: thread.interrupt_main() def start_the_debugger(self, gui_adap_oid): return RemoteDebugger.start_debugger(self.rpchandler, gui_adap_oid) def stop_the_debugger(self, idb_adap_oid): "Unregister the Idb Adapter. Link objects and Idb then subject to GC" self.rpchandler.unregister(idb_adap_oid) def get_the_calltip(self, name): return self.calltip.fetch_tip(name) def get_the_completion_list(self, what, mode): return self.autocomplete.fetch_completions(what, mode) def stackviewer(self, flist_oid=None): if self.usr_exc_info: typ, val, tb = self.usr_exc_info else: return None flist = None if flist_oid is not None: flist = self.rpchandler.get_remote_proxy(flist_oid) while tb and tb.tb_frame.f_globals["__name__"] in ["rpc", "run"]: tb = tb.tb_next sys.last_type = typ sys.last_value = val item = StackViewer.StackTreeItem(flist, tb) return RemoteObjectBrowser.remote_object_tree_item(item) capture_warnings(False) # Make sure turned off; see issue 18081