mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
pep8
This commit is contained in:
parent
38e447e519
commit
15c87a19d5
@ -18,7 +18,7 @@ from calibre.gui2 import NONE
|
||||
from calibre.gui2.widgets import EnComboBox, LineEditECM
|
||||
from calibre.utils.config import tweaks
|
||||
|
||||
class CompleteModel(QAbstractListModel): # {{{
|
||||
class CompleteModel(QAbstractListModel): # {{{
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QAbstractListModel.__init__(self, parent)
|
||||
@ -65,7 +65,7 @@ class CompleteModel(QAbstractListModel): # {{{
|
||||
return self.index(i)
|
||||
# }}}
|
||||
|
||||
class Completer(QListView): # {{{
|
||||
class Completer(QListView): # {{{
|
||||
|
||||
item_selected = pyqtSignal(object)
|
||||
relayout_needed = pyqtSignal()
|
||||
@ -92,7 +92,8 @@ class Completer(QListView): # {{{
|
||||
QListView.hide(self)
|
||||
|
||||
def item_chosen(self, index):
|
||||
if not self.isVisible(): return
|
||||
if not self.isVisible():
|
||||
return
|
||||
self.hide()
|
||||
text = self.model().data(index, Qt.DisplayRole)
|
||||
self.item_selected.emit(unicode(text))
|
||||
@ -287,7 +288,8 @@ class LineEdit(QLineEdit, LineEditECM):
|
||||
self.mcompleter.popup()
|
||||
|
||||
def text_edited(self, *args):
|
||||
if self.no_popup: return
|
||||
if self.no_popup:
|
||||
return
|
||||
self.update_completions()
|
||||
select_first = len(self.mcompleter.model().current_prefix) > 0
|
||||
if not select_first:
|
||||
@ -370,13 +372,13 @@ class EditWithComplete(EnComboBox):
|
||||
|
||||
@dynamic_property
|
||||
def all_items(self):
|
||||
def fget(self): return self.lineEdit().all_items
|
||||
def fset(self, val): self.lineEdit().all_items = val
|
||||
def fget(self):
|
||||
return self.lineEdit().all_items
|
||||
def fset(self, val):
|
||||
self.lineEdit().all_items = val
|
||||
return property(fget=fget, fset=fset)
|
||||
|
||||
|
||||
# }}}
|
||||
|
||||
def text(self):
|
||||
return unicode(self.lineEdit().text())
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user