!ffdZddlZddlZddlZddlZGddejjZy)z Debian crash database interface.Nc*eZdZdZdZdZddZdZy) CrashDatabaseziDebian crash database. This is a Apport CrashDB implementation for interacting with Debian BTS. ctjjj|||||_|jj dsd|jd<|jj dsd|jd<yy)zInitialize crash database connection. Debian implementation is pretty basic as most of its bug management processes revolve around the email interface smtphostzreportbug.debian.org recipientzsubmit@bugs.debian.orgN)apportcrashdbr__init__optionsget)self auth_filer s Incomplete backtrace. Please install the debug symbol packages)r r has_useful_stacktracerr raccepts)r reports rrzCrashDatabase.accepts+sn||).B&.PN ' ( 6 !&*F*F*HP ' (~~++33D&AArNc|j|sJ |djd\}}t j 5}|j jd|djd|j jd|djd|j jd jd |d =|j||j jd tjjj|j jjd}d d d |d d<|j d|d<|j d|d<|j#d|j d|j#dd|dj%t'j(|j d}|j+|j d|j d|j-jd|j/y#ttf$rYywxYw#t$rYwxYw#1swYxYw)zUpload given problem report return a handle for it. In Debian, we use BTS, which is heavily email oriented. This method crafts the bug into an email report understood by Debian BTS. Package Fz Package:  zUTF-8z Version: z z============================= CoreDumprNTitleSubjectrFromrToz X-Debbugs-CCUsertagzapport- ProblemTyperT)rsplitKeyError ValueErrortempfileNamedTemporaryFilefilewriteencodeseekemailmimetextMIMETextreaddecoder add_headerlowersmtplibSMTPsendmail as_stringquit) r rprogress_callbackuser_message_callback buggy_package buggy_versiontempmsgsmtps ruploadzCrashDatabase.upload<s||F### -3I->-D-DS-I *]M ( ( * Md IIOOi b9@@I J IIOOi f=DDWM N IIOO@HHQ R :& LL  IINN1 **//**499>>+;+B+B7+KLC+ M. Ill8,F LL-D  ~t||H'=> yGF=,A,G,G,I+J"KL||DLL45 LL " LL % MMO " "7 + S*%      M MsCH=BI"I ArKs.&iFNN00ir