Mercurial > hg > Feedworm
view feedworm.py @ 198:460a3062c5e6
create the database if it doesn't exist and drop it after test
author | dirk |
---|---|
date | Fri, 27 Jan 2012 02:35:46 +0100 |
parents | 66d1efcb8e8a |
children | bb3c851b18b1 |
line wrap: on
line source
from MainWindow import MainWindow from PyQt4 import QtGui from PyQt4.QtNetwork import QNetworkProxy import BackendFactory import logging import sys import warnings def setupProxy(preferences): if preferences.isProxyConfigured() and preferences.useProxy(): proxyHost = preferences.proxyHost() proxyPort = preferences.proxyPort() proxy = QNetworkProxy(QNetworkProxy.HttpProxy, proxyHost, proxyPort) QNetworkProxy.setApplicationProxy(proxy) if __name__ == '__main__': # filter out the warnings about duplicate inclusion of argparse warnings.filterwarnings("ignore", category=UserWarning) 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_())