-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/hgext/zeroconf/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pyc


l\c@sZdZddlZddlZddlZddlZddlmZmZmZm	Z	ddlm
Z
ddlmZ
dZdadadZdZd	Zd
efdYZdZded
ZedZdZdZe
je	dee
jejdee
jejdee
jedee
je
dedS(sdiscover and advertise repositories on the local network

The zeroconf extension will advertise :hg:`serve` instances over
DNS-SD so that they can be discovered using the :hg:`paths` command
without knowing the server's address.

To allow other people to discover your repository using run
:hg:`serve` in your repository::

  $ cd test
  $ hg serve

You can discover Zeroconf-enabled repositories by running
:hg:`paths`::

  $ hg paths
  zc-test = http://example.com:8000/test
iN(tuithgtencodingtdispatch(t
extensions(tservertinternalcCsy=tjtjtj}|jd|jd}|SWntjk
rSnXyAtjtjdd}|jdrd|kr|SWn#tj	tj
fk
rd}nXy=tjtjtj}|jd	|jd}|SWntjk
rnX|S(
Ns1.0.0.1iis127.t:s	127.0.0.1i(s1.0.0.1i(s1.0.0.1i(tsockettAF_INETt
SOCK_DGRAMtconnecttgetsocknameterrort
gethostbyaddrtgethostnamet
startswithtgaierrortherror(tstiptdumbip((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pytgetip)s*


cCs,tsCt}|jdr"dStj|atj|antjjdd}|d}d||f}tj	d|dd|d	|d
i|d6d|d
6dtdddd}tj
|tj	d|dd|d	|d
i|d6d|d
6dtdddd}tj
|dS(Ns127.t.is.locals%s-%ss_http._tcp.local.s._http._tcp.local.Rtportt
propertiestdescriptiont/tpathtaddresstweighttprioritys_hg._tcp.local.s._hg._tcp.local.(RRRRt	inet_atontlocaliptZeroconfRtsplittServiceInfotregisterService(tnametdescRRRthostnamethosttsvc((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pytpublishFs2	
	


	

cCsg|||}|j}y
|j}Wntk
r|jpStjj|jj}|jj	j
dddjd}|jj	j
dd|}t||||nX|j	j
dddjdd}	x|D]\}
}|j	j
}|jtjj|ddtjj|
}|	|
jd}|j
dd|}t||||qW|S(NtwebtprefixtRRs.hgthgrc(RtrepostAttributeErrortreponametosRtbasenametrepotrootRtconfigtstripR+tcopyt
readconfigtjoin(t
create_serverRtappthttpdRR0R&RR'R-R5tu((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pytzc_create_serverhs$	

!$%tlistenercBs#eZdZdZdZRS(cCs
i|_dS(N(tfound(tself((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pyt__init__scCs,t||jkr(|jt|=ndS(N(treprRB(RCRttypeR&((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pyt
removeServicescCs#|j|||jt|<dS(N(tgetServiceInfoRBRE(RCRRFR&((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pyt
addServices(t__name__t
__module__RDRGRI(((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pyRAs		ccst}|jdrdStj|}t}tj|d|tjd|jxp|jj	D]_}|j
|j
jd }dtj
|j|j|jjddf}d||fVqnWdS(	Ns127.s_hg._tcp.local.iRshttp://%s:%s%sRRszc-(RRR"RAtServiceBrowserttimetsleeptcloseRBtvaluesR&tindexRt	inet_ntoaRRRtget(RRtltvalueR&turl((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pyt
getzcpathss		

cCs^|dkrH|jdrHx*tD]\}}||kr%|Sq%Wn||||||S(Ntpathsszc-(RRW(torigRCtsectiontkeytdefaultt	untrustedR&R((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pyR7s
cCs2||||}|dkr.|t7}n|S(NRX(RW(RYRCRZR]R0((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pytconfigitemsscCs@x3tD](\}}||kr
|jtjSq
W||S(N(RWtencodeR(RYtsourceR&R((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pytdefaultdestscCs2z|||||SWdtr-tjnXdS(N(RRO(RYRtoptionstcmdtcmdfunc((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pytcleanupafterdispatchst_runcommandR7R^RaR<(t__doc__RRMR3R"t	mercurialRRRRRtmercurial.hgwebRt	servermodt
testedwithtNoneR!RR+R@tobjectRARWtFalseR7R^RaRetwrapfunction(((s;/usr/lib/python2.7/dist-packages/hgext/zeroconf/__init__.pyt<module>s,$"		"					


Copyright © 2017 || Recoded By Mr.Bumblebee