view AddFeed.py @ 242:03e3ebb1d52f

Disable the use of a proxy when updating feeds - https traffic does not seem to work currently over a proxy.
author Dirk Olmes <dirk@xanthippe.ping.de>
date Mon, 08 Jun 2015 19:20:46 +0200
parents 699d8f1cebd4
children 3ce39af93e77
line wrap: on
line source

# -*- coding: utf-8 -*-
from PyQt4.QtGui import QDialog
from Ui_AddFeed import Ui_AddFeed
import logging

class AddFeed(QDialog):
    def __init__(self, backend=None):
        super(AddFeed, self).__init__(None)
        self.backend = backend
        self.exception = None
        self.ui = Ui_AddFeed()
        self.ui.setupUi(self)
        self.ui.url.setFocus()

    def accept(self):
        try:
            url = self.getUrl()
            self.backend.createFeed(url)
        except AttributeError as ae:
            logging.getLogger("AddFeed").info(ae)
            self.exception = ae
        super(AddFeed, self).accept()

    def getUrl(self):
        text = self.ui.url.text()
        # the content of a QLineEdit is a QString, convert it to a Python string
        return str(text)