view feedworm-gui.py @ 135:b2ef673607e3

added a TODO item
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 23 Aug 2011 03:51:15 +0200
parents 9e1e6b96d8b0
children
line wrap: on
line source


from MainWindow import MainWindow
from PyQt4 import QtGui
from PyQt4.QtNetwork import QNetworkProxy
from backend.sqlalchemy.SqlAlchemyBackend import SqlAlchemyBackend
from backend.couchdb.CouchDbBackend import CouchDbBackend
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 = SqlAlchemyBackend()
    backend = CouchDbBackend()
    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_())