Easy spacing fixes, trailing stuff
Remove useless trailing \ Remove trailing spaces Add missing empty lines autopep8 -ir -j2 --select=E301,E302,E502,W291,W293,W391 . Diff quickly checked.
This commit is contained in:
parent
c21d1f7925
commit
7094931c92
231 changed files with 474 additions and 67 deletions
|
|
@ -39,6 +39,7 @@ from ..base import BaseApplication
|
|||
|
||||
__all__ = ['QtApplication', 'QtMainWindow', 'QtDo', 'HTMLDelegate']
|
||||
|
||||
|
||||
class QtScheduler(IScheduler):
|
||||
def __init__(self, app):
|
||||
self.app = app
|
||||
|
|
@ -81,6 +82,7 @@ class QtScheduler(IScheduler):
|
|||
def run(self):
|
||||
self.app.exec_()
|
||||
|
||||
|
||||
class QCallbacksManager(QObject):
|
||||
class Request(object):
|
||||
def __init__(self):
|
||||
|
|
@ -132,6 +134,7 @@ class QCallbacksManager(QObject):
|
|||
request.event.wait()
|
||||
return request.answer
|
||||
|
||||
|
||||
class QtApplication(QApplication, BaseApplication):
|
||||
def __init__(self):
|
||||
QApplication.__init__(self, sys.argv)
|
||||
|
|
@ -143,10 +146,12 @@ class QtApplication(QApplication, BaseApplication):
|
|||
def create_weboob(self):
|
||||
return Weboob(scheduler=QtScheduler(self))
|
||||
|
||||
|
||||
class QtMainWindow(QMainWindow):
|
||||
def __init__(self, parent=None):
|
||||
QMainWindow.__init__(self, parent)
|
||||
|
||||
|
||||
class QtDo(QObject):
|
||||
def __init__(self, weboob, cb, eb=None):
|
||||
QObject.__init__(self)
|
||||
|
|
@ -223,6 +228,7 @@ class QtDo(QObject):
|
|||
def thread_eb(self, backend, error, backtrace):
|
||||
self.emit(SIGNAL('eb'), backend, error, backtrace)
|
||||
|
||||
|
||||
class HTMLDelegate(QStyledItemDelegate):
|
||||
def paint(self, painter, option, index):
|
||||
optionV4 = QStyleOptionViewItemV4(option)
|
||||
|
|
@ -260,6 +266,7 @@ class HTMLDelegate(QStyledItemDelegate):
|
|||
|
||||
return QSize(doc.idealWidth(), max(doc.size().height(), optionV4.decorationSize.height()))
|
||||
|
||||
|
||||
class _QtValueStr(QLineEdit):
|
||||
def __init__(self, value):
|
||||
QLineEdit.__init__(self)
|
||||
|
|
@ -277,11 +284,13 @@ class _QtValueStr(QLineEdit):
|
|||
self._value.set(unicode(self.text()))
|
||||
return self._value
|
||||
|
||||
|
||||
class _QtValueBackendPassword(_QtValueStr):
|
||||
def get_value(self):
|
||||
self._value._domain = None
|
||||
return _QtValueStr.get_value(self)
|
||||
|
||||
|
||||
class _QtValueBool(QCheckBox):
|
||||
def __init__(self, value):
|
||||
QCheckBox.__init__(self)
|
||||
|
|
@ -297,6 +306,7 @@ class _QtValueBool(QCheckBox):
|
|||
self._value.set(self.isChecked())
|
||||
return self._value
|
||||
|
||||
|
||||
class _QtValueInt(QSpinBox):
|
||||
def __init__(self, value):
|
||||
QSpinBox.__init__(self)
|
||||
|
|
@ -312,6 +322,7 @@ class _QtValueInt(QSpinBox):
|
|||
self._value.set(self.getValue())
|
||||
return self._value
|
||||
|
||||
|
||||
class _QtValueChoices(QComboBox):
|
||||
def __init__(self, value):
|
||||
QComboBox.__init__(self)
|
||||
|
|
@ -332,6 +343,7 @@ class _QtValueChoices(QComboBox):
|
|||
self._value.set(unicode(self.itemData(self.currentIndex()).toString()))
|
||||
return self._value
|
||||
|
||||
|
||||
def QtValue(value):
|
||||
if isinstance(value, ValueBool):
|
||||
klass = _QtValueBool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue