Fix pep8 whining in module dummypythonqt

added myself to copyright
main
Alf Gaida 8 years ago
parent 1e26078459
commit 9fbc1c462c

@ -4,6 +4,7 @@
# === This file is part of Calamares - <http://github.com/calamares> === # === This file is part of Calamares - <http://github.com/calamares> ===
# #
# Copyright 2016-2017, Teo Mrnjavac <teo@kde.org> # Copyright 2016-2017, Teo Mrnjavac <teo@kde.org>
# Copyright 2017, Alf Gaida <agaida@siduction.org>
# #
# Calamares is free software: you can redistribute it and/or modify # Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -54,10 +55,13 @@ _ = gettext.gettext
# exposed as a single QWidget, returned by the widget function. # exposed as a single QWidget, returned by the widget function.
# #
# For convenience, both C++ and PythonQt ViewSteps are considered to be # For convenience, both C++ and PythonQt ViewSteps are considered to be
# implementations of ViewStep.h. Additionally, the Calamares PythonQt API allows # implementations of ViewStep.h. Additionally, the Calamares PythonQt API
# Python developers to keep their identifiers more Pythonic on the Python side. # allows Python developers to keep their identifiers more Pythonic on the
# Thus, all of the following are considered valid method identifiers in a # Python side. Thus, all of the following are considered valid method
# ViewStep implementation: isNextEnabled, isnextenabled, is_next_enabled. # identifiers in a ViewStep implementation: isNextEnabled, isnextenabled,
# is_next_enabled.
@calamares_module @calamares_module
class DummyPythonQtViewStep: class DummyPythonQtViewStep:
def __init__(self): def __init__(self):
@ -80,10 +84,10 @@ class DummyPythonQtViewStep:
btn.setText(_("Click me!")) btn.setText(_("Click me!"))
self.main_widget.layout().addWidget(btn) self.main_widget.layout().addWidget(btn)
# The syntax for signal-slot connections is very simple, though slightly # The syntax for signal-slot connections is very simple, though
# different from the C++ equivalent. There are no SIGNAL and SLOT # slightly different from the C++ equivalent. There are no SIGNAL and
# macros, and a signal can be connected to any Python method (without a # SLOT macros, and a signal can be connected to any Python method
# special "slot" designation). # (without a special "slot" designation).
btn.connect("clicked(bool)", self.on_btn_clicked) btn.connect("clicked(bool)", self.on_btn_clicked)
def on_btn_clicked(self): def on_btn_clicked(self):
@ -100,19 +104,20 @@ class DummyPythonQtViewStep:
def isAtBeginning(self): def isAtBeginning(self):
# True means the currently shown UI page is the first page of this # True means the currently shown UI page is the first page of this
# module, thus a "Back" button click will not be handled by this module, # module, thus a "Back" button click will not be handled by this
# and will cause a skip to the previous ViewStep instead (if any). # module and will cause a skip to the previous ViewStep instead
# Fals means that the present ViewStep provides other UI pages placed # (if any). False means that the present ViewStep provides other UI
# logically "before" the current one, thus a "Back" button click will # pages placed logically "before" the current one, thus a "Back" button
# be handled by this module instead of skipping to another ViewStep. # click will be handled by this module instead of skipping to another
# A module (ViewStep) with only one page will always return True here. # ViewStep. A module (ViewStep) with only one page will always return
# True here.
return True return True
def isAtEnd(self): def isAtEnd(self):
# True means the currently shown UI page is the last page of this # True means the currently shown UI page is the last page of this
# module, thus a "Next" button click will not be handled by this module, # module, thus a "Next" button click will not be handled by this
# and will cause a skip to the next ViewStep instead (if any). # module and will cause a skip to the next ViewStep instead (if any).
# Fals means that the present ViewStep provides other UI pages placed # False means that the present ViewStep provides other UI pages placed
# logically "after" the current one, thus a "Next" button click will # logically "after" the current one, thus a "Next" button click will
# be handled by this module instead of skipping to another ViewStep. # be handled by this module instead of skipping to another ViewStep.
# A module (ViewStep) with only one page will always return True here. # A module (ViewStep) with only one page will always return True here.
@ -139,9 +144,9 @@ class DummyPythonQtViewStep:
# user-visible strings must be retranslated (by calling tr() in C++ or # user-visible strings must be retranslated (by calling tr() in C++ or
# _() in Python) and reapplied on the relevant widgets. # _() in Python) and reapplied on the relevant widgets.
# When the user picks a new UI translation language, Qt raises a QEvent # When the user picks a new UI translation language, Qt raises a QEvent
# of type LanguageChange, which propagates through the QObject hierarchy. # of type LanguageChange, which propagates through the QObject
# By catching and reacting to this event, we can show user-visible # hierarchy. By catching and reacting to this event, we can show
# strings in the new language at the right time. # user-visible strings in the new language at the right time.
# The C++ side of the Calamares PythonQt API catches the LanguageChange # The C++ side of the Calamares PythonQt API catches the LanguageChange
# event and calls the present method. It is then up to the module # event and calls the present method. It is then up to the module
# developer to add here all the needed code to load the module's # developer to add here all the needed code to load the module's
@ -168,6 +173,8 @@ class DummyPythonQtViewStep:
# same rules apply as for ViewStep. No decorators are necessary here, because # same rules apply as for ViewStep. No decorators are necessary here, because
# only the ViewStep implementation is the unique entry point, and a module can # only the ViewStep implementation is the unique entry point, and a module can
# have any number of jobs. # have any number of jobs.
class DummyPQJob: class DummyPQJob:
def __init__(self, my_msg): def __init__(self, my_msg):
self.my_msg = my_msg self.my_msg = my_msg

Loading…
Cancel
Save