Ë
    XÔRgôd  ã                   ó.  — d dl Z d dlZd dlZd dlZ ej                  dd«       d dlmZmZmZm	Z	 ddl
mZmZmZmZ ddlmZmZmZmZ dZdZd	Ze	j.                  j1                  «       j3                  d
«        G d„ d«      Z G d„ dej6                  «      Zy)é    NÚGtkz3.0)ÚGLibÚGObjectÚGior   é   )ÚcacheÚ_flatpakÚ_aptÚdialogs)Úprint_timingÚcheck_mlÚdebugÚwarnÚaÚfz/usr/share/linuxmint/iconsc                   ót   — e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZ	 dd„Zd„ Zd„ Zd„ Zdd„Zd„ Zd„ Zy)ÚInstallerTaskÚinstallÚremoveÚupdateÚnoneÚokÚbrokenÚ	forbiddenÚunknownÚinitÚ
installingÚupdatingÚremovingÚfinishedÚfailedNc                 ót  — t         j                  | _        |
| _        || _        || _        |	| _        d | _        d | _        g | _	        i | _
        g | _        || _        || _        | j                  | _        d„ | _        d„ | _        d | _        t'        j(                  «       | _        || _        || _        || _        || _        d| _        | j6                  | _        d | _        d | _        d | _        d| _         d | _!        g | _"        g | _#        g | _$        g | _%        g | _&        g | _'        g | _(        d| _)        d| _*        d| _+        |rv|j                  | _        |jX                  j[                  d«      rd| _.        d| _/        d| _0        y |j\                  | _.        |j`                  | _0        |j^                  | _/        y y )Nc                   ó   — y©NT© r%   ó    ú@/usr/lib/python3/dist-packages/mintcommon/installer/installer.pyú<lambda>z(InstallerTask.__init__.<locals>.<lambda>N   ó   � r&   c                   ó   — yr$   r%   r%   r&   r'   r(   z(InstallerTask.__init__.<locals>.<lambda>O   r)   r&   Fr   r   Ú )1r   ÚINSTALL_TASKÚtypeÚuse_mainloopÚparent_windowÚpkginfoÚis_addon_taskÚas_pkgÚnameÚinitial_refs_to_updateÚref_prior_versions_dictÚtransaction_logÚinfo_ready_callbackÚinfo_error_callbackÚSTATUS_NONEÚinfo_ready_statusÚconfirmÚcancelÚexecuter   ÚCancellableÚcancellableÚclient_progress_cbÚclient_finished_cbÚerror_cleanup_cbÚfinished_cleanup_cbÚ
has_windowÚPROGRESS_STATE_INITÚprogress_stateÚcurrent_package_nameÚerror_messageÚtransactionÚpkit_request_idÚexec_stringÚ
to_installÚto_reinstallÚ	to_removeÚto_purgeÚ	to_updateÚto_downgradeÚto_skip_upgradeÚdownload_sizeÚinstall_sizeÚ
freed_sizeÚpkg_hashÚ
startswithÚarchÚbranchÚremote)Úselfr0   Ú	installerÚclient_info_ready_callbackÚclient_info_error_callbackÚclient_installer_finished_cbÚclient_installer_progress_cbÚinstaller_cleanup_cbÚinstaller_error_cleanup_cbr1   r.   r/   s               r'   Ú__init__zInstallerTask.__init__(   s»  € ô "×.Ñ.ˆŒ	à(ˆÔØ*ˆÔð ˆŒØ*ˆÔð ˆŒàˆŒ	ð ')ˆÔ#ð (*ˆÔ$Ø!ˆÔð
 $>ˆÔ Ø#=ˆÔ ð "&×!1Ñ!1ˆÔñ $ˆŒÙ"ˆŒØˆŒô Ÿ?™?Ó,ˆÔð #?ˆÔØ">ˆÔð
 !;ˆÔØ#7ˆÔ àˆŒð #×6Ñ6ˆÔà$(ˆÔ!à!ˆÔàˆÔØ ˆÔð  ˆÔð
 ˆŒØˆÔØˆŒØˆŒØˆŒØˆÔØ!ˆÔð ˆÔØˆÔØˆŒñ ØŸ™ˆDŒIà×Ñ×*Ñ*¨3Ô/Ø�”	Ø �”Ø �•à#ŸL™L�”	Ø%Ÿn™n�”Ø%Ÿn™n�•ð r&   c                 óÀ   — | j                   t        j                  k(  r!|j                  | j                  «      | _        y |j                  | j                  «      | _        y ©N)r-   r   r,   Úget_versionr0   ÚversionÚget_installed_version)r[   r\   s     r'   Úset_versionzInstallerTask.set_version�   sB   € Ø�9‰9œ×2Ñ2Ò2à$×0Ñ0°·±Ó>ˆD�Lð %×:Ñ:¸4¿<¹<ÓHˆD�Lr&   c                 ó   — | j                   S re   )r6   ©r[   s    r'   Úget_transaction_logz!InstallerTask.get_transaction_log—   s   € Ø×#Ñ#Ð#r&   c                 óº   — | j                   €y | j                  r1t        j                  | j                   | t        j                  ¬«       y | j                  | «       y ©N)Úpriority)r7   r.   r   Úidle_addÚPRIORITY_DEFAULTrk   s    r'   Úcall_info_ready_callbackz&InstallerTask.call_info_ready_callbackš   sD   € Ø×#Ñ#Ð+Øà×ÒÜ�M‰M˜$×2Ñ2°DÄ4×CXÑCXÖYà×$Ñ$ TÕ*r&   c                 óº  — 	 |j                   | _        |r†| j                  €+t	        j
                  | j                  | j                  «       y | j                  r1t        j                  | j                  | t        j                  ¬«       y | j                  | «       y t	        j
                  | j                  | j                  «       y #  t        |«      | _        Y ŒÇxY wrn   )ÚmessagerH   Ústrr8   r   Ú
show_errorr/   r.   r   rp   rq   )r[   ÚerrorÚ
info_stages      r'   Úhandle_errorzInstallerTask.handle_error£   s¥   € ð	,Ø!&§¡ˆDÔñ Ø×'Ñ'Ð/Ü×"Ñ" 4×#5Ñ#5°t×7IÑ7IÔJØà× Ò Ü—‘˜d×6Ñ6¸Ät×G\ÑG\Ö]à×(Ñ(¨Õ.ä×Ñ˜t×1Ñ1°4×3EÑ3EÕFøð	,Ü!$ U£ˆDÖús   ‚C ÃCc                 óº   — | j                   sy | j                  r1t        j                  | j                   | t        j                  ¬«       y | j                  | «       y rn   )rC   r.   r   rp   rq   rk   s    r'   Úcall_finished_cleanup_callbackz,InstallerTask.call_finished_cleanup_callbackµ   sA   € Ø×'Ò'Øà×ÒÜ�M‰M˜$×2Ñ2°DÄ4×CXÑCXÖYà×$Ñ$ TÕ*r&   c                 óº   — | j                   sy | j                  r1t        j                  | j                   | t        j                  ¬«       y | j                  | «       y rn   )rB   r.   r   rp   rq   rk   s    r'   Úcall_error_cleanup_callbackz)InstallerTask.call_error_cleanup_callback¾   sA   € Ø×$Ò$Øà×ÒÜ�M‰M˜$×/Ñ/°Ä×@UÑ@UÖVà×!Ñ! $Õ'r&   )FFN©F)Ú__name__Ú
__module__Ú__qualname__r,   ÚUNINSTALL_TASKÚUPDATE_TASKr9   Ú	STATUS_OKÚSTATUS_BROKENÚSTATUS_FORBIDDENÚSTATUS_UNKNOWNrE   ÚPROGRESS_STATE_INSTALLINGÚPROGRESS_STATE_UPDATINGÚPROGRESS_STATE_REMOVINGÚPROGRESS_STATE_FINISHEDÚPROGRESS_STATE_FAILEDrc   ri   rl   rr   ry   r{   r}   r%   r&   r'   r   r      s�   „ à€LØ€NØ€Kð €KØ€IØ€MØ"ÐØ€Nð !ÐØ ,ÐØ(ÐØ(ÐØ(ÐØ$Ðð
 z~óe-òNIò$ò+óGò$+ó(r&   r   c                   óŒ  — e Zd Zdej                  j
                  ddfiZedfd„Zd„ Z	d„ Z
d1d„Zd1d	„Zd
„ Zd„ Zed„ «       Zed„ «       Z	 d2d„Z	 d3d„Zd„ Zedfd„Zd„ Zd„ Zd„ Zd„ Zd„ Zed„ «       Zed„ «       Zd„ Zd„ Zd„ Zd„ Z d„ Z!d3d„Z"d„ Z#d „ Z$d!„ Z%d"„ Z&d#„ Z'd$„ Z(d%„ Z)d&„ Z*d'„ Z+d(„ Z,d)„ Z-d*„ Z.d+„ Z/d,„ Z0d-„ Z1d.„ Z2d/„ Z3d0„ Z4y)4Ú	Installerúappstream-changedNr%   Fc                 ób  — t         j                  j                  | «       i | _        || _        |r(t        j                  d¬«      }|j                  | _        nd | _        d| _	        d| _
        d| _        | j                  «       | _        i | _        d | _        t        j                  «       | _        y )Nzmint-common-installer-tmp)ÚprefixF)r   ÚObjectrc   ÚtasksÚpkg_typeÚtempfileÚNamedTemporaryFiler3   Ú
cache_pathÚremotes_changedÚinitedÚhave_flatpakÚ_get_flatpak_statusr   Ú_init_cbÚtimeÚstartup_timer)r[   r”   Útempr   s       r'   rc   zInstaller.__init__Ë   sŒ   € Ü�‰×Ñ Ô%àˆŒ
Ø ˆŒáÜ×+Ñ+Ð3NÔOˆAØŸf™fˆD�Oà"ˆDŒOà$ˆÔØˆŒà!ˆÔØ ×4Ñ4Ó6ˆÔàˆŒ
ØˆŒä!ŸY™Y›[ˆÕr&   c                 ób   — 	 t        j                  dd«       ddlm} y#  t	        d«       Y yxY w)NÚFlatpakz1.0r   )r¡   Tz`No flatpak support, install flatpak and gir1.2-flatpak-1.0 and restart mintinstall to enable it.F)ÚgiÚrequire_versionÚgi.repositoryr¡   r   )r[   r¡   s     r'   r›   zInstaller._get_flatpak_statusâ   s2   € ð	uÜ×Ñ˜y¨%Ô0Ý-àøð	uÜÐsÕtàús   ‚ Ÿ.c                 óâ  — | j                   t        k(  r| j                  st        d«       yt	        j
                  d¬«      | _        | j                  «       rd| _        i | _	        t        j                  | j                   | j                  | j                  «      | _
        | j                  j                  | j                  j                  k(  r$| j                  sd| _        | j!                  «        yy)zæ
        Loads the cache synchronously.  Returns True if all went ok, and returns False if there
        is no cache (or it's too old.)  You should then call init() with a callback so the cache
        can be regenerated.
        z?Not syncing for flatpaks only, as there is currently no supportTzcom.linuxmint.install)Ú	schema_idF)r”   ÚPKG_TYPE_FLATPAKrš   r   r   ÚSettingsÚsettingsÚ_fp_remotes_have_changedr˜   Úbackend_tabler   ÚPkgCacher—   Ústatusr„   r™   Úinitialize_appstreamrk   s    r'   Ú	init_synczInstaller.init_syncí   s±   € ð �=‰=Ô,Ò,°T×5FÒ5FÜÐSÔTØäŸ™Ð/FÔGˆŒà×(Ñ(Ô*Ø#'ˆDÔ àˆÔä—^‘^ D§M¡M°4·?±?ÀD×DUÑDUÓVˆŒ
à�:‰:×Ñ §
¡
× 4Ñ 4Ò4¸T×=QÒ=QØˆDŒKà×%Ñ%Ô'ààr&   c                 óÐ  — i | _         t        j                  | j                  | j                  | j
                  «      | _        || _        | j                  j                  | j                  j                  k(  r4| j                  s(d| _
        t        j                  | j                  «       | S | j                  rt        d«       | j                  j                  | j                  «       | S )zÈ
        Loads the cache asynchronously.  If there is no cache (or it's too old,) it causes
        one to be generated and saved.  The ready_callback is called on idle once this is finished.
        Tz=Installer: Flatpak remotes have changed, forcing a new cache.)r«   r   r¬   r”   r—   rš   rœ   r­   r„   r˜   r™   r   rp   Ú_idle_cache_load_doner   Úforce_new_cache_async©r[   Úready_callbacks     r'   r   zInstaller.init
  s¬   € ð
  ˆÔä—^‘^ D§M¡M°4·?±?ÀD×DUÑDUÓVˆŒ
à&ˆŒà�:‰:×Ñ §
¡
× 4Ñ 4Ò4¸T×=QÒ=QØˆDŒKä×Ñ˜T×7Ñ7Ô8ð ˆð ×#Ò#ÜÐUÔVà�J‰J×,Ñ,¨T×-GÑ-GÔHàˆr&   c                 ó:   — | j                   j                  |«       y)zU
        Forces the cache to regenerate, calling read_callback when complete
        N)r   r²   r³   s     r'   Úforce_new_cachezInstaller.force_new_cache!  s   € ð 	�
‰
×(Ñ(¨Õ8r&   c                 ó8   — | j                   j                  «        y)z>
        Forces the cache to regenerate synchronously
        N)r   r¶   rk   s    r'   Úforce_new_cache_synczInstaller.force_new_cache_sync'  s   € ð 	�
‰
×"Ñ"Õ$r&   c                 ó  — d| _         | j                  r| j                  «        d| _        | j                  «        t	        dt        j
                  «       | j                  z
  dz  z  «       | j                  r| j                  «        y y )NTFz$Full installer startup took %0.3f msg     @�@)r™   r˜   Ú_store_remotesr®   r   r�   rž   rœ   rk   s    r'   r±   zInstaller._idle_cache_load_done-  sl   € ØˆŒà×ÒØ×ÑÔ!Ø#(ˆDÔ à×!Ñ!Ô#äÐ4¼¿¹»Àt×GYÑGYÑ9YÐ]cÑ8cÑdÔeà�=Š=Ø�M‰M�Oð r&   c                 ó*  — d}d}| j                   j                  d«      }| j                  «       }|D ]@  }|dz  }|j                  ›d|j                  ›dt        |j                  «      ›�}||vsŒ>d} n |st        |«      |k7  rd}t        d|«       |S )a…  
        We check here for changed remotes.  We care if names, urls, and disabled status changed.
        The 'noenumerate' property won't change, and is usually marked on standalone (-source) ref
        installs.  We don't want to generate a new cache for those - their app can be accessed via
        installed apps, plus if you uninstall the app, the remote gets auto-removed.
        Fr   úflatpak-remotesr   ú::TzRemotes have changed:)	r©   Úget_strvÚlist_flatpak_remotesr3   Úurlru   ÚdisabledÚlenr   )r[   ÚchangedÚreal_remote_countÚsaved_remotesÚ
fp_remotesÚremote_infoÚitems          r'   rª   z"Installer._fp_remotes_have_changed;  s¥   € ð ˆØÐàŸ™×.Ñ.Ð/@ÓAˆØ×.Ñ.Ó0ˆ
à%ò 	ˆKØ Ñ"Ðà#.×#3Ó#3°[·_³_ÄcÈ+×J^ÑJ^ÔF_Ð`ˆDà˜=Ò(Ø�Ùð	ñ Ü�=Ó!Ð%6Ò6Ø�äÐ% wÔ/àˆr&   c                 óò   — g }| j                  «       }|D ]D  }|j                  ›d|j                  ›dt        |j                  «      ›�}|j                  |«       ŒF | j                  j                  d|«       y )Nr½   r¼   )r¿   r3   rÀ   ru   rÁ   Úappendr©   Úset_strv)r[   Únew_remotesrÆ   rÇ   rÈ   s        r'   rº   zInstaller._store_remotesZ  sj   € àˆà×.Ñ.Ó0ˆ
à%ò 	%ˆKØ#.×#3Ó#3°[·_³_ÄcÈ+×J^ÑJ^ÔF_Ð`ˆDà×Ñ˜tÕ$ð	%ð
 	�‰×ÑÐ0°+Õ>r&   c                 óª  — |j                   | j                  j                  «       v rE| j                  |j                      }t        j                  |j
                  |«       |j                  S t        || ||||| j                  | j                  ||¬«
      }| j                  |«      rt        j                  |_        nt        j                  |_        |j                  | «       | j                  |«      |_        |j                   j#                  d«      r!t%        j&                  |«       |j                  S t)        j&                  |«       |j                  S )aß  
        Initiates calculations for installing or removing a particular package
        (depending upon whether or not the selected package is installed.  Creates
        an InstallerTask instance and populates it with info relevant for display
        and for execution later.  When this is completed, ready_callback is called,
        with the newly-created task as its argument.  Note:  At that point, this is
        the *only* reference to the task object.  It can be safely discarded.  If
        the task is to be run, Installer.execute_task() is called, passing this task
        object, along with callback functions.  The task object is then added to a
        queue (and is tracked in self.tasks from there on out.)
        )r.   r/   r   )rV   r“   Úkeysr   rp   r7   r?   r   Ú_task_finishedÚ_task_errorÚpkginfo_is_installedr‚   r-   r,   ri   Úget_appstream_pkg_for_pkginfor2   rW   r
   Úselect_packagesr	   )	r[   r0   r]   r^   r_   r`   r.   r/   Útasks	            r'   Úselect_pkginfozInstaller.select_pkginfog  s  € ð ×Ñ˜tŸz™zŸ™Ó0Ñ0Ø—:‘:˜g×.Ñ.Ñ/ˆDä×Ñ˜T×5Ñ5°tÔ<Ø×#Ñ#Ð#ä˜W dØ7Ð9SØ9Ð;WØ!×0Ñ0°$×2BÑ2BØ*6Àmô	Uˆð ×$Ñ$ WÔ-ä%×4Ñ4ˆD�Iä%×2Ñ2ˆDŒIà×Ñ˜ÔØ×8Ñ8¸ÓAˆŒà×Ñ×&Ñ& sÔ+Ü× Ñ  Ô&ð ×ÑÐô ×$Ñ$ TÔ*à×ÑÐr&   c                 ó¾   — t        d| ||||| j                  | j                  |¬«	      }t         j                  |_        |r|ng |_        t        j                  |«       y)zÌ
        Creates an InstallerTask populated with all flatpak packages that can be
        updated. If refs is empty, selects all possible updates, otherwise, only attempts
        to update refs.
        N)r.   )r   rÏ   rÐ   rƒ   r-   r4   r	   Úselect_updates)r[   Úrefsr]   r^   r_   r`   r.   rÔ   s           r'   Úselect_flatpak_updatesz Installer.select_flatpak_updates’  s[   € ô ˜T 4Ø7Ð9SØ9Ð;WØ!×0Ñ0°$×2BÑ2BØ*6ô	8ˆô "×-Ñ-ˆŒ	Ù.2¡d¸ˆÔ#ä×Ñ Õ%r&   c                 ó@   — t        j                  | j                  «      S )z¼
        Returns a list of flatpak pkginfos that can be updated.  Unlike
        prepare_flatpak_update, this is for the convenience of displaying information
        to the user.
        )r	   Úlist_updated_pkginfosr   rk   s    r'   Úlist_updated_flatpak_pkginfosz'Installer.list_updated_flatpak_pkginfos¦  s   € ô ×-Ñ-¨d¯j©jÓ9Ð9r&   c                 ó<   — | j                   j                  |||«      S )z–
        Attempts to find and return a PkgInfo object, given a package name.  If
        pkg_type is None, looks in first apt, then flatpaks.
        )r   Úfind_pkginfo)r[   r3   r”   rZ   s       r'   rÞ   zInstaller.find_pkginfo®  s   € ð
 �z‰z×&Ñ& t¨X°vÓ>Ð>r&   c                 ó`   — | j                   r"t        j                  | j                  ||«       yy)a;  
        Accepts a GFile to a .flatpakref on a local path.  If the flatpak's remote
        has not been previously added to the system installation, this also adds
        it and downloads Appstream info as well, before calling ready_callback with
        the created (or existing) PkgInfo as an argument.
        N)rš   r	   Úget_pkginfo_from_filer   ©r[   Úfiler´   s      r'   Úget_pkginfo_from_ref_filez#Installer.get_pkginfo_from_ref_fileµ  s(   € ð ×ÒÜ×*Ñ*¨4¯:©:°t¸^ÕLð r&   c                 ór   — | j                   r"t        j                  | j                  ||«       y |dd«       y)z¼
        Accepts a GFile to a .flatpakrepo on a local path.  Adds the remote if it
        doesn't exist already, fetches any appstream data, and then calls
        ready_callback
        Nzno-flatpak-support)rš   r	   Úadd_remote_from_repo_filer   rá   s      r'   rå   z#Installer.add_remote_from_repo_file¿  s.   € ð ×ÒÜ×.Ñ.¨t¯z©z¸4ÀÕPá˜4Ð!5Õ6r&   c                 óF   — | j                   rt        j                  «       S g S )z—
        Returns a list of FlatpakRemoteInfos.  The remote_name can be used to match
        with PkgInfo.remote and the title is for display.
        )rš   r	   Úlist_remotesrk   s    r'   r¿   zInstaller.list_flatpak_remotesË  s!   € ð
 ×ÒÜ×(Ñ(Ó*Ð*àˆIr&   c                 óv   — | j                   r,t        j                  «       D ]  }|j                  |k(  sŒ|c S  g S re   )rš   r	   rç   r3   )r[   Úremote_namerZ   s      r'   Úget_remote_info_for_namez"Installer.get_remote_info_for_nameÕ  s;   € Ø×ÒÜ"×/Ñ/Ó1ò "�Ø—;‘; +Ó-Ø!’Mð"ð ˆ	r&   c                 óô   — | j                   rl|j                  j                  d«      rt        j                  |«      S | j
                  r0|j                  j                  d«      rt        j                  |«      S y)z•
        Returns whether or not a given package is currently installed.  This uses
        the AptCache or the FlatpakInstallation to check.
        r   r   F)r™   rV   rW   r
   rÑ   rš   r	   ©r[   r0   s     r'   rÑ   zInstaller.pkginfo_is_installedÝ  s`   € ð
 �;Š;Ø×Ñ×*Ñ*¨3Ô/Ü×0Ñ0°Ó9Ð9Ø×"Ò" w×'7Ñ'7×'BÑ'BÀ3Ô'GÜ×4Ñ4°WÓ=Ð=àr&   c                 ó\   — | j                   r t        j                  | j                  «       yy)zù
        Flatpaks installed from .flatpakref files may not actually be in the saved
        pkginfo cache, specifically, if they're added from no-enumerate-marked remotes.
        This gets run at startup to collect and generate their info.
        N)rš   r	   Úgenerate_uncached_pkginfosr   rk   s    r'   rî   z$Installer.generate_uncached_pkginfosê  s$   € ð ×ÒÜ×/Ñ/°·
±
Õ;ð r&   c                 ó„   — | j                   r t        j                  | j                  ¬«       t	        j
                  «        y)zs
        Loads and caches the xmlb pools so they can be used to provide
        display info for packages.
        )ÚcbN)rš   r	   r®   Úon_appstream_loadedr
   Úget_apt_cacherk   s    r'   r®   zInstaller.initialize_appstreamô  s/   € ð ×ÒÜ×)Ñ)¨T×-EÑ-EÕFô 	×ÑÕr&   c                 óF   — | j                  «        | j                  d«       y )Nr�   )rî   Úemitrk   s    r'   rñ   zInstaller.on_appstream_loaded   s   € Ø×'Ñ'Ô)Ø�	‰	Ð%Õ&r&   c                 óº   — d }|j                   j                  d«      r(t        j                  |«      }|�|| j                  |<   |S t        j                  |«      }|S )Nr   )rV   rW   r
   Úsearch_for_pkginfo_apt_pkgr«   r	   Ú$search_for_pkginfo_appstream_package)r[   r0   Úbackend_components      r'   rÒ   z'Installer.get_appstream_pkg_for_pkginfo  sd   € Ø Ðà×Ñ×&Ñ& sÔ+Ü $× ?Ñ ?ÀÓ HÐØ Ð,Ø.?�×"Ñ" 7Ñ+ð !Ð ô !)× MÑ MÈgÓ VÐà Ð r&   c                 ó–   — |j                   j                  d«      rt        d«       | j                  |«      }|€y|j	                  «       S )zT
        Return the launchables associated with the AsApp for this pkginfo.
        r   z(launch_flatpak: pkginfo is not a flatpakN)rV   rW   r   rÒ   Úget_launchables©r[   r0   r2   s      r'   Úget_flatpak_launchablesz!Installer.get_flatpak_launchables  sH   € ð
 ×Ñ×&Ñ& sÔ+ÜÐ<Ô=à×3Ñ3°GÓ<ˆàˆ>Øà×%Ñ%Ó'Ð'r&   c                 ób   — t        j                  «       j                  «       j                  «       S )z—
        Return the root path for the flatpak installation (generally /var/lib/flatpak for system
        and ~/.local/share/flatpak for user.
        )r	   Ú
get_fp_sysÚget_pathrk   s    r'   Úget_flatpak_root_pathzInstaller.get_flatpak_root_path  s%   € ô ×"Ñ"Ó$×-Ñ-Ó/×8Ñ8Ó:Ð:r&   c                 ó†   — |j                   j                  d«      ryt        j                  |«      }t	        |«      dk(  ry|S )zJ
        Returns an array of app ids of names of available addons
        r   Nr   )rV   rW   r	   Ú_get_addons_for_pkginforÂ   )r[   r0   Úaddonss      r'   Ú
get_addonszInstaller.get_addons'  s?   € ð ×Ñ×&Ñ& sÔ+Øä×1Ñ1°'Ó:ˆäˆv‹;˜!ÒØàˆr&   c                 ó  — |rM|j                   j                  d«      r2	 t        j                  |j                     j
                  j                  S | j                  |«      }|j                  |«      S # t        $ r Y Œ-w xY w)z‘
        Returns the description of the package.  If for_search is True,
        this is the raw, unformatted string in the case of apt.
        r   )
rV   rW   r
   Ú
_apt_cacher3   Ú	candidateÚdescriptionÚ	ExceptionrÒ   Úget_description)r[   r0   Ú
for_searchr2   s       r'   r
  zInstaller.get_description5  su   € ñ
 ˜'×*Ñ*×5Ñ5°cÔ:ðÜ—‘ w§|¡|Ñ4×>Ñ>×JÑJÐJð ×3Ñ3°GÓ<ˆØ×&Ñ& vÓ.Ð.øô	 ò Ùðús   Ÿ0A2 Á2	A>Á=A>c                 óF   — | j                  |«      }|j                  |«      S )z3
        Returns a list of screenshot urls
        )rÒ   Úget_screenshotsrû   s      r'   r  zInstaller.get_screenshotsC  s%   € ð ×3Ñ3°GÓ<ˆà×&Ñ& vÓ.Ð.r&   c                 óF   — | j                  |«      }|j                  |«      S ©zB
        Returns the current version string, if available
        )rÒ   rf   rû   s      r'   rf   zInstaller.get_versionK  s%   € ð ×3Ñ3°GÓ<ˆà×"Ñ" 6Ó*Ð*r&   c                 óF   — | j                  |«      }|j                  |«      S r  )rÒ   Úget_developerrû   s      r'   r  zInstaller.get_developerS  s%   € ð ×3Ñ3°GÓ<ˆà×$Ñ$ VÓ,Ð,r&   c                 ó„   — |j                   j                  d«      r| j                  |«      S t        j                  |«      S )zF
        Returns the currently deployed version of a flatpak.
        r   )rV   rW   rf   r	   Ú_get_deployed_versionrì   s     r'   rh   zInstaller.get_installed_version[  s<   € ð ×Ñ×&Ñ& sÔ+à×#Ñ# GÓ,Ð,ô ×1Ñ1°'Ó:Ð:r&   c                 óF   — | j                  |«      }|j                  |«      S )z­
        Returns the home page url for a package.  If there is
        no url for the package, in the case of flatpak, the remote's url
        is displayed instead
        )rÒ   Úget_homepage_urlrû   s      r'   r  zInstaller.get_homepage_urlg  s%   € ð ×3Ñ3°GÓ<ˆà×'Ñ'¨Ó/Ð/r&   c                 óF   — | j                  |«      }|j                  |«      S )z§
        Returns the help url for a package.  If there is
        no url for the package, returns an empty string. Apt always returns
        an empty string.
        )rÒ   Úget_help_urlrû   s      r'   r  zInstaller.get_help_urlq  s%   € ð ×3Ñ3°GÓ<ˆà×#Ñ# FÓ+Ð+r&   c                 óN   — t        | j                  j                  «       «      dkD  S )Nr   ©rÂ   r“   rÎ   rk   s    r'   Úis_busyzInstaller.is_busy{  s   € Ü�4—:‘:—?‘?Ó$Ó%¨Ñ)Ð)r&   c                 óH   — t        | j                  j                  «       «      S re   r  rk   s    r'   Úget_task_countzInstaller.get_task_count~  s   € Ü�4—:‘:—?‘?Ó$Ó%Ð%r&   c                 ó˜   — g }| j                   j                  «       D ]*  }|j                  | j                   |   j                  «       Œ, |S re   )r“   rÎ   rÊ   r0   )r[   ÚpkginfosrV   s      r'   Úget_active_pkginfoszInstaller.get_active_pkginfos�  sC   € ØˆàŸ
™
Ÿ™Ó)ò 	:ˆHØ�O‰O˜DŸJ™J xÑ0×8Ñ8Õ9ð	:ð ˆr&   c                 ób   — |j                   j                  | j                  j                  «       v S )zF
        Returns whether a given task is currently executing.
        )r0   rV   r“   rÎ   ©r[   rÔ   s     r'   Útask_runningzInstaller.task_running‰  s$   € ð �|‰|×$Ñ$¨¯
©
¯©Ó(9Ð9Ð9r&   c                 ó"   — |j                  «       S re   )r;   r!  s     r'   Úconfirm_taskzInstaller.confirm_task�  s   € Ø�|‰|‹~Ðr&   c                 ó$   — |j                  «        y re   )r<   r!  s     r'   Úcancel_taskzInstaller.cancel_task’  s   € Ø�‰�r&   c                 óÄ   — |j                   �|j                   j                  }nd}|| j                  |<   t        d|›d|j                  ›d�«       |j                  «        y)aE  
        Executes a given task.  The client_finished_cb is required always, to notify
        when the task completes. The progress and error callbacks are optional.  If
        they're left out, a standalone progress window is created to allow the user to
        see the task's progress (and cancel it if desired.)
        NÚupdateszStarting task for package z, type 'ú')r0   rV   r“   r   r-   r=   ©r[   rÔ   Úkeys      r'   Úexecute_taskzInstaller.execute_task•  sI   € ð �<‰<Ð#Ø—,‘,×'Ñ'‰CàˆCàˆ�
‰
�3‰åº3ÀÇ	Ã	ÐJÔKà�‰�r&   c                 óò   — |j                   s	 | j                  d= t        d«       n2|j                   j                  }|r	 | j                  |= t        d|«       | j	                  |«       y #  Y ŒxY w#  Y ŒxY w)Nr(  zDone with update task (success)zDone with task (success)©r0   r“   r   rV   Ú_post_task_updater*  s      r'   rÏ   zInstaller._task_finished¨  óu   € Ø�|Š|ðØ—J‘J˜yÐ)ÜÐ7Õ8ð —,‘,×'Ñ'ˆCáðØŸ
™
 3˜ÜÐ4°cÔ:ð 	×Ñ˜tÕ$øðÙûðÙúó   ŽA+ Á A2 Á+A/Á2A6c                 óò   — |j                   s	 | j                  d= t        d«       n2|j                   j                  }|r	 | j                  |= t        d|«       | j	                  |«       y #  Y ŒxY w#  Y ŒxY w)Nr(  zDone with update task (failure)zDone with task (failure)r.  r*  s      r'   rÐ   zInstaller._task_error»  r0  r1  c                 óî   — |j                   rX|j                   j                  j                  d«      r3t        j                  | j
                  |f¬«      }|j                  «        y | j                  |«       y )Nr   )ÚtargetÚargs)r0   rV   rW   Ú	threadingÚThreadÚ_apt_post_task_update_threadÚstartÚ_run_client_callback)r[   rÔ   Úthreads      r'   r/  zInstaller._post_task_updateÎ  sS   € Ø�<Š<˜DŸL™L×1Ñ1×<Ñ<¸SÔAÜ×%Ñ%¨T×-NÑ-NÐVZÐU\Ô]ˆFØ�L‰L�Nà×%Ñ% dÕ+r&   c                 óN   — t        j                  «        | j                  |«       y re   )r
   Úsync_cache_installed_statesr:  r!  s     r'   r8  z&Installer._apt_post_task_update_threadÕ  s   € Ü×(Ñ(Ô*ð 	×!Ñ! $Õ'r&   c                 ó~   — |j                   r1t        j                  |j                   |t        j                  ¬«       y y rn   )rA   r   rp   r   rq   r!  s     r'   r:  zInstaller._run_client_callbackÜ  s.   € Ø×"Ò"Ü×Ñ˜T×4Ñ4°dÄT×EZÑEZÖ[ð #r&   re   )FNr~   )5r   r€   r�   r   ÚSignalFlagsÚRUN_LASTÚ__gsignals__ÚPKG_TYPE_ALLrc   r›   r¯   r   r¶   r¸   r±   r   rª   rº   rÕ   rÙ   rÜ   rÞ   rã   rå   r¿   rê   rÑ   rî   r®   rñ   rÒ   rü   r   r  r
  r  rf   r  rh   r  r  r  r  r  r"  r$  r&  r,  rÏ   rÐ   r/  r8  r:  r%   r&   r'   rŽ   rŽ   Ç   sT  „ à˜g×1Ñ1×:Ñ:¸DÀ"ÐEð€Lð !-°5ó )ò.	òó:ó.9ò%òð ñó ðð< ñ
?ó ð
?ð :>ó) ð\ -2ó&ò(:ð +7¸tó ?òMò
7òòòð ñ<ó ð<ð ñ	ó ð	ò'ò
!ò(ò;òó/ò/ò+ò-ò
;ò0ò,ò*ò&òò:òòòò&%ò&%ò&,ò(ó\r&   rŽ   )r6  r�   r•   r¢   r£   r¤   r   r   r   r   r+   r   r	   r
   r   Úmiscr   r   r   r   rB  ÚPKG_TYPE_APTr§   Ú	IconThemeÚget_defaultÚappend_search_pathr   r’   rŽ   r%   r&   r'   ú<module>rH     s‚   ðã Û Û ã 	Ø €× Ñ �5˜%Ô  ß 1Ó 1ç ,Ó ,ß 5Ó 5à€Ø€ØÐ à ‡�× Ñ Ó × .Ñ .Ð/KÔ L÷r(ñ r(ôhW\�—‘õ W\r&   