mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DRYer
This commit is contained in:
parent
8c454346a2
commit
ebbefb5de3
@ -36,7 +36,7 @@ class HistoryMixin(object):
|
||||
|
||||
def initialize(self, name):
|
||||
self._name = name
|
||||
self.history = history.get(self.store_name, [])
|
||||
self.history = self.load_history()
|
||||
self.set_separator(None)
|
||||
self.update_items_cache(self.history)
|
||||
self.setText('')
|
||||
@ -45,6 +45,9 @@ class HistoryMixin(object):
|
||||
except AttributeError:
|
||||
self.lineEdit().editingFinished.connect(self.save_history)
|
||||
|
||||
def load_history(self):
|
||||
return history.get(self.store_name, [])
|
||||
|
||||
def save_history(self):
|
||||
ct = unicode_type(self.text())
|
||||
if len(ct) >= self.min_history_entry_length:
|
||||
|
Loading…
x
Reference in New Issue
Block a user