Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/apport/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/apport/ui.pyc


Yc@sCdZdZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlmZmZddlmZejjddZdZd	Zeed
ZdfdYZd
fdYZ dS(sAbstract Apport user interface.

This encapsulates the workflow and common code for any user interface
implementation (like GTK, Qt, or CLI).
s2.0.1iN(tget_crashdbtNeedsCredentials(tunicode_gettexttAPPORT_SYMPTOMS_DIRs/usr/share/apport/symptomsi cCst|jtjdS(s$Return exception message as unicode.treplace(tstrtdecodetlocaletgetpreferredencoding(t	exception((s-/usr/lib/python2.7/dist-packages/apport/ui.pytexcstrscBs,|j|j|ri}y}ee|j|d|fdU|d||}|svejd|dSejj	ejj
|d|d<Wqek
rej
dqejd|ejej
dqXn|s(d|krejj|d}q(ed	ny|j|Wn@ek
rX|s|q|n$ek
r{}e||d
<dSX|j|rej
dnyd|kr dejkr d
|kred|d
<q ejj|d
jds ed|djd|d
<q nWnek
r@|sAqAnXd|kro|j}|ro||d<qon|ddkrdejkr|j}	|	reddj|	|d
<qn|r(e|d}
ej |d|j!|
de"|
j#ejj$|ej |dndS(syCollect information about report.

    Encapsulate calls to add_*_info() and update given report, so that this
    function is suitable for threading.

    ui must be a HookUI instance, it gets passed to add_hooks_info().

    If reportfile is not None, the file is written back with the new data.

    If symptom_script is given, it will be run first (for run_symptom()).
    texecNtruns8symptom script %s did not determine the affected packageitSymptomssymptom script %s crashed:tExecutablePathsAcalled without a package, and report does not have ExecutablePathtUnreportableReasontCrashDBtAPPORT_DISABLE_DISTRO_CHECKtPackages4This package does not seem to be installed correctlysXThis is not an official %s package. Please remove any third party package and try again.t
DistroReleasetTitletProblemTypetCrashtAPPORT_IGNORE_OBSOLETE_PACKAGESsYou have some obsolete package versions installed. Please upgrade the following packages and check if the problem still occurs:

%ss, tatonly_newi(%tadd_gdb_infotadd_os_infotcompiletopentreadtapportterrortostpathtsplitexttbasenamet
StopIterationtsystexitt	tracebackt	print_exct	fileutilstfind_file_packagetKeyErrortadd_package_infot
ValueErrortSystemErrorR
tadd_hooks_infotenviront_t	packagingtis_distro_packagetsplittstandard_titletobsolete_packagestjointchmodtwritetTruetclosetmark_report_seen(treportt
reportfiletpackagetuitsymptom_scripttignore_uninstalledtsymbtettitletold_pkgstf((s-/usr/lib/python2.7/dist-packages/apport/ui.pytthread_collect_info$sv

&*


	 #

 
t
UserInterfacecBseZdZdZdZedZd(dZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZd(ed(dZdZdZdZdZdZdZdZedZdZdZ dZ!dZ"dZ#dZ$d Z%d!Z&d"Z'd#Z(d$Z)d%Z*d&Z+d'Z,RS()sApport user interface API.

    This provides an abstract base class for encapsulating the workflow and
    common code for any user interface implementation (like GTK, Qt, or CLI).

    A concrete subclass must implement all the abstract ui_* methods.
    cCsd|_d|_d|_d|_t|_ytd|_WnFt	k
rk}t
jdt|nt
k
rt
jdnXtj|j|jdS(s8Initialize program state and parse command line options.RsDCould not import module, is a package upgrade in progress? Error: %ss8/etc/apport/crashdb.conf is damaged: No default databaseN(tgettext_domaintNoneR>treport_filetcur_packagetFalset
offer_restartRtcrashdbtImportErrorRtfatalRR,tgettextt
textdomaint
parse_argv(tselfRE((s-/usr/lib/python2.7/dist-packages/apport/ui.pyt__init__s					
cCsjt}t|_tjdkr3tjj}ntjj}x!|D]}|j	|t}qIW|S(sPresent all currently pending crash reports.

        Ask the user what to do about them, and offer to file bugs for them.

        Return True if at least one crash report was processed, False
        otherwise.
        i(
ROR;RPR!tgeteuidRR*tget_new_system_reportstget_new_reportst	run_crash(RWtresulttreportsRH((s-/usr/lib/python2.7/dist-packages/apport/ui.pytrun_crashess	


c
Cs'||_y"ytjj|Wntk
r3nX|j|sGdSd|jkrZdS|jjddkrd|jkrd|jkrd|jkrtj	j
|jjdtd	}td
|}|jtd|d|td
fdStjj
}|j|}|ds6|drIy d|jkrU|jnWqIttjfk
r}d|_|jtddtdt|f|jdStk
r|jtdtd|jdStk
rE}tjt||jtdtddt||jdSXn|jdkr\dS|drt|jdS|dr|jn|dr|jjn|dsdSd|jkr|jddkrtjj|n|jj|jr*|jr
dS|j rdS|j!nWntk
r}|j"t"j#t"j$fkr|jtdtdt%j&dq#|j"t"j'kr|jtdtdt%j&dq#|jtd|j(t%j&dn8tk
r"}|j"t"j)krtj*dq#nXdS(sPresent and report a particular crash.

        If confirm is True, ask the user what to do about it, and offer to file
        a bug for it.

        If confirm is False, the user will not be asked, and the crash is
        reported right away.
        NtIgnoreRRtSignaltCoreDumpt
StacktraceRsunknown programs+Sorry, the program "%s" closed unexpectedlys
Problem in %ss%s

%ssxYour computer does not have enough free memory to automatically analyze the problem and send a report to the developers.R>texaminetDependenciessInvalid problem reports7This problem report is damaged and cannot be processed.s6The report belongs to a package that is not installed.sBAn error occurred while attempting to process this problem report:s

trestartt	blacklistt
MarkForUploadROs2You are not allowed to access this problem report.itErrors@There is not enough disk space available to process this report.sOut of memory, aborting(+RMRR*R=tOSErrortload_reportR>tgetR!R"R$R2tui_error_messagetallowed_to_reporttui_present_report_detailstcollect_infotIOErrortzlibR RLtreprtui_shutdownR.t	ExceptionRRdRftmark_ignoretmark_report_uploadRQtacceptsthandle_duplicatetcheck_unreportabletfile_reportterrnotEPERMtEACCESR&R'tENOSPCtstrerrortENOMEMRS(RWRMtconfirmtsubjecttheadingRntresponseRE((s-/usr/lib/python2.7/dist-packages/apport/ui.pyR\s		
		












cCso|jjrQ|jjrQ|rQ|jr1tS|jtdtdtStj	d|_
|jjrkyetd|jjjj
}t|d}|t@rd|j_n|j
j|jjWqxttfk
r
|jtdtdtStk
rg}|jtjkr/tS|jtjkra|jtd	td
tSqxXn
|j
j|jjr|jjj|j_n|jjdkrtjj|_n|jj|_y|j|Wn{tk
rc}t|dkr]|js6|jtdtd
|n#|jtdtd|jtSnX|jrtdS|j|j rtSy|j
d=Wnt!k
rnX|jj"r6y?tt#j$j%|jj"d}|j
j&||j'Wqkttfk
r2}|jtdt(|qkXn5tj)j*}|j+|}|drk|j,ntS(s@Report a bug.

        If a pid is given on the command line, the report will contain runtime
        debug information. Either a package or a pid must be specified; if none
        is given, show a list of symptoms.

        If a symptom script is given, this will be run first (used by
        run_symptom()).
        sNo package specifiedsHYou need to specify a package or a PID. See --help for more information.tBugs
/proc/%s/statitlinuxsInvalid PIDs6The specified process ID does not belong to a program.sPermission deniedsfThe specified process does not belong to you. Please run this program as the process owner or as root.spackage does not existsInvalid problem reports7Symptom script %s did not determine an affected packagesPackage %s does not existNtProcCmdlinetwsCannot create reportR>(-toptionsR@tpidtrun_symptomsR;RmR2RORtReportR>RRR5tintt
PF_KTHREADt
add_proc_infoR.RqRjR|tENOENTR~tadd_proc_environtstripR3tget_kernel_packageRNRpRRztadd_extra_tagsRyR,tsaveR!R"t
expanduserR:R<R
R*RnRoR{(RWRBtstattflagsRERHRnR((s-/usr/lib/python2.7/dist-packages/apport/ui.pytrun_report_bug1s

"




	

!#

cCs|jj|jjs8|jtdtdtS|jj|jj}|sx|jtd}|sxtSnt	j
d|_|jjr|jjj
g}n|jj|jj}t}x|D]}||_||jd<||jd<yt	jj|WnKtk
r]tjjtjjt	jjd|s^d|GHqq^nX|jd	tt}qW|s|jtdtd
tS|jj|jj|j|jd=|jd=y|jd=Wntk
rnXt|jd
kr-|jtdtd
tSt	j j!}|j"|}|dr|jj#|jj|jdd|ddtStS(s:Update an existing bug with locally collected information.sUpdating problem reportsYou are not the reporter or subscriber of this problem report, or the report is a duplicate or already closed.

Please create a new report using "apport-bug".sHYou are not the reporter of this problem report. It is much easier to mark a bug as a duplicate of another than to move your comments and attachments to a new bug.

Subsequently, we recommend that you file a new bug report using "apport-bug" and make a comment in this bug about the one you file.

Do you really want to proceed?Rt
SourcePackageRssource_%s.pys8Package %s not installed and no hook available, ignoringRCs$No additional information collected.RtDateiR>sapport informationtchange_descriptiontattachment_comment($RQt
can_updateRt
update_reportRmR2ROtis_reportertui_question_yesnoRRR>R@Rtget_affected_packagesRNR3tget_versionR.R!R"texistsR8t	_hook_dirRpR;tui_info_messaget
add_user_infoRRR,tlenR*RnRotupdate(RWRtrtpkgstinfo_collectedtpRnR((s-/usr/lib/python2.7/dist-packages/apport/ui.pytrun_update_reportsh

	


+	










cBsejejjed}g}g}x|D]}ejj|jdrXq1ni}y*ee|j	|d|fdUWn$e
jd|ej
q1nXd|kre
jd|q1n|jejjejj|d|j|jd	|d
q1W|s%eSeee||\}}e|}e|}|jd|jd|jed|e}|dkr||d}|r|jejje|d
qeSneS(slReport a bug from a list of available symptoms.

        Return False if no symptoms are available.
        s*.pyR2RNssymptom script %s is invalidRs0symptom script %s does not define run() functionitdescriptionis
Other problems+What kind of problem do you want to report?s.py(tglobR!R"R8tsymptom_script_dirR$t
startswithRRRRR R(R)tappendR#RlROtziptsortedtlistRLtui_question_choiceR2RR;(RWtscriptst
symptom_namestsymptom_descriptionstscriptRDtchtsymptom((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRsB
*
)!!

#cCsltjjt|jjd}tjj|s[|jtdtd|jjdS|j	|dS(s#Report a bug with a symptom script.s.pysUnknown symptomsThe symptom "%s" is not known.N(
R!R"R8RRRRRmR2R(RWR((s-/usr/lib/python2.7/dist-packages/apport/ui.pytrun_symptomscCs|jjr|jtS|jjr0|jS|jjd
k	rL|jS|jj	rat
GHtS|jjry|j|jjt
Wn/tk
r}|jtdt|nXtS|jjr|jdtdtjddgdtjdtj}|j\}}|jdkry t|jd	|j_Wn.tk
rw|jtd
tdtSX|jS|jtd
tdd|tSn
|jSd
S(sCall appopriate run_* method according to command line arguments.

        Return True if at least one report has been processed, and False
        otherwise.
        sInvalid problem reportts^After closing this message please click on an application window to report a problem about it.txpropt_NET_WM_PIDtstdouttstderriisCannot create reports2xprop failed to determine process ID of the windows

N(RRRR;tfilebugRRRLRtversiont__version__t
crash_fileR\RORjRmR2R
twindowRt
subprocesstPopentPIPEtcommunicatet
returncodeRR5RR.R_(RWRERtoutterr((s-/usr/lib/python2.7/dist-packages/apport/ui.pytrun_argv$sB


  


c	Cs
tjtd}|jdddtd|jdddd	gdtd
|j\|_|_t|jdks|jdjr|j	d
t
jdnt|jd|j_
d|j_t|j_d|j_d|j_g|_dS(sgParse command line options when being invoked in update mode.

        Return (options, args).
        s%prog <report number>s-ps	--packagethelpsSpecify package name.s--tagtactionRtdefaults@Add an extra tag to the report. Can be specified multiple times.iis-You need to specify a report number to updateN(toptparsetOptionParserR2t
add_optiont
parse_argsRtargsRtisdigitR R&R'RRRLRRORRR(RWt	optparser((s-/usr/lib/python2.7/dist-packages/apport/ui.pytparse_argv_updateSs

)
c
Csttjdkrdtjkritjjtjjtjdtjjtjdtjd<ntjd}|j	ds|j	dr|j
dSntjt
d}|jddd	d
ddd
tdt
d|jddd	d
d
tdt
d|jdddddddt
d|jdddddt
d|jdddt
d |jd!d"dddt
d#|jd$d%dd&dt
d'tjj|jd(dd&dt
d)|jd*d	d+d
gdt
d,|jd-d.d	d
dt
d/ttjdkrw|j	d0rwx&d7D]}tj|j|_qUWn|j\|_|_ttjdkrdSttjd1kr|j	d0rt|j_dSt|jd1krdStjjtjjt|jdd2rLt|j_|jd|j_g|_n/|jdj	d3sx|jdj	d4r|jd|j_g|_n|jdjrt|j_|jd|j_ g|_nd5|jdkrStj!j"|jd}|s/|j#d6|jdtj$d1ng|_t|j_||j_%n(t|j_|jd|j_%g|_dS(8sParse command line options.

        If a single argument is given without any options, this tries to "do
        what I mean".
        itAPPORT_INVOKED_ASs-update-bugs-collectNsF%prog [options] [symptom|pid|package|program path|.apport/.crash file]s-fs
--file-bugRt
store_truetdestRRRsStart in bug filing mode. Requires --package and an optional --pid, or just a --pid. If neither is given, display a list of known symptoms. (Implied if a single argument is given.)s-ws--windows7Click a window as a target for filing a problem report.s-us--update-bugttypeRRs;Start in bug updating mode. Can take an optional --package.s-ss	--symptomtmetavartSYMPTOMsWFile a bug report about a symptom. (Implied if symptom name is given as only argument.)s-ps	--packagesSpecify package name in --file-bug mode. This is optional if a --pid is specified. (Implied if package name is given as only argument.)s-Ps--pidsSpecify a running program in --file-bug mode. If this is specified, the bug report will contain more information.  (Implied if pid is given as only argument.)s-cs--crash-filetPATHsReport the crash from given .apport or .crash file instead of the pending ones in %s. (Implied if file is given as only argument.)s--savesIn bug filing mode, save the collected information into a file instead of reporting it. This file can then be reported later on from a different machine.s--tagRs@Add an extra tag to the report. Can be specified multiple times.s-vs	--versions Print the Apport version number.s-bugis.pys.crashs.apportt/s %s does not belong to a package.(s-fs-us-ss-ps-Ps-c(&RR&targvR!R1R"R8tdirnameR$tendswithRRRR2RRORR*t
report_dirt
SUPPRESS_HELPt
get_optionRRRRR;RRRRRRRR3tget_file_packageR R'R@(RWtcmdRtotpkg((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRVjs~&










$
$,,	cCsf|dkr$tjd|ddS|dkrHtjd|ddStjd|tddS(	sCFormat the given integer as humanly readable and i18n'ed file size.i@Bs%.1fg@@s KBiʚ;g.As MBs GB(Rtformattfloat(RWtsize((s-/usr/lib/python2.7/dist-packages/apport/ui.pytformat_filesizes
cCsd}xr|jD]g}|j|ry&|t|j|jdd7}Wqwtk
rs|t|j|7}qwXqqW|S(s'Return the size of the complete report.iii(R>Rt	gzipvaluetAttributeError(RWRtk((s-/usr/lib/python2.7/dist-packages/apport/ui.pytget_complete_sizes
&
"cCsd}x|jD]v}|dkr|j|ry&|t|j|jdd7}Wqtk
r|t|j|7}qXqqqW|S(s&Return the size of the reduced report.iRbii(R>RRR(RWRR((s-/usr/lib/python2.7/dist-packages/apport/ui.pytget_reduced_sizes
&
%cCs|jsd|jkrtSy5tjddgdtjdtjdkrQtSWntk
rftSXy|jdSWnt	k
rtSXdS(sCheck whether to offer the "Examine locally" button.

        This will be true if the report has a core dump, apport-retrace is
        installed and a terminal is available (see ui_run_terminal()).
        Rbsapport-retraces--helpRRiN(
R>RORtcallRtSTDOUTRjtui_run_terminalRLtNotImplementedError(RW((s-/usr/lib/python2.7/dist-packages/apport/ui.pytcan_examine_locallys

cCsqd|jksttjdkrmtjtjddd|jjd|jdtjdndS(sReopen the crashed application.Ritshs-ctRespawnCommandiN(	R>tAssertionErrorR!tforktsetsidtexeclpRlR&R'(RW((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRfs

,cCs|jtdtdtdtd|jgt}|dkrMdSdtjjd}d}d	|jjd	d
d	}i|d|d6|d|d
6|d|d|d6}|j	||ddS(sLocally examine crash report.sJThis will launch apport-retrace in a terminal window to examine the crash.sRun gdb sessions1Run gdb session without downloading debug symbolss)Update %s with fully symbolic stack traceNs"apport-retrace -S system -C %s -v s~/.cache/apport/retracesapport-retrace t's'\''s--gdb iis	--output t i(
RR2RMRORLR!R"RRR(RWRtretrace_with_downloadtretrace_no_downloadtfileargtcmds((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRds"				
c
Cs1d|jd<d|jkrd|jkrt|jd}|jd=ttj|jdj}||krd|jd<td|jd|jd<dSn|jrd|jkr|r|jjnH|jjd	d
krd|jks#|jjd	d
kr7d|jkr7|r3|ndS|j	t
|}d|jkr1tjj}t
jjd
tddd|j|j|j|||f}|jxI|jr|jy|jWqtk
rtjdqXqW|jtjjtjj||jnd|jkr\td|jd|_n|jd	dks|jd	dksd|jkrFt
jjd
|jjd|jj f}	|	jxL|	jr|jy|	jdWqtk
rtjdqXqW|	j|	j!rF|	j!|jd<qFn|jd	dkr*t
jjd
|jj"d|jf}
|
jxL|
jr|jy|
jdWqtk
rtjdqXqW|
j|
j!}|dk	r*|t#krd|jd<q'||jd<q*nt
jjd
|jj$}|jxL|jr|jy|jdWqRtk
rtjdqRXqRW|j|j%d|jks|jd	j&drd|jkr|j'tdtd|j(tjdn|r-|ndS(sHCollect additional information.

        Call all the add_*_info() methods and display a progress dialog during
        this.

        In particular, this adds OS, package and gdb information and checks bug
        patterns.

        If a symptom script is given, this will be run first (used by
        run_symptom()).
        R;RhRtExecutableTimestampROsPThe problem happened with the program %s which changed since the crash occurred.RNRRRcRettargettnameRIRiRtKernelCrasht
KernelOopsRg?tKnownReportRt1RtKernelsInvalid problem reports7Could not determine the package or source package name.()R>RR!Rtst_mtimeR2RNRRlt!ui_start_info_collection_progresstHookUIR1tcopyRtREThreadRIRMtstarttisAlivet!ui_pulse_info_collection_progresst
process_eventtKeyboardInterruptR&R'R8tclearRt	exc_raiseRRLRQtsearch_bug_patternstget_bugpattern_baseurltreturn_valuetknownR;t	anonymizet ui_stop_info_collection_progressRRmRt(
RWRBRCton_finishedt	orig_timetcur_timethookuitorig_envticthreadtbpthreadtknown_threadtvaltanonymize_thread((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRp+s



	''






















cCstj\}}tjdkrtj|tj\}}|rtd}td|}tj|j}|r|d|7}n|j||nytj|Wnt	k
rnXdStj
tj|y5ttjd}	ddd	d
t
|	g}
Wntk
r2g}
nXy[ytj|
d|gWn9t	k
r}tj|dtd
ttjdnXWn6tk
r}tj|t
|tjdnXdS(sjOpen the given URL in a new browser window.

        Display an error dialog if everything fails.
        isUnable to start web browsers'Unable to start web browser to open %s.s
NtSUDO_UIDtsudos-Hs-ut#sxdg-opentnewt	autoraisei(R!tpipeRR<twaitR2tfdopentreadlineRmRjRRtgetenvRt	TypeErrorRRt
webbrowserRR;R&R'RuR:(RWturlRRRtstatusRFR tmessagetuidtsudo_prefixRE((s-/usr/lib/python2.7/dist-packages/apport/ui.pytopen_urls@



 

c
CsW|jj|jsdS|jjd|jjdkrby|jd=Wqbtk
r^qbXny|jd=Wntk
rnXdad}|jtj	j	d|jj
d|j|f}|jx1|jr|j
ty|jd|jWqtk
r(tjd	qtk
r}td
}|j|t|}|dk	r|\}}|jj||tj	j	d|jj
d|j|f}|jqqtk
r}|jtddtd
t|fdSXqW|j|j}|j|jj|j|}	|	rS|j|	ndS(sGUpload the current report and guide the user to the reporting web page.NtPackageArchitecturetArchitecturetStacktraceAddressSignaturecSst||adS(N(Rt_UserInterface__upload_progress(tsentttotal((s-/usr/lib/python2.7/dist-packages/apport/ui.pytprogress_callbacksR
Rg?isDPlease enter your account information for the %s bug tracking systemsNetwork problems%s

%ssHCannot connect to crash database, please check your Internet connection.(RQRxR>RlR,RLRBtui_start_upload_progressRRtuploadRRtui_set_upload_progressR8RRR&R'RR2tui_question_userpassR
tset_credentialsRuRmRtui_stop_upload_progresstget_comment_urlR>(
RWREtupthreadRER;tdatatusertpasswordtticketR9((s-/usr/lib/python2.7/dist-packages/apport/ui.pyR{s\$

	




		

cCsUyMtj|_|jjt|ddd|jkrLtdnWntk
rd|_|jt	dt	dt
Stk
r}d|_|jt	d|jt
St
tttjfk
r}d|_|jt	ddt	d	t|ft
SXd
|jkr?|jd
jd|_n$tjj|jjdd
|_|jddkrQ|jjdd
}tjj|st	d}|rd||jdf}nd|_|jt	d|t
Sd|jkrQtjj|jdsNt	d}|jt	dd||jdft
SqQntS(sLoad report from given path and do some consistency checks.

        This might issue an error message and return False if the report cannot
        be processed, otherwise self.report is initialized and True is
        returned.
        tbinaryt
compressedRs+Report does not contain "ProblemType" fieldsMemory exhaustionsEYour system does not have enough memory to process this crash report.sInvalid problem reports%s

%ss7This problem report is damaged and cannot be processed.RiRRRsIThis problem report applies to a program which is not installed any more.s%s (%s)tInterpreterPathN(RRR>tloadRR.tMemoryErrorRLRmR2RORqRR7RRrR RsR5RNR*R+RlR!R"RRR;(RWR"REtexe_pathtmsg((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRk!sP
	
			$	
cCs|jj|jstSd|jkrt|jdtr^|jdjd|jd<nd|jkrtd|jdjd}nd}|j	|td|jdt
StS(snCheck if the current report is unreportable.

        If so, display an info message and return True.
        RsUTF-8Rs
Problem in %siRs#The problem cannot be reported:

%s(RQRxR>ROt
isinstanceRRR2R5RR;(RWRF((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRzWs $cCsd|jkr8tjj|jdr8|jd}n3ytjj|j}Wntk
rjd}nX|ry ddl
}|jj|SWqdSXndS(sReturn a matching xdg.DesktopEntry for the current report.

        Return None if report cannot be associated to a .desktop file.
        tDesktopFileiN(R>R!R"RRR*tfind_package_desktopfileRNR.RLtxdg.DesktopEntrytDesktopEntry(RWtdesktop_filetxdg((s-/usr/lib/python2.7/dist-packages/apport/ui.pytget_desktop_entryjs(

cCs|jj|jstSd|jkr,tS|jdjdru|jtdtd|j|jdn|jtdtdtS(sCheck if current report matches a bug pattern.

        If so, tell the user about it, open the existing bug in a browser, and
        return True.
        RthttpsProblem already knownsThis problem was already reported in the bug report displayed in the web browser. Please check if you can add any further information that might be helpful for the developers.s;This problem was already reported to developers. Thank you!(	RQRxR>RORRR2R>R;(RW((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRy~s

cCsj|jst|jjrf|jjdd}|rC|d7}n|dj|jj|jd<ndS(s6Add extra tags to report specified with --tags on CLI.tTagsRRN(R>RRttagRlR8(RWttags((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRs
cCstddS(sShow details of the bug report.

        Return the action and options as a dictionary:

        - Valid keys are: report the crash ('report'), restart
          the crashed application ('restart'), or blacklist further crashes
          ('blacklist').
        s.this function must be overridden by subclassesN(R(RWRn((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRos	cCstddS(s:Show an information message box with given title and text.s.this function must be overridden by subclassesN(R(RWRFttext((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRscCstddS(s4Show an error message box with given title and text.s.this function must be overridden by subclassesN(R(RWRFRe((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRmscCstddS(sOpen a indefinite progress bar for data collection.

        This tells the user to wait while debug information is being
        collected.
        s.this function must be overridden by subclassesN(R(RW((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRscCstddS(saAdvance the data collection progress bar.

        This function is called every 100 ms.
        s.this function must be overridden by subclassesN(R(RW((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRscCstddS(s,Close debug data collection progress window.s.this function must be overridden by subclassesN(R(RW((s-/usr/lib/python2.7/dist-packages/apport/ui.pyR"scCstddS(s{Open progress bar for data upload.

        This tells the user to wait while debug information is being uploaded.
        s.this function must be overridden by subclassesN(R(RW((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRFscCstddS(sUpdate data upload progress bar.

        Set the progress bar in the debug data upload progress window to the
        given ratio (between 0 and 1, or None for indefinite progress).

        This function is called every 100 ms.
        s.this function must be overridden by subclassesN(R(RWtprogress((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRHscCstddS(s(Close debug data upload progress window.s.this function must be overridden by subclassesN(R(RW((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRKscCsdS(sdCalled right before terminating the program.

        This can be used for for cleaning up.
        N((RW((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRtscCstddS(sRun command in, or check for a terminal window.

        If command is given, run command in a terminal window; raise an exception
        if terminal cannot be opened.

        If command is None, merely check if a terminal application is available
        and can be launched.
        s.this function must be overridden by subclassesN(R(RWtcommand((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRs	cCstddS(sShow a yes/no question.

        Return True if the user selected "Yes", False if selected "No" or
        "None" on cancel/dialog closing.
        s.this function must be overridden by subclassesN(R(RWRe((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRscCstddS(smShow an question with predefined choices.

        options is a list of strings to present. If multiple is True, they
        should be check boxes, if multiple is False they should be radio
        buttons.

        Return list of selected option indexes, or None if the user cancelled.
        If multiple == False, the list will always have one element.
        s.this function must be overridden by subclassesN(R(RWReRtmultiple((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRs
cCstddS(smShow a file selector dialog.

        Return path if the user selected a file, or None if cancelled.
        s.this function must be overridden by subclassesN(R(RWRe((s-/usr/lib/python2.7/dist-packages/apport/ui.pytui_question_filescCstddS(sRequest username and password from user.

        message is the text to be presented to the user when requesting for
        username and password information.

        Return a tuple (username, password), or None if cancelled.
        s.this function must be overridden by subclassesN(R(RWR;((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRIsN(-t__name__t
__module__t__doc__RXR_R;R\RLRRRRRRRVRRRRRfRdRORpR>R{RkRzR`RyRRoRRmRRR"RFRHRKRtRRRRiRI(((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRJsR		we	S	0		/		^						
		,	C	6											
						RcBsPeZdZdZdZdZedZdZdZ	dZ
RS(sgInteractive functions which can be used in package hooks.

    This provides an interface for package hooks which need to ask interactive
    questions. Directly passing the UserInterface instance to the hooks needs
    to be avoided, since we need to call the UI methods in a different thread,
    and also don't want hooks to be able to poke in the UI.
    cCsF||_tj|_tj|_d|_d|_d|_dS(sSCreate a HookUI object.

        ui is the UserInterface instance to wrap.
        N(	RAt	threadingtEventt_request_eventt_response_eventRLt_request_fnt
_request_argst	_response(RWRA((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRX)s			cCs|jdd|S(sShow an information with OK/Cancel buttons.

        This can be used for asking the user to perform a particular action,
        such as plugging in a device which does not work.
        RR(t_trigger_ui_request(RWRe((s-/usr/lib/python2.7/dist-packages/apport/ui.pytinformation;scCs|jd|S(sShow a yes/no question.

        Return True if the user selected "Yes", False if selected "No" or
        "None" on cancel/dialog closing.
        R(Rt(RWRe((s-/usr/lib/python2.7/dist-packages/apport/ui.pytyesnoCscCs|jd|||S(smShow an question with predefined choices.

        options is a list of strings to present. If multiple is True, they
        should be check boxes, if multiple is False they should be radio
        buttons.

        Return list of selected option indexes, or None if the user cancelled.
        If multiple == False, the list will always have one element.
        R(Rt(RWReRRh((s-/usr/lib/python2.7/dist-packages/apport/ui.pytchoiceKs
cCs|jd|S(smShow a file selector dialog.

        Return path if the user selected a file, or None if cancelled.
        Ri(Rt(RWRe((s-/usr/lib/python2.7/dist-packages/apport/ui.pytfileWscGs|jjst|jjs,t|jdksAtd|_||_||_|jj|jj	d|_|jj
|jS(s5Called by HookUi functions in info collection thread.N(Rotis_setRRpRqRLRsRrtsetR3R(RWtfnR((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRtbs			

	
cCsx|jjd|jjs#dS|jjs9t|jjt|j|j|j	|_
|jjdS(s;Called by GUI thread to check and process hook UI requests.g?N(RoR3RyRpRRtgetattrRARqRrRsRz(RW((s-/usr/lib/python2.7/dist-packages/apport/ui.pyRus
!(RjRkRlRXRuRvRORwRxRtR(((s-/usr/lib/python2.7/dist-packages/apport/ui.pyR!s					(!RlRRR&tos.pathR!RR(RRTR|RrRRmR8Rtapport.fileutilstapport.REThreadtapport.crashdbRRRR2R1RlRRR
RLRORIRJR(((s-/usr/lib/python2.7/dist-packages/apport/ui.pyt<module>s&T$$		^