1 # -*- coding: utf-8 -*-
3 # ------------------------------------------------------------
4 # directly start the browsing
6 # Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
8 # Copyright (C) 2013 AIT Austrian Institute of Technology
9 # AIT Austrian Institute of Technology GmbH
10 # Donau-City-Strasse 1 | 1220 Vienna | Austria
11 # http://www.ait.ac.at
13 # This program is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License
15 # as published by the Free Software Foundation version 2.
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 # Boston, MA 02110-1301, USA.
26 # ------------------------------------------------------------
29 # ------------------------------------------------------------
36 from PyQt4 import QtCore
37 from PyQt4 import QtGui
40 import __init__ as opensecurity
42 if sys.platform == 'win32' or sys.platform == 'cygwin':
43 from cygwin import Cygwin
46 # ------------------------------------------------------------
51 if __name__ == "__main__":
53 if not (sys.platform == 'win32' or sys.platform == 'cygwin'):
54 QtGui.QMessageBox.critical(self.parent(), 'OpenSecurity Error', 'This action is not supported on this platform.\nSorry.')
59 # get a proper browsing VM
62 # TODO: HARDCODED ADDRESS OF OPENSECURITYD
63 browsing_vm = urllib2.urlopen('http://127.0.0.1:8080/browsing').readline()
64 print('Called http://127.0.0.1:8080/browsing got: ' + str(browsing_vm))
68 QtGui.QApplication.instance().processEvents()
69 QtGui.QMessageBox.critical(None, 'Failed to invoke Safe Internet Browsing', 'OpenSecurity Error')