�
��Sc@s�ddlZddlZddlZddlZdZd
ZdZdZd�Z d�Z
d�Zd�Zd�Z
dejjfd��YZdS(i����Nll
ldl�l'l�l@Bl�1la�lJ5wld( gY@g��.Ag@�@cCs�|dkrdSd}x<�ttt��D](}|t|dkr)|d}Pq)q)W|dksm|dkr�tjjd|��n|S(Nilis%s value out of bounds(tNonetxrangetlent_powstdnst exceptiontSyntaxError(twhattdesctexpti((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyt_exponent_ofs
cCs�|dkrd}|d9}nd}tt|d��}t|d�}||d8}t|d�}||d8}t|d�}|t|d�8}t|�}|||||fS(Nii����ii��6i`�i�(tlongtroundtint(Rtsigntdegreestminutestseconds((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyt_float_to_tuple*s
cCs�|ddkr-d}t|d�d}nd}t|d�}|t|d�d7}|t|d�d7}|t|d�d7}||S( Nii����igN@ig �@ig@wKA(tfloat(RRtvalue((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyt_tuple_to_float:scCsBt|�}t||�d@}|td|�d@}|d|S(Nii
i(RRtpow(RRtexponenttbase((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyt_encode_sizeFscCsy|d@}|dkr/tjjd|��n|d@d?}|dkrbtjjd|��nt|�td|�S(Nii sbad %s exponenti�isbad %s basei
(RRRRR(RRRR((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyt_decode_sizeLs
tLOCcBs�eZdZddddddgZeeed�Zde d�Z
de d �Zee�Zddd
�Z
dd�Zee�Zd�Zd
�Zd�Zeeedd�Zd�Zd�Zeeedd�ZRS(s}LOC record
@ivar latitude: latitude
@type latitude: (int, int, int, int) tuple specifying the degrees, minutes,
seconds, and milliseconds of the coordinate.
@ivar longitude: longitude
@type longitude: (int, int, int, int) tuple specifying the degrees,
minutes, seconds, and milliseconds of the coordinate.
@ivar altitude: altitude
@type altitude: float
@ivar size: size of the sphere
@type size: float
@ivar horizontal_precision: horizontal precision
@type horizontal_precision: float
@ivar vertical_precision: vertical precision
@type vertical_precision: float
@see: RFC 1876tlatitudet longitudetaltitudetsizethorizontal_precisiontvertical_precisionc Cstt|�j||�t|t�s7t|t�rFt|�}nt|t�rdt|�}n||_t|t�s�t|t�r�t|�}nt|t�r�t|�}n||_ t|�|_
t|�|_t|�|_t|�|_
dS(s�Initialize a LOC record instance.
The parameters I{latitude} and I{longitude} may be either a 4-tuple
of integers specifying (degrees, minutes, seconds, milliseconds),
or they may be floating point values specifying the number of
degrees. The other parameters are floats. Size, horizontal precision,
and vertical precision are specified in centimeters.N(tsuperRt__init__t
isinstanceRRRRRRRR R!R"( tselftrdclasstrdtypeRRRR thprectvprec((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyR$ks
c
Ks<|jddkr)d}|jd}nd}d|jd}|jddkrid}|jd}nd}d|jd}d||jd|jd |jd
|||jd|jd |jd
||jdf}|jtks |jtks |jtkr8|d|jd|jd|jdf7}n|S(
NitNtSi����tEtWs(%d %d %d.%03d %s %d %d %d.%03d %s %0.2fmiiigY@s %0.2fm %0.2fm %0.2fm( RRRR t
_default_sizeR!t_default_hprecR"t_default_vprec( R&torigint
relativizetkwtlat_hemispheretlat_degreestlong_hemispheretlong_degreesttext((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pytto_text�s*!c
Cs-ddddg}ddddg}t}t} t}
|j�|d<|j�}|j�r�t|�|d<|j�}d|kr�|jd�\}}
|j�s�tj j
d��nt|�|d<|ddkr�tj j
d��nt|
�}|dks"|dks"|
j�r7tj j
d ��n|dkrLd
}n|dkrad}nd}|t|
�|d<|j�}q�|j�r�t|�|d<|j�}q�n|dkr�|dcd
9= 60isbad latitude milliseconds valueidi
R,i����R+sbad latitude hemisphere valuesbad longitude seconds valueslongitude seconds >= 60s bad longitude milliseconds valueR.R-sbad longitude hemisphere valuetmgY@(R/R0R1tget_intt
get_stringtisdigitRtsplitRRRRRtgettunescapet
is_eol_or_eofRtget_eol(tclsR'R(ttokR2R3RRR R)R*ttRtmillisecondstlR<�RttokenR((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyt from_text�s�% % c Cs�|jddkr3d}td|jd�}nd}t|jd�}|d|jdd|jdd|jd|}d |}|jddkr�d}td|jd�}nd}t|jd�}|d|jdd|jdd|jd|}d |}t|j�d
} t|jd�}
t|jd�}t|jd
�}tj dd|
||||| �}
|j
|
�dS(Nii����ii��6i`�ii�ill�1R shorizontal precisionsvertical precisions!BBBBIII(RRRRRR R!R"tstructtpacktwrite(R&tfiletcompressR2RRRHRRRR R)R*twire((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pytto_wires.%
%
cCs^tjd||||!�\}}} }
}}}
|dkrUt|d�d}ndtd|�d}|dks�|dkr�tjjd��n|dkr�t|d�d}ndtd|�d}|dks�|d krtjjd
��nt|
�d}
t|d�}t| d
�} t|
d�}
||||||
|| |
�S(Ns!BBBBIIIli��6i����g�V�g�V@sbad latitudeg�f�g�f@s
bad longitudeg�cAR shorizontal precisionsvertical precision(RLtunpackRRRt FormErrorR(RER'R(RQtcurrenttrdlenR2tversionR R)R*RRR((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyt from_wire$s"2cCsltj�}|j|�|j�}|jd�|j�|j|�|j�}|j�t||�S(Ni(t cStringIOtStringIORRtgetvaluetseekttruncatetclosetcmp(R&tothertftwire1twire2((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyt_cmp<s
cCs
t|j�S(N(RR(R&((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyt_get_float_latitudeHscCst|�|_dS(N(RR(R&R((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyt_set_float_latitudeKstdocs"latitude as a floating point valuecCs
t|j�S(N(RR(R&((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyt_get_float_longitudeQscCst|�|_dS(N(RR(R&R((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyt_set_float_longitudeTss#longitude as a floating point valueN(t__name__t
__module__t__doc__t __slots__R/R0R1R$RtTrueR:RKtclassmethodRRRXRdReRftpropertytfloat_latitudeRhRitfloat_longitude(((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyRUs&a (ll
ldl�l'l�l@Bl�1la�lJ5wld( (RYRLt
dns.exceptionRt dns.rdataRR/R0R1RRRRRtrdatatRdataR(((s9/usr/lib64/python2.7/site-packages/dns/rdtypes/ANY/LOC.pyts