replace DisplayTrace with logger
svn: r5702
This commit is contained in:
parent
d123f6ef77
commit
09292cbc15
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
|||||||
|
2006-01-09 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
|
||||||
|
* src/ChooseParents.py: replaced DisplayTrace with new logger
|
||||||
|
* src/DbPrompter.py: replaced DisplayTrace with new logger
|
||||||
|
* src/DisplayModels.py: replaced DisplayTrace with new logger
|
||||||
|
* src/EditPlace.py: replaced DisplayTrace with new logger
|
||||||
|
* src/EditSource.py: replaced DisplayTrace with new logger
|
||||||
|
* src/FamilyView.py: replaced DisplayTrace with new logger
|
||||||
|
* src/MapView.py: replaced DisplayTrace with new logger
|
||||||
|
* src/Report.py: replaced DisplayTrace with new logger
|
||||||
|
* src/StyleEditor.py: replaced DisplayTrace with new logger
|
||||||
|
* src/Tool.py: replaced DisplayTrace with new logger
|
||||||
|
* src/ViewManager.py: replaced DisplayTrace with new logger
|
||||||
|
* src/gramps_main.py: replaced DisplayTrace with new logger
|
||||||
|
* src/GrampsLogger/_ErrorReportAssistant.py: added a newline
|
||||||
|
|
||||||
2006-01-09 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
|
2006-01-09 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
|
||||||
* src/GrampsLogger/_ErrorReportAssistant.py: corrected wording, minor layout
|
* src/GrampsLogger/_ErrorReportAssistant.py: corrected wording, minor layout
|
||||||
changes.
|
changes.
|
||||||
|
@ -36,6 +36,14 @@ __version__ = "$Revision$"
|
|||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
import gc
|
import gc
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Python modules
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
import logging
|
||||||
|
log = logging.getLogger(".")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# GTK/Gnome modules
|
# GTK/Gnome modules
|
||||||
@ -653,8 +661,7 @@ class ChooseParents:
|
|||||||
import EditPerson
|
import EditPerson
|
||||||
EditPerson.EditPerson(self, person,self.db,self.add_new_parent)
|
EditPerson.EditPerson(self, person,self.db,self.add_new_parent)
|
||||||
except:
|
except:
|
||||||
import DisplayTrace
|
log.error("Failed to add parent",exc_info=True)
|
||||||
DisplayTrace.DisplayTrace()
|
|
||||||
|
|
||||||
def change_family_type(self,family,mother_rel,father_rel,trans):
|
def change_family_type(self,family,mother_rel,father_rel,trans):
|
||||||
"""
|
"""
|
||||||
|
@ -241,8 +241,7 @@ class ExistingDbPrompter:
|
|||||||
_("Could not open file: %s") % filename, msg[1])
|
_("Could not open file: %s") % filename, msg[1])
|
||||||
return False
|
return False
|
||||||
except:
|
except:
|
||||||
import DisplayTrace
|
log.error("Failed to open native database file.", exc_info=True)
|
||||||
DisplayTrace.DisplayTrace()
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# The above native formats did not work, so we need to
|
# The above native formats did not work, so we need to
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
import time
|
import time
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
import locale
|
import locale
|
||||||
|
import logging
|
||||||
|
log = logging.getLogger(".")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -46,7 +48,6 @@ import DateHandler
|
|||||||
import RelLib
|
import RelLib
|
||||||
import Utils
|
import Utils
|
||||||
import ToolTips
|
import ToolTips
|
||||||
import DisplayTrace
|
|
||||||
import GrampsLocale
|
import GrampsLocale
|
||||||
|
|
||||||
_GENDER = [ _(u'female'), _(u'male'), _(u'unknown') ]
|
_GENDER = [ _(u'female'), _(u'male'), _(u'unknown') ]
|
||||||
@ -340,7 +341,7 @@ class SourceModel(BaseModel):
|
|||||||
try:
|
try:
|
||||||
t = ToolTips.TipFromFunction(self.db, lambda: self.db.get_source_from_handle(data[0]))
|
t = ToolTips.TipFromFunction(self.db, lambda: self.db.get_source_from_handle(data[0]))
|
||||||
except:
|
except:
|
||||||
DisplayTrace.DisplayTrace()
|
log.error("Failed to create tooltip.",exc_info=True)
|
||||||
return t
|
return t
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -449,7 +450,7 @@ class PlaceModel(BaseModel):
|
|||||||
try:
|
try:
|
||||||
t = ToolTips.TipFromFunction(self.db, lambda: self.db.get_place_from_handle(data[0]))
|
t = ToolTips.TipFromFunction(self.db, lambda: self.db.get_place_from_handle(data[0]))
|
||||||
except:
|
except:
|
||||||
DisplayTrace.DisplayTrace()
|
log.error("Failed to create tooltip.", exc_info=True)
|
||||||
return t
|
return t
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -538,7 +539,7 @@ class FamilyModel(BaseModel):
|
|||||||
try:
|
try:
|
||||||
t = ToolTips.TipFromFunction(self.db, lambda: self.db.get_family_from_handle(data[0]))
|
t = ToolTips.TipFromFunction(self.db, lambda: self.db.get_family_from_handle(data[0]))
|
||||||
except:
|
except:
|
||||||
DisplayTrace.DisplayTrace()
|
log.error("Failed to create tooltip.", exc_info=True)
|
||||||
return t
|
return t
|
||||||
|
|
||||||
|
|
||||||
@ -617,7 +618,7 @@ class MediaModel(BaseModel):
|
|||||||
try:
|
try:
|
||||||
t = ToolTips.TipFromFunction(self.db, lambda: self.db.get_object_from_handle(data[0]))
|
t = ToolTips.TipFromFunction(self.db, lambda: self.db.get_object_from_handle(data[0]))
|
||||||
except:
|
except:
|
||||||
DisplayTrace.DisplayTrace()
|
log.error("Failed to create tooltip.", exc_info=True)
|
||||||
return t
|
return t
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -701,7 +702,7 @@ class EventModel(BaseModel):
|
|||||||
try:
|
try:
|
||||||
t = ToolTips.TipFromFunction(self.db, lambda: self.db.get_event_from_handle(data[0]))
|
t = ToolTips.TipFromFunction(self.db, lambda: self.db.get_event_from_handle(data[0]))
|
||||||
except:
|
except:
|
||||||
DisplayTrace.DisplayTrace()
|
log.error("Failed to create tooltip.", exc_info=True)
|
||||||
return t
|
return t
|
||||||
|
|
||||||
|
|
||||||
@ -818,5 +819,5 @@ class RepositoryModel(BaseModel):
|
|||||||
try:
|
try:
|
||||||
t = ToolTips.TipFromFunction(self.db, lambda: self.db.get_repository_from_handle(data[0]))
|
t = ToolTips.TipFromFunction(self.db, lambda: self.db.get_repository_from_handle(data[0]))
|
||||||
except:
|
except:
|
||||||
DisplayTrace.DisplayTrace()
|
log.error("Failed to create tooltip.", exc_info=True)
|
||||||
return t
|
return t
|
||||||
|
@ -30,7 +30,8 @@ import gc
|
|||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
log = sys.stderr.write
|
import logging
|
||||||
|
log = logging.getLogger(".")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -615,8 +616,8 @@ class EditPlace(DisplayState.ManagedWindow):
|
|||||||
# that has been added to the database or that Place has started
|
# that has been added to the database or that Place has started
|
||||||
# to be referenced by a different primary object. Print a warning
|
# to be referenced by a different primary object. Print a warning
|
||||||
# to remind us that this code need updating.
|
# to remind us that this code need updating.
|
||||||
log("WARNING: Unhandled Primary object type returned from "
|
log.warning("Unhandled Primary object type returned from "
|
||||||
"find_backlink_handles(): %s \n" % str(cls_name))
|
"find_backlink_handles(): %s \n" % str(cls_name))
|
||||||
|
|
||||||
if gtk.events_pending():
|
if gtk.events_pending():
|
||||||
return True
|
return True
|
||||||
|
@ -29,7 +29,8 @@ from gettext import gettext as _
|
|||||||
import gc
|
import gc
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
log = sys.stderr.write
|
import logging
|
||||||
|
log = logging.getLogger(".")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -515,8 +516,8 @@ class EditSource(DisplayState.ManagedWindow):
|
|||||||
# If we get here it means there is a new Primary object type
|
# If we get here it means there is a new Primary object type
|
||||||
# that has been added to the database. Print a warning
|
# that has been added to the database. Print a warning
|
||||||
# to remind us that this code need updating.
|
# to remind us that this code need updating.
|
||||||
log("WARNING: Unhandled Primary object type returned from "
|
log.warning("Unhandled Primary object type returned from "
|
||||||
"find_backlink_handles()\n")
|
"find_backlink_handles()\n")
|
||||||
|
|
||||||
if gtk.events_pending():
|
if gtk.events_pending():
|
||||||
return True
|
return True
|
||||||
|
@ -24,7 +24,6 @@ import pango
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import RelLib
|
import RelLib
|
||||||
import PageView
|
import PageView
|
||||||
import DisplayTrace
|
|
||||||
import NameDisplay
|
import NameDisplay
|
||||||
import Utils
|
import Utils
|
||||||
import DateHandler
|
import DateHandler
|
||||||
|
@ -468,7 +468,7 @@ class ErrorReportAssistant:
|
|||||||
self._user_information_text_buffer.get_start_iter(),
|
self._user_information_text_buffer.get_start_iter(),
|
||||||
self._user_information_text_buffer.get_end_iter()) +
|
self._user_information_text_buffer.get_end_iter()) +
|
||||||
|
|
||||||
"\n\nError Details: \n" +
|
"\n\n\nError Details: \n" +
|
||||||
"===================\n\n" +
|
"===================\n\n" +
|
||||||
|
|
||||||
self._error_details_text_buffer.get_text(
|
self._error_details_text_buffer.get_text(
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
import gc
|
import gc
|
||||||
import re
|
import re
|
||||||
|
import logging
|
||||||
|
|
||||||
|
log = logging.getLogger(".")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -45,7 +48,6 @@ import gtk.gdk
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import RelLib
|
import RelLib
|
||||||
import PageView
|
import PageView
|
||||||
import DisplayTrace
|
|
||||||
|
|
||||||
glob_loc_data = [ # (Name, longitude, latitude)
|
glob_loc_data = [ # (Name, longitude, latitude)
|
||||||
("_Center", 0,0),
|
("_Center", 0,0),
|
||||||
@ -456,7 +458,7 @@ class MapView(PageView.PageView):
|
|||||||
#d = self.parse_nima_countryfile("/tmp/gm.txt")
|
#d = self.parse_nima_countryfile("/tmp/gm.txt")
|
||||||
d = d + self.get_markers_from_database( self.dbstate.db)
|
d = d + self.get_markers_from_database( self.dbstate.db)
|
||||||
except:
|
except:
|
||||||
DisplayTrace.DisplayTrace()
|
log.error("Failed to rebuild places.", exc_info=True)
|
||||||
self.place_list_view.change_data( d)
|
self.place_list_view.change_data( d)
|
||||||
|
|
||||||
def entry_select_cb(self,treeview):
|
def entry_select_cb(self,treeview):
|
||||||
|
@ -34,6 +34,10 @@ __version__ = "$Revision$"
|
|||||||
import os
|
import os
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
from types import ClassType, InstanceType
|
from types import ClassType, InstanceType
|
||||||
|
import logging
|
||||||
|
|
||||||
|
log = logging.getLogger(".")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# GNOME/GTK modules
|
# GNOME/GTK modules
|
||||||
@ -549,8 +553,7 @@ class BareReportDialog:
|
|||||||
try:
|
try:
|
||||||
self.options.parse_user_options(self)
|
self.options.parse_user_options(self)
|
||||||
except:
|
except:
|
||||||
import DisplayTrace
|
log.error("Failed to parse user options.", exc_info=True)
|
||||||
DisplayTrace.DisplayTrace()
|
|
||||||
|
|
||||||
|
|
||||||
def add_option(self,label_text,widget,tooltip=None):
|
def add_option(self,label_text,widget,tooltip=None):
|
||||||
@ -1896,8 +1899,7 @@ def report(database,person,report_class,options_class,translated_name,name,categ
|
|||||||
except Errors.DatabaseError,msg:
|
except Errors.DatabaseError,msg:
|
||||||
ErrorDialog(_("Report could not be created"),str(msg))
|
ErrorDialog(_("Report could not be created"),str(msg))
|
||||||
except:
|
except:
|
||||||
import DisplayTrace
|
log.error("Failed to run report.", exc_info=True)
|
||||||
DisplayTrace.DisplayTrace()
|
|
||||||
dialog.window.destroy()
|
dialog.window.destroy()
|
||||||
|
|
||||||
# Book item generic task
|
# Book item generic task
|
||||||
@ -1915,8 +1917,7 @@ def write_book_item(database,person,report_class,options_class):
|
|||||||
(m1,m2) = msg.messages()
|
(m1,m2) = msg.messages()
|
||||||
ErrorDialog(m1,m2)
|
ErrorDialog(m1,m2)
|
||||||
except:
|
except:
|
||||||
import DisplayTrace
|
log.error("Failed to write book item.", exc_info=True)
|
||||||
DisplayTrace.DisplayTrace()
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Command-line generic task
|
# Command-line generic task
|
||||||
@ -1938,5 +1939,4 @@ def cl_report(database,name,category,report_class,options_class,options_str_dict
|
|||||||
MyReport.write_report()
|
MyReport.write_report()
|
||||||
MyReport.end_report()
|
MyReport.end_report()
|
||||||
except:
|
except:
|
||||||
import DisplayTrace
|
log.error("Failed to write report.", exc_info=True)
|
||||||
DisplayTrace.DisplayTrace()
|
|
||||||
|
@ -33,6 +33,9 @@ __version__ = "$Revision$"
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
import logging
|
||||||
|
log = logging.getLogger(".")
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -131,8 +134,7 @@ class StyleListDisplay:
|
|||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
ErrorDialog(_("Error saving stylesheet"),str(msg))
|
ErrorDialog(_("Error saving stylesheet"),str(msg))
|
||||||
except:
|
except:
|
||||||
import DisplayTrace
|
log.error("Failed to save stylesheet",exc_info=True)
|
||||||
DisplayTrace.DisplayTrace()
|
|
||||||
|
|
||||||
def on_button_press(self,obj,event):
|
def on_button_press(self,obj,event):
|
||||||
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
||||||
|
@ -32,6 +32,8 @@ __version__ = "$Revision$"
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from types import ClassType, InstanceType
|
from types import ClassType, InstanceType
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
import logging
|
||||||
|
log = logging.getLogger(".")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -215,8 +217,7 @@ def gui_tool(database,person,tool_class,options_class,translated_name,
|
|||||||
try:
|
try:
|
||||||
tool_class(database,person,options_class,name,callback,parent)
|
tool_class(database,person,options_class,name,callback,parent)
|
||||||
except:
|
except:
|
||||||
import DisplayTrace
|
log.error("Failed to start tool.", exc_info=True)
|
||||||
DisplayTrace.DisplayTrace()
|
|
||||||
|
|
||||||
# Command-line generic task
|
# Command-line generic task
|
||||||
def cli_tool(database,name,category,tool_class,options_class,options_str_dict):
|
def cli_tool(database,name,category,tool_class,options_class,options_str_dict):
|
||||||
@ -232,8 +233,7 @@ def cli_tool(database,name,category,tool_class,options_class,options_str_dict):
|
|||||||
try:
|
try:
|
||||||
tool_class(database,clt.person,clt.option_class,name)
|
tool_class(database,clt.person,clt.option_class,name)
|
||||||
except:
|
except:
|
||||||
import DisplayTrace
|
log.error("Failed to start tool.", exc_info=True)
|
||||||
DisplayTrace.DisplayTrace()
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
|
@ -29,6 +29,8 @@ from gettext import gettext as _
|
|||||||
from bsddb import db
|
from bsddb import db
|
||||||
import os
|
import os
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
|
import logging
|
||||||
|
log = logging.getLogger(".")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -50,7 +52,6 @@ import GrampsKeys
|
|||||||
import GrampsDb
|
import GrampsDb
|
||||||
import GrampsCfg
|
import GrampsCfg
|
||||||
import Errors
|
import Errors
|
||||||
import DisplayTrace
|
|
||||||
import Utils
|
import Utils
|
||||||
import QuestionDialog
|
import QuestionDialog
|
||||||
import PageView
|
import PageView
|
||||||
@ -569,8 +570,7 @@ class ViewManager:
|
|||||||
_("Could not open file: %s") % filename, msg[1])
|
_("Could not open file: %s") % filename, msg[1])
|
||||||
return False
|
return False
|
||||||
except:
|
except:
|
||||||
import DisplayTrace
|
log.error("Failed to open native.", exc_info=True)
|
||||||
DisplayTrace.DisplayTrace()
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# The above native formats did not work, so we need to
|
# The above native formats did not work, so we need to
|
||||||
@ -738,7 +738,7 @@ class ViewManager:
|
|||||||
_('%s could not be opened.' % filename) + '\n' + msg[1])
|
_('%s could not be opened.' % filename) + '\n' + msg[1])
|
||||||
return False
|
return False
|
||||||
except Exception:
|
except Exception:
|
||||||
DisplayTrace.DisplayTrace()
|
log.error("Failed to open database.", exc_info=True)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Undo/Redo always start with standard labels and insensitive state
|
# Undo/Redo always start with standard labels and insensitive state
|
||||||
|
@ -50,7 +50,6 @@ import EventView
|
|||||||
import SourceView
|
import SourceView
|
||||||
import MediaView
|
import MediaView
|
||||||
import ArgHandler
|
import ArgHandler
|
||||||
import DisplayTrace
|
|
||||||
import GrampsKeys
|
import GrampsKeys
|
||||||
import GrampsCfg
|
import GrampsCfg
|
||||||
import const
|
import const
|
||||||
@ -128,7 +127,7 @@ class Gramps:
|
|||||||
gtk.main_quit()
|
gtk.main_quit()
|
||||||
return
|
return
|
||||||
except:
|
except:
|
||||||
DisplayTrace.DisplayTrace()
|
log.error("Error reading configuration.", exc_info=True)
|
||||||
return
|
return
|
||||||
|
|
||||||
if not mime_type_is_defined(const.app_gramps):
|
if not mime_type_is_defined(const.app_gramps):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user