comparison feedworm.py @ 137:5b131f82057d

allow choosing the backend via commandline option
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 23 Aug 2011 14:36:58 +0200
parents feedworm-gui.py@9e1e6b96d8b0
children 2c91b5653878
comparison
equal deleted inserted replaced
136:7217b060b39c 137:5b131f82057d
1
2 from MainWindow import MainWindow
3 from PyQt4 import QtGui
4 from PyQt4.QtNetwork import QNetworkProxy
5 import BackendFactory
6 import logging
7 import sys
8
9 def setupProxy(preferences):
10 if preferences.isProxyConfigured():
11 proxyHost = preferences.proxyHost()
12 proxyPort = preferences.proxyPort()
13 proxy = QNetworkProxy(QNetworkProxy.HttpProxy, proxyHost, proxyPort)
14 QNetworkProxy.setApplicationProxy(proxy)
15
16 if __name__ == '__main__':
17 logging.basicConfig(level=logging.DEBUG)
18 backend = BackendFactory.createBackend()
19 preferences = backend.preferences()
20 setupProxy(preferences)
21
22 app = QtGui.QApplication(sys.argv)
23 mainWindow = MainWindow(backend)
24
25 maximized = preferences.startMaximized()
26 if maximized:
27 mainWindow.showMaximized()
28 else:
29 mainWindow.show()
30
31 sys.exit(app.exec_())