bg ddlZddlZddlZddlmZmZmZddlmZej dej Z ej dZ ej dZ GddeZGd d eZdS) N)RegionExampleDocument)diffz^\.\.\s*topic::?\s*(.+)\bz(\n\Z|\n(?=\S))z\s+:class:\s*(read|write)-fileceZdZdZdS) FileBlockc2|||c|_|_|_dSNpathcontentaction)selfr r rs c/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/testfixtures/sybil.py__init__zFileBlock.__init__s/3Wf, 4<N)__name__ __module__ __qualname__rrrrr s(EEEEErrc6eZdZdZdefdZdefdZdefdZ dS) FileParsera9 A `Sybil `__ parser that parses certain ReST sections to read and write files in the configured :class:`~testfixtures.TempDirectory`. :param name: This is the name of the :class:`~testfixtures.TempDirectory` to use in the Sybil test namespace. namec||_dSr )r)rrs rrzFileParser.__init__s  rdocumentc#K|ttD]*\}}}|}t|d}|s>d}||dkr|dz }tjd ||d }|ddkr|dz }t| d|| d}t||||jV,dS)Nz:: r )find_region_sourcesFILEBLOCK_START FILEBLOCK_END splitlinesCLASSmatchstriptextwrapdedentjoinlstriprgrouprstartendevaluate) rr start_match end_matchsourcelinesclass_indexparseds r__call__zFileParser.__call__sX.6.J.J ]/ /    *KF%%''E[[q**F EU|!!##t++ _TYYuUVV}%=%=>>EEGGFbzT!!$ &&q))||AF !!##      )  rexamplec |j}|j|j}|jdkr||jdtjd}||j krAt|j |d|j|j fzd| |jzS|jdkr#| |j|j ddSdS)NreadasciirzFile %r, line %i:zReading from "%s":write)r6 namespacerrr:r replaceoslinesepr rline as_stringr<)rr8blockdiractuals rr/zFileParser.evaluate;s"> * <6 ! !XXej'22::2:tLLF&&M'7<*FF(3==+D+DD  <7 " " IIej%- 9 9 9 9 9 # "rN) rrr__doc__strrrr7rr/rrrrrsoS8 : : : : : : :rr)r?rer(sybilrrr testfixturesrcompile MULTILINEr"r#r%objectrrrrrrNs ++++++++++"*92<HH -..  455EEEEEEEE 6:6:6:6:6:6:6:6:6:6:r