Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/DistUpgrade/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyc


Oc@sddlmZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZm
Z
ddlmZdZdejjjfdYZd	ejjjfd
YZdefdYZd
efdYZedd\ZZZZZZZ edededededfdefdYZ!e"dkreZ#e#j$ndS(i(tgettext(tngettextN(tdoAufsChroottdoAufsChrootRsync(tapport_pkgfailurecCst|}|d}|dd}|dd}|d}|dkrQd}nidd6dd6dd6dd	6}|dkrtd
d|||d<n|dkrtdd
|||d<n|dkrtdd|||d<ntdd|||d	<|dkr:|ddkr,|dStd|S|dkrN|dS|dkr|ddkrr|dStd|S|dkr|dS|d	S(s; return the time a bit fuzzy (no seconds if time > 60 secs i<iiittstr_dayst	str_hourststr_minuteststr_secondss%li days%li dayss%li hours	%li hourss
%li minutes%li minutess
%li seconds%li secondss%(str_days)s %(str_hours)sis%(str_hours)s %(str_minutes)siiQi(tintRt_(tsectdaysthourstminutestsecondstmap((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytFuzzyTimeToStr$s>

	



t
FetchProgresscBsJeZdZdZdZdZddZdZdZ	RS(cCs tt|jd|_dS(Ng(tsuperRt__init__t	est_speed(tself((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyRjscCs;tt|jd|_d|_d|_t|_dS(Ng(RRtstartRtetatpercenttFalsetrelease_file_download_error(R((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyRms
			cCstt|j|||||tjkrtjd||jds]|jdrx6dddgD]"}|j|rmt	|_
PqmqmWqndS(Ns update_status: dlFailed on '%s' sRelease.gpgtReleasethttptftptmirror(RRt
update_statustapt_pkgtSTAT_FAILEDtloggingtwarntendswitht
startswithtTrueR(Rturitdescrt
shortDescrtstatustnet((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyR!ss	cCstS(N(R((Rtarg((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytpulse_itemsscCstt|j||j|jdt|j|j|_|j	|j
krm|j
|j	d|_
n|j	dkr|j|jt|j	|_ntS(NgY@g@i(
RRtpulset
current_bytest
current_itemstfloatttotal_bytesttotal_itemsRtcurrent_cpsRRR((Rtowner((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyR0s
cCs
|jdkS(Ni(R(R((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytisDownloadSpeedEstimatedscCsr|jdkrQ|dd}|dd}tdt|t|f}|Stdt||j}|S(	s! get the estimated download time ii8iis[This download will take about %s with a 1Mbit DSL connection and about %s with a 56k modem.s7This download will take about %s with your connection. ii(RRR(RtrequiredDownloadt	timeModemttimeDSLts((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytestimatedDownloadTimes	N(
t__name__t
__module__RRR!R/tNoneR0R8R=(((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyRhs				
	tInstallProgresscBs2eZdZdZdZdZdZRS(s_ Base class for InstallProgress that supports some fancy
      stuff like apport integration
  cCs#tjjjj|d|_dS(N(tapttprogresstbaseRARR@t	master_fd(R((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyRscCsxtry#tj|jggg|jWn1tjk
r_\}}|tjkr`q`nX|jy5tj	|j
tj\}}||j
krPnWqtk
r\}}|tjkrn|tj
krPqqXqW|S(sWait for child progress to exit.

      The return values is the full status returned from os.waitpid()
      (not only the return code).
      (R(tselecttstatusfdtselect_timeoutterrorterrnotEINTRtupdate_interfacetostwaitpidt	child_pidtWNOHANGtOSErrortECHILD(Rterrno_terrstrtpidtres((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyt
wait_childs"	#

cCsd|j}|dkrdtjkr\ttjdtjds\dGHtjdq\ntjtjtjy|j|j	}WnUt
k
r}dG|GHtjdt
dd	jt|tj|jnXtj|n||_tj|j}|dkr`d
tjkr`tjdttjds`tjd|jSn|S(
NitRELEASE_UPGRADE_USE_AUFS_CHROOTtRELEASE_UPGRADE_AUFS_RWDIRs*ERROR: failed to setup aufs chroot overlayis!Exception during pm.DoInstall(): sException during pm.DoInstall()s%/var/run/update-manager-apt-exceptiontwt!RELEASE_UPGRADE_RSYNC_AUFS_CHROOTs doing rsync commit of the updates/FATAL ERROR: doAufsChrootRsync() returned FALSE(tforkRMtenvironRt_exittsignaltSIGPIPEtSIG_IGNt
do_installtwritefdt	ExceptionR$t	exceptiontopentwritetstrtResultFailedROtWEXITSTATUSRWtinfoRRI(RtpmRURVte((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytruns2
	
	


cCstjjjj|||tjd||fd|krTtjj|}nd|krv|j	dd}nt
||dS(s install error from a package s*got an error from dpkg for pkg: '%s': '%s't/RiN(RBRCRDRARIR$RMtpathtbasenametsplitR(Rtpkgterrormsg((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyRIs(R>R?t__doc__RRWRnRI(((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyRAs
			 tDumbTerminalcBseZedZRS(cCsddl}|j|dS(s7 expects a command in the subprocess style (as a list) iN(t
subprocesstcall(RtcmdthiddenRw((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyRxs(R>R?RRx(((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyRvst
DummyHtmlViewcBs#eZdZdZdZRS(cCsdS(N((Rturl((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyRfscCsdS(N((R((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytshowscCsdS(N((R((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pythides(R>R?RfR}R~(((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyR{s		iisPreparing to upgradesGetting new software channelssGetting new packagessInstalling the upgradessCleaning uptDistUpgradeViewcBseZdZdZdZdZddZdZdZ	dZ
dZd	Zd
Z
dZdedZd
dZdZddZddZdZedZdZRS(s" abstraction for the upgrade view cCs
t|_dS(N(Rtneeds_screen(R((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyRs	cCstjjjS(s5 return a OpProgress() subclass for the given graphic(RBRCRDt
OpProgress(R((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytgetOpCacheProgressscCstS(s  return a fetch progress object (R(R((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytgetFetchProgressscCstS(s" return a install progress object (RA(Rtcache((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytgetInstallProgressscCstS(N(Rv(R((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytgetTerminalscCstS(N(R{(R((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytgetHtmlViewscCsdS(s\ update the current status of the distUpgrade based
            on the current view
        N((Rtmsg((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytupdateStatusscCsdS(s8 provide a visual feedback that the upgrade was aborted N((R((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytabortscCsdS(s 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((Rtstep((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytsetStep s	cCsdS(s" hide a certain step from the GUI N((RR((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pythideStep*scCsdS(s" show a certain step from the GUI N((RR((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytshowStep-scCsd|_||_g|_g|_g|_g|_g|_x|D]}|jrh|jj|qF|j	r|jj|qF|j
r|jjj
|jr|jj|q|jj|qF|jrF|jj|qFqFW|jj|jj|jj|jj|jjt|jt|jt|jt|jt|jt|kstd}t|jt|j}	t|j}
t|j}t|jdkr|tddt|jit|jd67}|d7}n|	dkrI|tdd	|	|	7}|d
7}n|
dkr||tdd|
|
7}|d
7}n|dkr|td
d||7}|d
7}n|dkr|tdtj|7}||jj|7}n||
dkrX||
|	dkrX|jjrA|dtd7}q{|dtd7}n#|	dkr{|dtd7}n||
|	dkrtd}td}|j||tS||_tS(sm display the list of changed packages (apt.Package) and
            return if the user confirms them
        Rs
iso%(amount)d installed package is no longer supported by Canonical. You can still get support from the community.sq%(amount)d installed packages are no longer supported by Canonical. You can still get support from the community.tamounts

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

You have to download a total of %s. ids

%ssnInstalling the upgrade can take several hours. Once the download has finished, the process cannot be canceled.s{Fetching and installing the upgrade can take several hours. Once the download has finished, the process cannot be canceled.s.Removing the packages can take several hours. is,The software on this computer is up to date.sRThere are no upgrades available for your system. The upgrade will now be canceled.(tconfirmChangesMessaget	demotionst	toInstallt	toUpgradettoRemovettoRemoveAutottoDowngradetmarked_installtappendtmarked_upgradet
marked_deletet_pcachet	_depcachetis_auto_installedt_pkgtmarked_downgradetsorttlentAssertionErrorRRR"t	SizeToStrRR=R8RIRR((RtsummarytchangesRtdownloadSizetactionstremoval_boldRsRtpkgs_removet	pkgs_insttpkgs_upgrade((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytconfirmChanges0s							
				




U'
	
	
	
$	tNocCsdS(s0 ask a Yes/No question and return True on 'Yes' N((RRRtdefault((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytaskYesNoQuestionscCs(td}td}|j||S(s2 generic ask about the restart, can be overridden sReboot requiredsMThe upgrade is finished and a reboot is required. Do you want to do this now?(RR(RRR((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytconfirmRestartscCsdS(s display a error N((RRRtextended_msg((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyRIscCsdS(s display a information msgN((RRRR((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pytinformationscCsdS(sQ process gui events (to keep the gui alive during a long
            computation N((R((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyt
processEventsscCsdS(sX do a progress pulse (e.g. bounce a bar back and forth, show
          a spinner)
      N((Rtfinished((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyt
pulseProgressscCs |j||dj|dS(sr
      show demoted packages to the user, default implementation
      is to just show a information dialog
      s
N(Rtjoin(RRRR((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyt
showDemotionssN(R>R?RuRRRR@RRRRRRRRR(RRRRIRRRRR(((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyRs(								
		\		t__main__(%tDistUpgradeGettextRRRRBRJRMR"R$R_RFtDistUpgradeAufsRRtDistUpgradeApportRRRCRDtAcquireProgressRRAtobjectRvR{trangetSTEP_PREPAREtSTEP_MODIFY_SOURCESt
STEP_FETCHtSTEP_INSTALLtSTEP_CLEANUPtSTEP_REBOOTtSTEP_NRR>tfpR0(((s?/usr/lib/python2.7/dist-packages/DistUpgrade/DistUpgradeView.pyt<module>s2	D6K$