Ë
    ¾×f1%  ã                   óæ   — d dl m Z d dlmZ d dlmZmZmZ d dlm	Z	m
Z
mZ d dlmZ d dlmZ d dlmZ d dlmZ d	Zd
Z ee«      j,                   ee«      j,                  ddgZddgZ G d„ de	«      Zy)é    )Úgettext)Ú	Launchpad)ÚNotFoundÚ
BadRequestÚUnauthorized)ÚShortcutHandlerÚShortcutExceptionÚInvalidShortcutException)ÚSourcesListShortcutHandler)ÚURIShortcutHandler)ÚDeb822SourceEntry)Úurlparsez5https://ppa.launchpadcontent.net/{team}/{ppa}/ubuntu/z=https://private-ppa.launchpadcontent.net/{team}/{ppa}/ubuntu/zppa.launchpad.netzprivate-ppa.launchpad.netÚmainú
main/debugc                   ó´   ‡ — e Zd Zdˆ fd„	Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Z	ed„ «       Z
dˆ fd„	Zˆ fd	„Zd
„ Zd„ Zd„ Zd„ Zd„ Zˆ xZS )ÚPPAShortcutHandlerc                 óÖ  •— t        t        | �
  |fddi|¤Ž | | _        d | _        d | _        d | _        d | _        d| _        | j                  |«      sKd| _
        t        | j                  |«      | j                  |«      f«      st        d«      |z  }t        |«      ‚| j                   ›d| j"                  ›�| _        | j'                  «        | j                  r	 | j(                   | j,                  sÕ| j.                  }|s$dg}| j(                  j0                  rt3        d«       | j(                  j4                  rt6        nt8        }|j;                  | j                   | j"                  ¬	«      }t=        d d
«      }| j>                  g|_         |g|_!        | jD                  g|_#        ||_$        | jK                  tM        |«      «       y y # t*        $ r t        t        d«      «      ‚w xY w)NÚdeb822TFz%ERROR: '%s' is not a valid ppa formatz-ubuntu-zERROR: Can't find ppar   zDPPA publishes dbgsym, you may need to include 'main/debug' component)ÚteamÚppaÚ )'Úsuperr   Ú__init__Ú_lp_anonÚ_signing_key_dataÚ_lpÚ_lpteamÚ_lpppaÚ_is_sourceslistÚ
_match_ppar   ÚanyÚ
_match_uriÚ_match_sourceslistÚ_r
   ÚteamnameÚppanameÚ	_filebaseÚ	_set_authÚlpppar	   Ú_source_entryÚ
componentsÚpublish_debug_symbolsÚprintÚprivateÚPRIVATE_PPA_URI_FORMATÚPPA_URI_FORMATÚformatr   Úbinary_typeÚtypesÚurisÚdistÚsuitesÚcompsÚ_set_source_entryÚstr)
ÚselfÚshortcutÚloginÚkwargsÚmsgr7   Ú
uri_formatÚuriÚentryÚ	__class__s
            €ú8/usr/lib/python3/dist-packages/softwareproperties/ppa.pyr   zPPAShortcutHandler.__init__4   s´  ø€ ÜÔ  $Ñ0°ÑQÀ$ÐQÈ&ÒQØ!˜	ˆŒØ!%ˆÔàˆŒØˆŒØˆŒà$ˆÔð �‰˜xÔ(ð  ˆDŒKä˜Ÿ™¨Ó1Ø×/Ñ/°Ó9ð;ô <äÐ@ÓAÀHÑL�Ü.¨sÓ3Ð3à+/¯=«=¸$¿,º,ÐGˆŒØ�‰Ôð ×ÒðKØ—
’
ð ×!Ò!Ø—O‘OˆEÙØ˜�Ø—:‘:×3Ò3ÜÐ`Ôað 48·:±:×3EÒ3EÕ/Ì>ˆJØ×#Ñ#¨¯©¸D¿L¹LÐ#ÓIˆCä% d¨BÓ/ˆEØ×+Ñ+Ð,ˆEŒKØ˜ˆEŒJØ ŸI™I˜;ˆEŒLØˆEŒKà×"Ñ"¤3 u£:Õ.ð# "øô %ò KÜ.¬qÐ1HÓ/IÓJÐJðKús   ÃG
 Ç
G(c                 óò   — | j                   s`| j                  rt        j                  }nt        j                  } || j
                  ›d| j                  j                  ›�dd¬«      | _         | j                   S )Nú.Ú
productionÚdevel)Úservice_rootÚversion)r   r   r   Úlogin_anonymouslyÚ
login_withÚ
__module__rB   Ú__name__)r:   Ú
login_funcs     rC   ÚlpzPPAShortcutHandler.lph   sX   € à�xŠxØ�}Š}Ü&×8Ñ8‘
ä&×1Ñ1�
Ù!¨T¯_«_¸d¿n¹n×>UÒ>UÐ"VØ/;Ø*1ô3ˆDŒHð �x‰xˆó    c                 óV  — | j                   s7	 | j                  j                  | j                  «      | _         | j                   S | j                   S # t        $ r$ t        d«      | j                  z  }t        |«      ‚t        $ r$ t        d«      | j                  z  }t        |«      ‚w xY w)Nz8ERROR: user/team '%s' not found (use --login if private)z"ERROR: invalid user/team name '%s')r   rO   Úpeopler%   r   r$   r	   r   ©r:   r>   s     rC   ÚlpteamzPPAShortcutHandler.lpteamt   s•   € à�|Š|ð-Ø#Ÿw™wŸ~™~¨d¯m©mÓ<�”ð �|‰|Ðˆt�|‰|Ðøô ò -ÜÐSÓTÐW[×WdÑWdÑd�Ü'¨Ó,Ð,Üò -ÜÐ=Ó>ÀÇÁÑN�Ü'¨Ó,Ð,ð-ús   Ž*A ÁAB(c                 óp  — | j                   s8	 | j                  j                  | j                  ¬«      | _         | j                   S | j                   S # t        $ r0 t        d«      | j                  | j                  fz  }t        |«      ‚t        $ r$ t        d«      | j                  z  }t        |«      ‚w xY w)N)Únamez5ERROR: ppa '%s/%s' not found (use --login if private)zERROR: invalid ppa name '%s')	r   rT   ÚgetPPAByNamer&   r   r$   r%   r	   r   rS   s     rC   r)   zPPAShortcutHandler.lpppa�   s£   € à�{Š{ð-Ø"Ÿk™k×6Ñ6¸D¿L¹LÐ6ÓI�”ð �{‰{Ðˆt�{‰{Ðøô ò -ÜÐPÓQØŸ™ t§|¡|Ð4ñ5�ä'¨Ó,Ð,Üò -ÜÐ7Ó8¸4¿<¹<ÑG�Ü'¨Ó,Ð,ð-ús   Ž+A ÁA$B5c                 ó.   — | j                   j                  S ©N)r)   Údescription©r:   s    rC   rZ   zPPAShortcutHandler.description�   s   € à�z‰z×%Ñ%Ð%rP   c                 ó.   — | j                   j                  S rY   )r)   Úweb_linkr[   s    rC   r]   zPPAShortcutHandler.web_link“   s   € à�z‰z×"Ñ"Ð"rP   c                 ó˜  — | j                   s³| j                  j                  «       }| j                  j                  }|st	        t        d«      «       ned|v rt	        t        d«      «       nL|| j                  |«      vr9t        d«      |dj                  | j                  |«      «      fz  }t        |«      ‚|| _         | j                   S )NzHWarning: could not get PPA signing_key_fingerprint from LP, using anywayÚredactedzAPrivate PPA fingerprint redacted, using key anyway (LP: #1879781)z6Fingerprints do not match, not importing: '%s' != '%s'ú,)	r   r)   ÚgetSigningKeyDataÚsigning_key_fingerprintr-   r$   ÚfingerprintsÚjoinr	   )r:   ÚkeyÚfingerprintr>   s       rC   Útrustedparts_contentz'PPAShortcutHandler.trustedparts_content—   s²   € à×%Ò%Ø—*‘*×.Ñ.Ó0ˆCØŸ*™*×<Ñ<ˆKáÜ”aÐbÓcÕdØ˜{Ñ*Ü”aÐ[Ó\Õ]Ø  D×$5Ñ$5°cÓ$:Ñ:ÜÐQÓRØ# S§X¡X¨d×.?Ñ.?ÀÓ.DÓ%EÐFñG�ä'¨Ó,Ð,à%(ˆDÔ"Ø×%Ñ%Ð%rP   c                 óÊ   •— t         t        | �  |¬«      }|| j                  k7  s| j                  r|S t        t        |j                  «      t        dg«      z
  «      |_        |S )N)Úpkgtyper   )r   r   ÚSourceEntryÚsource_typer+   ÚlistÚsetr7   )r:   ri   rA   rB   s      €rC   rj   zPPAShortcutHandler.SourceEntry©   sY   ø€ ÜÔ(¨$Ñ;ÀGÐ;ÓLˆØ�d×&Ñ&Ò&¨$¯/ª/ØˆLô
 œ3˜uŸ{™{Ó+¬c°<°.Ó.AÑAÓBˆŒØˆrP   c                 óä   •— t         t        | �  |«       t        | j	                  «       j
                  «      t        t        «      z
  }|r't        t        d«      dj                  |«      z  «       y y )Nz*Warning: components '%s' not valid for PPAú )
r   r   r8   rm   rj   r7   ÚPPA_VALID_COMPSr-   r$   rd   )r:   ÚlineÚinvalid_compsrB   s      €rC   r8   z$PPAShortcutHandler._set_source_entry´   sZ   ø€ ÜÔ  $Ñ9¸$Ô?ä˜D×,Ñ,Ó.×4Ñ4Ó5¼¼OÓ8LÑLˆÙÜ”!Ð@ÓAÀCÇHÁHÈ]ÓD[Ñ[Õ\ð rP   c                 ó*  — |j                  d«      \  }}}|j                  «       dk(  sy|j                  d«      \  }}}|j                  d«      }d|v r.|j                  d«      \  }}}|j                  «       dk7  ryd|v ry|| _        |xs d| _        y)Nú:r   Fú/ú~ÚubuntuT)Ú
rpartitionÚlowerÚ	partitionÚlstripr%   r&   )r:   r;   Úprefixr$   r   r%   r&   rw   s           rC   r    zPPAShortcutHandler._match_ppa»   sœ   € Ø#×.Ñ.¨sÓ3Ñˆ��CØ�|‰|‹~ Ò&Øà!$§¡¨sÓ!3Ñˆ�1�gØ—?‘? 3Ó'ˆØ�'‰>Ø#*×#4Ñ#4°SÓ#9Ñ ˆV�Q˜Ø�|‰|‹~ Ò)àØ�g‰~àà ˆŒØÒ' %ˆŒØrP   c                 óV   — 	 | j                  t        |«      «      S # t        $ r Y yw xY w)NF)Ú_match_handlerr   r
   )r:   r;   s     rC   r"   zPPAShortcutHandler._match_uriÏ   s0   € ð	Ø×&Ñ&Ô'9¸(Ó'CÓDÐDøÜ'ò 	Ùð	ús   ‚ œ	(§(c                 óh   — 	 | j                  t        |«      «      }d| _        |S # t        $ r Y yw xY w)NFT)r~   r   r
   r   )r:   r;   Úhandlers      rC   r#   z%PPAShortcutHandler._match_sourceslistÕ   s@   € ð	Ø×)Ñ)Ô*DÀXÓ*NÓOˆGð  $ˆÔØˆøô (ò 	Ùð	ús   ‚% ¥	1°1c                 ó¼  — t        |j                  «       j                  «      }|j                  t        vry|j
                  j                  «       j                  d«      j                  d«      }t        |«      dk  ry|d   | _	        |d   | _
        |j                  | _        |j                  | _        | j                  |j                  «       j                   «       y)NFru   é   r   é   T)r   rj   r@   ÚhostnameÚPPA_VALID_HOSTNAMESÚpathÚstripÚsplitÚlenr%   r&   ÚusernameÚ	_usernameÚpasswordÚ	_passwordr8   rq   )r:   r€   Úparsedr†   s       rC   r~   z!PPAShortcutHandler._match_handlerÝ   s±   € Ü˜'×-Ñ-Ó/×3Ñ3Ó4ˆØ�‰Ô"5Ñ5Øà�{‰{× Ñ Ó"×(Ñ(¨Ó-×3Ñ3°CÓ8ˆÜˆt‹9�qŠ=ØØ˜Q™ˆŒØ˜A‘wˆŒà ×)Ñ)ˆŒØ ×)Ñ)ˆŒà×Ñ˜w×2Ñ2Ó4×9Ñ9Ô:ØrP   c                 óú  — | j                   s| j                  j                  sy | j                  r| j                  ry 	 | j
                  j                  | j
                  j                  j                  «      }|j                  | j                  ¬«      }t        |«      }|j                  | _        |j                  | _        y # t        $ r0 t        d«      | j                  | j                   fz  }t#        |«      ‚w xY w)N)ÚarchivezMCould not find PPA subscription for ppa:%s/%s, you may need to request access)r   r)   r.   r‹   r�   rO   rR   ÚmerV   ÚgetArchiveSubscriptionURLr   rŠ   rŒ   r   r$   r%   r&   r	   )r:   r‘   ÚurlrŽ   r>   s        rC   r(   zPPAShortcutHandler._set_authî   s¿   € Ø�=Š= §
¡
× 2Ò 2Øà�>Š>˜dŸnšnØð	-à—‘—‘ §¡§
¡
§¡Ó0ˆBØ×.Ñ.°t·z±zÐ.ÓBˆCô ˜c“]ˆFØ#Ÿ_™_ˆDŒNØ#Ÿ_™_ˆD�Nøô ò 	)ÜÐdÓeØ—M‘M 4§<¡<Ð0ñ1ˆCä# CÓ(Ð(ð	)ús   ¾AC Ã9C:)FrY   )rM   rL   Ú__qualname__r   ÚpropertyrO   rT   r)   rZ   r]   rg   rj   r8   r    r"   r#   r~   r(   Ú__classcell__)rB   s   @rC   r   r   3   s¥   ø„ õ2/ðh ñ	ó ð	ð ñ
ó ð
ð ñó ðð ñ&ó ð&ð ñ#ó ð#ð ñ&ó ð&õ"	ô]òò(òòö"-rP   r   N)r   r$   Úlaunchpadlib.launchpadr   Úlazr.restfulclient.errorsr   r   r   Ú"softwareproperties.shortcuthandlerr   r	   r
   Úsoftwareproperties.sourceslistr   Úsoftwareproperties.urir   Úaptsources.sourceslistr   Úurllib.parser   r0   r/   r„   r…   rp   r   © rP   rC   ú<module>rŸ      s~   ðõ. !å ,ß JÑ J÷Jñ Jå EÝ 5å 4å !ð I€ØXÐ áˆ^Ó×%Ñ%ÙÐ#Ó$×-Ñ-àØðÐ ð ˜<Ð(€ôM-˜õ M-rP   