ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ HXc@sdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddl mZddl mZmZddlmZmZmZdd lmZdd lmZdd lmZmZmZmZdd lm Z dd l!m"Z"m#Z#ddl$m%Z%m&Z&ddl'm(Z)ddl*m+Z,ddl-m.Z.m/Z/yddl0m1Z1Wn!e2k rddl3m1Z1nXe4dZ5de,fdYZ+de+fdYZ6de+fdYZ7dZ8de+fdYZ9de+fdYZ:de;fd YZ<d!Z=e4d"Z>gd#Z?e@d$kre=ndS(%s babel.messages.frontend ~~~~~~~~~~~~~~~~~~~~~~~ Frontends for the message extraction functionality. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. i(tprint_functionN(tdatetime(tgetpreferredencoding(t __version__(tLocalet localedata(tStringIOt string_typest text_type(tUnknownLocaleError(tCatalog(tDEFAULT_KEYWORDStDEFAULT_MAPPINGtcheck_and_call_extract_filetextract_from_dir(twrite_mo(tread_potwrite_po(tLOCALTZtodict(tlog(tCommand(tDistutilsOptionErrortDistutilsSetupError(tRawConfigParsercCsg}t|ttfs'|g}nxz|D]r}|dkrFq.nt|ttfrz|jt|d|q.n|jdt|j|Dq.W|S(s 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: tsplitcss|]}|jVqdS(N(tstrip(t.0ts((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pys OsN(t isinstancetlistttupletNonetextendt listify_valueRR(targRtouttval((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyR"*s   *RcBs8eZdZdZdZiZiZeZ ddZ RS(cCsD||_|jd|_t|_d|_d|_d|_dS(Ni( t distributiontinitialize_optionsR t_dry_runtFalsetverbosetforcethelpt finalized(tselftdist((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyt__init__rs      N((( t__name__t __module__R tas_argstmultiple_value_optionstboolean_optionstoption_aliasestoption_choicest distutils_logRR0(((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRTstcompile_catalogc Bs_eZdZdZddddddd!gZddgZdZdZdZ dZ RS("sCatalog 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 s+compile message catalogs to binary MO filessdomain=tDs>domains of PO files (space separated list, default 'messages')s directory=tds.path to base directory containing the catalogss input-file=tisname of the input files output-file=tosQname of the output file (default '//LC_MESSAGES/.mo')slocale=tls locale of the catalog to compiles use-fuzzytfsalso include fuzzy translationst statisticss#print statistics about translationscCsCd|_d|_d|_d|_d|_t|_t|_dS(Ntmessages( tdomainR t directoryt input_filet output_filetlocaleR)t use_fuzzyR@(R.((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyR's      cCs\t|j|_|j r5|j r5tdn|j rX|j rXtdndS(Ns<you must specify either the input file or the base directorys=you must specify either the output file or the base directory(R"RBRDRCRRE(R.((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pytfinalize_optionss cCs%x|jD]}|j|q WdS(N(RBt _run_domain(R.RB((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pytrunsc Cs+g}g}|js|jr|j|jtjj|j|jd|df|jtjj|j|jd|dqvxtj|jD]y}tjj|j|d|d}tjj|r|j||f|jtjj|j|d|dqqWna|j|j|jf|j rJ|j|j n,|jtjj|j|jd|d|st dnxt |D]\}\}}||}t |d}t ||} WdQX|jrid} x.t| dD]} | jr| d7} qqWd} t| rD| dt| } n|jjd | t| | |n| jr|j r|jjd |qnxG| jD]9\} } x*| D]"}|jjd || j|qWqW|jjd ||t |d }t|| d|jWdQXqWdS(Nt LC_MESSAGESs.pos.mosno message catalogs foundtrbiiids)%d of %d messages (%d%%) translated in %ss'catalog %s is marked as fuzzy, skippingserror: %s:%d: %sscompiling catalog %s to %stwbRG(RDRFtappendtostpathtjoinRCtlistdirtexistsRERt enumeratetopenRR@RtstringtlenRtinfotfuzzyRGtcheckterrortlinenoR(R.RBtpo_filestmo_filesRFtpo_filetidxtmo_filetinfiletcatalogt translatedtmessaget percentageterrorsR[toutfile((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRIsh           (sdomain=R:s>domains of PO files (space separated list, default 'messages')(s directory=R;s.path to base directory containing the catalogs(s input-file=R<sname of the input file(s output-file=R=sQname of the output file (default '//LC_MESSAGES/.mo')(slocale=R>s locale of the catalog to compile(s use-fuzzyR?salso include fuzzy translationsN(R@Ns#print statistics about translations( R1R2t__doc__t descriptionR t user_optionsR5R'RHRJRI(((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyR9}s*   textract_messagescBseZdZdZdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUgZdd ddddd)gZd0ZdVZidWd26dXd56dYd76dZd)6Z id[d<6Z d=Z d>Z d?Z d@ZRS(\sMessage 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} ) s1extract localizable strings from the project codescharset=s3charset to use in the output file (default "utf-8")s keywords=tksispace-separated list of keywords to look for in addition to the defaults (may be repeated multiple times)sno-default-keywordss#do not include the default keywordss mapping-file=tFs&path to the mapping configuration files no-locations>do not include location comments with filename and line numbers add-location=slocation 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).s omit-headers'do not include msgid "" entry in headers output-file=R=sname of the output fileswidth=tws"set output line width (default 76)sno-wrapsVdo not break long message lines, longer than the output line width, into several liness sort-outputs&generate sorted output (default False)s sort-by-files,sort output by file location (default False)smsgid-bugs-address=sset report address for msgidscopyright-holder=sset copyright holder in outputsproject=sset project name in outputsversion=sset project version in outputs add-comments=tcsuplace comment block with TAG (or those preceding keyword lines) in output file. Separate multiple TAGs with commas(,)sstrip-commentsRs)strip the comment TAGs from the comments.s input-paths=sofiles or directories that should be scanned for messages. Separate multiple files or directories with commas(,)s input-dirs=s@alias for input-paths (does allow files as well as directories).s input-pathss add-commentstkeywordss --keywords --mappings mapping-files--outputs output-files--strip-comment-tagstfulltfiletnevers add-locationcCsd|_d|_t|_d|_t|_d|_t|_d|_ d|_ d|_ d|_ t|_ t|_t|_d|_d|_d|_d|_d|_t|_t|_dS(Nsutf-8(tcharsetR RqR)tno_default_keywordst mapping_filet no_locationt add_locationt omit_headerREt input_dirst input_pathstwidthtno_wrapt sort_outputt sort_by_filetmsgid_bugs_addresstcopyright_holdertprojecttversiont add_commentststrip_commentstTruetinclude_lineno(R.((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyR'Ms*                    cCs|jr0|js!|j|_q0tdn|jrBi}n tj}|jtt|j ||_ |j stdn|j stdn|j r|j rtdn|j r|j rd|_ n$|j dk rt|j |_ n|jr)|jr)tdn|jrbt|jtrtjd|j|_qnb|jdk rtjg|jjpdD]}|jdd d ^qj|_n g|_|jstd nx6|jD]+}tjj|std |qqWt|jp$dd |_|jrx|jsW|jj|_n|j sx|jj!|_ qxn|j"dkrt#|_$n|j"dkrt%|_&ndS(Ns1input-dirs and input-paths are mutually exclusives=you must specify new keywords if you disable the default onessno output file specifieds0'--no-wrap' and '--width' are mutually exclusiveiLs;'--sort-output' and '--sort-by-file' are mutually exclusives,\s*t.iis'no input files or directories specifiedsInput path: %s does not existt,RtRs((('R{R|RRvR tcopytupdatetparse_keywordsR"RqRER~R}R tintRRRRtreRR&tdicttfromkeystpackagestkeysRORPRSRRtget_nameRt get_versionRyRRxR)R(R.RqRmRP((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRHdsZ           A      csj}tjd}tdjdjdjdjdj}x+|D]#\}}fd}t j j rt j }t |||jjj|}n3t||djd jd |d j}x|D]y\} } } } } t j j r4| }n!t j jt j j| }|j| d|| fgd | d | qWq^Wjjdjt||djdjdjdjdjdjWdQXdS(NRMRRRRRucs|dkrdStjjr+}n!tjjtjj|}d}|rddjg|jD]\}}d||f^qn}njjd||dS(Ntignorets (%s)s, s%s="%s"sextracting messages from %s%s(RORPtisfiletnormpathRQtitemsRRX(tfilenametmethodtoptionstfilepathtoptstrRmtv(RPR.(s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pytcallbacks  ! 3Rqt comment_tagsRtstrip_comment_tagst auto_commentstcontextswriting PO template file to %sR}RxRzRRR(t _get_mappingsRURER RRRRRuRORPRtgetcwdR RqRRRRRQtaddR RRXRR}RxRzRRR(R.tmappingsRhRct method_mapt options_mapRt current_dirt extractedRR\RetcommentsRR((RPR.s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRJsD            !    c Csbg}|jrit|jd}t|\}}WdQXx|jD]}|j|||fqFWnt|jddr4|jj}x|j D]\}}t |t rtt |\}}nJgi}}x:|D]2\}} } |j|| f| p i||W|S(NtUtmessage_extractors(RwRUt parse_mappingR|RNtgetattrR&R RRRRRR ( R.RtfileobjRRRPRtmappingtpatternRR((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRs&   N(scharset=Ns3charset to use in the output file (default "utf-8")(s keywords=Rmsispace-separated list of keywords to look for in addition to the defaults (may be repeated multiple times)(sno-default-keywordsNs#do not include the default keywords(s mapping-file=Rns&path to the mapping configuration file(s no-locationNs>do not include location comments with filename and line number(s add-location=Nslocation 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).(s omit-headerNs'do not include msgid "" entry in header(s output-file=R=sname of the output file(swidth=Ros"set output line width (default 76)(sno-wrapNsVdo not break long message lines, longer than the output line width, into several lines(s sort-outputNs&generate sorted output (default False)(s sort-by-fileNs,sort output by file location (default False)(smsgid-bugs-address=Nsset report address for msgid(scopyright-holder=Nsset copyright holder in output(sproject=Nsset project name in output(sversion=Nsset project version in output(s add-comments=Rpsuplace comment block with TAG (or those preceding keyword lines) in output file. Separate multiple TAGs with commas(,)(sstrip-commentsRs)strip the comment TAGs from the comments.(s input-paths=Nsofiles or directories that should be scanned for messages. Separate multiple files or directories with commas(,)(s input-dirs=Ns@alias for input-paths (does allow files as well as directories).(s add-commentsRq(s --keyword(s --mapping(s--output(s--strip-comment-tags(RrRsRt(R1R2RiRjR RkR5R3R4R6R7R'RHRJR(((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRlsr       C =cCs"t|tstdndS(sgValidate the ``message_extractors`` keyword argument to ``setup()``. :param dist: the distutils/setuptools ``Distribution`` object :param name: the name of the keyword argument (should always be "message_extractors") :param value: the value of the keyword argument :raise `DistutilsSetupError`: if the value is not valid sDthe value of the "message_extractors" parameter must be a dictionaryN(RRR(R/tnametvalue((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pytcheck_message_extractorss t init_catalogc BsSeZdZdZddddddd gZdgZdZdZdZ RS(!sNew catalog initialization 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 init_catalog setup( ... cmdclass = {'init_catalog': init_catalog} ) s(create a new catalog based on a POT filesdomain=R:s&domain of PO file (default 'messages')s input-file=R<sname of the input files output-dir=R;spath to output directorys output-file=R=sQname of the output file (default '//LC_MESSAGES/.po')slocale=R>s$locale for the new localized catalogswidth=Ros"set output line width (default 76)sno-wrapsVdo not break long message lines, longer than the output line width, into several linescCsCd|_d|_d|_d|_d|_t|_d|_dS(NRA( R t output_dirRERDRFRBR)R~R}(R.((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyR'3s      cCsn|jstdn|js0tdnytj|j|_Wntk rj}t|nX|j r|j rtdn|jst j j |j|jd|j d|_nt j j t j j|jst jt j j|jn|jr&|jr&tdn|j rF|j rFd|_n$|jdk rjt|j|_ndS(Nsyou must specify the input files-you must provide a locale for the new catalogs%you must specify the output directoryRKs.pos0'--no-wrap' and '--width' are mutually exclusiveiL(RDRRFRtparset_localeR RERRORPRQRBRStdirnametmakedirsR~R}R R(R.te((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRH<s*   ! c Cs|jjd|j|jt|jd}t|d|j}WdQX|j|_tj t |_ t |_ t|jd}t||d|jWdQXdS(Nscreating catalog %s based on %sRLRFRMR}(RRXRERDRURRFRRtnowRt revision_dateR)RYRR}(R.RbRcRh((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRJXs   (sdomain=R:s&domain of PO file (default 'messages')(s input-file=R<sname of the input file(s output-dir=R;spath to output directory(s output-file=R=sQname of the output file (default '//LC_MESSAGES/.po')(slocale=R>s$locale for the new localized catalog(swidth=Ros"set output line width (default 76)N(sno-wrapNsVdo not break long message lines, longer than the output line width, into several lines( R1R2RiRjR RkR5R'RHRJ(((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRs(    tupdate_catalogc BskeZdZdZd#d$d%d&d'd(d*d+d,d-d.g ZdddddgZd Zd!Zd"Z RS(/sCatalog 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 s'update message catalogs from a POT filesdomain=R:s&domain of PO file (default 'messages')s input-file=R<sname of the input files output-dir=R;s.path to base directory containing the catalogss output-file=R=sQname of the output file (default '//LC_MESSAGES/.po')slocale=R>s locale of the catalog to compileswidth=Ros"set output line width (default 76)sno-wrapsVdo not break long message lines, longer than the output line width, into several linessignore-obsolete=s1whether to omit obsolete messages from the outputsno-fuzzy-matchingtNsdo not use fuzzy matchingsupdate-header-commentsupdate target header commenttpreviouss+keep previous msgids of translated messagessignore-obsoletecCsgd|_d|_d|_d|_d|_d|_t|_t|_ t|_ t|_ t|_ dS(NRA( RBR RDRRERFR}R)R~tignore_obsoletetno_fuzzy_matchingtupdate_header_commentR(R.((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyR's          cCs|jstdn|j r;|j r;tdn|jr]|j r]tdn|jr~|jr~tdn|j r|j rd|_n$|jdk rt|j|_n|j r|j rt |_ ndS(Nsyou must specify the input files-you must specify the output file or directorysyou must specify the locales0'--no-wrap' and '--width' are mutually exclusiveiL( RDRRERRFR~R}R RRRR)(R.((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRHs  c Csg}|js|jrS|j|jtjj|j|jd|jdfqxtj|jD]S}tjj|j|d|jd}tjj |rf|j||fqfqfWn|j|j|jf|st dn|j}|s%tjj tjj |j d}nt|j d}t|}WdQXx`|D]X\}}|jjd||j t|d}t|d|d|}WdQX|j||jd |jtjjtjj|tjtjj |} yDt| d /} t| |d |jd |jd |jWdQXWntj| nXytj| |WqStk rtj|tj | |tj| qSXqSWdS(NRKs.posno message catalogs foundiRLsupdating catalog %s based on %sRFRBRRMRtinclude_previousR}(!RERFRNRORPRQRRBRRRSRtsplitexttbasenameRDRURRRXRRRRttempfilet gettempprefixRRRR}tremovetrenametOSErrortshutilR( R.R]RFR_RBRbttemplateRRcttmpnamettmpfile((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRJsZ    (        (sdomain=R:s&domain of PO file (default 'messages')(s input-file=R<sname of the input file(s output-dir=R;s.path to base directory containing the catalogs(s output-file=R=sQname of the output file (default '//LC_MESSAGES/.po')(slocale=R>s locale of the catalog to compile(swidth=Ros"set output line width (default 76)N(sno-wrapNsVdo not break long message lines, longer than the output line width, into several lines(signore-obsolete=Ns1whether to omit obsolete messages from the output(sno-fuzzy-matchingRsdo not use fuzzy matching(supdate-header-commentNsupdate target header comment(RNs+keep previous msgids of translated messages( R1R2RiRjR RkR5R'RHRJ(((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRjs8  tCommandLineInterfacecBseZdZdZdeZidd6dd6dd6d d 6Zied6ed6e d6e d 6Z dZ dd Zd Zd ZdZRS(sCommand-line interface. This class provides a simple command-line interface to the message extraction and PO file generation functionality. s%%prog %s [options] %ss %%prog %ss$compile message catalogs to MO filestcompiles:extract messages from source files and generate a POT filetextracts+create new message catalogs from a POT filetinits0update existing message catalogs from a POT fileRc Cs<|dkrtj}ntjd|jdd|j|_|jj|j |j_ |jj ddddd d d |jj d d dddddt j d d|jj dddddddt jd d|jjdtdt j|jj|d\}}|j|j|jrtj}tg|D]}t|^q>}|jd|d}x[|D]S}tj|}|||jf} t| jtj j!pt"pddqxWdS|s|jj#dn|d} | |j$kr|jj#d| n|j%| |d} | j&S(s{Main entry point of the command-line interface. :param argv: list of arguments passed on the command-line tusagetcommands[args]Rs--list-localestdestt list_localestactiont store_trueR,s print all known locales and exits-vs --verboset store_consttlogleveltconstsprint as much as possibles-qs--quietsprint as little as possibleiu %%-%ds %%stasciitreplaceisQno valid command or option passed. Try the -h/--help option for more information.sunknown command "%s"N(Rs[args]('R tsystargvtoptparset OptionParserRRtparsertdisable_interspersed_argst_helpt print_helpt add_optiontloggingtDEBUGtERRORt set_defaultsR)tINFOt parse_argst_configure_loggingRRRtlocale_identifierstmaxRWtsortRRt english_nametprinttencodetstdouttencodingRR[tcommandst_configure_commandRJ( R.RRtargst identifierst identifiertlongesttformatRFtoutputtcmdnametcmdinst((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRJsJ     %    cCstjd|_|jj||jjrA|jjd}ntj}|jj||j|tjd}|j|dS(Ntbabelis %(message)s( Rt getLoggerRtsetLevelthandlerst StreamHandlert addHandlert Formattert setFormatter(R.Rthandlert formatter((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRBs   cCst|jjtdtg|jD]}t|^q*}dtd|d}t|jj}x(|D] \}}t|||fqxWdS(Ns commands:s %%-%ds %%sii(RRt format_helpRRRWtsortedR(R.RRRRRRj((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRQs (c CsZ|j|}|}|jr.|j|_n|jtjd|j|dfd|j|}t|dd}x9|jD].\}}} |j d} t|| j dd} d| g} |r| j d |n| j |j j| d|jj| d} | |kr3|jd | 7_q| |jkr^|jd d d | | q| |jkr|jd dd | d| | q|jd | d| d| | qW|j|\}}|rt||j dd|nx0t|jD]\}}t|||qWy|jWn&tk rU}|jt|nX|S(sB :type cmdname: str :type argv: list[str] RRRjR3t=t-t_s--%ss-%ss<%s>RRR,RNtchoicestdefault((N(tcommand_classesRR'RRRRRRkRRRNR!R6tgetR7R R5RR4RtsetattrtvarsRtensure_finalizedRR[tstr(R.RRtcmdclassRRR3tlongtshortR,RRtstrsRRRtkeyRterr((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRZsD       "#N(R1R2RiRtVERSIONRRR9RlRRRR RRJRRR(((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRs$    3  cCstjtjS(N(RRJRR(((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pytmainsc Cs4i}g}i}t}t|j|_|j||x|jD]}|dkrtt|j|}qJg|jddD]}|j^q\}} |j | |ft|j||| >> 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` t extractorst:i( RRt _sectionstreadfptsectionsRRRRRNRT( RRR$RRRtsectiontpartRRR`((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRs$1  1  cCsi}x|D]}d|kr7|jd\}}n |d}}||kr |rg}xZ|jdD]I}|ddkr|jt|d dfql|jt|qlWt|}n|||>> 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)) R%RiRpN(RR RNRR(tstringsRqRVtfuncnametindicestindstx((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyRs      t__main__(ARit __future__RRRRORRRRRRFRRRR"RRt babel._compatRRRt babel.coreR tbabel.messages.catalogR tbabel.messages.extractR R R Rtbabel.messages.mofileRtbabel.messages.pofileRRt babel.utilRRt distutilsRR8t distutils.cmdRt_Commandtdistutils.errorsRRt ConfigParserRt ImportErrort configparserR R"R9RlRRRtobjectRR#RRR1(((s;/usr/lib/python2.7/site-packages/babel/messages/frontend.pyt sP       "  *) [  I