JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbrў fz#c@sdZddlZddlZddlZddlmZejejdZe dd \Z Z ddl m Z ddlmZddlZejZejreej7ZnGd d d ZdS( uAutoComplete.py - An IDLE extension for automatically completing names. This extension can complete either attribute names of file names. It can pop a window with all available names, for the user to select from. iN(uidleConfu_ii(uAutoCompleteWindow(u HyperParsercBs|EeZdZdd!gfgZejddddddd Zd d d Zd d Z d ddZ ddZ ddZ ddZ ddZddZd ddZddZddZd S("u AutoCompleteuedituShow Completionsu<>u extensionsu popupwaitutypeuintudefaulticCsD||_|dkrdS|j|_d|_d|_d|_dS(N(ueditwinuNoneutextuautocompletewindowu_delayed_completion_idu_delayed_completion_index(uselfueditwin((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu__init__&s     uAutoComplete.__init__cCstj|jS(N(uAutoCompleteWindowutext(uself((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu_make_autocomplete_window3su&AutoComplete._make_autocomplete_windowcCs&|jr"|jjd|_ndS(N(uautocompletewindowu hide_windowuNone(uselfuevent((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu_remove_autocomplete_window6s  u(AutoComplete._remove_autocomplete_windowcCs|jddddS(uqHappens when the user really wants to open a completion list, even if a function call is needed. NTF(uopen_completionsuTrueuFalse(uselfuevent((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyuforce_open_completions_event;su)AutoComplete.force_open_completions_eventcCs`|jjd}|dkr7|jdddtn%|tkr\|jdddtndS(uHappens when it would be nice to open a completion list, but not really necessary, for example after an dot, so function calls won't be made. u insert-1cu.NF(utextugetu_open_completions_lateruFalseuCOMPLETE_ATTRIBUTESuSEPSuCOMPLETE_FILES(uselfueventulastchar((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyutry_open_completions_eventAs   u'AutoComplete.try_open_completions_eventcCsht|dr|jrdS|jrE|jjrE|jjdS|jddd}|rddSdS(uHappens when the user wants to complete his word, and if necessary, open a completion list after that (if there is more than one completion) umc_stateNubreakFT(uhasattrumc_stateuautocompletewindowu is_activeucompleteuopen_completionsuFalseuTrue(uselfueventuopened((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyuautocomplete_eventNs uAutoComplete.autocomplete_eventcGs_|jjd|_|jdk r:|jj|jn|jj|j|j||_dS(Nuinsert( utextuindexu_delayed_completion_indexu_delayed_completion_iduNoneu after_canceluafteru popupwaitu_delayed_open_completions(uselfuargs((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu_open_completions_later^s u$AutoComplete._open_completions_latercGs9d|_|jjd|jkr(dS|j|dS(Nuinsert(uNoneu_delayed_completion_idutextuindexu_delayed_completion_indexuopen_completions(uselfuargs((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu_delayed_open_completionsfs u&AutoComplete._delayed_open_completionsc Cs|jd k r.|jj|jd |_nt|jd}|jjdd}t|}}|jr| s|t kr|j t }x,|r||ddt kr|d8}qW|||} |}x(|r||ddkr|d8}qW|||} n|j r| s6|t kr|j t }xB|r||dtks}t||ddkr|d8}qIW|||} |r ||ddkr |jdt||d|j} | s| r| jdd krd Sqd } nd S|r/| r/| r/d S|j| |} | d sOd S|j|_|jj| dt| ||| S( uXFind the completions and create the AutoCompleteWindow. Return True if successful (no syntax error or so found). if complete is True, then if there's nothing to complete and no start of completion, won't open completions and return False. If mode is given, will open a completion list only in this mode. uinsertuinsert linestartiu'"iu.u insert-%dcu(Nuii(u_delayed_completion_iduNoneutextu after_cancelu HyperParserueditwinugetulenu is_in_stringuCOMPLETE_FILESu_remove_autocomplete_windowuSEPSu is_in_codeuCOMPLETE_ATTRIBUTESuID_CHARSuordu set_indexuget_expressionufindufetch_completionsu_make_autocomplete_windowuautocompletewindowu show_window( uselfu evalfuncsucompleteu userWantsWinumodeuhpucurlineuiuju comp_startu comp_whatu comp_lists((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyuopen_completionslsN  ! 7    uAutoComplete.open_completionsc Csy|jjjjj}Wnd }YnX|rL|jdd||fiS|tkrK|dkrtj j }|j tj j t d|}|jd|krtt d|}qHdd|D}qyZ|j|}t|}|jd|krt|j}ndd|D}WqggfSYqXn|tkr|dkrld }nyBtjj|}tj|}|jd d|D}Wqtk rggfSYqXn|s|}n||fSd S( uOReturn a pair of lists of completions for something. The first list is a sublist of the second. Both are sorted. If there is a Python subprocess, get the comp. list there. Otherwise, either fetch_completions() is running in the subprocess itself or it was called in an IDLE EditorWindow before any script had been run. The subprocess environment is that of the most recently run script. If two unrelated modules are being edited some calltips in the current module may be inoperative if the module was not the last to run. uexecuget_the_completion_listuudir()u__all__cSs,g|]"}|dddkr|qS(Niu_((u.0us((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu s u2AutoComplete.fetch_completions..cSs,g|]"}|dddkr|qS(Niu_((u.0us((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu s u.cSs,g|]"}|dddkr|qS(Niu.((u.0us((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu s N(ueditwinuflistupyshelluinterpurpccltuNoneu remotecalluCOMPLETE_ATTRIBUTESu__main__u__dict__ucopyuupdateu __builtins__uevalusortusortedu get_entityudiru__all__uCOMPLETE_FILESuosupathu expanduserulistdiruOSError( uselfuwhatumodeurpccltu namespaceubiglusmallluentityu expandedpath((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyufetch_completionssL                uAutoComplete.fetch_completionscCs,tjj}|jtjt||S(uALookup name in a namespace spanning sys.modules and __main.dict__(usysumodulesucopyuupdateu__main__u__dict__ueval(uselfunameu namespace((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu get_entitysuAutoComplete.get_entityN(uShow Completionsu<>(u__name__u __module__u __qualname__umenudefsuidleConfu GetOptionu popupwaituNoneu__init__u_make_autocomplete_windowu_remove_autocomplete_windowuforce_open_completions_eventutry_open_completions_eventuautocomplete_eventu_open_completions_lateru_delayed_open_completionsuopen_completionsufetch_completionsu get_entity(u __locals__((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu AutoCompletes      ; 9u AutoCompletei(u__doc__uosusysustringuidlelib.configHandleruidleConfu ascii_lettersudigitsuID_CHARSurangeuCOMPLETE_ATTRIBUTESuCOMPLETE_FILESuidlelibuAutoCompleteWindowuidlelib.HyperParseru HyperParseru__main__usepuSEPSualtsepu AutoComplete(((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyus