mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
9392aa40e4
commit
36566458bc
@ -22,7 +22,7 @@ from calibre.gui2 import (gprefs, warning_dialog, Dispatcher, error_dialog,
|
||||
from calibre.library.database2 import LibraryDatabase2
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
|
||||
class LibraryUsageStats(object): # {{{
|
||||
class LibraryUsageStats(object): # {{{
|
||||
|
||||
def __init__(self):
|
||||
self.stats = {}
|
||||
@ -92,7 +92,7 @@ class LibraryUsageStats(object): # {{{
|
||||
self.write_stats()
|
||||
# }}}
|
||||
|
||||
class MovedDialog(QDialog): # {{{
|
||||
class MovedDialog(QDialog): # {{{
|
||||
|
||||
def __init__(self, stats, location, parent=None):
|
||||
QDialog.__init__(self, parent)
|
||||
@ -200,7 +200,6 @@ class ChooseLibraryAction(InterfaceAction):
|
||||
type=Qt.QueuedConnection)
|
||||
self.choose_menu.addAction(ac)
|
||||
|
||||
|
||||
self.rename_separator = self.choose_menu.addSeparator()
|
||||
|
||||
self.maintenance_menu = QMenu(_('Library Maintenance'))
|
||||
@ -477,19 +476,20 @@ class ChooseLibraryAction(InterfaceAction):
|
||||
else:
|
||||
return
|
||||
|
||||
#from calibre.utils.mem import memory
|
||||
#import weakref
|
||||
#from PyQt4.Qt import QTimer
|
||||
#self.dbref = weakref.ref(self.gui.library_view.model().db)
|
||||
#self.before_mem = memory()/1024**2
|
||||
# from calibre.utils.mem import memory
|
||||
# import weakref
|
||||
# from PyQt4.Qt import QTimer
|
||||
# self.dbref = weakref.ref(self.gui.library_view.model().db)
|
||||
# self.before_mem = memory()/1024**2
|
||||
self.gui.library_moved(loc, allow_rebuild=True)
|
||||
#QTimer.singleShot(5000, self.debug_leak)
|
||||
# QTimer.singleShot(5000, self.debug_leak)
|
||||
|
||||
def debug_leak(self):
|
||||
import gc
|
||||
from calibre.utils.mem import memory
|
||||
ref = self.dbref
|
||||
for i in xrange(3): gc.collect()
|
||||
for i in xrange(3):
|
||||
gc.collect()
|
||||
if ref() is not None:
|
||||
print 'DB object alive:', ref()
|
||||
for r in gc.get_referrers(ref())[:10]:
|
||||
@ -500,7 +500,6 @@ class ChooseLibraryAction(InterfaceAction):
|
||||
print
|
||||
self.dbref = self.before_mem = None
|
||||
|
||||
|
||||
def qs_requested(self, idx, *args):
|
||||
self.switch_requested(self.qs_locations[idx])
|
||||
|
||||
@ -546,3 +545,4 @@ class ChooseLibraryAction(InterfaceAction):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user