correct errors introduced by allowing no gtk loading plugins for CLI
svn: r16076
This commit is contained in:
parent
548a43cb8d
commit
833759d3dd
@ -48,7 +48,7 @@ import gc
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gen.plug import Tool
|
from gui.plug import tool
|
||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
from QuestionDialog import InfoDialog
|
from QuestionDialog import InfoDialog
|
||||||
from glade import Glade
|
from glade import Glade
|
||||||
@ -58,7 +58,7 @@ from glade import Glade
|
|||||||
# Actual tool
|
# Actual tool
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
class Leak(tool.Tool,ManagedWindow.ManagedWindow):
|
class Leak(tool.Tool, ManagedWindow.ManagedWindow):
|
||||||
def __init__(self,dbstate, uistate, options_class, name, callback=None):
|
def __init__(self,dbstate, uistate, options_class, name, callback=None):
|
||||||
self.title = _('Uncollected Objects Tool')
|
self.title = _('Uncollected Objects Tool')
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ class Leak(tool.Tool,ManagedWindow.ManagedWindow):
|
|||||||
parent=self.window)
|
parent=self.window)
|
||||||
|
|
||||||
def display(self):
|
def display(self):
|
||||||
gc.collect()
|
gc.collect(2)
|
||||||
self.model.clear()
|
self.model.clear()
|
||||||
count = 0
|
count = 0
|
||||||
if len(gc.garbage):
|
if len(gc.garbage):
|
||||||
@ -151,6 +151,7 @@ class Leak(tool.Tool,ManagedWindow.ManagedWindow):
|
|||||||
self.modeldata.append(each)
|
self.modeldata.append(each)
|
||||||
self.model.append((count, 'db.DB instance at %s' % id(each)))
|
self.model.append((count, 'db.DB instance at %s' % id(each)))
|
||||||
count += 1
|
count += 1
|
||||||
|
self.glade.get_object('label2').set_text(_('Uncollected Objects: %s') % str(len(gc.garbage)))
|
||||||
|
|
||||||
def apply_clicked(self, obj):
|
def apply_clicked(self, obj):
|
||||||
self.display()
|
self.display()
|
||||||
@ -160,10 +161,10 @@ class Leak(tool.Tool,ManagedWindow.ManagedWindow):
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
class LeakOptions(Tool.ToolOptions):
|
class LeakOptions(tool.ToolOptions):
|
||||||
"""
|
"""
|
||||||
Defines options and provides handling interface.
|
Defines options and provides handling interface.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name,person_id=None):
|
def __init__(self, name,person_id=None):
|
||||||
Tool.ToolOptions.__init__(self, name,person_id)
|
tool.ToolOptions.__init__(self, name,person_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user