-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyc

ó
î:ïNc@@sdZddlmZddlZddlZddlmZmZm	Z	m
Z
mZmZddl
mZmZddlmZd„Zd„Zd	„Zd
efd„ƒYZdefd
„ƒYZd„Zd„Zd„Zd„Zdd„Zd„Zd„Zde d„Z!dS(s‡Extract docstrings from Bazaar commands.

This module only handles bzrlib objects that use strings not directly wrapped
by a gettext() call. To generate a complete translation template file, this
output needs to be combined with that of xgettext or a similar command for
extracting those strings, as is done in the bzr Makefile. Sorting the output
is also left to that stage of the process.
i(tabsolute_importN(tcommandsterrorsthelp_topicstoptiontpluginthelp(tmuttertnote(tgettextcC@sF|jddƒjddƒjddƒjddƒjd	d
ƒ}|S(Ns\s\\s
s\ns
s\rs	s\tt"s\"(treplace(ts((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt_escape1scC@sŽ|jdƒ}t|ƒdkr8dt|ƒd}nR|ds^|d=|dd|d<ntt|ƒ}d}d|j|ƒd}|S(Ns
iR
iÿÿÿÿs\n"
"s""
"(tsplittlenR
tmaptjoin(Rtlinestlineterm((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt
_normalize:s
cC@sŸddl}i}i}xz|j|j|ƒƒD]`}t||jƒr\|j||j<q1t||jƒr1|j|jj	dƒ||j<q1q1W||fS(s4Get object to lineno mappings from given source_textiNs
(
tasttwalktparset
isinstancetClassDeftlinenotnametStrRtcount(tsource_textRt
cls_to_linenot
str_to_linenotnode((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt
_parse_sourceJs't_ModuleContextcB@s>eZdZddd„Zed„ƒZd„Zd„ZRS(s+Record of the location within a source treeicC@s7||_||_|dk	r3|\|_|_ndS(N(tpathRtNonet_cls_to_linenot_str_to_lineno(tselfR$Rt_source_info((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt__init__`s		cC@sMtj|ƒ}tjj|ƒ}||dtdjtj|ƒdƒƒƒS(s?Get new context from module object and parse source for linenosR)ti(tinspectt
getsourcefiletosR$trelpathR"Rt
findsource(tclstmodulet
sourcepathR/((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pytfrom_modulefs	cC@sdy|j|j}Wn+ttfk
rAtd||jƒ|SX|j|j||j|jfƒS(s?Get new context with same details but lineno of class in sources Definition of %r not found in %r(R&t__name__tAttributeErrortKeyErrorRR$t	__class__R'(R(R1R((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt
from_classoscC@sey|j|}Wn/ttfk
rBtd|d |jƒ|SX|j|j||j|jfƒS(s@Get new context with same details but lineno of string in sourcesString %r not found in %ri(R'R6R7RR$R8R&(R(tstringR((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pytfrom_stringysN(	R5t
__module__t__doc__R%R*tclassmethodR4R9R;(((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyR#]s
		
t_PotExportercB@sGeZdZed„Zdd„Zdd„Zdd„Zd„Z	RS(s:Write message details to output stream in .pot file formatcC@s4||_|rd|_ntƒ|_i|_dS(N(toutfR%t_msgidstsett_module_contexts(R(R@tinclude_duplicates((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyR*‡s
	cC@s£|jdk	r5||jkr"dS|jj|ƒn|dkrJd}n
d|}td|d ||ƒ|jjdjd|d|d|d	t|ƒƒƒdS(
NR+s# %s
s!Exporting msg %r at line %d in %ris3#: {path}:{lineno}
{comment}msgid {msg}
msgstr ""

R$Rtcommenttmsg(RAR%taddRR@twritetformatR(R(R$RRRE((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pytpoentrys	
		cC@s/|j|ƒ}|j|j|j||ƒdS(N(R;RJR$R(R(tcontextR:RE((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pytpoentry_in_context¡scC@sl|jdƒ}|dk	r-t||ƒ}nx8|D]0}|j|||ƒ||jdƒd7}q4WdS(Ns

s
i(RR%tfilterRJR(R(R$Rtmsgidtincludet
paragraphstp((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pytpoentry_per_paragraph¥s
cC@s{tj|ƒ}y|j|j}Wn0tk
rUtj|ƒ}||j|j<nXtj|ƒrw|j|ƒ}n|S(N(	R,t	getmoduleRCR5R7R#R4tisclassR9(R(tobjR2RK((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pytget_context®s
N(
R5R<R=tFalseR*R%RJRLRRRV(((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyR?„s	c	C@sêt|dtƒrdS|j}t|ddƒr\|j||jdjd|d|ƒƒnx‡|jƒD]y\}}}}||kr´|j|ƒrœqindj	||gƒ}n|ri|j||djd|d|ƒƒqiqiWdS(Nthiddenttitlestitle of {name!r} {what}Rtwhatt=shelp of {name!r} {what}(
tgetattrRWRR%RLRYRIt
iter_switchest	is_hiddenR(texporterRKtoptRtoptnameRt_thelptxt((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt
_write_optionºs	cC@sbtjj}|jtƒ}x@t|jƒƒD],}||}t||j|ƒ|dƒq.WdS(NR(RtOptiontOPTIONSRVtsortedtkeysRdR;(R_RfRKRR`((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt_standard_optionsËs

cC@sRdj|jƒƒ}x6|jD]+}t|tƒst||||ƒqqWdS(Nsoption of {0!r} command(RIRt
takes_optionsRtstrRd(R_RKtcmdRR`((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt_command_optionsÓscC@sr|j|jƒ}|j}|j|ƒ}tj|ƒ}d„}|j|j|j||ƒt	|||ƒdS(NcS@s|jƒddkrtSdS(Nis:Usage:(t
splitlinestTrue(RQ((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt
exclude_usageás(
RVR8R=R;R,tcleandocRRR$RRm(R_RlRKtrawdoctdcontexttdocRp((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt_write_command_helpÛs		cC@szddlm}xgtjƒD]Y}tj|tƒ}|jrDqn|dk	rVqnttdƒ|ƒt	||ƒqWt
jƒ}||dƒ}g|D]$}tj
jtj
j|ƒƒ^q}x¬tjƒD]ž}tj|tƒ}|jrûqÔn|dk	r|jƒ|krqÔn|dkrC|jƒ|krCqÔnttdƒj||jƒƒƒt	||ƒqÔWdS(s©Extract docstrings from path.

    This respects the Bazaar cmdtable/table convention and will
    only extract docstrings from functions mentioned in these tables.
    i(tglobs+Exporting messages from builtin command: %ss/*/__init__.pys2Exporting messages from plugin command: {0} in {1}N(Rvt
_mod_commandstbuiltin_command_namestget_cmd_objectRWRXR%RR	RuRtget_core_plugin_pathR.R$tbasenametdirnametplugin_command_namestplugin_nameRI(R_R~Rvtcmd_nametcommandtplugin_pathtcore_pluginsRQ((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt_command_helpsìs0	.	cC@sË|jtƒ}tj}x¬ttƒD]ž}tt|ƒ}tj|ƒsOq%nt||ƒsdq%n||krvq%n|jr…q%nt|ddƒ}|r%t
tdƒ|ƒ|j||ƒq%q%WdS(s&Extract fmt string from bzrlib.errors.t_fmts Exporting message from error: %sN(
RVRtBzrErrortdirR\R,RTt
issubclasstinternal_errorR%RR	RL(R_RKt
base_klassRtklasstfmt((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt_error_messagess 		cC@sÉtj}x¹|jƒD]«}|j|ƒ}t|tƒrX|jd|dd|ƒn0t|ƒrˆ|jd|dd||ƒƒn|j|ƒ}|dk	r|j
d|dd|ƒqqWdS(Nsdummy/help_topics/s/detail.txtisen/help_topics/s.txts/summary.txt(Rttopic_registryRhtgetRRkRRtcallabletget_summaryR%RJ(R_RtkeyRttsummary((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt_help_topics(s	
cC@sWt||ƒ}|dkrFt|ƒt|ƒt|ƒt|ƒn
t||ƒdS(N(R?R%RiRƒRŒR“(R@RRDR_((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt
export_pot:s



("R=t
__future__RR,R.tbzrlibRRwRRRRRtbzrlib.traceRRtbzrlib.i18nR	R
RR"tobjectR#R?RdRiRmRuR%RƒRŒR“RWR”(((s5/usr/lib/python2.7/dist-packages/bzrlib/export_pot.pyt<module>s&.				'6				(		

Copyright © 2017 || Recoded By Mr.Bumblebee