-=[ Mr. Bumblebee ]=-
_Indonesia_

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

σ
ΈρNc@@sΥdZddlmZddlmZmZddlmZeeƒdƒej	dddd	d
ƒZ
ejdddd	d
ƒZej	dddd	dƒZ
ej	dddd	dƒZdejfd„ƒYZdS(s Merge logic for po_merge plugin.i(tabsolute_import(tconfigtmerge(tlazy_imports~
import fnmatch
import subprocess
import tempfile
import sys

from bzrlib import (
    cmdline,
    osutils,
    trace,
    )
spo_merge.commandtdefaults<msgmerge -N "{other}" "{pot_file}" -C "{this}" -o "{result}"thelpsCommand used to create a conflict-free .po file during merge.

The following parameters are provided by the hook:
``this`` is the ``.po`` file content before the merge in the current branch,
``other`` is the ``.po`` file content in the branch merged from,
``pot_file`` is the path to the ``.pot`` file corresponding to the ``.po``
file being merged.
``result`` is the path where ``msgmerge`` will output its result. The hook will
use the content of this file to produce the resulting ``.po`` file.

All paths are absolute.
spo_merge.po_dirsspo,debian/pos;List of dirs containing .po files that the hook applies to.spo_merge.po_globs*.pos?Glob matching all ``.po`` files in one of ``po_merge.po_dirs``.spo_merge.pot_globs*.pots?Glob matching the ``.pot`` file in one of ``po_merge.po_dirs``.tPoMergercB@s;eZdZd„Zd„Zd„Zd„Zd„ZRS(sMerge .po files.cC@sŸttj|ƒj|ƒ|jjƒ|_|jjdƒ|_|jjdƒ|_	|jjdƒ|_
|jjddtƒ|_d|_tjdƒdS(Nspo_merge.po_dirsspo_merge.po_globspo_merge.pot_globspo_merge.commandtexpandsPoMerger created(tsuperRt
PerFileMergert__init__tthis_branchtget_config_stacktconftgettpo_dirstpo_globtpot_globtFalsetcommandtNonetpot_file_abspathttracetmutter(tselftmerger((sD/usr/lib/python2.7/dist-packages/bzrlib/plugins/po_merge/po_merge.pyR
Ms	c	C@sd|js|jrtSd	}|j||jjƒ}xt|jD]H}tj||j	ƒ}t
j
||ƒr@tjd||fƒPq@q@Wtjd|j|j	fƒtSx°|jjj
d|dtƒD]Œ}tjd|fƒ|d|d}}t
j
||jƒrΜtj||ƒ}|jjj|ƒ|_tjd||jfƒtSqΜWtSd	S(
s<Return True if merge_matching should be called on this file.spo %s matches: %ss$PoMerger did not match for %s and %stfrom_dirt	recursives
inv_entry: %riiswill msgmerge %s using %sN(RRRRtget_filepathRt	this_treetosutilstpathjoinRtfnmatchRRt
list_filesRtabspathRtTrue(	Rtparamstpo_dirtpo_pathtglobt	inv_entrytpot_nametpot_file_idtrelpath((sD/usr/lib/python2.7/dist-packages/bzrlib/plugins/po_merge/po_merge.pytfile_matches`s.	
	cC@sitjd|fƒtjtj|ƒdtjdtjdtjƒ}|jƒ\}}|j||fS(NsWill msgmerge: %ststdouttstderrtstdin(	RRt
subprocesstPopentcmdlinetsplittPIPEtcommunicatet
returncode(RRtproctoutterr((sD/usr/lib/python2.7/dist-packages/bzrlib/plugins/po_merge/po_merge.pyt_invoke…s		cC@s
|j|ƒS(N(t
merge_text(RR$((sD/usr/lib/python2.7/dist-packages/bzrlib/plugins/po_merge/po_merge.pytmerge_matchingsc		C@sFtjddƒ}i}tj|dƒ|d<tj|dƒ|d<tj|dƒ|d<|j|d<zΔtj|ddƒ}|j|jƒWdQXtj|ddƒ}|j|jƒWdQX|j	j
|j|ƒ}|j|ƒ\}}}tj|dƒ}d	t
|jƒƒfSWdQXWdtj|ƒXd
gfS(srCalls msgmerge when .po files conflict.

        This requires a valid .pot file to reconcile both sides.
        tprefixtpo_mergetthistothertresulttpot_filetwbNtsuccesssnot applicable(ttempfiletmkdtempRRRt	open_filet
writelinest
this_linestother_linesR
texpand_optionsRR:tlistt	readlinestrmtree(	RR$ttmpdirtenvtfRtretcodeR8R9((sD/usr/lib/python2.7/dist-packages/bzrlib/plugins/po_merge/po_merge.pyR;’s"
 (t__name__t
__module__t__doc__R
R,R:R<R;(((sD/usr/lib/python2.7/dist-packages/bzrlib/plugins/po_merge/po_merge.pyRJs		%	
	N(RUt
__future__RtbzrlibRRtbzrlib.lazy_importRtglobalstOptiontcommand_optiont
ListOptiontpo_dirs_optiontpo_glob_optiontpot_glob_optionR	R(((sD/usr/lib/python2.7/dist-packages/bzrlib/plugins/po_merge/po_merge.pyt<module>s&	
				

Copyright © 2017 || Recoded By Mr.Bumblebee