From e88ce5e837860cec0977166f8a086f214d0da59c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 9 May 2014 15:32:01 +0200 Subject: [PATCH] Fix CRLF in depenencies.py --- qutebrowser/utils/dependencies.py | 180 +++++++++++++++--------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/qutebrowser/utils/dependencies.py b/qutebrowser/utils/dependencies.py index 5ad9a7a53..c808cbab0 100644 --- a/qutebrowser/utils/dependencies.py +++ b/qutebrowser/utils/dependencies.py @@ -1,90 +1,90 @@ -# Copyright 2014 Florian Bruhin (The Compiler) -# -# This file is part of qutebrowser. -# -# qutebrowser is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# qutebrowser is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with qutebrowser. If not, see . - -"""Check if everything needed for qutebrowser is there. - -In a separate file because this needs to be done early before any imports. -""" - -import sys - - -def check(): - """Check if all dependencies are met.""" - if sys.hexversion < 0x03030000: - print("Fatal error: At least Python 3.3 is required to run " - "qutebrowser, but {} is installed!".format( - '.'.join(map(str, sys.version_info[:3])))) - sys.exit(1) - import textwrap - try: - import PyQt5.QtCore # pylint: disable=unused-variable - except ImportError: - print(textwrap.dedent(""" - Fatal error: PyQt5 is required to run qutebrowser but could not - be imported! Maybe it's not installed? - - On Debian: - apt-get install python3-pyqt5 python3-pyqt5.qtwebkit - - On Archlinux: - pacman -S python-pyqt5 qt5-webkit - or install the qutebrowser package from AUR - - On Windows: - Use the installer by Riverbank computing or the standalone - qutebrowser exe. - - http://www.riverbankcomputing.co.uk/software/pyqt/download5 - - For other distributions: - Check your package manager for similiarly named packages. - """).strip()) - if '--debug' in sys.argv: - import traceback - print() - traceback.print_exc() - sys.exit(1) - # At this point we can rely on QtCore being available, so we can display an - # error dialog - try: - import PyQt5.QtWebKit - except ImportError: - from PyQt5.QtWidgets import QApplication, QMessageBox - app = QApplication(sys.argv) - msgbox = QMessageBox(QMessageBox.Critical, "qutebrowser: Fatal error!", - textwrap.dedent(""" - Fatal error: QtWebKit is required to run qutebrowser but could not - be imported! Maybe it's not installed? - - On Debian: - apt-get install python3-pyqt5.qtwebkit - - On Archlinux: - pacman -S qt5-webkit - - For other distributions: - Check your package manager for similiarly named packages. - """).strip()) - if '--debug' in sys.argv: - import traceback - print() - traceback.print_exc() - msgbox.resize(msgbox.sizeHint()) - msgbox.exec_() - app.quit() - # At this point we have everything we need. +# Copyright 2014 Florian Bruhin (The Compiler) +# +# This file is part of qutebrowser. +# +# qutebrowser is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# qutebrowser is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with qutebrowser. If not, see . + +"""Check if everything needed for qutebrowser is there. + +In a separate file because this needs to be done early before any imports. +""" + +import sys + + +def check(): + """Check if all dependencies are met.""" + if sys.hexversion < 0x03030000: + print("Fatal error: At least Python 3.3 is required to run " + "qutebrowser, but {} is installed!".format( + '.'.join(map(str, sys.version_info[:3])))) + sys.exit(1) + import textwrap + try: + import PyQt5.QtCore # pylint: disable=unused-variable + except ImportError: + print(textwrap.dedent(""" + Fatal error: PyQt5 is required to run qutebrowser but could not + be imported! Maybe it's not installed? + + On Debian: + apt-get install python3-pyqt5 python3-pyqt5.qtwebkit + + On Archlinux: + pacman -S python-pyqt5 qt5-webkit + or install the qutebrowser package from AUR + + On Windows: + Use the installer by Riverbank computing or the standalone + qutebrowser exe. + + http://www.riverbankcomputing.co.uk/software/pyqt/download5 + + For other distributions: + Check your package manager for similiarly named packages. + """).strip()) + if '--debug' in sys.argv: + import traceback + print() + traceback.print_exc() + sys.exit(1) + # At this point we can rely on QtCore being available, so we can display an + # error dialog + try: + import PyQt5.QtWebKit + except ImportError: + from PyQt5.QtWidgets import QApplication, QMessageBox + app = QApplication(sys.argv) + msgbox = QMessageBox(QMessageBox.Critical, "qutebrowser: Fatal error!", + textwrap.dedent(""" + Fatal error: QtWebKit is required to run qutebrowser but could not + be imported! Maybe it's not installed? + + On Debian: + apt-get install python3-pyqt5.qtwebkit + + On Archlinux: + pacman -S qt5-webkit + + For other distributions: + Check your package manager for similiarly named packages. + """).strip()) + if '--debug' in sys.argv: + import traceback + print() + traceback.print_exc() + msgbox.resize(msgbox.sizeHint()) + msgbox.exec_() + app.quit() + # At this point we have everything we need.