view feedworm.py @ 153:65c4bb6d5add

move management of the selected feed entry into the backend - sqlachemy backend works, couchdb backend currently broken
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sat, 27 Aug 2011 07:29:33 +0200
parents 5b131f82057d
children 2c91b5653878
line wrap: on
line source


from MainWindow import MainWindow
from PyQt4 import QtGui
from PyQt4.QtNetwork import QNetworkProxy
import BackendFactory
import logging
import sys

def setupProxy(preferences):
    if preferences.isProxyConfigured():
        proxyHost = preferences.proxyHost()
        proxyPort = preferences.proxyPort()
        proxy = QNetworkProxy(QNetworkProxy.HttpProxy, proxyHost, proxyPort)
        QNetworkProxy.setApplicationProxy(proxy)
    
if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)
    backend = BackendFactory.createBackend()
    preferences = backend.preferences()
    setupProxy(preferences)

    app = QtGui.QApplication(sys.argv)
    mainWindow = MainWindow(backend)

    maximized = preferences.startMaximized()
    if maximized:
        mainWindow.showMaximized()
    else:
        mainWindow.show()

    sys.exit(app.exec_())