kfdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddlmZddlmZddlmZmZddlmZdd lmZdd lmZmZdd lmZmZmZm Z dd l!m"Z"dd l#m$Z$m%Z%ddl&m'Z'ej(dZ) ddl*m+Z,e)Z- ddl.m/Z/m0Z0m1Z1n#e2$r e3xZ0xZ1Z/YnwxYwn)#e2$r!ddl4m)Z-ddl5m+Z,ddl6m7Z/ddl6m8Z0ddl6m9Z1YnwxYwd+dZ:Gdde,Z+Gdde+Z;dZ<Gdde+Z=dZ>Gdd e+Z?Gd!d"e+Z@Gd#d$ZAd%ZBd+d&ZCd,d(eeDfd)ZEeFd*kr eBdSdS)-z babel.messages.frontend ~~~~~~~~~~~~~~~~~~~~~~~ Frontends for the message extraction functionality. :copyright: (c) 2013-2023 by the Babel Team. :license: BSD, see LICENSE for more details. N) OrderedDict)RawConfigParser)StringIO)Iterable)Locale localedata) __version__)UnknownLocaleError)DEFAULT_HEADERCatalog)DEFAULT_KEYWORDSDEFAULT_MAPPINGcheck_and_call_extract_fileextract_from_dir)write_mo)read_powrite_po)LOCALTZbabel)Command) BaseError OptionError SetupError)log)DistutilsError)DistutilsOptionError)DistutilsSetupErrorcg}t|ttfs|g}|D]}|t|ttfr%|t ||F|dt ||Dtd|DsJ|S)a Make a list out of an argument. Values from `distutils` argument parsing are always single strings; values from `optparse` parsing may be lists of strings that may need to be further split. No matter the input, this function returns a flat list of whitespace-trimmed strings, with `None` values filtered out. >>> listify_value("foo bar") ['foo', 'bar'] >>> listify_value(["foo bar"]) ['foo', 'bar'] >>> listify_value([["foo"], "bar"]) ['foo', 'bar'] >>> listify_value([["foo"], ["bar", None, "foo"]]) ['foo', 'bar', 'foo'] >>> listify_value("foo, bar, quux", ",") ['foo', 'bar', 'quux'] :param arg: A string or a list of strings :param split: The argument to pass to `str.split()`. :return: Nsplitc3>K|]}|VdSNstrip).0ss w/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/babel/messages/frontend.py z listify_value..`s*<<17799<<<<<<c3@K|]}t|tVdSr") isinstancestr)r%vals r'r(z listify_value..as,33z#s##333333r))r+listtupleextend listify_valuer,r all)argr outr-s r'r1r1;s4 C cD%= ) )e== ;  cD%= ) )  JJ}S666 7 7 7  <eZdZdZdZgdZddgZdZdZdZ d Z d S) compile_catalogaCatalog compilation command for use in ``setup.py`` scripts. If correctly installed, this command is available to Setuptools-using setup scripts automatically. For projects using plain old ``distutils``, the command needs to be registered explicitly in ``setup.py``:: from babel.messages.frontend import compile_catalog setup( ... cmdclass = {'compile_catalog': compile_catalog} ) .. versionadded:: 0.9 z+compile message catalogs to binary MO files))domain=Dz>domains of PO files (space separated list, default 'messages'))z directory=d.path to base directory containing the catalogsz input-file=izname of the input file) output-file=ozQname of the output file (default '//LC_MESSAGES/.mo')locale=lz locale of the catalog to compile) use-fuzzyfzalso include fuzzy translations) statisticsNz#print statistics about translationsrXrZchd|_d|_d|_d|_d|_d|_d|_dSNmessagesF)domain directory input_file output_filelocale use_fuzzyrZr?s r'r9z"compile_catalog.initialize_optionss8   r)ct|j|_|js|jst d|js|jst ddSdS)Nz}||D]}|t|z }?|r|jd||rdndS)Nrz%d errors encountered.)r^ _run_domainvalueslenrerror)r?n_errorsr^errorss r'runzcompile_catalog.runsk ( (F**62299;; ( (CKK' (  ? HNN3X > > >$1%r)c Rg}g}|jsN|jr||jtj|j|jd|df|tj|j|jd|dn?tj|jD]}tj|j|d|d}tj|rT|||f|tj|j|d|dn||j|jf|j r||j nB|tj|j|jd|d|stdi}t|D]\}\}}||}t|d5} t| |} dddn #1swxYwY|jryd} t| ddD]} | jr| dz } d} t#| r| dzt#| z} |jd | t#| | || jr#|js|jd |t| x|| <}|D],\} }|D]$}|jd || j|%-|jd ||t|d 5}t3|| |jdddn #1swxYwY|S)N LC_MESSAGES.poz.mono message catalogs foundrbrrhdz)%d of %d messages (%d%%) translated in %sz'catalog %s is marked as fuzzy, skippingzerror: %s:%d: %szcompiling catalog %s to %swb)rc)r`rbappendospathjoinr_listdirexistsrar enumerateopenrrZr.stringrkrinfofuzzyrccheckrllinenor)r?r^po_filesmo_filesrbpo_filecatalogs_and_errorsidxmo_fileinfilecatalog translatedmessage percentagecatalog_errorsrnrloutfiles r'rizcompile_catalog._run_domains >{ F!#dndk.;17nnn">">!?@@@ T^T[-:06^^^!=!=>>>>!j88FFF gll4>6+8V...JJGw~~g..F (9:::  T^V5B8>^^^)E)EFFF F OOT[$/: ; ; ; > 01111 T^T[-:06^^^!=!=>>> ;9:: : &/&9&9 E E "C"&'smGgt$$ 2!&&11 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2  #G}}QRR0((G~("a  w<<B!+c!1S\\!AJ ?G j' } T^  GQQQ<@#1  #EHNN*GW^U HMM6 I I Igt$$ E'T^DDDD E E E E E E E E E E E E E E E#"s$#II I 6NN !N N) rBrCrD__doc__ description user_optionsrGr9rfrorir6r)r'rLrLs @KL"#L1O   ___&&&F#F#F#F#F#r)rLcfd}|S)zO Build a directory_filter function based on a list of ignore patterns. c|tj|tfdD S)Nc3BK|]}tj|VdSr")fnmatch)r%ignore_patternbasenames r'r(zG_make_directory_filter..cli_directory_filter..sC   OHn 5 5      r))rxryrany)dirnamerignore_patternss @r'cli_directory_filterz4_make_directory_filter..cli_directory_filtersX7##G,,           r)r6)rrs` r'_make_directory_filterrs$      r)cheZdZdZdZgdZgdZdZdZddd d d Z d d iZ dZ dZ de fdZdZdZdS)extract_messagesaMessage extraction command for use in ``setup.py`` scripts. If correctly installed, this command is available to Setuptools-using setup scripts automatically. For projects using plain old ``distutils``, the command needs to be registered explicitly in ``setup.py``:: from babel.messages.frontend import extract_messages setup( ... cmdclass = {'extract_messages': extract_messages} ) z1extract localizable strings from the project code))zcharset=Nz3charset to use in the output file (default "utf-8"))z keywords=kzispace-separated list of keywords to look for in addition to the defaults (may be repeated multiple times))no-default-keywordsNz#do not include the default keywords)z mapping-file=Fz&path to the mapping configuration file) no-locationNz>do not include location comments with filename and line number)z add-location=Nzlocation lines format. If it is not given or "full", it generates the lines with both file name and line number. If it is "file", the line number part is omitted. If it is "never", it completely suppresses the lines (same as --no-location).) omit-headerNz'do not include msgid "" entry in header)rSrTzname of the output filezwidth=wz"set output line width (default 76)no-wrapNzVdo not break long message lines, longer than the output line width, into several lines) sort-outputNz&generate sorted output (default False)) sort-by-fileNz,sort output by file location (default False))zmsgid-bugs-address=Nzset report address for msgid)zcopyright-holder=Nzset copyright holder in output)zproject=Nzset project name in output)zversion=Nzset project version in output)z add-comments=czuplace comment block with TAG (or those preceding keyword lines) in output file. Separate multiple TAGs with commas(,))strip-commentsr&z)strip the comment TAGs from the comments.)z input-paths=Nzofiles or directories that should be scanned for messages. Separate multiple files or directories with commas(,))z input-dirs=Nz@alias for input-paths (does allow files as well as directories).)z ignore-dirs=NzwPatterns for directories to ignore when scanning for messages. Separate multiple patterns with spaces (default ".* ._"))zheader-comment=Nzheader comment for the catalog)rrrrrrrz input-paths)z add-commentskeywordsz ignore-dirs)z --keyword)z --mapping)z--output)z--strip-comment-tags)rz mapping-filez output-filerz add-location)fullfilenevercHd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nzutf-8FT)charsetrno_default_keywords mapping_file no_location add_location omit_headerra input_dirs input_pathswidthno_wrap sort_output sort_by_filemsgid_bugs_addresscopyright_holderprojectversion add_commentsstrip_commentsinclude_lineno ignore_dirsheader_commentrds r'r9z#extract_messages.initialize_options}s  #(        !"& $   #""r)c|jr#|js |j|_ntd|jrint j}|tt|j ||_ |j std|j std|j r|j rtd|j s|j sd|_ n |j t|j |_ |jr|jrtd|jr:t!|jt"rt%jd|j|_nV|jHt*d|jjpd D|_ng|_|jstd |jD]4}t2j|std |d 5t|jpd d |_|jrJ|js|j|_|js|j |_|j!dkrd|_"n|j!dkrd|_#t|j$}|rtK|j$|_&dSd|_&dS)Nz1input-dirs and input-paths are mutually exclusivez=you must specify new keywords if you disable the default oneszno output file specified0'--no-wrap' and '--width' are mutually exclusiveLz;'--sort-output' and '--sort-by-file' are mutually exclusivez,\s*cFg|]}|dddS).rhrr)r%rs r' z5extract_messages.finalize_options..s9...Q"...r)r6z'no input files or directories specifiedz Input path: z does not exist,rTrF)'rrrrr copyupdateparse_keywordsr1rrarrintrrr+r,rer r8dictfromkeyspackageskeysrxryr|rrget_namer get_versionrrrrrdirectory_filter)r?rryrs r'rfz!extract_messages.finalize_optionss ? # #'?  !G1N227G7L7N7N}T]'C'CDDEEE  } O  :899 9 < DJ B | )DJ )DJJ Z #TZDJ    1 M    "$*C00 G#%8GT5E#F#F   *#}}..+4:...  tvv    "D  IGHH H$ H HD7>>$'' H!"F"F"F"FGGG H*$*;*Ar3GG   ?< <#099;; < ?#0<<>>   ' '#D    & ( ("'D #D$455  )$:4;K$L$LD ! ! !$(D ! ! !r)rycBdtdtdtffd }|S)Nfilenamemethodoptionsc|dkrdStjr}n=tjtj|}d}|r7dd|D}d|d}jd||dS)Nignorez, c3,K|]\}}|d|dVdS)z=""Nr6)r%rvs r'r(zEextract_messages._build_callback..callback..s2&P&P1!||q|||&P&P&P&P&P&Pr)z ()zextracting messages from %s%s)rxryisfilenormpathrzitemsrr)rrrfilepathoptstr opt_valuesryr?s r'callbackz2extract_messages._build_callback..callbacks!! w~~d## J7++BGLLx,H,HIIF ,!YY&P&P &P&P&PPP +j+++ HMM98V L L L L Lr))r,r)r?ryrs`` r'_build_callbackz extract_messages._build_callbacksM Ms MC M$ M M M M M M M$r)c |}t|jd5}t|j|j|j|j|j|j pt}|D]&\}}}| |}tj |r9tj}t!|||||j|j|j|} n+t)||||j|j||j|j} | D]\} } } } }tj |r| }n=tj tj || }|| d|| fg| |(|jd|jt7|||j|j|j|j|j |j!ddddS#1swxYwYdS)Nrv)rrrrrr)r comment_tagsrstrip_comment_tagsr) auto_commentscontextzwriting PO template file to %s)rrrrrr)" _get_mappingsr~rar rrrrrrr rrxryrgetcwdrrrrrrrrzaddrrrrrrrrr)r?mappingsrrry method_map options_mapr current_dir extractedrrrcommentsrrs r'rozextract_messages.runsn%%'' $"D ) )) 9Wdl&*l151H/3/D&*l.2.A.S^ VVVG2: I I-j+//557>>$''"$)++K ;j+ $-1B+[!!II !1j+!%%)%6!)+/+>)-)> !!!IENII@Hfgxw~~d++R#+#%7#3#3BGLLx4P4P#Q#QKK60B/C.6 IIII I HMM:D//LC_MESSAGES/.po'))rVrWz$locale for the new localized catalogrrrchd|_d|_d|_d|_d|_d|_d|_dSr\) output_dirrar`rbr^rrrds r'r9zinit_catalog.initialize_optionsrs8     r)c6|jstd|jstd tj|j|_n"#t $r}t||d}~wwxYw|js|jstd|js9tj |j|jd|j d|_tj tj |js6tjtj |j|jr|jrtd|js|js d|_dS|jt%|j|_dSdS)Nyou must specify the input filez-you must provide a locale for the new catalogz%you must specify the output directoryrqrrrr)r`rrbrparse_localer rar rxryrzr^r|rmakedirsrrrr?es r'rfzinit_catalog.finalize_options{s A?@@ @{ OMNN N (!< 44DLL! ( ( (a..a ' ( G GEFF F P!w||DOT[,9dk;N;N;N P PD w~~bgood.>??@@ ; K(899 : : : < RDJ RPQQ Q| )DJ )DJJJ Z #TZDJJJ$ #sA A,A''A,c|jd|j|jt |jd5}t ||j}dddn #1swxYwY|j|_tj t|_ d|_ t |jd5}t|||jddddS#1swxYwYdS)Ncreating catalog %s based on %srtrbFrv)r)rrrar`r~rrbrdatetimenowr revision_daterrr)r?rrrs r'rozinit_catalog.runsX  -t/?   $/4 ( ( :FfT[999G : : : : : : : : : : : : : : :  ( 1 5 5g > > $"D ) ) 9W WgTZ 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9s#AA#&A#;C  C$'C$N rBrCrDrrrrGr9rfror6r)r'rrNsl  =KL$!kO)))499999r)rc8eZdZdZdZgdZgdZdZdZdZ dS) update_catalogaCatalog merging command for use in ``setup.py`` scripts. If correctly installed, this command is available to Setuptools-using setup scripts automatically. For projects using plain old ``distutils``, the command needs to be registered explicitly in ``setup.py``:: from babel.messages.frontend import update_catalog setup( ... cmdclass = {'update_catalog': update_catalog} ) .. versionadded:: 0.9 z'update message catalogs from a POT file)r rQ)r rOrPr )rNz%do not include msgid entry in headerrUrr)zignore-obsolete=Nz1whether to omit obsolete messages from the output)z init-missing=Nz6if any output files are missing, initialize them first)no-fuzzy-matchingNzdo not use fuzzy matching)update-header-commentNzupdate target header comment)previousNz+keep previous msgids of translated messages)zcheck=Nzdon't update the catalog, just return the status. Return code 0 means nothing would change. Return code 1 means that the catalog would be updated)rrzignore-obsoletez init-missingrr!r rcd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ dSr\)r^r`r rarrbrrignore_obsolete init_missingno_fuzzy_matchingupdate_header_commentr!rrds r'r9z!update_catalog.initialize_optionssn      $!!&%*"  r)cJ|jstd|js|jstd|jr|jstd|jrX|jstd t j|j|_n)#t$r}t||d}~wwxYwd|_|j r|j rtd|j s|j sd|_ n |j t|j |_ |j r|jr d|_dSdSdS)Nrz-you must specify the output file or directoryzyou must specify the localez?you must specify the locale for the init-missing option to workrrF)r`rrar rbr$rrrr rrrr%r!rs r'rfzupdate_catalog.finalize_optionssj A?@@ @ O OMNN N   =DK =;<< <   ; !6  ,%|DK88 % , , ,!!nn!+ , DL < RDJ RPQQ Q| )DJ )DJJ Z #TZDJ  ! "dm "!DMMM " " " "s/B B-B((B-c  i}g}|js|jrO||jtj|j|jd|jdfntj|jD]g}tj|j|d|jd}tj |r|||fhn!||j|jf|std|j}|sGtj tj |j d}t|j d5}t|}dddn #1swxYwY|D]\}}|jrtj |s|jrd||<:|jd||j t|j d5}t||j} dddn #1swxYwY|j| _t*jt.| _d| _t|d 5} t5| | dddn #1swxYwY|jd ||j t|d5}t||| } dddn #1swxYwY| ||j|j tjtj|t?j tj |z} t| d 5} t5| | |j!|j"|j#|j$ dddn #1swxYwYn##tJ$rtj&| wxYw|jrt|d5} t| }dddn #1swxYwYt| d5}t|}dddn #1swxYwY|j|_|'|||<tj&| " tj(| |:#tR$rAtj&|tUj+| |tj&| YwxYw|jr|,D]>\}}|r|jd|#|j-d|?t]|/stad|jddSdS)NrqrrrsrrtFrrrvzupdating catalog %s based on %s)rbr^)r&)rr#include_previousrzCatalog %s is up to date.zCatalog %s is out of date.zSome catalogs are out of date.z All the catalogs are up-to-date.)1rarbrwrxryrzr r^r{r|rsplitextrr`r~rr$rrrrrrrrrrrr%r&rtempfile gettempprefixrr#r!r Exceptionremove is_identicalrenameOSErrorshutilrrwarningr2rjr)r? check_statusrrbrr^rtemplaterrrtmpnametmpfileorigfileoriginal_catalognewfileupdated_catalog up_to_dates r'rozupdate_catalog.runs  ={ ;!#dot{.;15.A.A.A"C"C!DEEEE !j99;;F gll4?F+8.2k+>+>+>@@Gw~~g..; (9::: ; OOT[$*:; < < < ;9:: : LW%%bg&6&6t&G&GHHKF $/4 ( ( 'FvH ' ' ' ' ' ' ' ' ' ' ' ' ' ' '!)? #? # FH  /)A)A /:-2L* 5x$/400BF&fT[AAAGBBBBBBBBBBBBBBB "&(0(9(=(=g(F(F% % (D))/WWg.../////////////// HMM;Xt W W Wh%% H!&GGG H H H H H H H H H H H H H H H NN$0&*&@     gll27??8#<#<#+#9#;#;#%7#3#3H#=#=$>??G '4((OGWg)-)9-1-A.2m4:OOOOOOOOOOOOOOOOOOO     '""" z (D))9X'.x'8'8$999999999999999'4((7G&-g&6&6O7777777777777770@0N-)8)E)EFV)W)W X& '""" # '8,,,, # # #  (### GX... '""""" # : (4(:(:(<(< M M$*MHMM"=xHHHHH$$%A8LLLL|**,,-- B @AAA @AAA F  s;FFFH77H; >H; J++J/ 2J/ 'LL L "O42*O( O4(O, ,O4/O, 0O44 P.Q  Q Q %RR R SAT)(T)Nrr6r)r'rrsz hhhhhr)rcZeZdZdZdZdeZdddddZee e e dZ d Z dd Zd Zd Zd Zd S)CommandLineInterfacezCommand-line interface. This class provides a simple command-line interface to the message extraction and PO file generation functionality. z%%prog %s [options] %sz%prog z$compile message catalogs to MO filesz:extract messages from source files and generate a POT filez+create new message catalogs from a POT filez0update existing message catalogs from a POT file)compileextractinitrNc`| tj}tj|jdz|j|_|j|j|j_ |j dddd|j d d d d tj d |j ddd d tj d|jdtj|j|dd\}}||j|jrtt)j}t-d|Ddz}t/|D]3}t1j|}t5|d|d|j4dS|s|jd|d}||jvr|jd|d|||dd} | S)z{Main entry point of the command-line interface. :param argv: list of arguments passed on the command-line N)commandz[args])usagerz--list-locales list_locales store_truez print all known locales and exit)destactionr=z-vz --verbose store_constloglevelzprint as much as possible)rHrGconstr=z-qz--quietzprint as little as possibleF)rErJrhc34K|]}t|VdSr"rk)r% identifiers r'r(z+CommandLineInterface.run..s(IIz3z??IIIIIIr)< rzQno valid command or option passed. Try the -h/--help option for more information.zunknown command "r) sysargvoptparse OptionParserrDrparserdisable_interspersed_args_help print_help add_optionloggingDEBUGERROR set_defaultsINFO parse_args_configure_loggingrJrErlocale_identifiersmaxsortedrrprint english_namerlcommands_configure_commandro) r?rRrargs identifiersid_widthrNrbcmdnamecmdinsts r'rozCommandLineInterface.runsl <8D+$*?T2T48LBBB  --///!%  /n&2$F  H H H t[$.gm$?  A A A tY}$.gm$A  C C C   egl KKK ..tABBx88   0111   $799KII[IIIIIAMH$[11 I I j11GhGGGG&2EGGHHHH1 P K  O P P Pq' $- ' ' K  <'<<< = = =))'48<<{{}}r)cft|_|j||jjr|jjd}n-tj}|j|||tjd}||dS)Nrz %(message)s)rsetLevelhandlersrZ StreamHandler addHandler Formatter setFormatter)r?rJhandler formatters r'r`z'CommandLineInterface._configure_loggings (### 8  )h'*GG+--G H   ( ( ("""%m44 Y'''''r)cXt|jtdtdtd|jDdz}t |jD]\}}td|d|d|dS)Nz commands:c34K|]}t|VdSr"rM)r%rCs r'r(z-CommandLineInterface._help..s(IIs7||IIIIIIr)rhz rOrP)rdrU format_helprbrfrcr)r? cmd_widthrrs r'rWzCommandLineInterface._helps dk%%''((( k3II4=IIIIIAMNN !' (;(;(=(=!>!> : : D+ 8t8i8888;88 9 9 9 9 : :r)c|j|}|}|jr |j|_t|tsJ|t j|j|dfz|j|}t|dd}|j D]\}}} | d} t|| dd} d| g} |r| d|| |j| d|j| d } | |kr|xjd | d z c_| |jvr|j| d | d | |jvr|j| d| | d|j| | | | d||\}}|r%t-|| dd|t/|D]\}}t-||| |n9#t4$r,}|t9|Yd }~nd }~wwxYw|S)zB :type cmdname: str :type argv: list[str] r)rDrrEr6=-_z--NrO>rF)rHr=rw)rHr=choices)r=defaultr)command_classesrr+rr9rSrTrDrfrrr$replacerwr0rHgetrIrGrYrFr_setattrvarsrensure_finalizedrrlr,)r?rkrRcmdclassrlrUrElongshortr=rrstrsrrrhkeyrerrs r'rgz'CommandLineInterface._configure_commands '0(** 8 #(GK'7+++++""$$$&*}, g.   (Ir22!)!6 V V D%::c??Dgt||C'='=>>GKK=D ) KKK((( KK/33D"== > > >-11$==Gw D + 111!!4 4HHHHH888!!4tWUUUUU!!4dGWUUUUU))$//   > GW__S#66 = = =w----// ) )JC GS% ( ( ( ( #  $ $ & & & & # # # LLS " " " " " " " " #sH,, I"6"II"r")rBrCrDrrDVERSIONrrfrLrrrrrror`rWrgr6r)r'r>r>{s %E w  G9O=D H## O C,,,,\ ( ( (:::.....r)r>cXttjSr")r>rorQrRr6r)r'mainr s  ! ! % %ch / //r)c(i}g}i}t}t|j|_||||D]}|dkr#t ||}+d|ddD\}}|||ft ||||<|r+t|D]\} \}}||vr||}||f|| <||fS)aParse an extraction method mapping from a file-like object. >>> buf = StringIO(''' ... [extractors] ... custom = mypackage.module:myfunc ... ... # Python source files ... [python: **.py] ... ... # Genshi templates ... [genshi: **/templates/**.html] ... include_attrs = ... [genshi: **/templates/**.txt] ... template_class = genshi.template:TextTemplate ... encoding = latin-1 ... ... # Some custom extractor ... [custom: **/custom/*.*] ... ''') >>> method_map, options_map = parse_mapping(buf) >>> len(method_map) 4 >>> method_map[0] ('**.py', 'python') >>> options_map['**.py'] {} >>> method_map[1] ('**/templates/**.html', 'genshi') >>> options_map['**/templates/**.html']['include_attrs'] '' >>> method_map[2] ('**/templates/**.txt', 'genshi') >>> options_map['**/templates/**.txt']['template_class'] 'genshi.template:TextTemplate' >>> options_map['**/templates/**.txt']['encoding'] 'latin-1' >>> method_map[3] ('**/custom/*.*', 'mypackage.module:myfunc') >>> options_map['**/custom/*.*'] {} :param fileobj: a readable file-like object containing the configuration text to parse :see: `extract_from_directory` extractorsc3>K|]}|VdSr"r#)r%parts r'r(z parse_mapping..Js*NNtzz||NNNNNNr):rh) rr _sections read_filesectionsrrr rwr}) rrrrrrUsectionrrrs r'rr s?bJJK   F"6#344F Wh'''??$$?? l " "fll73344JJNN c18M8MNNNOFG   w/ 0 0 0#' W(=(=#>#>K 0&/ &;&; 0 0 "C"'6###F+&/JsOO { ""r)r6stringsc ti}|D]}d|vr|d\}}n|d}}||vr|rg}|dD]]}|ddkr-|t|dddf;|t|^t|}|||<|S)aQParse keywords specifications from the given list of strings. >>> kw = sorted(parse_keywords(['_', 'dgettext:2', 'dngettext:2,3', 'pgettext:1c,2']).items()) >>> for keyword, indices in kw: ... print((keyword, indices)) ('_', None) ('dgettext', (2,)) ('dngettext', (2, 3)) ('pgettext', ((1, 'c'), 2)) rNrr)r rwrr/)rrrfuncnameindicesindsxs r'rrWsH)) &== & S 1 1 Hgg &gH 8 # # & s++,,Au|| S3B3[[#$67777 CFF++++++!(HX  Or)__main__r")r6)GrrrrZrSrxrr2rQr+ collectionsr configparserriortypingrrrrr r babel.corer babel.messages.catalogr r babel.messages.extractr rrrbabel.messages.mofilerbabel.messages.pofilerr babel.utilr getLoggerr setuptoolsr_CommandrJsetuptools.errorsrrr ImportErrorr- distutils distutils.cmddistutils.errorsrrrr1rLrrrrrr>rrr,rrBr6r)r'rsH ######(((((($$$$$$$$(((((()))))):::::::: +*****33333333g  C......M9HHHHHHHHHHH 999/88 8j9999CCC......111111<<<<<<DDDDDDBBBBBBBB C''''T&&&&&h&&&RD#D#D#D#D#gD#D#D#N    WWWWWwWWWt   "V9V9V9V9V97V9V9V9rQQQQQWQQQhKKKKKKKK\000G#G#G#G#THSM< zDFFFFFs6 B2 B B2 B.+B2-B..B22#CC