Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/DistUpgrade/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/DistUpgrade/__pycache__/DistUpgradeView.cpython-310.pyc
o

��*d�C�@s�ddlmZddlmZddlmZddlZddlm	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZze
�e
jd�e
��\ZZWne�d	�d
ZYeswd
Ze�dd�z	e
�e
jd�Wn
e
jyvYnwe�d
e
���dd�ZGdd�dejj j!�Z!Gdd�dejj j"�Z"Gdd�de#�Z$Gdd�de#�Z%Gdd�de	�Z&ed�ed�ed�ed�ed�fGdd �d e#�Z'e(d!kr�e!�Z)e)�*�dSdS)"�)�gettext)�ngettext)�get�N)�Enum)�apport_pkgfailure�zgetting the encoding failedzutf-8�LC_CTYPEzC.UTF-8zlocale: '%s' '%s'cCs*t|�}|d}|dd}|dd}|d}|dkrd}ddddd�}|dkr3td	d
|�||d<|dkrAtdd
|�||d<|dkrOtdd|�||d<tdd|�||d<|dkrm|ddkrg|dStd�|S|dkru|dS|dkr�|ddkr�|dStd�|S|dkr�|dS|dS)z; return the time a bit fuzzy (no seconds if time > 60 secs i�Qi��<rrr)�str_days�	str_hours�str_minutes�str_secondsz%li dayz%li daysrz%li hourz	%li hoursr
z
%li minutez%li minutesrz
%li secondz%li secondsrz%(str_days)s %(str_hours)s�z%(str_hours)s %(str_minutes)s)�intr�_)�sec�days�hours�minutes�seconds�map�r�=/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeView.py�FuzzyTimeToStr;s@�

rcsZeZdZ�fdd�Z�fdd�Z�fdd�Zdd�Zd�fd
d�	Zdd
�Zdd�Z	�Z
S)�AcquireProgresscstt|���d|_dS)N�)�superr�__init__�	est_speed��self��	__class__rrr�s
zAcquireProgress.__init__cs*tt|���d|_d|_d|_d|_dS)NrF)rr�startr �eta�percent�release_file_download_errorr!r#rrr%�s

zAcquireProgress.startcsntt|��||||�|tjkr1t�d|�|�d�s!|�d�r3dD]}|�|�r0d|_	dSq#dSdSdS)Nz update_status: dlFailed on '%s' zRelease.gpg�Release)�http�ftp�mirrorT)
rr�
update_status�apt_pkg�STAT_FAILED�logging�warning�endswith�
startswithr()r"�uri�descr�
shortDescr�status�netr#rrr-�s

��zAcquireProgress.update_statuscC�dS�NTr)r"�argrrr�pulse_items��zAcquireProgress.pulse_itemsNcsvtt|��|�|j|jdt|j|j�|_|j	|j
kr(|j
|j	d|_
|j	dkr9|j|jt|j	�|_dS)NgY@g@rT)rr�pulse�
current_bytes�
current_items�float�total_bytes�total_itemsr'�current_cpsr r&)r"�ownerr#rrr>�s�

�zAcquireProgress.pulsecCs
|jdkS)Nr)r r!rrr�isDownloadSpeedEstimated�s
z(AcquireProgress.isDownloadSpeedEstimatedcCsP|jdkr|d}|d}td�t|�t|�f}|Std�t||j�}|S)z! get the estimated download time rg�#Ag�SAz_This download will take about %s with a 40Mbit connection and about %s with a 5Mbit connection.z7This download will take about %s with your connection. )r rr)r"�required_download�	time5Mbit�
time40Mbit�srrr�estimatedDownloadTime�s
�z%AcquireProgress.estimatedDownloadTime�N)�__name__�
__module__�__qualname__rr%r-r<r>rFrK�
__classcell__rrr#rrs
rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�InstallProgressz_ Base class for InstallProgress that supports some fancy
      stuff like apport integration
  cCstjjj�|�d|_dSrL)�apt�progress�baserQr�	master_fdr!rrrr�s
zInstallProgress.__init__c
Cs�	z
t�|jggg|j�Wntjy*}z|jdtjkr �WYd}~nd}~ww|��zt�	|j
tj�\}}||j
krBW|SWn&tyi}z|jtjkrR�|jtj
kr_WYd}~|SWYd}~nd}~wwq)z�Wait for child progress to exit.

      The return values is the full status returned from os.waitpid()
      (not only the return code).
      TrN)�select�statusfd�select_timeout�error�args�errno�EINTR�update_interface�os�waitpid�	child_pid�WNOHANG�OSError�ECHILD)r"�e�pid�resrrr�
wait_child�s4���
�
����zInstallProgress.wait_childcCs�|��}|dkr\t�tjtj�z|�|j�}Wn>tyV}z2td|�t�	d�t
dd��}|�t|��Wd�n1sAwYt
�|j�WYd}~nd}~wwt
�|�||_t
�|���}|S)Nrz!Exception during pm.DoInstall(): zException during pm.DoInstall()z./var/run/ubuntu-release-upgrader-apt-exception�w)�fork�signal�SIGPIPE�SIG_IGN�
do_install�writefd�	Exception�printr0�	exception�open�write�strr^�_exit�
RESULT_FAILEDr`�WEXITSTATUSrg)r"�pmrerfrd�frrr�run�s$

���
zInstallProgress.runcCs�tjjj�|||�t�d||f�d|vrtj�|�}|�	d�d�
�r2d�|�	d�dd��}d|vr=|�	d�d}t||�dS)z install error from a package z*got an error from dpkg for pkg: '%s': '%s'�/�-rrNr)
rRrSrTrQrYr0r^�path�basename�split�isdigit�joinr)r"�pkg�errormsgrrrrY�szInstallProgress.errorN)rMrNrO�__doc__rrgrzrYrrrrrQ�srQc@seZdZddd�ZdS)�DumbTerminalFcCsddl}|�|�dS)z7 expects a command in the subprocess style (as a list) rN)�
subprocess�call)r"�cmd�hiddenr�rrrr��szDumbTerminal.callN�F)rMrNrOr�rrrrr��sr�c@s$eZdZdd�Zdd�Zdd�ZdS)�SampleHtmlViewcC�dSrLr)r"�urlrrrrr�r=zSampleHtmlView.opencCr�rLrr!rrr�show�r=zSampleHtmlView.showcCr�rLrr!rrr�hider=zSampleHtmlView.hideN)rMrNrOrrr�r�rrrrr��sr�c@s(eZdZdZdZdZdZdZdZdZ	dS)	�Stepr�r����N)
rMrNrO�PREPARE�MODIFY_SOURCES�FETCH�INSTALL�CLEANUP�REBOOT�Nrrrrr�sr�zPreparing to upgradezGetting new software channelszGetting new packageszInstalling the upgradeszCleaning upc@s�eZdZdZdd�Zdd�Zdd�Zd3d	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Z	d4dd�Zd5dd�Zd6d d!�Zd"d#�Zd$d%�Zd&d'�Zd3d(d)�Zd3d*d+�Zd,d-�Zd7d/d0�Zd1d2�ZdS)8�DistUpgradeViewz" abstraction for the upgrade view cCs
d|_dS)NF)�needs_screenr!rrrrszDistUpgradeView.__init__cCstjj��S)z5 return a OpProgress() subclass for the given graphic)rRrSrT�
OpProgressr!rrr�getOpCacheProgresssz"DistUpgradeView.getOpCacheProgresscC�t�S)z# return an acquire progress object )rr!rrr�getAcquireProgress�z"DistUpgradeView.getAcquireProgressNcCr�)z" return a install progress object )rQ)r"�cacherrr�getInstallProgress r�z"DistUpgradeView.getInstallProgresscCr�rL)r�r!rrr�getTerminal#�zDistUpgradeView.getTerminalcCr�rL)r�r!rrr�getHtmlView%r�zDistUpgradeView.getHtmlViewcCr9)z\ update the current status of the distUpgrade based
            on the current view
        Nr)r"�msgrrr�updateStatus'�zDistUpgradeView.updateStatuscCr9)z8 provide a visual feedback that the upgrade was aborted Nrr!rrr�abort,�zDistUpgradeView.abortcCst��|j�dS)z� we have 6 steps current for a upgrade:
        1. Analyzing the system
        2. Updating repository information
        3. fetch packages
        3. Performing the upgrade
        4. Post upgrade stuff
        5. Complete
        N)�
get_telemetry�	add_stage�name�r"�steprrr�setStep/s	zDistUpgradeView.setStepcCr9)z" hide a certain step from the GUI Nrr�rrr�hideStep:r�zDistUpgradeView.hideStepcCr9)z" show a certain step from the GUI Nrr�rrr�showStep=r�zDistUpgradeView.showStepTc
Cs�d|_||_g|_g|_g|_g|_g|_g|_|D]B}|jr&|j�	|�q|j
r0|j�	|�q|jr:|j�	|�q|jrS|j
j�|j�rL|j�	|�q|j�	|�q|jr\|j�	|�q|j|j|_|j��|j��|j��|j��|j��d}t|j�t|j�}	t|j�t|j�}
t|j�}t|j�dkr�|tddt|j��dt|j�i7}|d7}|	dkr�|tdd	|	�|	7}|d
7}|
dkr�|tdd|
�|
7}|d
7}|dkr�|td
d|�|7}|d
7}|dk�rt�|�}t|t�r�|�t�}|td�|7}||���|�7}||
dk�r9||
|	dk�r9|�����r0|dtd�7}n|dtd�7}n
|	dk�rF|dtd�7}||
|	dk�r_td�}td�}|�||�dS||_dS)zm display the list of changed packages (apt.Package) and
            return if the user confirms them
        r�
rzo%(amount)d installed package is no longer supported by Canonical. You can still get support from the community.zq%(amount)d installed packages are no longer supported by Canonical. You can still get support from the community.�amountz

z"%d package is going to be removed.z$%d packages are going to be removed.� z(%d new package is going to be installed.z*%d new packages are going to be installed.z#%d package is going to be upgraded.z%%d packages are going to be upgraded.z&

You have to download a total of %s. �dz

%sznInstalling the upgrade can take several hours. Once the download has finished, the process cannot be canceled.z{Fetching and installing the upgrade can take several hours. Once the download has finished, the process cannot be canceled.z.Removing the packages can take several hours. rz,The software on this computer is up to date.zRThere are no upgrades available for your system. The upgrade will now be canceled.FT) �confirmChangesMessage�	demotions�	toInstall�toReinstall�	toUpgrade�toRemove�toRemoveAuto�toDowngrade�marked_install�append�marked_upgrade�marked_reinstall�
marked_delete�_pcache�	_depcache�is_auto_installed�_pkg�marked_downgrade�sort�lenrr.�size_to_str�
isinstance�bytes�decode�ENCODINGrr�rKrFrY)
r"�summary�changesr��downloadSize�actions�removal_boldr�r��pkgs_remove�	pkgs_inst�pkgs_upgrade�downloadSizeStrrrr�confirmChanges@s��





��������



� 
zDistUpgradeView.confirmChanges�NocCr9)z0 ask a Yes/No question and return True on 'Yes' Nr�r"r�r��defaultrrr�askYesNoQuestion�r�z DistUpgradeView.askYesNoQuestion�CancelcCr9)z= ask a Cancel/Continue question and return True on 'Continue'Nrr�rrr�askCancelContinueQuestion�r�z)DistUpgradeView.askCancelContinueQuestioncCstd�}td�}|�||�S)z2 generic ask about the restart, can be overridden zReboot requiredzMThe upgrade is finished and a reboot is required. Do you want to do this now?)rr�)r"r�r�rrr�confirmRestart�szDistUpgradeView.confirmRestartcC�&td�}td�}td�}|�|||�S)NzAction requiredz9Exit all other instances of Ubuntu WSL before continuing.z'Unsaved progress may otherwise be lost.�r�information�r"r�r��extendedrrr�adviseExitOtherWSL��z"DistUpgradeView.adviseExitOtherWSLcCr�)NzWSL restart requiredz!Exit this instance of Ubuntu WSL.z"The upgrade will then be complete.r�r�rrr�adviseRestartWSL�r�z DistUpgradeView.adviseRestartWSLcCr9)z display a error Nr�r"r�r��extended_msgrrrrY�r�zDistUpgradeView.errorcCr9)z display a information msgNrr�rrrr��r�zDistUpgradeView.informationcCr9)zQ process gui events (to keep the gui alive during a long
            computation Nrr!rrr�
processEvents�szDistUpgradeView.processEventsFcCr9)zX do a progress pulse (e.g. bounce a bar back and forth, show
          a spinner)
      Nr)r"�finishedrrr�
pulseProgress�r�zDistUpgradeView.pulseProgresscCs|�||d�|��dS)zr
      show demoted packages to the user, default implementation
      is to just show a information dialog
      r�N)r�r�)r"r�r�r�rrr�
showDemotions�szDistUpgradeView.showDemotionsrLr:)r�)r�r�)rMrNrOr�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rYr�r�r�r�rrrrr�s2

�
c



r��__main__)+�DistUpgradeGettextrrr�	telemetryrr�rR�enumrr[r^r.�localer0rjrV�DistUpgradeApportr�	setlocale�LC_ALL�getdefaultlocale�coder�rq�putenvr	rY�info�	getlocalerrSrTrrQ�objectr�r�r�r�rM�fpr>rrrr�<module>s\
�D6@�=�

Spamworldpro Mini