@@ -508,11 +508,11 @@ def show_source(self, index):
508508class NamespaceViewer :
509509 "Global/local namespace viewer for debugger GUI."
510510
511- def __init__ (self , master , title , dict = None ):
511+ def __init__ (self , master , title , odict = None ): # XXX odict never passed.
512512 width = 0
513513 height = 40
514- if dict :
515- height = 20 * len (dict ) # XXX 20 == observed height of Entry widget
514+ if odict :
515+ height = 20 * len (odict ) # XXX 20 == observed height of Entry widget
516516 self .master = master
517517 self .title = title
518518 import reprlib
@@ -533,24 +533,24 @@ def __init__(self, master, title, dict=None):
533533 canvas ["yscrollcommand" ] = vbar .set
534534 self .subframe = subframe = Frame (canvas )
535535 self .sfid = canvas .create_window (0 , 0 , window = subframe , anchor = "nw" )
536- self .load_dict (dict )
536+ self .load_dict (odict )
537537
538- dict = - 1
538+ prev_odict = - 1 # Needed for initial comparison below.
539539
540- def load_dict (self , dict , force = 0 , rpc_client = None ):
541- if dict is self .dict and not force :
540+ def load_dict (self , odict , force = 0 , rpc_client = None ):
541+ if odict is self .prev_odict and not force :
542542 return
543543 subframe = self .subframe
544544 frame = self .frame
545545 for c in list (subframe .children .values ()):
546546 c .destroy ()
547- self .dict = None
548- if not dict :
547+ self .prev_odict = None
548+ if not odict :
549549 l = Label (subframe , text = "None" )
550550 l .grid (row = 0 , column = 0 )
551551 else :
552552 #names = sorted(dict)
553- ###
553+ #
554554 # Because of (temporary) limitations on the dict_keys type (not yet
555555 # public or pickleable), have the subprocess to send a list of
556556 # keys, not a dict_keys object. sorted() will take a dict_keys
@@ -560,12 +560,12 @@ def load_dict(self, dict, force=0, rpc_client=None):
560560 # interpreter gets into a loop requesting non-existing dict[0],
561561 # dict[1], dict[2], etc from the debugger_r.DictProxy.
562562 # TODO recheck above; see debugger_r 159ff, debugobj 60.
563- keys_list = dict .keys ()
563+ keys_list = odict .keys ()
564564 names = sorted (keys_list )
565- ###
565+
566566 row = 0
567567 for name in names :
568- value = dict [name ]
568+ value = odict [name ]
569569 svalue = self .repr .repr (value ) # repr(value)
570570 # Strip extra quotes caused by calling repr on the (already)
571571 # repr'd value sent across the RPC interface:
@@ -577,7 +577,7 @@ def load_dict(self, dict, force=0, rpc_client=None):
577577 l .insert (0 , svalue )
578578 l .grid (row = row , column = 1 , sticky = "nw" )
579579 row = row + 1
580- self .dict = dict
580+ self .prev_odict = odict
581581 # XXX Could we use a <Configure> callback for the following?
582582 subframe .update_idletasks () # Alas!
583583 width = subframe .winfo_reqwidth ()
0 commit comments