Ë rN0¡À€ãó—dZdZddlZddlZddlmZddlmZGd„d«ZGd„d «Z Gd „d e«Z Gd „d e «Z Gd„d«Z Gd„de e«Z Gd„de e «ZGd„d«ZGd„de«ZGd„de«ZGd„de«ZGd„de«ZGd„de«ZGd „d!e«ZGd"„d#e«ZGd$„d%e«ZGd&„d'e«ZGd(„d)e«ZGd*„d+e«Zd,d-ej8d.«fd/„Zd0„Zy)1a« A finite state machine specialized for regular-expression-based text filters, this module defines the following classes: - `StateMachine`, a state machine - `State`, a state superclass - `StateMachineWS`, a whitespace-sensitive version of `StateMachine` - `StateWS`, a state superclass for use with `StateMachineWS` - `SearchStateMachine`, uses `re.search()` instead of `re.match()` - `SearchStateMachineWS`, uses `re.search()` instead of `re.match()` - `ViewList`, extends standard Python lists. - `StringList`, string-specific ViewList. Exception classes: - `StateMachineError` - `UnknownStateError` - `DuplicateStateError` - `UnknownTransitionError` - `DuplicateTransitionError` - `TransitionPatternNotFound` - `TransitionMethodNotFound` - `UnexpectedIndentationError` - `TransitionCorrection`: Raised to switch to another transition. - `StateCorrection`: Raised to switch to another state & transition. Functions: - `string2lines()`: split a multi-line string into a list of one-line strings How To Use This Module ====================== (See the individual classes, methods, and attributes for details.) 1. Import it: ``import statemachine`` or ``from statemachine import ...``. You will also need to ``import re``. 2. Derive a subclass of `State` (or `StateWS`) for each state in your state machine:: class MyState(statemachine.State): Within the state's class definition: a) Include a pattern for each transition, in `State.patterns`:: patterns = {'atransition': r'pattern', ...} b) Include a list of initial transitions to be set up automatically, in `State.initial_transitions`:: initial_transitions = ['atransition', ...] c) Define a method for each transition, with the same name as the transition pattern:: def atransition(self, match, context, next_state): # do something result = [...] # a list return context, next_state, result # context, next_state may be altered Transition methods may raise an `EOFError` to cut processing short. d) You may wish to override the `State.bof()` and/or `State.eof()` implicit transition methods, which handle the beginning- and end-of-file. e) In order to handle nested processing, you may wish to override the attributes `State.nested_sm` and/or `State.nested_sm_kwargs`. If you are using `StateWS` as a base class, in order to handle nested indented blocks, you may wish to: - override the attributes `StateWS.indent_sm`, `StateWS.indent_sm_kwargs`, `StateWS.known_indent_sm`, and/or `StateWS.known_indent_sm_kwargs`; - override the `StateWS.blank()` method; and/or - override or extend the `StateWS.indent()`, `StateWS.known_indent()`, and/or `StateWS.firstknown_indent()` methods. 3. Create a state machine object:: sm = StateMachine(state_classes=[MyState, ...], initial_state='MyState') 4. Obtain the input text, which needs to be converted into a tab-free list of one-line strings. For example, to read text from a file called 'inputfile':: with open('inputfile', encoding='utf-8') as fp: input_string = fp.read() input_lines = statemachine.string2lines(input_string) 5. Run the state machine on the input text and collect the results, a list:: results = sm.run(input_lines) 6. Remove any lingering circular references:: sm.unlink() ÚrestructuredtextéN)Úeast_asian_width)Úutilscó´—eZdZdZdd„Zd„Z dd„Zdd„Zdd„Zd„Z d „Z d „Z dd „Z d „Z d „Zd„Zd„Zdd„Zd„Zdd„Zdd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zy)Ú StateMachinea´ A finite state machine for text filters using regular expressions. The input is provided in the form of a list of one-line strings (no newlines). States are subclasses of the `State` class. Transitions consist of regular expression patterns and transition methods, and are defined in each state. The state machine is started with the `run()` method, which returns the results of processing in a list. có´—d|_ d|_ d|_ d|_ ||_ ||_ ||_ i|_ |j|«g|_ y)a+ Initialize a `StateMachine` object; add state objects. Parameters: - `state_classes`: a list of `State` (sub)classes. - `initial_state`: a string, the class name of the initial state. - `debug`: a boolean; produce verbose output if true (nonzero). Nréÿÿÿÿ) Ú input_linesÚ input_offsetÚlineÚ line_offsetÚdebugÚ initial_stateÚ current_stateÚstatesÚ add_statesÚ observers)ÚselfÚ state_classesrrs ú:/usr/lib/python3.12/site-packages/docutils/statemachine.pyÚ__init__zStateMachine.__init__ƒsu€ð ˆÔð #ðˆÔØJàˆŒ Ø!àˆÔØMàˆŒ Ø$à*ˆÔØCà*ˆÔØCàˆŒ Ø4à �‰˜ Ô&àˆŒð *ócóp—|jj«D]}|j«Œd|_y©z9Remove circular references to objects no longer required.N)rÚvaluesÚunlink©rÚstates rrzStateMachine.unlink®s)€à—[‘[×'Ñ'Ö)ˆEØ �L‰L�Nð*àˆ� rNcóÌ—|j«t|t«r||_nt||¬«|_||_d|_|xs |j |_|jrDtd|j ›ddj|j«›�tj¬«d}g}|j«} |jrtdtj¬«|j|«\}} |j| « |j!«|jrV|jj#|j «\} } td | ›d | ›d|j$›�tj¬«|j'|||«\}} } |j| « d}|j| «}Œ±#t($rd|jr2td |j*j,ztj¬«|j/|«} |j| «Y�n wxYw#t0$rp} |j3«| j4d f}|jr9td |j*j,›d|d ›d�tj¬«Yd} ~ �Œ–d} ~ wt6$r†} |j3«| j4d } t9| j4«dk(rd}n| j4df}|jr%td| ›d|d ›d�tj¬«Yd} ~ �Œƒd} ~ wwxYwn"#|jr|j;«‚xYwg|_|S)aÜ Run the state machine on `input_lines`. Return results (a list). Reset `self.line_offset` and `self.current_state`. Run the beginning-of-file transition. Input one line at a time and check for a matching transition. If a match is found, call the transition method and possibly change the state. Store the context returned by the transition method to be passed on to the next transition matched. Accumulate the results returned by the transition methods in a list. Run the end-of-file transition. Finally, return the accumulated results. Parameters: - `input_lines`: a list of strings without newlines, or `StringList`. - `input_offset`: the line offset of `input_lines` from the beginning of the file. - `context`: application-specific storage. - `input_source`: name or path of source of `input_lines`. - `initial_state`: name of initial state. )Úsourcer z, StateMachine.run: input_lines (line_offset=z): | z | ©ÚfileNz! StateMachine.run: bof transitionz StateMachine.run: line (source=z , offset=z$ StateMachine.run: %s.eof transitionrz2 StateMachine.run: TransitionCorrection to state "z", transition Ú.éz- StateMachine.run: StateCorrection to state ")Ú runtime_initÚ isinstanceÚ StringListr r r rrrÚprintÚjoinÚsysÚstderrÚ get_stateÚbofÚextendÚ next_lineÚinfor Ú check_lineÚEOFErrorÚ __class__Ú__name__ÚeofÚTransitionCorrectionÚ previous_lineÚargsÚStateCorrectionÚlenÚerrorr)rr r ÚcontextÚ input_sourcerÚ transitionsÚresultsrÚresultr ÚoffsetÚ next_stateÚ exceptions rÚrunzStateMachine.run´s€ð. ×ÑÔÜ �k¤:Ô .Ø*ˆDÕ ä)¨+¸lÔKˆDÔ Ø(ˆÔØˆÔØ*Ò@¨d×.@Ñ.@ˆÔØ �:Š:Ý Ø×%Ó% v§{¡{°4×3CÑ3CÔ'DðFä—z‘zõ #ðˆ ØˆØ—‘Ó ˆð4 Ø�zŠzÜÐ:ÄÇÁÕLØ#Ÿi™i¨Ó0‰OˆG�VØ �N‰N˜6Ô "Øð)'ð/ØŸ™Ô(ØŸ:š:Ø-1×-=Ñ-=×-BÑ-BØ $× 0Ñ 0ó.2™N˜F Fä!ð%-Ø-3¨J°iÀ¸zðJ'Ø'+§y¡y kð#3ä9<¿¹õEð7;·o±oØ# U¨Kó79Ñ3˜ ¨Vð Ÿ™ vÕ.ð,#'�KØŸ™ zÓ2�ðWøô$òØŸ:š:Ü!Ð"IØ$)§O¡O×$<Ñ$<ñ#=ÜCFÇ:Á:õOà!&§¡¨7Ó!3˜ØŸ™ vÔ.Úð ûô,òØ×&Ñ&Ô(Ø#,§>¡>°!Ñ#4Ð"6�KØ—z’zÜð(Ø(-¯©×(@Ñ(@Ð'AðB,Ø,7¸©NÐ+;¸1ð>ô$'§:¡:õ/õûÜ&ò /Ø×&Ñ&Ô(Ø!*§¡°Ñ!2�Jܘ9Ÿ>™>Ó*¨aÒ/Ø&*™ à'0§~¡~°aÑ'8Ð&:˜ Ø—z’zÜð"Ø", ¨^¸KȹNÐ;KÈ1ðNä#&§:¡:õ/ÿùð /úðøð4 Ø�zŠzØ— ‘ ” Ø ú؈ŒØˆsqÃA L;ÄB GÆH1Æ-L;ÇA)H.È*H1È+L;È-H.È.H1È1 L7È:A%J%ÊL;Ê% L7Ê1A;L2Ì,L;Ì2L7Ì7L;Ì;Mc ó<—|r_|jrL||jk7r=td|j›d|›d|j«›d�tj ¬«||_ |j |jS#t$rt|j«‚wxYw)zá Return current state object; set it first if `next_state` given. Parameter `next_state`: a string, the name of the next state. Exception: `UnknownStateError` raised if `next_state` unknown. z. StateMachine.get_state: Changing state from "z" to "z" (input line z).r!) rrr(Úabs_line_numberr*r+rÚKeyErrorÚUnknownStateError)rrBs rr,zStateMachine.get_states�€ñ Ø�zŠz˜j¨D×,>Ñ,>Ò>Ýà×+Ó+ªZØ×-Ñ-Õ/ð1ô8;·z±zõCð",ˆDÔ ð 8Ø—;‘;˜t×1Ñ1Ñ2Ð 2øÜò 8Ü# D×$6Ñ$6Ó7Ð 7ð 8ús Á#A<Á<Bcó— |xj|z c_|j|j|_|j|j «S#t$rd|_t‚wxYw#|j «wxYw)z9Load `self.line` with the `n`'th next line and return it.N)r r r Ú IndexErrorr2Únotify_observers©rÚns rr/zStateMachine.next_line&sv€ð $ð Ø× Ò  AÑ%Õ Ø ×,Ñ,¨T×-=Ñ-=Ñ>�” ð—9‘9à × !Ñ !Õ #øô ò Ø �” Ü�ð ûð × !Ñ !Õ #úsƒ3A¶ A,ÁA)Á)A,Á,A>cóx— |j|jdzj« S#t$rYywxYw)z6Return True if the next line is blank or non-existent.r$)r r ÚstriprJ©rs rÚis_next_line_blankzStateMachine.is_next_line_blank3sA€ð Ø×'Ñ'¨×(8Ñ(8¸1Ñ(<Ñ=×CÑCÓEÐEÐ EøÜò Ùð ús ‚*-­ 9¸9cóL—|jt|j«dz k\S)z0Return 1 if the input is at or past end-of-file.r$)r r:r rPs rÚat_eofzStateMachine.at_eof:s#€à×Ѥ3 t×'7Ñ'7Ó#8¸1Ñ#<Ñ<Ðs€à×Ñ 1Ñ$Ð$rcóΗ|xj|zc_|jdkrd|_n|j|j|_|j«|jS)z=Load `self.line` with the `n`'th previous line and return it.rN)r r r rKrLs rr7zStateMachine.previous_lineBsV€à ×Ò˜AÑÕØ × Ñ ˜aÒ ØˆD�Ià×(Ñ(¨×)9Ñ)9Ñ:ˆDŒIØ ×ÑÔØ�y‰yÐrcó— ||jz |_|j|j|_|j|j «S#t$rd|_t ‚wxYw#|j «wxYw)z?Jump to absolute line offset `line_offset`, load and return it.N)r r r r rJr2rK©rr s rÚ goto_linezStateMachine.goto_lineLsx€ð $ð Ø#.°×1BÑ1BÑ#B�Ô Ø ×,Ñ,¨T×-=Ñ-=Ñ>�” ð—9‘9à × !Ñ !Õ #øô ò Ø �” Ü�ð ûð × !Ñ !Õ #úsƒ2Aµ A+ÁA(Á(A+Á+A=cóR—|jj||jz «S)zØ×%Ñ%‰Fà˜d×/Ñ/Ñ/°!Ñ3ˆFð &Ø!×-Ñ-×2Ñ2°6Ó:‰NˆC�Ø !‘mˆGð�Gˆ|Ðøôò $à×3Ñ3°F¸T×=NÑ=NÑ4NÓO‰LˆC�ؘ !™ Ð#Ò #Üò &Ø%‰LˆC‘ð�Gˆ|Ðð  &ús£#A Á 1BÁ= BÂBcó8—|jj|jdzdd|zt|«¬«|jj|jdzdd|zd¬«|jj|jdzt ||««y)Nr$Úzinternal padding after )r rAzinternal padding before r é)r Úinsertr r:r')rr r s rÚ insert_inputzStateMachine.insert_input€s�€Ø ×Ñ×Ñ × 0Ñ 0°1Ñ 4°bØ'@ÀÑ'GÜ'*¨;Ó'7ð ô 9ð ×Ñ×Ñ × 0Ñ 0°1Ñ 4°bØ'AÀ&Ñ'HØ')ð ô +ð ×Ñ×Ñ × 0Ñ 0°1Ñ 4Ü *¨;¸Ó ?õ Arcó — |jj|j|«}|jt |«dz «|S#t $r2}|j d}|jt |«dz «‚d}~wwxYw)úÜ Return a contiguous block of text. If `flush_left` is true, raise `UnexpectedIndentationError` if an indented line is encountered before the text block ends (with a blank line). r$rN)r Úget_text_blockr r/r:ÚUnexpectedIndentationErrorr8)rÚ flush_leftÚblockÚerrs rrozStateMachine.get_text_blockŠsv€ð Ø×$Ñ$×3Ñ3°D×4DÑ4DØ4>ó@ˆEà �N‰Nœ3˜u›:¨™>Ô *؈LøÜ)ò Ø—H‘H˜Q‘KˆEØ �N‰Nœ3˜u›:¨™>Ô *Ø ûð ús‚AAÁ BÁ-A=Á=BcóL—|€ |j}|jr6td|jj›d|›d�t j ¬«|D]€}|j|\}}}|j|j«}|sŒ4|jr6td|›d|jj›d�t j ¬«||||«cS|jr2td|jjzt j ¬«|j||«S) a¯ Examine one line of input for a transition match & execute its method. Parameters: - `context`: application-dependent storage. - `state`: a `State` object, the current state. - `transitions`: an optional ordered list of transition names to try, instead of ``state.transition_order``. Return the values returned by the transition method: - context: possibly modified from the parameter `context`; - next state name (`State` subclass name); - the result output of the transition, a list. When there is no match, ``state.no_match()`` is called and its return value is returned. z! StateMachine.check_line: state="z", transitions=r#r!z. StateMachine.check_line: Matched transition "z " in state "z".z1 StateMachine.check_line: No match in state "%s".) Útransition_orderrr(r3r4r*r+r>Úmatchr Úno_match) rr<rr>ÚnameÚpatternÚmethodrBrvs rr1zStateMachine.check_lineœsÿ€ð( Ð Ø×0Ñ0ˆKØ �:Š:Ý Ø—_‘_×-Ó-ª{ð<ÜBEÇ*Á*õ NãˆDØ*/×*;Ñ*;¸DÑ*AÑ 'ˆG�V˜ZØ—M‘M $§)¡)Ó,ˆEÚØ—:’:ÜðØ"˜V <°·±×0HÑ0HÐ/IÈðMä"Ÿz™zõ+ñ˜e W¨jÓ9Ò9ð ð�zŠzÜÐJØŸ™×0Ñ0ñ1Ü7:·z±zõCà—>‘> '¨;Ó7Ð 7rcóŽ—|j}||jvr t|«‚|||j«|j|<y)zª Initialize & add a `state_class` (`State` subclass) object. Exception: `DuplicateStateError` raised if `state_class` was already added. N)r4rÚDuplicateStateErrorr)rÚ state_classÚ statenames rÚ add_statezStateMachine.add_stateÄs?€ð ×(Ñ(ˆ Ø ˜Ÿ ™ Ñ #Ü% iÓ0Ð 0Ù!,¨T°4·:±:Ó!>ˆ� ‰ �IÒrcó4—|D]}|j|«Œy)zE Add `state_classes` (a list of `State` subclasses). N)r)rrr}s rrzStateMachine.add_statesÐs€ó)ˆKØ �N‰N˜;Õ 'ñ)rcób—|jj«D]}|j«Œy)z+ Initialize `self.states`. N)rrr%rs rr%zStateMachine.runtime_init×s'€ð—[‘[×'Ñ'Ö)ˆEØ × Ñ Õ ñ*rcó—t«\}}}}}t|›d|›�tj¬«td|j «ztj¬«td|›d|›d|›�tj¬«y)zReport error details.z: r!z input line %szmodule z, line z , function N)Ú_exception_datar(r*r+rF)rÚtypeÚvalueÚmoduler Úfunctions rr;zStateMachine.errorÞs\€ä.=Ó.?Ñ+ˆˆe�V˜T 8Ü š$¡Ð&¬S¯Z©ZÕ8Ü ˆo ×!5Ñ!5Ó!7Ñ8¼s¿z¹zÕJÝ ²6º4ÁÐJÜ—:‘:ö rcó:—|jj|«y)z– The `observer` parameter is a function or bound method which takes two arguments, the source and offset of the current line. N)rÚappend©rÚobservers rÚattach_observerzStateMachine.attach_observeræs€ð �‰×јhÕ'rcó:—|jj|«y©N)rÚremoverŠs rÚdetach_observerzStateMachine.detach_observerís€Ø �‰×јhÕ'rcóž—|jD]-} |jj|j«}||ŽŒ/y#t$rd}YŒwxYw)Nra)rr r0r rJ)rr‹r0s rrKzStateMachine.notify_observersðsP€ØŸœˆHð $Ø×'Ñ'×,Ñ,¨T×-=Ñ-=Ó>�ñ �dŠOñ 'øôò $Ø#’ð $ús‘%>¾ A Á A ©F)rNNNrŽ©r$)r4Ú __module__Ú __qualname__Ú__doc__rrrDr,r/rQrSrUr7rYr[r^rFrcrlror1rrr%r;rŒr�rK©rrrrus�„ñ ó)*òVð 8<Ø-1ó\ó|8ó( $òò=ò%óò $òHò4ò8óò6Aóó$&8òP ?ò(ò!òò(ò(órrcóz—eZdZdZdZ dZ dZ dZ dd„Zd„Z d„Z d„Z d„Z d„Z d „Zdd „Zd „Zd „Zd „Zd„Zd„Zy)ÚStateaw State superclass. Contains a list of transitions, and transition methods. Transition methods all have the same signature. They take 3 parameters: - An `re` match object. ``match.string`` contains the matched input line, ``match.start()`` gives the start index of the match, and ``match.end()`` gives the end index. - A context object, whose meaning is application-defined (initial value ``None``). It can be used to store any information required by the state machine, and the returned context is passed on to the next transition method unchanged. - The name of the next state, a string, taken from the transitions list; normally it is returned unchanged, but it may be altered by the transition method if necessary. Transition methods all return a 3-tuple: - A context object, as (potentially) modified by the transition method. - The next state name (a return value of ``None`` means no state change). - The processing result, a list, which is accumulated by the state machine. Transition methods may raise an `EOFError` to cut processing short. There are two implicit transitions, and corresponding transition methods are defined: `bof()` handles the beginning-of-file, and `eof()` handles the end-of-file. These methods have non-standard signatures and return values. `bof()` returns the initial context and results, and may be used to return a header string, or do any other processing needed. `eof()` should handle any remaining context and wrap things up; it returns the final processing result. Typical applications need only subclass `State` (or a subclass), set the `patterns` and `initial_transitions` class attributes, and provide corresponding transition methods. The default object initialization will take care of constructing the list of transitions. Ncó—g|_ i|_ |j«||_ ||_ |j €|jj |_|j€*|j g|j jdœ|_yy)zã Initialize a `State` object; make & add initial transitions. Parameters: - `statemachine`: the controlling `StateMachine` object. - `debug`: a boolean; produce verbose output if true. N)rr) rur>Úadd_initial_transitionsÚ state_machinerÚ nested_smr3Únested_sm_kwargsr4©rrœrs rrzState.__init__Fs�€ð!#ˆÔØ9àˆÔð ð ×$Ñ$Ô&à*ˆÔØCàˆŒ Ø$à �>‰>Ð !Ø!×/Ñ/×9Ñ9ˆDŒNØ × Ñ Ð (Ø7;·~±~Ð6FØ6:·n±n×6MÑ6Mñ%OˆDÕ !ð )rcó—y)z{ Initialize this `State` before running the state machine; called from `self.state_machine.run()`. Nr—rPs rr%zState.runtime_initjs€ð rcó—d|_yr)rœrPs rrz State.unlinkqs €à!ˆÕrcó~—|jr1|j|j«\}}|j||«yy)z>Make and add transitions listed in `self.initial_transitions`.N)Úinitial_transitionsÚmake_transitionsÚadd_transitions©rÚnamesr>s rr›zState.add_initial_transitionsus>€à × #Ò #Ø!%×!6Ñ!6Ø%)×%=Ñ%=ó"?Ñ ˆE�;à × Ñ  ¨ Õ 4ð $rcó¶—|D]*}||jvr t|«‚||vsŒ!t|«‚||jdd|jj |«y)a" Add a list of transitions to the start of the transition list. Parameters: - `names`: a list of transition names. - `transitions`: a mapping of names to transition tuples. Exceptions: `DuplicateTransitionError`, `UnknownTransitionError`. Nr)r>ÚDuplicateTransitionErrorÚUnknownTransitionErrorruÚupdate)rr§r>rxs rr¥zState.add_transitions|sb€óˆDØ�t×'Ñ'Ñ'Ü.¨tÓ4Ð4ؘ;Ò&Ü,¨TÓ2Ð2ð ð %*ˆ×јb˜qÐ!Ø ×Ñ×Ñ  Õ,rcót—||jvr t|«‚|g|jdd||j|<y)z¹ Add a transition to the start of the transition list. Parameter `transition`: a ready-made transition 3-tuple. Exception: `DuplicateTransitionError`. Nr)r>r©ru)rrxÚ transitions rÚadd_transitionzState.add_transition�sA€ð �4×#Ñ#Ñ #Ü*¨4Ó0Ð 0Ø%) Fˆ×јb˜qÐ!Ø!+ˆ×јÒrcóv— |j|=|jj|«y#t|«‚xYw)z^ Remove a transition by `name`. Exception: `UnknownTransitionError`. N)r>rur�rª)rrxs rÚremove_transitionzState.remove_transitionœs;€ð  /Ø× Ñ  Ð&Ø × !Ñ !× (Ñ (¨Õ .øð /Ü(¨Ó.Ð .ús‚(+« 8cóœ—|€|jj} |j|}t|d«s$t j |«x}|j|< t||«}|||fS#t $r&t|jj›d|›d�«‚wxYw#t$r%t|jj›d|›�«‚wxYw)aŽ Make & return a transition tuple based on `name`. This is a convenience function to simplify transition creation. Parameters: - `name`: a string, the name of the transition pattern & method. This `State` object must have a method called '`name`', and a dictionary `self.patterns` containing a key '`name`'. - `next_state`: a string, the name of the next `State` object for this transition. A value of ``None`` (or absent) implies no state change (i.e., continue with the same state). Exceptions: `TransitionPatternNotFound`, `TransitionMethodNotFound`. rvz .patterns[Ú]r#) r3r4ÚpatternsÚhasattrÚreÚcompilerGÚTransitionPatternNotFoundÚgetattrÚAttributeErrorÚTransitionMethodNotFound)rrxrBryrzs rÚmake_transitionzState.make_transition¨sÖ€ð" Ð ØŸ™×0Ñ0ˆJð GØ—m‘m DÑ)ˆGܘ7 GÔ,Ü02· ± ¸7Ó0CÐC�˜$Ÿ-™-¨Ñ-ð =ܘT 4Ó(ˆF𘠠Ð*Ð*øôò GÜ+Ø'+§~¡~×'>Ó'>ÂÐEóGð Gð Gûô ò =Ü*Ø!Ÿ^™^×4Ó4±dÐ;ó=ð =ð =úsš?A+Á BÁ+/BÂ.C cóÞ—g}i}|D]a}t|t«r&|j|«||<|j|«Œ9|j|Ž||d<|j|d«Œc||fS)zú Return a list of transition names and a transition mapping. Parameter `name_list`: a list, where each entry is either a transition name string, or a 1- or 2-tuple (transition name, optional next state name). r)r&Ústrr»r‰)rÚ name_listr§r>Ú namestates rr¤zState.make_transitionsÉs{€ðˆØˆ Û"ˆIܘ)¤SÔ)Ø)-×)=Ñ)=¸iÓ)H� ˜IÑ&Ø— ‘ ˜YÕ'à,@¨D×,@Ñ,@À)Ð,L� ˜I a™LÑ)Ø— ‘ ˜Y q™\Õ*ð #ð�kÐ!Ð!rcó —|dgfS)a' Called when there is no match from `StateMachine.check_line()`. Return the same values returned by transition methods: - context: unchanged; - next state name: ``None``; - empty result list. Override in subclasses to catch this event. Nr—)rr<r>s rrwzState.no_matchÜs€ð˜˜bÐ Ð rcó —|gfS)z± Handle beginning-of-file. Return unchanged `context`, empty result. Override in subclasses. Parameter `context`: application-defined storage. r—©rr<s rr-z State.bofês€ð˜ˆ{Ðrcó—gS)z– Handle end-of-file. Return empty result. Override in subclasses. Parameter `context`: application-defined storage. r—rÂs rr5z State.eofôs €ðˆ rcó —||gfS)z· A "do nothing" transition method. Return unchanged `context` & `next_state`, empty result. Useful for simple state changes (actionless transitions). r—©rrvr<rBs rÚnopz State.nopþs€ð˜  BÐ&Ð&rr’rŽ)r4r”r•r–r³r£r�ržrr%rr›r¥r®r°r»r¤rwr-r5rÆr—rrr™r™ùs~„ñ%ðN€Hðð Ððð €IððÐð ó"OòH ò"ò5ò-ò& ,ò /ó+òB"ò& !òòó'rr™có,—eZdZdZdd„Zdd„Z dd„Zy)ÚStateMachineWSaq `StateMachine` subclass specialized for whitespace recognition. There are three methods provided for extracting indented text blocks: - `get_indented()`: use when the indent is unknown. - `get_known_indented()`: use when the indent is known for all lines. - `get_first_known_indented()`: use when only the first line's indent is known. cóB—|j«}|jj|j||«\}}}|r|j t |«dz «|r>|dj «s+|j«|dz }|r|dj «sŒ+||||fS)a Return a block of indented lines of text, and info. Extract an indented block where the indent is unknown for all lines. :Parameters: - `until_blank`: Stop collecting at the first blank line if true. - `strip_indent`: Strip common leading indent if true (default). :Return: - the indented block (a list of lines of text), - its indent, - its first line offset from BOF, and - whether or not it finished with a blank line. r$r©r^r Ú get_indentedr r/r:rOÚ trim_start)rÚ until_blankÚ strip_indentrAÚindentedÚindentÚ blank_finishs rrËzStateMachineWS.get_indenteds €ð ×%Ñ%Ó'ˆØ)-×)9Ñ)9×)FÑ)FØ×Ñ  ¨\ó*;Ñ&ˆ�&˜,á Ø �N‰Nœ3˜x›=¨1Ñ,Ô -Ù˜x¨™{×0Ñ0Ô2Ø × Ñ Ô !Ø �a‰KˆFñ˜x¨™{×0Ñ0Õ2𘠨Ð5Ð5rcó@—|j«}|jj|j|||¬«\}}}|j t |«dz «|r>|dj «s+|j«|dz }|r|dj «sŒ+|||fS)aß Return an indented block and info. Extract an indented block where the indent is known for all lines. Starting with the current line, extract the entire text block with at least `indent` indentation (which must be whitespace, except for the first line). :Parameters: - `indent`: The number of indent columns/characters. - `until_blank`: Stop collecting at the first blank line if true. - `strip_indent`: Strip `indent` characters of indentation if true (default). :Return: - the indented block, - its first line offset from BOF, and - whether or not it finished with a blank line. )Ú block_indentr$rrÊ)rrÐrÍrÎrArÏrÑs rÚget_known_indentedz!StateMachineWS.get_known_indented/s¦€ð(×%Ñ%Ó'ˆØ)-×)9Ñ)9×)FÑ)FØ×Ñ  ¨\Ø!ð*Gó*#Ñ&ˆ�&˜,ð �‰”s˜8“} qÑ(Ô)Ù˜x¨™{×0Ñ0Ô2Ø × Ñ Ô !Ø �a‰KˆFñ˜x¨™{×0Ñ0Õ2ð˜ Ð-Ð-rcóF—|j«}|jj|j|||¬«\}}}|j t |«dz «|r@|r>|dj «s+|j«|dz }|r|dj «sŒ+||||fS)aã Return an indented block and info. Extract an indented block where the indent is known for the first line and unknown for all other lines. :Parameters: - `indent`: The first line's indent (# of columns/characters). - `until_blank`: Stop collecting at the first blank line if true (1). - `strip_indent`: Strip `indent` characters of indentation if true (1, default). - `strip_top`: Strip blank lines from the beginning of the block. :Return: - the indented block, - its indent, - its first line offset from BOF, and - whether or not it finished with a blank line. )Ú first_indentr$rrÊ)rrÐrÍrÎÚ strip_toprArÏrÑs rÚget_first_known_indentedz'StateMachineWS.get_first_known_indentedMs«€ð,×%Ñ%Ó'ˆØ)-×)9Ñ)9×)FÑ)FØ×Ñ  ¨\Ø!ð*Gó*#Ñ&ˆ�&˜,ð �‰”s˜8“} qÑ(Ô)Ù Ù 8¨A¡;×#4Ñ#4Ô#6Ø×#Ñ#Ô%ؘ!‘ �ñ 8¨A¡;×#4Ñ#4Õ#6𘠨Ð5Ð5rN)FT)FTT)r4r”r•r–rËrÔrØr—rrrÈrÈs„ñ ó6ó4.ð<Bô6rrÈcó —eZdZdZdZ dZ dZ dZ ejd«ejd«dœZ dZ d d„Z d„Z d„Zd „Zd „Zd „Zy) ÚStateWSa´ State superclass specialized for whitespace (blank lines & indents). Use this class with `StateMachineWS`. The transitions 'blank' (for blank lines) and 'indent' (for indented text blocks) are added automatically, before any other transitions. The transition method `blank()` handles blank lines and `indent()` handles nested indented blocks. Indented blocks trigger a new state machine to be created by `indent()` and run. The class of the state machine to be created is in `indent_sm`, and the constructor keyword arguments are in the dictionary `indent_sm_kwargs`. The methods `known_indent()` and `firstknown_indent()` are provided for indented blocks where the indent (all lines' and first line's only, respectively) is known to the transition method, along with the attributes `known_indent_sm` and `known_indent_sm_kwargs`. Neither transition method is triggered automatically. Nz *$z +)ÚblankrÐcó—tj|||«|j€|j|_|j€|j |_|j €|j|_|j€|j|_yy)z™ Initialize a `StateSM` object; extends `State.__init__()`. Check for indent state machine attributes, set defaults if not set. N)r™rÚ indent_smr�Úindent_sm_kwargsržÚknown_indent_smÚknown_indent_sm_kwargsrŸs rrzStateWS.__init__¬sz€ô �‰�t˜]¨EÔ2Ø �>‰>Ð !Ø!Ÿ^™^ˆDŒNØ × Ñ Ð (Ø$(×$9Ñ$9ˆDÔ !Ø × Ñ Ð 'Ø#'§>¡>ˆDÔ Ø × &Ñ &Ð .Ø*.×*?Ñ*?ˆDÕ 'ð /rcóþ—tj|«|j€i|_|jj|j«|j |j «\}}|j||«y)z‹ Add whitespace-specific transitions before those defined in subclass. Extends `State.add_initial_transitions()`. N)r™r›r³r«Ú ws_patternsr¤Úws_initial_transitionsr¥r¦s rr›zStateWS.add_initial_transitions¼si€ô ×%Ñ% dÔ+Ø �=‰=Р؈DŒMØ � ‰ ×јT×-Ñ-Ô.Ø!×2Ñ2Ø × 'Ñ 'ó)шˆ{à ×јU KÕ0rcó(—|j|||«S)z9Handle blank lines. Does nothing. Override in subclasses.)rÆrÅs rrÛz StateWS.blankÊs€à�x‰x˜˜w¨ Ó3Ð3rcóÀ—|jj«\}}}}|jdd|ji|j¤Ž}|j ||¬«} ||| fS)z¸ Handle an indented text block. Extend or override in subclasses. Recursively run the registered state machine for indented blocks (`self.indent_sm`). r©r r—)rœrËrÝrrÞrD) rrvr<rBrÏrÐr rÑÚsmr?s rrÐzStateWS.indentÎsd€ð× Ñ × ,Ñ ,Ó .ñ ˆ�6˜;¨ à ˆT�^‰^Ñ F $§*¡*Ð F°×0EÑ0EÑ FˆØ—&‘&˜° �&Ó<ˆØ˜  GÐ+Ð+rcóÜ—|jj|j««\}}}|jdd|ji|j ¤Ž}|j ||¬«}|||fS)a Handle a known-indent text block. Extend or override in subclasses. Recursively run the registered state machine for known-indent indented blocks (`self.known_indent_sm`). The indent is the length of the match, ``match.end()``. rrær—)rœrÔÚendrßrràrD© rrvr<rBrÏr rÑrçr?s rÚ known_indentzStateWS.known_indentÛsv€ð× Ñ × 2Ñ 2°5·9±9³;Ó ?ñ ˆ�;  à !ˆT× !Ñ !ñA¨¯ © ðAØ$(×$?Ñ$?ñAˆà—&‘&˜° �&Ó<ˆØ˜  GÐ+Ð+rcóÜ—|jj|j««\}}}|jdd|ji|j ¤Ž}|j ||¬«}|||fS)a0 Handle an indented text block (first line's indent known). Extend or override in subclasses. Recursively run the registered state machine for known-indent indented blocks (`self.known_indent_sm`). The indent is the length of the match, ``match.end()``. rrær—)rœrØrérßrràrDrês rÚfirst_known_indentzStateWS.first_known_indentêsv€ð× Ñ × 8Ñ 8¸¿¹»Ó Eñ ˆ�;  à !ˆT× !Ñ !ñA¨¯ © ðAØ$(×$?Ñ$?ñAˆà—&‘&˜° �&Ó<ˆØ˜  GÐ+Ð+rr’)r4r”r•r–rÝrÞrßràrµr¶rârãrr›rÛrÐrërír—rrrÚrÚos�„ñð$€IððÐðð€Oðð"Ððð'˜BŸJ™J uÓ-Ø'˜RŸZ™Z¨Ó-ñ/€Kðð1ÐðFó@ò 1ò4ò ,ò ,ó,rrÚcó—eZdZdZd„Zy)Ú_SearchOverridea£ Mix-in class to override `StateMachine` regular expression behavior. Changes regular expression matching, from the default `re.match()` (succeeds only if the pattern matches at the start of `self.line`) to `re.search()` (succeeds if the pattern matches anywhere in `self.line`). When subclassing a `StateMachine`, list this class **first** in the inheritance list of the class definition. có8—|j|j«S)z® Return the result of a regular expression search. Overrides `StateMachine.match()`. Parameter `pattern`: `re` compiled regular expression. )Úsearchr )rrys rrvz_SearchOverride.matchs€ð�~‰~˜dŸi™iÓ(Ð(rN)r4r”r•r–rvr—rrrïrïüs „ñó)rrïcó—eZdZdZy)ÚSearchStateMachinez@`StateMachine` which uses `re.search()` instead of `re.match()`.N©r4r”r•r–r—rrrórós„ÙJØrrócó—eZdZdZy)ÚSearchStateMachineWSzB`StateMachineWS` which uses `re.search()` instead of `re.match()`.Nrôr—rrrörös„ÙLØrröcó—eZdZdZ d(d„Zd„Zd„Zd„Zd„Zd„Z d „Z d „Z d „Z d „Z d „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZeZd„Zd„Zd)d„Zd)d„Zd*d„Zd+d„Zd+d„Zd„Zd„Z d„Z!d „Z"d!„Z#d"„Z$d#„Z%d$„Z&d%„Z'd&„Z(d'„Z)y),ÚViewLista> List with extended functionality: slices of ViewList objects are child lists, linked to their parents. Changes made to a child list also affect the parent list. A child list is effectively a "view" (in the SQL sense) of the parent list. Changes to parent lists, however, do *not* affect active child lists. If a parent list is changed, any active child lists should be recreated. The start and end of the slice can be trimmed using the `trim_start()` and `trim_end()` methods, without affecting the parent list. The link between child and parent lists can be broken by calling `disconnect()` on the child list. Also, ViewList objects keep track of the source & offset of each item. This information is accessible via the `source()`, `offset()`, and `info()` methods. Ncó®—g|_ g|_ ||_ ||_ t |t «r)|jdd|_|jdd|_nE|�Ct |«|_|r||_n)tt|««D�cgc]}||f‘Œc}|_t|j«t|j«k(sJd«‚ycc}w)Nú data mismatch) ÚdataÚitemsÚparentÚ parent_offsetr&røÚlistÚranger:)rÚinitlistr rürýrþÚis rrzViewList.__init__1s€àˆŒ ØFàˆŒ ð ðˆŒ Øà*ˆÔØHä �h¤Ô )Ø Ÿ ™ ¡aÐ(ˆDŒIØ!Ÿ™©Ð*ˆD�JØ Ð !ܘX›ˆDŒIÙØ"�• ä38¼¸X»Ô3GÓHÑ3G¨a˜v qškÐ3GÑH�” Ü�4—9‘9‹~¤ T§Z¡Z£Ò0ÐA°/ÓAÑ0ùòIs Ccó,—t|j«SrŽ)r½rûrPs rÚ__str__zViewList.__str__Ló€Ü�4—9‘9‹~Ðrcóh—|jj›d|j›d|j›d�S)NÚ(z, items=Ú))r3r4rûrürPs rÚ__repr__zViewList.__repr__Os.€Ø—.‘.×)Ñ)Ð*¨!¨D¯I©I¨;°h¸t¿z¹z¸lÈ!ÐLÐLrcó>—|j|j|«kSrŽ©rûÚ_ViewList__cast©rÚothers rÚ__lt__zViewList.__lt__Ró€ D§I¡I°· ± ¸EÓ0BÑ$BÐBrcó>—|j|j|«kSrŽr r s rÚ__le__zViewList.__le__Só€ D§I¡I°·±¸UÓ1CÑ$CÐCrcó>—|j|j|«k(SrŽr r s rÚ__eq__zViewList.__eq__Trrcó>—|j|j|«k7SrŽr r s rÚ__ne__zViewList.__ne__Urrcó>—|j|j|«kDSrŽr r s rÚ__gt__zViewList.__gt__Vrrcó>—|j|j|«k\SrŽr r s rÚ__ge__zViewList.__ge__Wrrcó>—t|t«r |jS|SrŽ)r&rørûr s rÚ__castzViewList.__castYs€Ü �eœXÔ &Ø—:‘:Ð àˆLrcó—||jvSrŽ©rû©rÚitems rÚ __contains__zViewList.__contains___s€Ø�t—y‘yÐ Ð rcó,—t|j«SrŽ)r:rûrPs rÚ__len__zViewList.__len__brrcó4—t|t«rz|jdvsJd«‚|j|j|j |j |j|j |j ||j xsd¬«S|j|S)N©Nr$úcannot handle slice with strider)rürýrþ)r&ÚsliceÚstepr3rûÚstartÚstoprü©rrs rÚ __getitem__zViewList.__getitem__is„€Ü �aœÔ Ø—6‘6˜YÑ&Ð IÐ(IÓ IÐ&Ø—>‘> $§)¡)¨A¯G©G°A·F±FÐ";Ø(,¯ © °1·7±7¸1¿6¹6Ð(BØ)-¸Q¿W¹Wº\Èð"óKð Kð—9‘9˜Q‘<Ð rcóΗt|t«�r|jdvsJd«‚t|t«s t d«‚|j |j |j |j|j|j|j |jt|j «t|j«k(sJd«‚|jrS|j xsd|jz}|jxs t|«|jz}||j||yy||j |<|jr||j||jz<yy)Nr&r'z(assigning non-ViewList to ViewList slicerúr) r&r(r)rørbrûr*r+rür:rýrþ)rrr!ÚkrMs rÚ __setitem__zViewList.__setitem__rs€Ü �aœÕ Ø—6‘6˜YÑ&Ð IÐ(IÓ IÐ&ܘd¤HÔ-ÜÐ JÓKÐKØ(,¯ © ˆD�I‰I�a—g‘g˜aŸf™fÐ %Ø)-¯©ˆD�J‰J�q—w‘w˜qŸv™vÐ &Ü�t—y‘y“>¤S¨¯©£_Ò4Ð E°oÓ EÐ4Ø�{Š{Ø—W‘W’\  T×%7Ñ%7Ñ7�Ø—V‘VÒ(œs 4›y¨D×,>Ñ,>Ñ>�Ø#'�— ‘ ˜A˜aÑ ðð  ˆD�I‰I�a‰LØ�{Š{Ø6:�— ‘ ˜A × 2Ñ 2Ñ2Ò3ðrcó— |j|=|j|=|jr|j||jz=yy#t$r¼|j �Jd«‚|j|j |j…=|j|j |j…=|jrT|j xsd|jz}|jxs t|«|jz}|j||…=YyYywxYw)Nr'r) rûrürýrþrbr)r*r+r:)rrr/rMs rÚ __delitem__zViewList.__delitem__ƒsä€ð %Ø— ‘ ˜!� Ø— ‘ ˜1� Ø�{Š{Ø—K‘K  D×$6Ñ$6Ñ 6Ñ7ðøäò %Ø—6‘6�>Ð DÐ#DÓ D�>Ø— ‘ ˜!Ÿ'™' !§&¡&˜.Ð)Ø— ‘ ˜1Ÿ7™7 1§6¡6˜>Ð*Ø�{Š{Ø—W‘W’\  T×%7Ñ%7Ñ7�Ø—V‘VÒ(œs 4›y¨D×,>Ñ,>Ñ>�Ø—K‘K  ! Ò$ñð  %ús‚AAÁCD ÄD cóº—t|t«rA|j|j|jz|j|jz¬«St d«‚)N©rüz!adding non-ViewList to a ViewList©r&rør3rûrürbr s rÚ__add__zViewList.__add__’sQ€Ü �eœXÔ &Ø—>‘> $§)¡)¨e¯j©jÑ"8Ø)-¯©°e·k±kÑ)Að"óDð DôÐ?Ó@Ð @rcóº—t|t«rA|j|j|jz|j|jz¬«St d«‚)Nr4z!adding ViewList to a non-ViewListr5r s rÚ__radd__zViewList.__radd__™sQ€Ü �eœXÔ &Ø—>‘> %§*¡*¨t¯y©yÑ"8Ø).¯©°t·z±zÑ)Að"óDð DôÐ?Ó@Ð @rcóz—t|t«r!|xj|jz c_|Std«‚)Nz!argument to += must be a ViewList)r&rørûrbr s rÚ__iadd__zViewList.__iadd__ s3€Ü �eœXÔ &Ø �IŠI˜Ÿ™Ñ #�Iðˆ ôÐ?Ó@Ð @rcó\—|j|j|z|j|z¬«S)Nr4)r3rûrürLs rÚ__mul__zViewList.__mul__§s%€Ø�~‰~˜dŸi™i¨!™m°D·J±JÀ±Nˆ~ÓDÐDrcóZ—|xj|zc_|xj|zc_|SrŽ)rûrürLs rÚ__imul__zViewList.__imul__¬s!€Ø � Š �Q‰� Ø � Š �a‰� ؈ rcó^—t|t«s td«‚|jr<|jj t |j «|jz|«|j j|j «|jj|j«y)Nz(extending a ViewList with a non-ViewList) r&rørbrýrkr:rûrþr.rür s rr.zViewList.extend±sr€Ü˜%¤Ô*ÜÐFÓGÐ GØ �;Š;Ø �K‰K× Ñ œs 4§9¡9›~°×0BÑ0BÑBÀEÔ JØ � ‰ ×јŸ™Ô$Ø � ‰ ×ј%Ÿ+™+Õ&rcó0—|€|j|«y|jr>|jjt|j«|j z|||«|jj |«|jj ||f«yrŽ)r.rýrkr:rûrþr‰rü)rr!r rAs rr‰zViewList.append¹sq€Ø ˆ>Ø �K‰K˜Õ à�{Š{Ø— ‘ ×"Ñ"¤3 t§y¡y£>°D×4FÑ4FÑ#FÈØ#)¨6ô3à �I‰I× Ñ ˜TÔ "Ø �J‰J× Ñ ˜v vÐ.Õ /rcó¬—|€²t|t«s td«‚|j|j|||j|j|||j rXt |j«|zt |j«z}|j j||jz|«yy|jj||«|jj|||f«|j rZt |j«|zt |j«z}|j j||jz|||«yy)Nz+inserting non-ViewList with no source given) r&rørbrûrürýr:rkrþ)rrr!r rAÚindexs rrkzViewList.insertÃs €Ø ˆ>ܘd¤HÔ-ÜÐ MÓNÐNØ!ŸY™YˆD�I‰I�a˜ˆNØ"Ÿj™jˆD�J‰J�q˜ˆOØ�{Š{ܘTŸY™Y›¨!Ñ+¬s°4·9±9«~Ñ=�Ø— ‘ ×"Ñ" 5¨4×+=Ñ+=Ñ#=¸tÕDðð �I‰I× Ñ ˜Q Ô %Ø �J‰J× Ñ ˜a &¨&Ð!1Ô 2Ø�{Š{ܘTŸY™Y›¨!Ñ+¬s°4·9±9«~Ñ=�Ø— ‘ ×"Ñ" 5¨4×+=Ñ+=Ñ#=¸tØ#)¨6õ3ðrcó2—|jrVt|j«|zt|j«z}|jj||jz«|j j|«|jj|«SrŽ)rýr:rûÚpoprþrü)rrrBs rrDz ViewList.popÔsf€Ø �;Š;ܘŸ™“^ aÑ'¬3¨t¯y©y«>Ñ9ˆEØ �K‰K�O‰O˜E D×$6Ñ$6Ñ6Ô 7Ø � ‰ �‰�qÔØ�y‰y�}‰}˜QÓÐrcó—|t|j«kDr%td|›dt|j«›d�«‚|dkr td«‚|jd|…=|jd|…=|jr|xj |z c_yy)zW Remove items from the start of the list, without touching the parent. ú#Size of trim too large; can't trim ú items from a list of size r#rúTrim size must be >= 0.N)r:rûrJrürýrþrLs rrÌzViewList.trim_startÛs„€ð Œs�4—9‘9‹~Ò ÝÚ:;¼SÀÇÁ½^ðMóNð Nà �ŠUÜÐ6Ó7Ð 7Ø �I‰I�b�q�bˆMØ �J‰J�r˜�rˆNØ �;Š;Ø × Ò  !Ñ #Ö ð rcóÞ—|t|j«kDr%td|›dt|j«›d�«‚|dkr td«‚|j| d…=|j| d…=y)zU Remove items from the end of the list, without touching the parent. rFrGr#rrHN)r:rûrJrürLs rÚtrim_endzViewList.trim_endésg€ð Œs�4—9‘9‹~Ò ÝÚ:;¼SÀÇÁ½^ðMóNð Nà �ŠUÜÐ6Ó7Ð 7Ø �I‰I�q�b‘cˆNØ �J‰J˜�r‘s‰Orcó,—|j|«}||=yrŽ)rB)rr!rBs rr�zViewList.removeõs€Ø— ‘ ˜4Ó ˆØ �‰Krcó8—|jj|«SrŽ)rûÚcountr s rrMzViewList.countùó€Ø�y‰y�‰˜tÓ$Ð$rcó8—|jj|«SrŽ)rûrBr s rrBzViewList.indexürNrcóz—|jj«|jj«d|_yrŽ)rûÚreverserürýrPs rrQzViewList.reverseÿs)€Ø � ‰ ×ÑÔØ � ‰ ×ÑÔØˆ� rcóÚ—tt|j|j«g|¢­Ž}|D�cgc]}|d‘Œ c}|_|D�cgc]}|d‘Œ c}|_d|_ycc}wcc}w)Nrr$)ÚsortedÚziprûrürý)rr8ÚtmpÚentrys rÚsortz ViewList.sortsc€Ü”S˜Ÿ™ D§J¡JÓ/Ð7°$Ò7ˆÙ+.Ó/©3 %�U˜1“X¨3Ñ/ˆŒ Ù,/Ó0©C 5�e˜A“h¨CÑ0ˆŒ ؈� ùò0ùÚ0s ¯ A#Á A(có — |j|S#t$r3|t|j«k(r|j|dz ddfcYS‚wxYw)z%Return source & offset for index `i`.r$rN)rürJr:rûr,s rr0z ViewList.info sT€ð Ø—:‘:˜a‘=Ð øÜò Ø”C˜Ÿ ™ “NÒ"Ø—z‘z ! a¡%Ñ(¨Ñ+¨TÐ1Ò1àð  ús‚‘8A Á A có*—|j|«dS)zReturn source for index `i`.r©r0r,s rr zViewList.sourceó€à�y‰y˜‹|˜A‰Ðrcó*—|j|«dS)zReturn offset for index `i`.r$rZr,s rrAzViewList.offsetr[rcó—d|_y)z-Break link between this list and parent list.N)rýrPs rÚ disconnectzViewList.disconnects €àˆ� rc#ópK—t|j|j«D]\}\}}|||f–—Œy­w)z8Return iterator yielding (source, offset, value) tuples.N)rTrûrü)rr…r rAs rÚxitemszViewList.xitems s7èø€ä),¨T¯Y©Y¸¿ ¹ Ö)CÑ %ˆUÑ$�V˜Vؘ& %Ð'Ó 'ñ*Dùs‚46cóJ—|j«D]}td|z«Œy)z=Print the list in `grep` format (`source:offset:value` lines)z%s:%d:%sN)r`r()rr s rÚpprintzViewList.pprint%s€à—K‘K–MˆDÜ �*˜tÑ#Õ $ñ"r)NNNNN©Nr)r r“)*r4r”r•r–rrr rrrrrrr r"r$r-r0r2r6r8r:r<Ú__rmul__r>r.r‰rkrDrÌrJr�rMrBrQrWr0r rAr^r`rbr—rrrørøsË„ñð$:>Ø,0óBò6òMòCÚCÚCÚCÚBÚCòò !òò ò;ò" %òAòAòòEð€Hòò 'ó0ó3ó" ó $ó òò%ò%òò ò òòòò(ó %rrøcóX—eZdZdZdej fd„Zd d„Z d d„Zd d„Z d„Z d „Z y) r'z*A `ViewList` with string-specific methods.rcóh—|j||D�cgc]}||d‘Œ c}|j||ycc}w)zÕ Trim `length` characters off the beginning of each item, in-place, from index `start` to `end`. No whitespace-checking is done on the trimmed text. Does not affect slice parent. Nr)rÚlengthr*rér s rÚ trim_leftzStringList.trim_left/sE€ð-1¯I©I°e¸CÑ,@ó BÙ,@ Dð!% V W¢ Ø,@ñ Bˆ� ‰ �%˜Ñùò Bs’ /cóü—|}t|j«}||kr\|j|}|j«sn<|r/|ddk(r'|j|«\}}t |||||dz«‚|dz }||krŒ\|||S)rnrÚ r$)r:rûrOr0rp)rr*rqréÚlastr r rAs rrozStringList.get_text_block8s’€ðˆÜ�4—9‘9‹~ˆØ�DŠjØ—9‘9˜S‘>ˆDØ—:‘:”<ØÙ˜t A™w¨#š~Ø!%§¡¨3£‘�˜Ü0°°e¸C°À&Ø17¸!±ó=ð=à �1‰HˆCð�D‹jð�E˜#ˆÐrNcó6—|}|}|�|€|}|�|dz }t|j«}||kr£|j|} | rF| ddk7s|�<| d|j«r)||kDxr!|j|dz j« } nN| j«} | s|r-d} n7|€(t| «t| «z } |€| }n t || «}|dz }||krŒ£d} |||} |�!| r| jd|d| jd<|r|r| j ||du¬«| |xsd| fS)a¯ Extract and return a StringList of indented lines of text. Collect all lines with indentation, determine the minimum indentation, remove the minimum indentation from all indented lines (unless `strip_indent` is false), and return them. All lines up to but not including the first unindented line will be returned. :Parameters: - `start`: The index of the first line to examine. - `until_blank`: Stop collecting at the first blank line if true. - `strip_indent`: Strip common leading indent if true (default). - `block_indent`: The indent of the entire block, if known. - `first_indent`: The indent of the first line, if known. :Return: - a StringList of indented lines with minimum indent removed; - the amount of the indent; - a boolean: did the indented block finish with a blank line or EOF? Nr$rrj)r*)r:rûrOÚlstripÚminrh)rr*rÍrÎrÓrÖrÐrérkr rÑÚstrippedÚ line_indentrrs rrËzStringList.get_indentedMsa€ð,ˆØˆØ Ð #¨ Ð(<Ø'ˆLØ Ð #Ø �1‰HˆCÜ�4—9‘9‹~ˆØ�DŠjØ—9‘9˜S‘>ˆDÙ˜˜a™ CšØ)Ð5Ø!% m |Ð!4×!:Ñ!:Ô!<ð"% u¡ò!CØ(,¯ © °#¸±'Ñ(:×(@Ñ(@Ó(BÐ$BðàØ—{‘{“}ˆHÙÙØ#$�LØØÐ%Ü! $›i¬#¨h«-Ñ7� Ø�>Ø(‘Fä  ¨Ó5�FØ �1‰HˆCð+�D‹jð.ˆLØ�U˜3�ˆØ Ð #©Ø!ŸJ™J q™M¨,¨-Ð8ˆE�J‰J�q‰MÙ ‘lØ �O‰O˜F¨<¸tÐ+CˆOÔ EØ�f’k  <Ð/Ð/rc ó—|||}|}tt|j««D]‘}tj|j|«} | |} | |}|j|||j «x|j|<} | sŒct|t| «t| j««z «}Œ“|r1d|cxkr|kr&n|S|jD� cgc]} | |d‘Œ c} |_|S#t $r*|t|j|«t| «z z }YŒÐwxYw#t $r+|t|j|«t| «z z }Y�ŒwxYwcc} wrc) rr:rûrÚcolumn_indicesrJÚrstriprnrm) rÚtopÚleftÚbottomÚrightrÎrrrÐrÚcir s rÚ get_2D_blockzStringList.get_2D_block‰sP€Ø�S˜Ð ˆØˆÜ”s˜5Ÿ:™:“Ö'ˆAä×%Ñ% e§j¡j°¡mÓ4ˆBð 5ؘ$‘x�ð 6ؘ5™ �ð$)§:¡:¨a¡=°°eÐ#<×#CÑ#CÓ#EÐ EˆE�J‰J�q‰M˜DÚܘV¤S¨£Y´°T·[±[³]Ó1CÑ%CÓD‘ð(ñ ˜A Ô.¨Ô.àˆ ð5:·J²JÓ?±J¨D˜$˜v˜wš-°JÑ?ˆEŒJ؈ øôò 5Øœ˜EŸJ™J q™MÓ*¬S°«WÑ4Ñ4’ð 5ûôò 6Øœ˜UŸZ™Z¨™]Ó+¬c°"«gÑ5Ñ5“ð 6üò @s*Á C/ÁD%à EÃ/0D"Ä!D"Ä%0EÅEcó8—tt|j««D]y}|j|}t|t«sŒ#g}|D]2}|j |«t |«dvsŒ"|j |«Œ4dj|«|j|<Œ{y)zrPad all double-width characters in `self` appending `pad_char`. For East Asian language support. ÚWFriN)rr:rûr&r½r‰rr))rÚpad_charrr ÚnewÚchars rÚpad_double_widthzStringList.pad_double_widthžs}€ô ”s˜4Ÿ9™9“~Ö&ˆAØ—9‘9˜Q‘<ˆDܘ$¤Õ$Ø�Û �DØ—J‘J˜tÔ$Ü'¨Ó-°Ò5ØŸ ™  8Õ,ð!ð "Ÿw™w s›|�— ‘ ˜!’ ñ'rcó¢—tt|j««D].}|j|j||«|j|<Œ0y)z6Replace all occurrences of substring `old` with `new`.N)rr:rûÚreplace)rÚoldr}rs rr�zStringList.replace­s;€ä”s˜4Ÿ9™9“~Ö&ˆAØŸ9™9 Q™<×/Ñ/°°SÓ9ˆD�I‰I�aŠLñ'rr’)rFTNN)T) r4r”r•r–r*ÚmaxsizerhrorËryrr�r—rrr'r'+s8„á4à&'¨S¯[©[óBóð*EIØ59ó:0óxò* ,ó:rr'có —eZdZy)ÚStateMachineErrorN©r4r”r•r—rrr…r…³ó…rr…có —eZdZy)rHNr†r—rrrHrH´r‡rrHcó —eZdZy)r|Nr†r—rrr|r|µr‡rr|có —eZdZy)rªNr†r—rrrªrª¶r‡rrªcó —eZdZy)r©Nr†r—rrr©r©·r‡rr©có —eZdZy)r·Nr†r—rrr·r·¸r‡rr·có —eZdZy)rºNr†r—rrrºrº¹r‡rrºcó —eZdZy)rpNr†r—rrrprpºr‡rrpcó—eZdZdZy)r6z‡ Raise from within a transition method to switch to another transition. Raise with one argument, the new transition name. Nrôr—rrr6r6½s„òrr6có—eZdZdZy)r9zª Raise from within a transition method to switch to another state. Raise with one or two arguments: new state name, and an optional new transition name. Nrôr—rrr9r9Æs„òrr9éFz[ ]cóª—|r|jd|«}|j«D�cgc]!}|j|«j«‘Œ#c}Scc}w)a6 Return a list of one-line strings with tabs expanded, no newlines, and trailing whitespace stripped. Each tab is expanded with between 1 and `tab_width` spaces, so that the next character's index becomes a multiple of `tab_width` (8 by default). Parameters: - `astring`: a multi-line string. - `tab_width`: the number of columns between tab stops. - `convert_whitespace`: convert form feeds and vertical tabs to spaces? - `whitespace`: pattern object with the to-be-converted whitespace characters (default [\v\f]). rj)ÚsubÚ splitlinesÚ expandtabsrs)ÚastringÚ tab_widthÚconvert_whitespaceÚ whitespaceÚss rÚ string2linesr›ÐsL€ñ"Ø—.‘.  gÓ.ˆØ6=×6HÑ6HÔ6JÓ KÑ6J°ˆA�L‰L˜Ó #× *Ñ *Õ ,Ð6JÑ KÐKùÒ Ks§&Acó—tj«\}}}|jr|j}|jrŒ|jj}|j ||j |j|jfS)zü Return exception information: - the exception's class name; - the exception object; - the name of the file containing the offending code; - the line number of the offending code; - the function name of the offending code. ) r*Úexc_infoÚtb_nextÚtb_frameÚf_coder4Ú co_filenameÚ tb_linenoÚco_name)r„r…Ú tracebackÚcodes rrƒrƒæsp€ô!Ÿ\™\›^Ñ€Dˆ%�Ø × Ò Ø×%Ñ%ˆ ð × Ó à × Ñ × $Ñ $€DØ �M‰M˜5 $×"2Ñ"2°I×4GÑ4GØ �L‰Lð ðr)r–Ú __docformat__r*rµÚ unicodedatarÚdocutilsrrr™rÈrÚrïrórörør'Ú Exceptionr…rHr|rªr©r·rºrpr6r9r¶r›rƒr—rrÚrªsðñ eðN#€ ã Û Ý(å÷AñA÷H L'ñL'ô^d6�\ôd6ôNJ,ˆeôJ,÷Z)ñ)ô. ˜¨,ô ô  ˜?¨Nô ÷ K%ñK%ô\E:�ôE:ôP)˜ Ô(Ü0Ð)Ô0Ü2Ð+Ô2Ü5Ð.Ô5Ü7Ð0Ô7Ü8Ð 1Ô8Ü7Ð0Ô7Ü9Ð!2Ô9ô˜9ôô�iôð%&¸%Ø&˜BŸJ™J xÓ0óLó,r