def bugzilla(self): """ Return Bugzilla instance. TODO: check whether we should use cookies or not """ if self._bugzilla is not None: return self._bugzilla self._baseurl = self.options.get('baseurl') self._bugzilla = Bugz(self._baseurl) cj = CookiePot().make_lwp_cookiejar(self._bugzilla.cookiejar.filename, self._bugzilla.host) self._bugzilla.cookiejar = cj self._bugzilla.opener = build_opener(HTTPCookieProcessor(cj)) if self.username is None or self.password is None: if not self._bugzilla.try_auth(): self._bugzilla = None raise apport.crashdb.NeedsCredentials, self.distro else: self._bugzilla = Bugz(self._baseurl, self.username, self.password) try: self._bugzilla.auth() except RuntimeError: # Happens when the username/password pair is invalid. raise apport.crashdb.NeedsCredentials, self.distro return self._bugzilla
def __init__(self, *args): QtGui.QWidget.__init__(self, None) self.ui = Ui_bugWidget() self.ui.setupUi(self) QObject.connect(self.ui.logoutButton, SIGNAL("clicked()"), self.logout) self.bugzilla = Bugz(BUGZILLA_URL) cj = CookiePot().make_lwp_cookiejar( self.bugzilla.cookiejar.filename, #'bugs.pardus.org.tr') 'landfill.bugzilla.org') self.bugzilla.cookiejar = cj self.bugzilla.opener = build_opener(HTTPCookieProcessor(cj)) self.is_logged_in = False