GEPS008: Moved Errors module
svn: r19785
This commit is contained in:
parent
1ac34dfeb9
commit
1d6a4e60c4
@ -5,7 +5,6 @@
|
||||
|
||||
#src
|
||||
src/AutoComp.py
|
||||
src/Errors.py
|
||||
src/ImgManip.py
|
||||
src/RecentFiles.py
|
||||
src/Sort.py
|
||||
@ -17,6 +16,7 @@ src/cli/__init__.py
|
||||
src/cli/user.py
|
||||
|
||||
# gen
|
||||
src/gen/errors.py
|
||||
src/gen/user.py
|
||||
|
||||
# gen API
|
||||
|
@ -67,7 +67,7 @@ import gen.datehandler
|
||||
import const
|
||||
from gui.display import display_help
|
||||
from gui.managedwindow import ManagedWindow
|
||||
from Errors import ValidationError
|
||||
from gen.errors import ValidationError
|
||||
from gui.glade import Glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -18,7 +18,6 @@ gdir_PYTHON = \
|
||||
const.py\
|
||||
constfunc.py\
|
||||
DateEdit.py\
|
||||
Errors.py\
|
||||
ExportAssistant.py\
|
||||
ExportOptions.py\
|
||||
gramps.py\
|
||||
|
@ -48,7 +48,7 @@ LOG = logging.getLogger(".")
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.display.name import displayer as name_displayer
|
||||
import gen.lib
|
||||
import Errors
|
||||
from gen.errors import DatabaseError
|
||||
from gen.locale import codeset
|
||||
import gen.datehandler
|
||||
|
||||
@ -759,7 +759,7 @@ class ProbablyAlive(object):
|
||||
try:
|
||||
date1, date2, explain, other = descendants_too_old(person, self.AVG_GENERATION_GAP)
|
||||
except RuntimeError:
|
||||
raise Errors.DatabaseError(
|
||||
raise DatabaseError(
|
||||
_("Database error: %s is defined as his or her own ancestor") %
|
||||
name_displayer.display(person))
|
||||
|
||||
|
@ -48,7 +48,7 @@ LOG = logging.getLogger(".grampscli")
|
||||
from gen.display.name import displayer as name_displayer
|
||||
import config
|
||||
import const
|
||||
import Errors
|
||||
from gen.errors import DbError
|
||||
from gen.dbstate import DbState
|
||||
from gen.db import DbBsddb
|
||||
import gen.db.exceptions
|
||||
@ -164,7 +164,7 @@ class CLIDbLoader(object):
|
||||
self.dbstate.no_database()
|
||||
self._errordialog(
|
||||
_("Could not open file: %s") % filename, str(msg))
|
||||
except Errors.DbError, msg:
|
||||
except DbError, msg:
|
||||
self.dbstate.no_database()
|
||||
self._dberrordialog(msg)
|
||||
except Exception:
|
||||
|
@ -55,7 +55,7 @@ from gen.plug.menu import (FamilyOption, PersonOption, NoteOption,
|
||||
BooleanOption, DestinationOption, StringOption,
|
||||
TextOption, EnumeratedListOption, Option)
|
||||
from gen.display.name import displayer as name_displayer
|
||||
from Errors import ReportError
|
||||
from gen.errors import ReportError
|
||||
from gen.plug.report import (CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK,
|
||||
CATEGORY_GRAPHVIZ, CATEGORY_CODE)
|
||||
from gen.plug.report._paper import paper_sizes
|
||||
|
@ -39,7 +39,7 @@ from TabbedDoc import *
|
||||
|
||||
import const
|
||||
|
||||
import Errors
|
||||
from gen.errors import ReportError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -340,9 +340,9 @@ class ODSTab(TabbedDoc):
|
||||
self.content_xml = tempfile.mktemp()
|
||||
self.f = open(self.content_xml,"wb")
|
||||
except IOError,msg:
|
||||
raise Errors.ReportError(_("Could not create %s") % self.content_xml, msg)
|
||||
raise ReportError(_("Could not create %s") % self.content_xml, msg)
|
||||
except:
|
||||
raise Errors.ReportError(_("Could not create %s") % self.content_xml)
|
||||
raise ReportError(_("Could not create %s") % self.content_xml)
|
||||
|
||||
self.f = open(self.content_xml,"w")
|
||||
self.f.write(
|
||||
@ -403,9 +403,9 @@ class ODSTab(TabbedDoc):
|
||||
file = zipfile.ZipFile(self.filename,"w",zipfile.ZIP_DEFLATED)
|
||||
except IOError,msg:
|
||||
errmsg = "%s\n%s" % (_("Could not create %s") % self.filename, msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
except:
|
||||
raise Errors.ReportError(_("Could not create %s") % self.filename)
|
||||
raise ReportError(_("Could not create %s") % self.filename)
|
||||
|
||||
file.write(self.manifest_xml,str("META-INF/manifest.xml"))
|
||||
file.write(self.content_xml,str("content.xml"))
|
||||
@ -426,10 +426,10 @@ class ODSTab(TabbedDoc):
|
||||
self.f = open(self.styles_xml,"wb")
|
||||
except IOError,msg:
|
||||
errmsg = "%s\n%s" % (_("Could not create %s") % self.styles_xml, msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
except:
|
||||
pass
|
||||
raise Errors.ReportError(_("Could not create %s") % self.styles_xml)
|
||||
raise ReportError(_("Could not create %s") % self.styles_xml)
|
||||
|
||||
self.f = open(self.styles_xml,"w")
|
||||
self.f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
|
||||
@ -461,10 +461,10 @@ class ODSTab(TabbedDoc):
|
||||
self.f = open(self.manifest_xml,"wb")
|
||||
except IOError,msg:
|
||||
errmsg = "%s\n%s" % (_("Could not create %s") % self.manifest_xml, msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
except:
|
||||
pass
|
||||
raise Errors.ReportError(_("Could not create %s") % self.manifest_xml)
|
||||
raise ReportError(_("Could not create %s") % self.manifest_xml)
|
||||
|
||||
self.f = open(self.manifest_xml,"w")
|
||||
self.f.write(_MANIFEST)
|
||||
@ -477,10 +477,10 @@ class ODSTab(TabbedDoc):
|
||||
self.f = open(self.meta_xml,"wb")
|
||||
except IOError,msg:
|
||||
errmsg = "%s\n%s" % (_("Could not create %s") % self.meta_xml, msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
except:
|
||||
pass
|
||||
raise Errors.ReportError(_("Could not create %s") % self.meta_xml)
|
||||
raise ReportError(_("Could not create %s") % self.meta_xml)
|
||||
|
||||
self.f = open(self.meta_xml,"w")
|
||||
|
||||
@ -500,10 +500,10 @@ class ODSTab(TabbedDoc):
|
||||
self.f = open(self.mimetype,"wb")
|
||||
except IOError,msg:
|
||||
errmsg = "%s\n%s" % (_("Could not create %s") % self.mimetype, msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
except:
|
||||
pass
|
||||
raise Errors.ReportError(_("Could not create %s") % self.mimetype)
|
||||
raise ReportError(_("Could not create %s") % self.mimetype)
|
||||
|
||||
self.f = open(self.mimetype,"w")
|
||||
self.f.write('application/vnd.oasis.opendocument.spreadsheet')
|
||||
|
@ -23,6 +23,7 @@ pkgpythondir = $(datadir)/@PACKAGE@/gen
|
||||
pkgpython_PYTHON = \
|
||||
__init__.py \
|
||||
dbstate.py \
|
||||
errors.py \
|
||||
ggettext.py \
|
||||
updatecallback.py \
|
||||
user.py
|
||||
|
@ -60,7 +60,7 @@ from gen.db.dbconst import *
|
||||
from gen.utils.callback import Callback
|
||||
from gen.db import (BsddbBaseCursor, DbReadBase)
|
||||
from Utils import create_id
|
||||
import Errors
|
||||
from gen.errors import DbError
|
||||
|
||||
LOG = logging.getLogger(DBLOGNAME)
|
||||
LOG = logging.getLogger(".citation")
|
||||
@ -418,7 +418,7 @@ class DbBsddbRead(DbReadBase, Callback):
|
||||
return DbReadCursor(table, self.txn)
|
||||
except DBERRS, msg:
|
||||
self.__log_error()
|
||||
raise Errors.DbError(msg)
|
||||
raise DbError(msg)
|
||||
|
||||
def get_person_cursor(self, *args, **kwargs):
|
||||
return self.get_cursor(self.person_map, *args, **kwargs)
|
||||
@ -727,7 +727,7 @@ class DbBsddbRead(DbReadBase, Callback):
|
||||
return None
|
||||
except DBERRS, msg:
|
||||
self.__log_error()
|
||||
raise Errors.DbError(msg)
|
||||
raise DbError(msg)
|
||||
|
||||
def get_person_from_gramps_id(self, val):
|
||||
"""
|
||||
@ -1472,7 +1472,7 @@ class DbBsddbRead(DbReadBase, Callback):
|
||||
return table.get(str(handle), txn=self.txn)
|
||||
except DBERRS, msg:
|
||||
self.__log_error()
|
||||
raise Errors.DbError(msg)
|
||||
raise DbError(msg)
|
||||
|
||||
def get_raw_person_data(self, handle):
|
||||
return self.__get_raw_data(self.person_map, handle)
|
||||
@ -1512,7 +1512,7 @@ class DbBsddbRead(DbReadBase, Callback):
|
||||
return table.get(str(handle), txn=self.txn) is not None
|
||||
except DBERRS, msg:
|
||||
self.__log_error()
|
||||
raise Errors.DbError(msg)
|
||||
raise DbError(msg)
|
||||
|
||||
def has_person_handle(self, handle):
|
||||
"""
|
||||
|
@ -50,7 +50,7 @@ from gen.ggettext import gettext as _
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.db.dbconst import *
|
||||
from gen.db import BSDDBTxn
|
||||
import Errors
|
||||
from gen.errors import DbError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -209,7 +209,7 @@ class DbUndo(object):
|
||||
|
||||
except DBERRS, msg:
|
||||
self.db._log_error()
|
||||
raise Errors.DbError(msg)
|
||||
raise DbError(msg)
|
||||
|
||||
return try_
|
||||
|
||||
@ -302,7 +302,7 @@ class DbUndo(object):
|
||||
|
||||
except DBERRS, msg:
|
||||
self.db._log_error()
|
||||
raise Errors.DbError(msg)
|
||||
raise DbError(msg)
|
||||
|
||||
def undo_data(self, data, handle, db_map, emit, signal_root):
|
||||
"""
|
||||
@ -323,7 +323,7 @@ class DbUndo(object):
|
||||
|
||||
except DBERRS, msg:
|
||||
self.db._log_error()
|
||||
raise Errors.DbError(msg)
|
||||
raise DbError(msg)
|
||||
|
||||
undo_count = property(lambda self:len(self.undoq))
|
||||
redo_count = property(lambda self:len(self.redoq))
|
||||
|
@ -63,7 +63,7 @@ from gen.db import (DbBsddbRead, DbWriteBase, BSDDBTxn,
|
||||
from gen.db.dbconst import *
|
||||
from gen.utils.callback import Callback
|
||||
from gen.updatecallback import UpdateCallback
|
||||
import Errors
|
||||
from gen.errors import DbError
|
||||
import constfunc
|
||||
|
||||
_LOG = logging.getLogger(DBLOGNAME)
|
||||
@ -245,7 +245,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
return func(self, *args, **kwargs)
|
||||
except DBERRS, msg:
|
||||
self.__log_error()
|
||||
raise Errors.DbError(msg)
|
||||
raise DbError(msg)
|
||||
return try_
|
||||
|
||||
def __open_db(self, file_name, table_name, dbtype=db.DB_HASH, flags=0):
|
||||
@ -1737,7 +1737,7 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
||||
if self.txn is not None:
|
||||
msg = self.transaction.get_description()
|
||||
self.transaction_abort(self.transaction)
|
||||
raise Errors.DbError(_('A second transaction is started while there'
|
||||
raise DbError(_('A second transaction is started while there'
|
||||
' is still a transaction, "%s", active in the database.') % msg)
|
||||
|
||||
if not isinstance(transaction, DbTxn) or len(transaction) != 0:
|
||||
|
@ -30,7 +30,7 @@ Package providing filtering framework for GRAMPS.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.filters._genericfilter import GenericFilter
|
||||
from Errors import FilterError
|
||||
from gen.errors import FilterError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -33,7 +33,7 @@ Provide merge capabilities for citations.
|
||||
from gen.lib import (Person, Family, Event, Place, MediaObject, Repository)
|
||||
from gen.db import DbTxn
|
||||
from gen.ggettext import sgettext as _
|
||||
from Errors import MergeError
|
||||
from gen.errors import MergeError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -32,7 +32,7 @@ Provide merge capabilities for events.
|
||||
from gen.lib import Person, Family
|
||||
from gen.db import DbTxn
|
||||
from gen.ggettext import sgettext as _
|
||||
from Errors import MergeError
|
||||
from gen.errors import MergeError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -31,7 +31,7 @@ Provide merge capabilities for families.
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.db import DbTxn
|
||||
from gen.ggettext import sgettext as _
|
||||
from Errors import MergeError
|
||||
from gen.errors import MergeError
|
||||
from gen.merge import MergePersonQuery
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -32,7 +32,7 @@ Provide merge capabilities for media objects.
|
||||
from gen.lib import Person, Family, Event, Source, Citation, Place
|
||||
from gen.db import DbTxn
|
||||
from gen.ggettext import sgettext as _
|
||||
from Errors import MergeError
|
||||
from gen.errors import MergeError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -33,7 +33,7 @@ from gen.lib import (Person, Family, Event, Place, Source, Citation, Repository,
|
||||
MediaObject)
|
||||
from gen.db import DbTxn
|
||||
from gen.ggettext import sgettext as _
|
||||
from Errors import MergeError
|
||||
from gen.errors import MergeError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -33,7 +33,7 @@ Provide merge capabilities for persons.
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.db import DbTxn
|
||||
from gen.ggettext import sgettext as _
|
||||
from Errors import MergeError
|
||||
from gen.errors import MergeError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -33,7 +33,7 @@ Provide merge capabilities for places.
|
||||
from gen.lib import Person, Family, Event
|
||||
from gen.db import DbTxn
|
||||
from gen.ggettext import sgettext as _
|
||||
from Errors import MergeError
|
||||
from gen.errors import MergeError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -32,7 +32,7 @@ Provide merge capabilities for repositories.
|
||||
from gen.lib import Source
|
||||
from gen.db import DbTxn
|
||||
from gen.ggettext import sgettext as _
|
||||
from Errors import MergeError
|
||||
from gen.errors import MergeError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -35,7 +35,7 @@ from gen.lib import (Person, Family, Event, Place, Source, Repository,
|
||||
MediaObject, Citation)
|
||||
from gen.db import DbTxn
|
||||
from gen.ggettext import sgettext as _
|
||||
from Errors import MergeError
|
||||
from gen.errors import MergeError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -1507,7 +1507,7 @@ class MultiTreeView(gtk.TreeView):
|
||||
try:
|
||||
EditPerson(self.dbstate,
|
||||
self.uistate, [], person)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Event':
|
||||
event = self.dbstate.db.get_event_from_handle(handle)
|
||||
@ -1515,7 +1515,7 @@ class MultiTreeView(gtk.TreeView):
|
||||
try:
|
||||
EditEvent(self.dbstate,
|
||||
self.uistate, [], event)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Family':
|
||||
ref = self.dbstate.db.get_family_from_handle(handle)
|
||||
@ -1523,7 +1523,7 @@ class MultiTreeView(gtk.TreeView):
|
||||
try:
|
||||
EditFamily(self.dbstate,
|
||||
self.uistate, [], ref)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Source':
|
||||
ref = self.dbstate.db.get_source_from_handle(handle)
|
||||
@ -1531,7 +1531,7 @@ class MultiTreeView(gtk.TreeView):
|
||||
try:
|
||||
EditSource(self.dbstate,
|
||||
self.uistate, [], ref)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Place':
|
||||
ref = self.dbstate.db.get_place_from_handle(handle)
|
||||
@ -1539,7 +1539,7 @@ class MultiTreeView(gtk.TreeView):
|
||||
try:
|
||||
EditPlace(self.dbstate,
|
||||
self.uistate, [], ref)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Repository':
|
||||
ref = self.dbstate.db.get_repository_from_handle(handle)
|
||||
@ -1547,7 +1547,7 @@ class MultiTreeView(gtk.TreeView):
|
||||
try:
|
||||
EditRepository(self.dbstate,
|
||||
self.uistate, [], ref)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Note':
|
||||
ref = self.dbstate.db.get_note_from_handle(handle)
|
||||
@ -1555,7 +1555,7 @@ class MultiTreeView(gtk.TreeView):
|
||||
try:
|
||||
EditNote(self.dbstate,
|
||||
self.uistate, [], ref)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass in ['Media', 'MediaObject']:
|
||||
ref = self.dbstate.db.get_object_from_handle(handle)
|
||||
@ -1563,7 +1563,7 @@ class MultiTreeView(gtk.TreeView):
|
||||
try:
|
||||
EditMedia(self.dbstate,
|
||||
self.uistate, [], ref)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def short(val,size=60):
|
||||
|
@ -156,7 +156,7 @@ class ConfigureDialog(ManagedWindow):
|
||||
configuration page
|
||||
:param configobj: the unique object that is configured, it must be
|
||||
identifiable (id(configobj)). If the configure dialog of the
|
||||
configobj is already open, a Errors.WindowActiveError will be
|
||||
configobj is already open, a WindowActiveError will be
|
||||
raised. Grab this exception in the calling method
|
||||
:param configmanager: a configmanager object. Several convenience
|
||||
methods are present in ConfigureDialog to set up widgets that
|
||||
|
@ -62,7 +62,7 @@ from gui.pluginmanager import GuiPluginManager
|
||||
from gui.dialog import (DBErrorDialog, ErrorDialog, QuestionDialog2,
|
||||
WarningDialog)
|
||||
from gui.user import User
|
||||
import Errors
|
||||
from gen.errors import DbError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -323,7 +323,7 @@ class DbLoader(CLIDbLoader):
|
||||
self.dbstate.no_database()
|
||||
self._errordialog(
|
||||
_("Could not open file: %s") % filename, str(msg))
|
||||
except Errors.DbError, msg:
|
||||
except DbError, msg:
|
||||
self.dbstate.no_database()
|
||||
self._dberrordialog(msg)
|
||||
except Exception as newerror:
|
||||
|
@ -38,7 +38,7 @@ import gobject
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.ddtargets import DdTargets
|
||||
from addressmodel import AddressModel
|
||||
from embeddedlist import EmbeddedList
|
||||
@ -104,7 +104,7 @@ class AddrEmbedList(EmbeddedList):
|
||||
"""
|
||||
Called when the Add button is clicked. Creates a new Address instance
|
||||
and calls the EditAddress editor with the new address. If the window
|
||||
already exists (Errors.WindowActiveError), we ignore it. This prevents
|
||||
already exists (WindowActiveError), we ignore it. This prevents
|
||||
the dialog from coming up twice on the same object.
|
||||
"""
|
||||
addr = gen.lib.Address()
|
||||
@ -112,7 +112,7 @@ class AddrEmbedList(EmbeddedList):
|
||||
from gui.editors import EditAddress
|
||||
EditAddress(self.dbstate, self.uistate, self.track,
|
||||
addr, self.add_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
return
|
||||
|
||||
def add_callback(self, name):
|
||||
@ -128,7 +128,7 @@ class AddrEmbedList(EmbeddedList):
|
||||
"""
|
||||
Called with the Edit button is clicked. Gets the selected Address instance
|
||||
and calls the EditAddress editor with the address. If the window
|
||||
already exists (Errors.WindowActiveError), we ignore it. This prevents
|
||||
already exists (WindowActiveError), we ignore it. This prevents
|
||||
the dialog from coming up twice on the same object.
|
||||
"""
|
||||
addr = self.get_selected()
|
||||
@ -137,7 +137,7 @@ class AddrEmbedList(EmbeddedList):
|
||||
from gui.editors import EditAddress
|
||||
EditAddress(self.dbstate, self.uistate, self.track,
|
||||
addr, self.edit_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
return
|
||||
|
||||
def edit_callback(self, name):
|
||||
|
@ -34,7 +34,7 @@ import gobject
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.ddtargets import DdTargets
|
||||
from attrmodel import AttrModel
|
||||
from embeddedlist import EmbeddedList
|
||||
@ -92,7 +92,7 @@ class AttrEmbedList(EmbeddedList):
|
||||
self.get_editor()(
|
||||
self.dbstate, self.uistate, self.track, attr,
|
||||
pname, self.get_user_values(), self.add_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def add_callback(self, name):
|
||||
@ -110,7 +110,7 @@ class AttrEmbedList(EmbeddedList):
|
||||
self.get_editor()(
|
||||
self.dbstate, self.uistate, self.track, attr,
|
||||
pname, self.get_user_values(), self.edit_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def edit_callback(self, name):
|
||||
|
@ -41,7 +41,7 @@ import gtk
|
||||
# GRAMPS classes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.widgets import SimpleButton
|
||||
from embeddedlist import EmbeddedList
|
||||
|
||||
@ -144,47 +144,47 @@ class BackRefList(EmbeddedList):
|
||||
try:
|
||||
person = self.dbstate.db.get_person_from_handle(ref)
|
||||
EditPerson(self.dbstate, self.uistate, [], person)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif reftype == 'Family':
|
||||
try:
|
||||
family = self.dbstate.db.get_family_from_handle(ref)
|
||||
EditFamily(self.dbstate, self.uistate, [], family)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif reftype == 'Source':
|
||||
try:
|
||||
source = self.dbstate.db.get_source_from_handle(ref)
|
||||
EditSource(self.dbstate, self.uistate, [], source)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif reftype == 'Citation':
|
||||
try:
|
||||
citation = self.dbstate.db.get_citation_from_handle(ref)
|
||||
EditCitation(self.dbstate, self.uistate, [], citation)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif reftype == 'Place':
|
||||
try:
|
||||
place = self.dbstate.db.get_place_from_handle(ref)
|
||||
EditPlace(self.dbstate, self.uistate, [], place)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif reftype == 'MediaObject':
|
||||
try:
|
||||
obj = self.dbstate.db.get_object_from_handle(ref)
|
||||
EditMedia(self.dbstate, self.uistate, [], obj)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif reftype == 'Event':
|
||||
try:
|
||||
event = self.dbstate.db.get_event_from_handle(ref)
|
||||
EditEvent(self.dbstate, self.uistate, [], event)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif reftype == 'Repository':
|
||||
try:
|
||||
repo = self.dbstate.db.get_repository_from_handle(ref)
|
||||
EditRepository(self.dbstate, self.uistate, [], repo)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
@ -42,7 +42,7 @@ import gtk
|
||||
#-------------------------------------------------------------------------
|
||||
from gui.widgets import SimpleButton
|
||||
from grampstab import GrampsTab
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
|
||||
_KP_ENTER = gtk.gdk.keyval_from_name("KP_Enter")
|
||||
_RETURN = gtk.gdk.keyval_from_name("Return")
|
||||
@ -196,7 +196,7 @@ class ButtonTab(GrampsTab):
|
||||
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
||||
try:
|
||||
self.edit_button_clicked(obj)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def key_pressed(self, obj, event):
|
||||
@ -209,7 +209,7 @@ class ButtonTab(GrampsTab):
|
||||
if event.keyval in (_RETURN, _KP_ENTER):
|
||||
try:
|
||||
self.edit_button_clicked(obj)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif event.keyval in (_DEL,) and self.del_btn:
|
||||
if self.dirty_selection or self.dbstate.db.readonly:
|
||||
|
@ -42,7 +42,7 @@ import gobject
|
||||
# GRAMPS classes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
import gen.lib
|
||||
from gen.lib import Source, Citation
|
||||
from gui.dbguielement import DbGUIElement
|
||||
@ -130,7 +130,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement):
|
||||
the new citation.
|
||||
|
||||
Called when the Add button is clicked.
|
||||
If the window already exists (Errors.WindowActiveError), we ignore it.
|
||||
If the window already exists (WindowActiveError), we ignore it.
|
||||
This prevents the dialog from coming up twice on the same object.
|
||||
"""
|
||||
try:
|
||||
@ -138,7 +138,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement):
|
||||
EditCitation(self.dbstate, self.uistate, self.track,
|
||||
gen.lib.Citation(), gen.lib.Source(),
|
||||
self.add_callback, self.callertitle)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def add_callback(self, value):
|
||||
@ -167,7 +167,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement):
|
||||
gen.lib.Citation(), object,
|
||||
callback=self.add_callback,
|
||||
callertitle=self.callertitle)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
from gui.dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text())
|
||||
@ -177,7 +177,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement):
|
||||
EditCitation(self.dbstate, self.uistate, self.track,
|
||||
object, callback=self.add_callback,
|
||||
callertitle=self.callertitle)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
from gui.dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text())
|
||||
@ -200,7 +200,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement):
|
||||
with the citation.
|
||||
|
||||
Called when the Edit button is clicked.
|
||||
If the window already exists (Errors.WindowActiveError), we ignore it.
|
||||
If the window already exists (WindowActiveError), we ignore it.
|
||||
This prevents the dialog from coming up twice on the same object.
|
||||
"""
|
||||
handle = self.get_selected()
|
||||
@ -210,7 +210,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement):
|
||||
from gui.editors import EditCitation
|
||||
EditCitation(self.dbstate, self.uistate, self.track, citation,
|
||||
callertitle = self.callertitle)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def citation_delete(self, del_citation_handle_list):
|
||||
@ -250,7 +250,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement):
|
||||
EditCitation(self.dbstate, self.uistate, self.track,
|
||||
object, callback=self.add_callback,
|
||||
callertitle=self.callertitle)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
from gui.dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text())
|
||||
@ -270,7 +270,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement):
|
||||
gen.lib.Citation(), object,
|
||||
callback=self.add_callback,
|
||||
callertitle=self.callertitle)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
from gui.dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text())
|
||||
|
@ -36,7 +36,7 @@ import gobject
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.ddtargets import DdTargets
|
||||
from groupembeddedlist import GroupEmbeddedList
|
||||
from eventrefmodel import EventRefModel
|
||||
@ -230,7 +230,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
|
||||
self.get_ref_editor()(
|
||||
self.dbstate, self.uistate, self.track,
|
||||
event, ref, self.object_added)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def __blocked_text(self):
|
||||
@ -255,7 +255,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
|
||||
self.get_ref_editor()(
|
||||
self.dbstate, self.uistate, self.track,
|
||||
event, ref, self.object_added)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
from gui.dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text())
|
||||
@ -268,7 +268,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
|
||||
self.get_ref_editor()(
|
||||
self.dbstate, self.uistate, self.track,
|
||||
event, ref[1], self.object_edited)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
from gui.dialog import WarningDialog
|
||||
WarningDialog(_("Cannot edit this reference"),
|
||||
self.__blocked_text())
|
||||
@ -332,7 +332,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
|
||||
try:
|
||||
self.get_ref_editor()(self.dbstate, self.uistate, self.track,
|
||||
event, obj, self.object_edited)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
from gui.dialog import WarningDialog
|
||||
WarningDialog(
|
||||
_("Cannot edit this reference"),
|
||||
@ -353,7 +353,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
|
||||
self.get_ref_editor()(
|
||||
self.dbstate, self.uistate, self.track,
|
||||
event, ref, self.object_added)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def editnotworkgroup(self, key):
|
||||
@ -364,7 +364,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList):
|
||||
try:
|
||||
from gui.editors import EditPerson
|
||||
EditPerson(self.dbstate, self.uistate, [], person)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def dropnotworkgroup(self, row, obj):
|
||||
|
@ -54,7 +54,7 @@ import gen.lib
|
||||
from gen.db import DbTxn
|
||||
import Utils
|
||||
from gui.thumbnails import get_thumbnail_image
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
import gen.mime
|
||||
from gui.ddtargets import DdTargets
|
||||
from buttontab import ButtonTab
|
||||
@ -274,7 +274,7 @@ class GalleryTab(ButtonTab, DbGUIElement):
|
||||
EditMediaRef(self.dbstate, self.uistate, self.track,
|
||||
gen.lib.MediaObject(), gen.lib.MediaRef(),
|
||||
self.add_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def add_callback(self, media_ref, media):
|
||||
@ -319,7 +319,7 @@ class GalleryTab(ButtonTab, DbGUIElement):
|
||||
from gui.editors import EditMediaRef
|
||||
EditMediaRef(self.dbstate, self.uistate, self.track,
|
||||
src, sref, self.add_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
from gui.dialog import WarningDialog
|
||||
WarningDialog(_("Cannot share this reference"),
|
||||
self.__blocked_text())
|
||||
@ -339,7 +339,7 @@ class GalleryTab(ButtonTab, DbGUIElement):
|
||||
from gui.editors import EditMediaRef
|
||||
EditMediaRef(self.dbstate, self.uistate, self.track,
|
||||
obj, ref, self.edit_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
from gui.dialog import WarningDialog
|
||||
WarningDialog(_("Cannot edit this reference"),
|
||||
self.__blocked_text())
|
||||
|
@ -34,7 +34,7 @@ import gobject
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from ldsmodel import LdsModel
|
||||
from embeddedlist import EmbeddedList
|
||||
|
||||
@ -88,7 +88,7 @@ class LdsEmbedList(EmbeddedList):
|
||||
try:
|
||||
self.get_editor()(self.dbstate, self.uistate, self.track,
|
||||
self.new_data(), self.add_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def add_callback(self, name):
|
||||
@ -103,7 +103,7 @@ class LdsEmbedList(EmbeddedList):
|
||||
try:
|
||||
self.get_editor()(self.dbstate, self.uistate, self.track,
|
||||
lds, self.edit_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def edit_callback(self, name):
|
||||
|
@ -34,7 +34,7 @@ import gobject
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.ddtargets import DdTargets
|
||||
from locationmodel import LocationModel
|
||||
from embeddedlist import EmbeddedList
|
||||
@ -78,7 +78,7 @@ class LocationEmbedList(EmbeddedList):
|
||||
from gui.editors import EditLocation
|
||||
EditLocation(self.dbstate, self.uistate, self.track,
|
||||
loc, self.add_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def add_callback(self, name):
|
||||
@ -94,7 +94,7 @@ class LocationEmbedList(EmbeddedList):
|
||||
from gui.editors import EditLocation
|
||||
EditLocation(self.dbstate, self.uistate, self.track,
|
||||
loc, self.edit_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def edit_callback(self, name):
|
||||
|
@ -42,7 +42,7 @@ from gen.ggettext import gettext as _
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.ddtargets import DdTargets
|
||||
from namemodel import NameModel
|
||||
from groupembeddedlist import GroupEmbeddedList
|
||||
@ -160,7 +160,7 @@ class NameEmbedList(GroupEmbeddedList):
|
||||
from gui.editors import EditName
|
||||
EditName(self.dbstate, self.uistate, self.track,
|
||||
name, self.add_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def add_callback(self, name):
|
||||
@ -181,7 +181,7 @@ class NameEmbedList(GroupEmbeddedList):
|
||||
elif name[0] == NameModel.DEFINDEX:
|
||||
EditName(self.dbstate, self.uistate, self.track,
|
||||
name[1], self.editdef_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def edit_callback(self, name):
|
||||
|
@ -39,7 +39,7 @@ import gobject
|
||||
# GRAMPS classes
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
import gen.lib
|
||||
from gui.dbguielement import DbGUIElement
|
||||
from gui.selectors import SelectorFactory
|
||||
@ -124,7 +124,7 @@ class NoteTab(EmbeddedList, DbGUIElement):
|
||||
note.
|
||||
|
||||
Called when the Add button is clicked.
|
||||
If the window already exists (Errors.WindowActiveError), we ignore it.
|
||||
If the window already exists (WindowActiveError), we ignore it.
|
||||
This prevents the dialog from coming up twice on the same object.
|
||||
"""
|
||||
note = gen.lib.Note()
|
||||
@ -135,7 +135,7 @@ class NoteTab(EmbeddedList, DbGUIElement):
|
||||
EditNote(self.dbstate, self.uistate, self.track,
|
||||
note, self.add_callback,
|
||||
self.callertitle, extratype = [self.notetype])
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def add_callback(self, name):
|
||||
@ -155,7 +155,7 @@ class NoteTab(EmbeddedList, DbGUIElement):
|
||||
note.
|
||||
|
||||
Called when the Edit button is clicked.
|
||||
If the window already exists (Errors.WindowActiveError), we ignore it.
|
||||
If the window already exists (WindowActiveError), we ignore it.
|
||||
This prevents the dialog from coming up twice on the same object.
|
||||
"""
|
||||
handle = self.get_selected()
|
||||
@ -166,7 +166,7 @@ class NoteTab(EmbeddedList, DbGUIElement):
|
||||
EditNote(self.dbstate, self.uistate, self.track, note,
|
||||
callertitle = self.callertitle,
|
||||
extratype = [self.notetype] )
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def share_button_clicked(self, obj):
|
||||
|
@ -38,7 +38,7 @@ import gen.lib
|
||||
from gen.display.name import displayer as name_displayer
|
||||
from eventembedlist import EventEmbedList
|
||||
from eventrefmodel import EventRefModel
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -117,7 +117,7 @@ class PersonEventEmbedList(EventEmbedList):
|
||||
try:
|
||||
from gui.editors import EditFamily
|
||||
EditFamily(self.dbstate, self.uistate, [], family)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def _non_native_change(self):
|
||||
|
@ -34,7 +34,7 @@ import gobject
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.ddtargets import DdTargets
|
||||
from personrefmodel import PersonRefModel
|
||||
from embeddedlist import EmbeddedList
|
||||
@ -89,7 +89,7 @@ class PersonRefEmbedList(EmbeddedList):
|
||||
EditPersonRef(
|
||||
self.dbstate, self.uistate, self.track,
|
||||
ref, self.add_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def add_callback(self, obj):
|
||||
@ -106,7 +106,7 @@ class PersonRefEmbedList(EmbeddedList):
|
||||
EditPersonRef(
|
||||
self.dbstate, self.uistate, self.track,
|
||||
ref, self.edit_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def edit_callback(self, obj):
|
||||
@ -124,5 +124,5 @@ class PersonRefEmbedList(EmbeddedList):
|
||||
EditPersonRef(
|
||||
self.dbstate, self.uistate, self.track,
|
||||
ref, self.add_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
@ -36,7 +36,7 @@ import gobject
|
||||
import gen.lib
|
||||
from gui.dbguielement import DbGUIElement
|
||||
from gui.selectors import SelectorFactory
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.ddtargets import DdTargets
|
||||
from reporefmodel import RepoRefModel
|
||||
from embeddedlist import EmbeddedList
|
||||
@ -107,7 +107,7 @@ class RepoEmbedList(EmbeddedList, DbGUIElement):
|
||||
EditRepoRef(
|
||||
self.dbstate, self.uistate, self.track,
|
||||
repo, ref, self.add_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def add_button_clicked(self, obj):
|
||||
@ -118,7 +118,7 @@ class RepoEmbedList(EmbeddedList, DbGUIElement):
|
||||
EditRepoRef(
|
||||
self.dbstate, self.uistate, self.track,
|
||||
repo, ref, self.add_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def share_button_clicked(self, obj):
|
||||
@ -141,7 +141,7 @@ class RepoEmbedList(EmbeddedList, DbGUIElement):
|
||||
ref,
|
||||
self.add_callback)
|
||||
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def add_callback(self, value):
|
||||
@ -162,7 +162,7 @@ class RepoEmbedList(EmbeddedList, DbGUIElement):
|
||||
EditRepoRef(
|
||||
self.dbstate, self.uistate, self.track, repo,
|
||||
ref, self.edit_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
from gui.dialog import WarningDialog
|
||||
WarningDialog(
|
||||
_("Cannot edit this reference"),
|
||||
|
@ -35,7 +35,7 @@ import gobject
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.ddtargets import DdTargets
|
||||
from webmodel import WebModel
|
||||
from embeddedlist import EmbeddedList
|
||||
@ -87,7 +87,7 @@ class WebEmbedList(EmbeddedList):
|
||||
try:
|
||||
EditUrl(self.dbstate, self.uistate, self.track,
|
||||
'', url, self.add_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def add_callback(self, url):
|
||||
@ -103,7 +103,7 @@ class WebEmbedList(EmbeddedList):
|
||||
try:
|
||||
EditUrl(self.dbstate, self.uistate, self.track,
|
||||
'', url, self.edit_callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def edit_callback(self, url):
|
||||
|
@ -48,7 +48,7 @@ import gtk
|
||||
#-------------------------------------------------------------------------
|
||||
from editsecondary import EditSecondary
|
||||
from gen.lib import NoteType
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.glade import Glade
|
||||
from displaytabs import CitationEmbedList, NoteTab
|
||||
from gui.widgets import MonitoredDataType, PrivacyButton
|
||||
@ -176,7 +176,7 @@ class EditChildRef(EditSecondary):
|
||||
person = self.db.get_person_from_handle(handle)
|
||||
EditPerson(self.dbstate, self.uistate,
|
||||
self.track, person)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def person_change(self, handles):
|
||||
|
@ -66,7 +66,7 @@ from gen.display.name import displayer as name_displayer
|
||||
from gen.utils import get_marriage_or_fallback
|
||||
import gen.lib
|
||||
from gen.db import DbTxn
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
import gen.datehandler
|
||||
from gui.glade import Glade
|
||||
|
||||
@ -242,7 +242,7 @@ class ChildEmbedList(EmbeddedList):
|
||||
try:
|
||||
EditChildRef(n, self.dbstate, self.uistate, self.track,
|
||||
ref, self.child_ref_edited)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def edit_child_button_clicked(self, obj=None):
|
||||
@ -252,7 +252,7 @@ class ChildEmbedList(EmbeddedList):
|
||||
try:
|
||||
EditPerson(self.dbstate, self.uistate, self.track,
|
||||
p, self.child_ref_edited)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def north_american(self):
|
||||
@ -841,7 +841,7 @@ class EditFamily(EditPrimary):
|
||||
person = self.db.get_person_from_handle(handle)
|
||||
EditPerson(self.dbstate, self.uistate,
|
||||
self.track, person)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def load_parent(self, handle, name_obj, birth_obj, birth_label, death_obj,
|
||||
|
@ -53,7 +53,7 @@ from displaytabs import GrampsTab, CitationEmbedList, NoteTab, SurnameTab
|
||||
from gui.widgets import (MonitoredEntry, MonitoredMenu, MonitoredDate,
|
||||
MonitoredDataType, PrivacyButton)
|
||||
from gui.glade import Glade
|
||||
from Errors import ValidationError
|
||||
from gen.errors import ValidationError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -57,7 +57,7 @@ import gen.lib
|
||||
from gen.db import DbTxn
|
||||
from gui import widgets
|
||||
from gen.display.name import displayer as name_displayer
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.glade import Glade
|
||||
|
||||
from editprimary import EditPrimary
|
||||
@ -65,7 +65,7 @@ from editmediaref import EditMediaRef
|
||||
from editname import EditName
|
||||
import config
|
||||
from gui.dialog import ErrorDialog, ICON
|
||||
from Errors import ValidationError
|
||||
from gen.errors import ValidationError
|
||||
|
||||
from displaytabs import (PersonEventEmbedList, NameEmbedList, CitationEmbedList,
|
||||
AttrEmbedList, AddrEmbedList, NoteTab, GalleryTab,
|
||||
@ -600,7 +600,7 @@ class EditPerson(EditPrimary):
|
||||
try:
|
||||
EditMediaRef(self.dbstate, self.uistate, self.track,
|
||||
media_obj, media_ref, self.load_photo)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
elif gui.utils.is_right_click(event):
|
||||
@ -857,7 +857,7 @@ class EditPerson(EditPrimary):
|
||||
try:
|
||||
EditName(self.dbstate, self.uistate, self.track,
|
||||
self.pname, self._update_name)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def _mult_surn_clicked(self, obj):
|
||||
|
@ -50,7 +50,7 @@ from editprimary import EditPrimary
|
||||
from displaytabs import (GrampsTab, LocationEmbedList, CitationEmbedList,
|
||||
GalleryTab, NoteTab, WebEmbedList, PlaceBackRefList)
|
||||
from gui.widgets import MonitoredEntry, PrivacyButton
|
||||
from Errors import ValidationError
|
||||
from gen.errors import ValidationError
|
||||
from PlaceUtils import conv_lat_lon
|
||||
from gui.dialog import ErrorDialog
|
||||
from gui.glade import Glade
|
||||
|
@ -50,7 +50,7 @@ from editmedia import EditMedia
|
||||
from editnote import EditNote
|
||||
from gui.selectors import SelectorFactory
|
||||
from gui.ddtargets import DdTargets
|
||||
from Errors import WindowActiveError
|
||||
from gen.errors import WindowActiveError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -61,7 +61,7 @@ from gui.managedwindow import ManagedWindow
|
||||
from gui.dialog import QuestionDialog
|
||||
import const
|
||||
from gui.display import display_help
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gen.ggettext import sgettext as _
|
||||
import gen.lib
|
||||
from gen.filters import rules
|
||||
@ -839,7 +839,7 @@ class EditFilter(ManagedWindow):
|
||||
EditRule(self.namespace, self.dbstate, self.uistate, self.track,
|
||||
self.filterdb, None, _('Add Rule'), self.update_rule,
|
||||
self.filter.get_name())
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def on_edit_clicked(self, obj):
|
||||
@ -851,7 +851,7 @@ class EditFilter(ManagedWindow):
|
||||
EditRule(self.namespace, self.dbstate, self.uistate, self.track,
|
||||
self.filterdb, d, _('Edit Rule'), self.update_rule,
|
||||
self.filter.get_name())
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def update_rule(self, old_rule, new_rule):
|
||||
|
@ -47,7 +47,7 @@ import gtk
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import const
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
import config
|
||||
from gui.glade import Glade
|
||||
|
||||
@ -357,7 +357,7 @@ class ManagedWindow(object):
|
||||
|
||||
if uistate and uistate.gwm.get_item_from_id(window_key):
|
||||
uistate.gwm.get_item_from_id(window_key).present()
|
||||
raise Errors.WindowActiveError('This window is already active')
|
||||
raise WindowActiveError('This window is already active')
|
||||
else:
|
||||
self.window_id = window_key
|
||||
self.submenu_label = submenu_label
|
||||
|
@ -33,7 +33,7 @@ from gen.ggettext import sgettext as _
|
||||
from gen.display.name import displayer as name_displayer
|
||||
import const
|
||||
from gui.display import display_help
|
||||
from Errors import MergeError
|
||||
from gen.errors import MergeError
|
||||
from gui.dialog import ErrorDialog
|
||||
from gui.managedwindow import ManagedWindow
|
||||
from gen.merge import MergePersonQuery, MergeFamilyQuery
|
||||
|
@ -44,7 +44,7 @@ from gen.display.name import displayer as name_displayer
|
||||
import const
|
||||
from gui.display import display_help
|
||||
import gen.datehandler
|
||||
from Errors import MergeError
|
||||
from gen.errors import MergeError
|
||||
from gui.dialog import ErrorDialog
|
||||
from gui.managedwindow import ManagedWindow
|
||||
from gen.merge import MergePersonQuery
|
||||
|
@ -47,7 +47,7 @@ import gobject
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gui.managedwindow import ManagedWindow
|
||||
import Errors
|
||||
from gen.errors import UnavailableError, WindowActiveError
|
||||
from gen.plug import PluginRegister, PTYPE_STR, load_addon_file
|
||||
from gen.ggettext import gettext as _
|
||||
from gui.utils import open_file_with_default_application
|
||||
@ -469,7 +469,7 @@ class PluginStatus(ManagedWindow):
|
||||
hiddenstr = self.HIDDEN
|
||||
else:
|
||||
hiddenstr = self.AVAILABLE
|
||||
if err == Errors.UnavailableError:
|
||||
if err == UnavailableError:
|
||||
self.model.append(row=[
|
||||
'<span color="blue">%s</span>' % _('Unavailable'),
|
||||
i[0], str(i[1][1]), None, pdata.id, hiddenstr])
|
||||
@ -810,7 +810,7 @@ class ToolManagedWindowBase(ManagedWindow):
|
||||
if event.type == gtk.gdk._2BUTTON_PRESS:
|
||||
try:
|
||||
EditPerson(self.dbstate, self.uistate, [], person)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
else:
|
||||
self.uistate.set_active(person_handle, 'Person')
|
||||
|
@ -49,7 +49,7 @@ from gtk.gdk import ACTION_COPY
|
||||
from gen.ggettext import sgettext as _
|
||||
from gen.simple import SimpleTable
|
||||
from TransUtils import trans_objclass
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.widgets.multitreeview import MultiTreeView
|
||||
from gui.ddtargets import DdTargets
|
||||
from gui.plug.quick import run_quick_report_by_name
|
||||
@ -185,7 +185,7 @@ class QuickTable(SimpleTable):
|
||||
EditPerson(self.simpledoc.doc.dbstate,
|
||||
self.simpledoc.doc.uistate, [], person)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Event':
|
||||
event = self.access.dbase.get_event_from_handle(handle)
|
||||
@ -194,7 +194,7 @@ class QuickTable(SimpleTable):
|
||||
EditEvent(self.simpledoc.doc.dbstate,
|
||||
self.simpledoc.doc.uistate, [], event)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Family':
|
||||
ref = self.access.dbase.get_family_from_handle(handle)
|
||||
@ -203,7 +203,7 @@ class QuickTable(SimpleTable):
|
||||
EditFamily(self.simpledoc.doc.dbstate,
|
||||
self.simpledoc.doc.uistate, [], ref)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Citation':
|
||||
ref = self.access.dbase.get_citation_from_handle(handle)
|
||||
@ -212,7 +212,7 @@ class QuickTable(SimpleTable):
|
||||
EditCitation(self.simpledoc.doc.dbstate,
|
||||
self.simpledoc.doc.uistate, [], ref)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Source':
|
||||
ref = self.access.dbase.get_source_from_handle(handle)
|
||||
@ -221,7 +221,7 @@ class QuickTable(SimpleTable):
|
||||
EditSource(self.simpledoc.doc.dbstate,
|
||||
self.simpledoc.doc.uistate, [], ref)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Place':
|
||||
ref = self.access.dbase.get_place_from_handle(handle)
|
||||
@ -230,7 +230,7 @@ class QuickTable(SimpleTable):
|
||||
EditPlace(self.simpledoc.doc.dbstate,
|
||||
self.simpledoc.doc.uistate, [], ref)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Repository':
|
||||
ref = self.access.dbase.get_repository_from_handle(handle)
|
||||
@ -239,7 +239,7 @@ class QuickTable(SimpleTable):
|
||||
EditRepository(self.simpledoc.doc.dbstate,
|
||||
self.simpledoc.doc.uistate, [], ref)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'Note':
|
||||
ref = self.access.dbase.get_note_from_handle(handle)
|
||||
@ -248,7 +248,7 @@ class QuickTable(SimpleTable):
|
||||
EditNote(self.simpledoc.doc.dbstate,
|
||||
self.simpledoc.doc.uistate, [], ref)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass in ['Media', 'MediaObject']:
|
||||
ref = self.access.dbase.get_object_from_handle(handle)
|
||||
@ -257,7 +257,7 @@ class QuickTable(SimpleTable):
|
||||
EditMedia(self.simpledoc.doc.dbstate,
|
||||
self.simpledoc.doc.uistate, [], ref)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif objclass == 'PersonList':
|
||||
run_quick_report_by_name(self.simpledoc.doc.dbstate,
|
||||
|
@ -50,7 +50,7 @@ import gtk
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.ggettext import gettext as _
|
||||
import config
|
||||
import Errors
|
||||
from gen.errors import DatabaseError, FilterError, ReportError, WindowActiveError
|
||||
from gui.utils import open_file_with_default_application
|
||||
from gui.plug import add_gui_options
|
||||
from gui.user import User
|
||||
@ -626,7 +626,7 @@ def report(dbstate, uistate, person, report_class, options_class,
|
||||
elif category in (CATEGORY_BOOK, CATEGORY_CODE):
|
||||
try:
|
||||
report_class(dbstate, uistate)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
return
|
||||
else:
|
||||
@ -654,15 +654,15 @@ def report(dbstate, uistate, person, report_class, options_class,
|
||||
out_file = dialog.options.get_output()
|
||||
open_file_with_default_application(out_file)
|
||||
|
||||
except Errors.FilterError, msg:
|
||||
except FilterError, msg:
|
||||
(m1, m2) = msg.messages()
|
||||
ErrorDialog(m1, m2)
|
||||
except IOError, msg:
|
||||
ErrorDialog(_("Report could not be created"), str(msg))
|
||||
except Errors.ReportError, msg:
|
||||
except ReportError, msg:
|
||||
(m1, m2) = msg.messages()
|
||||
ErrorDialog(m1, m2)
|
||||
except Errors.DatabaseError,msg:
|
||||
except DatabaseError,msg:
|
||||
ErrorDialog(_("Report could not be created"), str(msg))
|
||||
# The following except statement will catch all "NoneType" exceptions.
|
||||
# This is useful for released code where the exception is most likely
|
||||
|
@ -40,7 +40,7 @@ log = logging.getLogger(".")
|
||||
#-------------------------------------------------------------------------
|
||||
import const
|
||||
from gen.display.name import displayer as name_displayer
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gen.plug._options import (Options, OptionHandler, OptionList,
|
||||
OptionListCollection)
|
||||
from gen.plug import (TOOL_DEBUG, TOOL_ANAL, TOOL_DBPROC, TOOL_DBFIX,
|
||||
@ -251,7 +251,7 @@ def gui_tool(dbstate, uistate, tool_class, options_class, translated_name,
|
||||
|
||||
try:
|
||||
tool_class(dbstate, uistate, options_class, name, callback)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
except:
|
||||
log.error("Failed to start tool.", exc_info=True)
|
||||
|
@ -49,7 +49,6 @@ import constfunc
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gen.lib
|
||||
import Errors
|
||||
import constfunc
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -81,7 +81,7 @@ from gui.displaystate import DisplayState, RecentDocsMenu
|
||||
import const
|
||||
import constfunc
|
||||
import config
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.dialog import (ErrorDialog, WarningDialog, QuestionDialog2,
|
||||
InfoDialog)
|
||||
from gui import widgets
|
||||
@ -1105,7 +1105,7 @@ class ViewManager(CLIManager):
|
||||
"""
|
||||
try:
|
||||
GrampsPreferences(self.uistate, self.dbstate)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
return
|
||||
|
||||
def tip_of_day_activate(self, obj):
|
||||
@ -1121,7 +1121,7 @@ class ViewManager(CLIManager):
|
||||
"""
|
||||
try:
|
||||
PluginWindows.PluginStatus(self.dbstate, self.uistate, [])
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def navigator_toggle(self, obj):
|
||||
@ -1649,7 +1649,7 @@ class ViewManager(CLIManager):
|
||||
"""
|
||||
try:
|
||||
ReportPluginDialog(self.dbstate, self.uistate, [])
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
return
|
||||
|
||||
def tools_clicked(self, obj):
|
||||
@ -1658,7 +1658,7 @@ class ViewManager(CLIManager):
|
||||
"""
|
||||
try:
|
||||
ToolPluginDialog(self.dbstate, self.uistate, [])
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
return
|
||||
|
||||
def clipboard(self, obj):
|
||||
@ -1668,7 +1668,7 @@ class ViewManager(CLIManager):
|
||||
from gui.clipboard import ClipboardWindow
|
||||
try:
|
||||
ClipboardWindow(self.dbstate, self.uistate)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
return
|
||||
|
||||
def config_view(self, obj):
|
||||
@ -1699,7 +1699,7 @@ class ViewManager(CLIManager):
|
||||
"""
|
||||
try:
|
||||
self.undo_history_window = UndoHistory(self.dbstate, self.uistate)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
return
|
||||
|
||||
def export_data(self, obj):
|
||||
@ -1710,7 +1710,7 @@ class ViewManager(CLIManager):
|
||||
import ExportAssistant
|
||||
try:
|
||||
ExportAssistant.ExportAssistant(self.dbstate, self.uistate)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
return
|
||||
|
||||
def __rebuild_report_and_tool_menus(self):
|
||||
|
@ -55,7 +55,7 @@ from gui.views.navigationview import NavigationView
|
||||
from gui.columnorder import ColumnOrder
|
||||
import config
|
||||
import TreeTips
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.filters import SearchBar
|
||||
from gui.utils import add_menuitem
|
||||
import const
|
||||
@ -333,7 +333,7 @@ class ListView(NavigationView):
|
||||
try:
|
||||
FilterEditor(self.FILTER_TYPE , const.CUSTOM_FILTERS,
|
||||
self.dbstate, self.uistate)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
return
|
||||
|
||||
def setup_filter(self):
|
||||
|
@ -46,7 +46,7 @@ from gen.ggettext import gettext as _
|
||||
# GRAMPS
|
||||
#
|
||||
#----------------------------------------------------------------
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.dbguielement import DbGUIElement
|
||||
from gui.widgets.menutoolbuttonaction import MenuToolButtonAction
|
||||
from gui.grampsbar import GrampsBar
|
||||
@ -606,7 +606,7 @@ class PageView(DbGUIElement):
|
||||
ident=_("%(cat)s - %(view)s") %
|
||||
{'cat': self.get_translated_category(),
|
||||
'view': self.get_title()})
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
return
|
||||
|
||||
class ViewConfigureDialog(ConfigureDialog):
|
||||
|
@ -41,7 +41,7 @@ from gen.ggettext import gettext as _
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
import const
|
||||
from gui.editors import EditPerson, EditFamily
|
||||
from gui.managedwindow import ManagedWindow
|
||||
@ -598,7 +598,7 @@ class GuiGramplet(object):
|
||||
self.uistate,
|
||||
[], person)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif event.type == gtk.gdk.BUTTON_PRESS: # single
|
||||
self.uistate.set_active(handle, 'Person')
|
||||
@ -610,7 +610,7 @@ class GuiGramplet(object):
|
||||
self.uistate,
|
||||
[], person)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif link_type == 'Surname':
|
||||
if event.button == 1: # left mouse
|
||||
@ -659,7 +659,7 @@ class GuiGramplet(object):
|
||||
self.uistate,
|
||||
[], family)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif event.type == gtk.gdk.BUTTON_PRESS: # single
|
||||
self.uistate.set_active(handle, 'Family')
|
||||
@ -671,7 +671,7 @@ class GuiGramplet(object):
|
||||
self.uistate,
|
||||
[], family)
|
||||
return True # handled event
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
elif link_type == 'PersonList':
|
||||
if event.button == 1: # left mouse
|
||||
|
@ -47,7 +47,7 @@ import pango
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from Errors import MaskError, ValidationError, WindowActiveError
|
||||
from gen.errors import MaskError, ValidationError, WindowActiveError
|
||||
from gui.widgets.undoableentry import UndoableEntry
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -70,7 +70,7 @@ import gobject
|
||||
import const
|
||||
import Utils
|
||||
from gui.listmodel import ListModel
|
||||
import Errors
|
||||
from gen.errors import FilterError, ReportError
|
||||
from gui.pluginmanager import GuiPluginManager
|
||||
from gen.plug.docgen import StyleSheet, StyleSheetList, PaperStyle
|
||||
from gui.dialog import WarningDialog, ErrorDialog
|
||||
@ -1395,10 +1395,10 @@ def write_book_item(database, report_class, options, user):
|
||||
All user dialog has already been handled and the output file opened."""
|
||||
try:
|
||||
return report_class(database, options, user)
|
||||
except Errors.ReportError, msg:
|
||||
except ReportError, msg:
|
||||
(m1, m2) = msg.messages()
|
||||
ErrorDialog(m1, m2)
|
||||
except Errors.FilterError, msg:
|
||||
except FilterError, msg:
|
||||
(m1, m2) = msg.messages()
|
||||
ErrorDialog(m1, m2)
|
||||
except:
|
||||
|
@ -38,7 +38,7 @@ from gen.ggettext import gettext as _
|
||||
#------------------------------------------------------------------------
|
||||
from gen.plug.docgen import (BaseDoc, TextDoc,
|
||||
PARA_ALIGN_RIGHT, PARA_ALIGN_CENTER)
|
||||
import Errors
|
||||
from gen.errors import ReportError
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@ -149,9 +149,9 @@ class AsciiDoc(BaseDoc,TextDoc):
|
||||
self.f = open(self.filename,"w")
|
||||
except IOError,msg:
|
||||
errmsg = "%s\n%s" % (_("Could not create %s") % self.filename, msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
except:
|
||||
raise Errors.ReportError(_("Could not create %s") % self.filename)
|
||||
raise ReportError(_("Could not create %s") % self.filename)
|
||||
|
||||
self.in_cell = 0
|
||||
self.text = ""
|
||||
|
@ -44,7 +44,7 @@ from math import radians
|
||||
#------------------------------------------------------------------------
|
||||
from gen.plug.docgen import PAPER_PORTRAIT
|
||||
import libcairodoc
|
||||
import Errors
|
||||
from gen.errors import UnavailableError
|
||||
#import constfunc
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
@ -64,7 +64,7 @@ import cairo
|
||||
try: # the Gramps-Connect server has no DISPLAY
|
||||
import gtk
|
||||
if gtk.pygtk_version < (2, 10, 0):
|
||||
raise Errors.UnavailableError(_("PyGtk 2.10 or later is required"))
|
||||
raise UnavailableError(_("PyGtk 2.10 or later is required"))
|
||||
except:
|
||||
pass
|
||||
|
||||
|
@ -49,7 +49,6 @@ import re, os, sys
|
||||
from gen.plug.docgen import BaseDoc, TextDoc, PAPER_LANDSCAPE, FONT_SANS_SERIF, URL_PATTERN
|
||||
from gen.plug.docbackend import DocBackend
|
||||
import Image
|
||||
import Errors
|
||||
import Utils
|
||||
|
||||
_CLICKABLE = r'''\url{\1}'''
|
||||
|
@ -89,7 +89,7 @@ from libodfbackend import OdfBackend
|
||||
import const
|
||||
from gen.plug.report import utils as ReportUtils
|
||||
import ImgManip
|
||||
import Errors
|
||||
from gen.errors import ReportError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -1189,9 +1189,9 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
|
||||
zfile = zipfile.ZipFile(self.filename, "w", zipfile.ZIP_DEFLATED)
|
||||
except IOError, msg:
|
||||
errmsg = "%s\n%s" % (_("Could not create %s") % self.filename, msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
except:
|
||||
raise Errors.ReportError(_("Could not create %s") % self.filename)
|
||||
raise ReportError(_("Could not create %s") % self.filename)
|
||||
|
||||
t = time.localtime(time.time())[:6]
|
||||
|
||||
@ -1217,7 +1217,7 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
|
||||
except:
|
||||
errmsg = "%s\n%s" % (_("Could not open %s") % image[0],
|
||||
msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
zfile.close()
|
||||
|
||||
def _write_styles_file(self):
|
||||
|
@ -40,7 +40,7 @@ from gen.ggettext import gettext as _
|
||||
from gen.plug.report import utils as ReportUtils
|
||||
from gen.plug.docgen import BaseDoc, DrawDoc, FONT_SERIF, PAPER_PORTRAIT, SOLID
|
||||
from gen.plug.utils import gformat
|
||||
import Errors
|
||||
from gen.errors import ReportError
|
||||
|
||||
def lrgb(grp):
|
||||
grp = ReportUtils.rgb_color(grp)
|
||||
@ -105,9 +105,9 @@ class PSDrawDoc(BaseDoc, DrawDoc):
|
||||
self.file = open(self.filename,"w")
|
||||
except IOError,msg:
|
||||
errmsg = "%s\n%s" % (_("Could not create %s") % self.filename, msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
except:
|
||||
raise Errors.ReportError(_("Could not create %s") % self.filename)
|
||||
raise ReportError(_("Could not create %s") % self.filename)
|
||||
|
||||
self.file.write(
|
||||
'%!PS-Adobe-3.0\n'
|
||||
|
@ -39,7 +39,7 @@ import sys
|
||||
#------------------------------------------------------------------------
|
||||
import libcairodoc
|
||||
from gen.plug.docgen import INDEX_TYPE_ALP, INDEX_TYPE_TOC
|
||||
import Errors
|
||||
from gen.errors import ReportError
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@ -92,9 +92,9 @@ class PdfDoc(libcairodoc.CairoDoc):
|
||||
surface = cairo.PDFSurface(filename, paper_width, paper_height)
|
||||
except IOError,msg:
|
||||
errmsg = "%s\n%s" % (_("Could not create %s") % filename, msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
except:
|
||||
raise Errors.ReportError(_("Could not create %s") % filename)
|
||||
raise ReportError(_("Could not create %s") % filename)
|
||||
surface.set_fallback_resolution(300, 300)
|
||||
cr = pangocairo.CairoContext(cairo.Context(surface))
|
||||
|
||||
|
@ -42,7 +42,7 @@ from gen.plug.docgen import (BaseDoc, TextDoc, FONT_SERIF, PARA_ALIGN_RIGHT,
|
||||
PARA_ALIGN_CENTER, PARA_ALIGN_JUSTIFY,
|
||||
URL_PATTERN)
|
||||
import ImgManip
|
||||
import Errors
|
||||
from gen.errors import ReportError
|
||||
import Utils
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
@ -91,9 +91,9 @@ class RTFDoc(BaseDoc,TextDoc):
|
||||
self.f = open(self.filename,"w")
|
||||
except IOError,msg:
|
||||
errmsg = "%s\n%s" % (_("Could not create %s") % self.filename, msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
except:
|
||||
raise Errors.ReportError(_("Could not create %s") % self.filename)
|
||||
raise ReportError(_("Could not create %s") % self.filename)
|
||||
|
||||
style_sheet = self.get_style_sheet()
|
||||
|
||||
|
@ -40,7 +40,7 @@ import StringIO
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from gen.plug.docgen import BaseDoc, DrawDoc, SOLID, FONT_SANS_SERIF
|
||||
import Errors
|
||||
from gen.errors import ReportError
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -76,9 +76,9 @@ class SvgDrawDoc(BaseDoc, DrawDoc):
|
||||
try:
|
||||
self.f = open(name,"w")
|
||||
except IOError,msg:
|
||||
raise Errors.ReportError(_("Could not create %s") % name, msg)
|
||||
raise ReportError(_("Could not create %s") % name, msg)
|
||||
except:
|
||||
raise Errors.ReportError(_("Could not create %s") % name)
|
||||
raise ReportError(_("Could not create %s") % name)
|
||||
|
||||
self.t = StringIO.StringIO()
|
||||
|
||||
|
@ -46,7 +46,7 @@ from gen.ggettext import sgettext as _
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
#from Errors import ReportError
|
||||
#from gen.errors import ReportError
|
||||
|
||||
from gen.plug.menu import BooleanOption
|
||||
from gen.plug.menu import NumberOption
|
||||
|
@ -37,7 +37,7 @@ import time
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gen.display.name import displayer as _nd
|
||||
from Errors import ReportError
|
||||
from gen.errors import ReportError
|
||||
import Relationship
|
||||
from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
|
||||
FONT_SERIF, PARA_ALIGN_CENTER,
|
||||
|
@ -35,7 +35,7 @@ Reports/Graphical Reports/Personal Tree
|
||||
#------------------------------------------------------------------------
|
||||
from gen.ggettext import sgettext as _
|
||||
|
||||
from Errors import ReportError
|
||||
from gen.errors import ReportError
|
||||
|
||||
from gen.plug.menu import TextOption
|
||||
from gen.plug.menu import NumberOption
|
||||
|
@ -41,7 +41,7 @@ def log2(val):
|
||||
# gramps modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from Errors import ReportError
|
||||
from gen.errors import ReportError
|
||||
from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
|
||||
FONT_SANS_SERIF, PARA_ALIGN_CENTER)
|
||||
from gen.plug.menu import EnumeratedListOption, NumberOption, PersonOption
|
||||
|
@ -47,7 +47,6 @@ log = logging.getLogger(".WriteFtree")
|
||||
#-------------------------------------------------------------------------
|
||||
import Utils
|
||||
from ExportOptions import WriterOptionBox
|
||||
import Errors
|
||||
from gui.glade import Glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -44,7 +44,7 @@ import time
|
||||
import gen.lib
|
||||
import const
|
||||
import libgedcom
|
||||
import Errors
|
||||
from gen.errors import DatabaseError
|
||||
from ExportOptions import WriterOptionBox
|
||||
from gen.updatecallback import UpdateCallback
|
||||
from Utils import media_path_full
|
||||
@ -1444,6 +1444,6 @@ def export_data(database, filename, user, option_box=None):
|
||||
except IOError, msg:
|
||||
msg2 = _("Could not create %s") % filename
|
||||
user.notify_error(msg2, str(msg))
|
||||
except Errors.DatabaseError, msg:
|
||||
except DatabaseError, msg:
|
||||
user.notify_db_error(_("Export failed"), str(msg))
|
||||
return ret
|
||||
|
@ -50,7 +50,6 @@ log = logging.getLogger(".ExportVCal")
|
||||
from ExportOptions import WriterOptionBox
|
||||
import Utils
|
||||
from gen.lib import Date, EventType
|
||||
import Errors
|
||||
from gui.glade import Glade
|
||||
|
||||
class CalendarWriter(object):
|
||||
|
@ -38,7 +38,6 @@ import libxml2
|
||||
|
||||
from libgrampsxml import GRAMPS_XML_VERSION
|
||||
from const import VERSION
|
||||
import Errors
|
||||
import ExportVCard
|
||||
|
||||
class VCardCheck(unittest.TestCase):
|
||||
|
@ -26,7 +26,7 @@ from gen.ggettext import gettext as _
|
||||
from gen.display.name import displayer as name_displayer
|
||||
from gen.utils import get_birth_or_fallback, get_death_or_fallback
|
||||
import gen.datehandler
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
import gtk
|
||||
|
||||
class Children(Gramplet):
|
||||
@ -66,7 +66,7 @@ class Children(Gramplet):
|
||||
try:
|
||||
person = self.dbstate.db.get_person_from_handle(handle)
|
||||
EditPerson(self.dbstate, self.uistate, [], person)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
class PersonChildren(Children):
|
||||
|
@ -24,7 +24,7 @@ from gui.editors import EditSource, EditCitation
|
||||
from gui.listmodel import ListModel, NOSORT
|
||||
from gen.plug import Gramplet
|
||||
from gen.ggettext import gettext as _
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
import gtk
|
||||
|
||||
class Citations(Gramplet):
|
||||
@ -236,7 +236,7 @@ class Citations(Gramplet):
|
||||
try:
|
||||
source = self.dbstate.db.get_source_from_handle(handle)
|
||||
EditSource(self.dbstate, self.uistate, [], source)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def edit_citation(self, handle):
|
||||
@ -248,7 +248,7 @@ class Citations(Gramplet):
|
||||
source_handle = citation.get_reference_handle()
|
||||
source = self.dbstate.db.get_source_from_handle(source_handle)
|
||||
EditCitation(self.dbstate, self.uistate, [], citation, source)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
class PersonCitations(Citations):
|
||||
|
@ -58,7 +58,7 @@ from gen.plug import Gramplet
|
||||
|
||||
from libmetadata import MetadataView, format_datetime
|
||||
from gui.widgets import ValidatableMaskedEntry
|
||||
from Errors import ValidationError
|
||||
from gen.errors import ValidationError
|
||||
from gui.dialog import QuestionDialog, OptionDialog
|
||||
|
||||
from gen.lib import Date
|
||||
|
@ -26,7 +26,7 @@ from gen.ggettext import gettext as _
|
||||
from gen.display.name import displayer as name_displayer
|
||||
import gen.datehandler
|
||||
from gen.utils import get_birth_or_fallback, get_marriage_or_fallback
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
import gtk
|
||||
import config
|
||||
|
||||
@ -122,7 +122,7 @@ class Events(Gramplet):
|
||||
try:
|
||||
event = self.dbstate.db.get_event_from_handle(handle)
|
||||
EditEvent(self.dbstate, self.uistate, [], event)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
class PersonEvents(Events):
|
||||
|
@ -58,7 +58,7 @@ from gen.plug import Gramplet
|
||||
from Utils import (find_children, find_parents, find_witnessed_people)
|
||||
from libformatting import FormattingHelper
|
||||
import gen.lib
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.editors import EditPerson
|
||||
import gui.utils
|
||||
|
||||
@ -672,7 +672,7 @@ class FanChartGramplet(Gramplet):
|
||||
if person:
|
||||
try:
|
||||
EditPerson(self.dbstate, self.uistate, [], person)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
return True
|
||||
return False
|
||||
|
@ -25,7 +25,7 @@ from gui.listmodel import ListModel, NOSORT
|
||||
from gen.plug import Gramplet
|
||||
from gen.ggettext import gettext as _
|
||||
import gen.datehandler
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
import gtk
|
||||
|
||||
class PersonResidence(Gramplet):
|
||||
@ -118,5 +118,5 @@ class PersonResidence(Gramplet):
|
||||
try:
|
||||
event = self.dbstate.db.get_event_from_handle(handle)
|
||||
EditEvent(self.dbstate, self.uistate, [], event)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
@ -39,7 +39,7 @@ from gen.ggettext import gettext as _
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gen.display.name import displayer as name_displayer
|
||||
from Errors import ReportError
|
||||
from gen.errors import ReportError
|
||||
from gen.plug.menu import (PersonOption, BooleanOption, NumberOption,
|
||||
EnumeratedListOption)
|
||||
from gen.plug.report import Report
|
||||
|
@ -43,7 +43,7 @@ LOG = logging.getLogger(".GedcomImport")
|
||||
# GRAMPS modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
import Errors
|
||||
from gen.errors import DbError, GedcomError
|
||||
from gui.glade import Glade
|
||||
from libmixin import DbMixin
|
||||
import libgedcom
|
||||
@ -111,7 +111,7 @@ def importData(database, filename, user):
|
||||
except IOError, msg:
|
||||
user.notify_error(_("%s could not be opened\n") % filename, str(msg))
|
||||
return
|
||||
except Errors.GedcomError, msg:
|
||||
except GedcomError, msg:
|
||||
user.notify_error(_("Invalid GEDCOM file"),
|
||||
_("%s could not be imported") % filename + "\n" + str(msg))
|
||||
return
|
||||
@ -126,9 +126,9 @@ def importData(database, filename, user):
|
||||
msg = _("%s could not be opened\n") % filename
|
||||
user.notify_error(msg, str(msg))
|
||||
return
|
||||
except Errors.DbError, msg:
|
||||
except DbError, msg:
|
||||
user.notify_db_error(str(msg.value))
|
||||
return
|
||||
except Errors.GedcomError, msg:
|
||||
except GedcomError, msg:
|
||||
user.notify_error(_('Error reading GEDCOM file'), str(msg))
|
||||
return
|
||||
|
@ -46,7 +46,7 @@ LOG = logging.getLogger(".ImportGeneWeb")
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import Errors
|
||||
from gen.errors import GedcomError
|
||||
import gen.lib
|
||||
from gen.db import DbTxn
|
||||
from htmlentitydefs import name2codepoint
|
||||
@ -172,7 +172,7 @@ class GeneWebParser(object):
|
||||
else:
|
||||
LOG.warn("parse_geneweb_file(): Token >%s< unknown. line %d skipped: %s" %
|
||||
(fields[0],self.lineno,line))
|
||||
except Errors.GedcomError, err:
|
||||
except GedcomError, err:
|
||||
self.errmsg(str(err))
|
||||
|
||||
t = time.time() - t
|
||||
|
@ -48,7 +48,7 @@ LOG = logging.getLogger(".ImportVCard")
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import Errors
|
||||
from gen.errors import GrampsImportError
|
||||
import gen.lib
|
||||
from gen.db import DbTxn
|
||||
from gen.plug.utils import OpenFileOrStdin
|
||||
@ -67,7 +67,7 @@ def importData(database, filename, user):
|
||||
except EnvironmentError, msg:
|
||||
user.notify_error(_("%s could not be opened\n") % filename, str(msg))
|
||||
return
|
||||
except Errors.GrampsImportError, msg:
|
||||
except GrampsImportError, msg:
|
||||
user.notify_error(_("%s could not be opened\n") % filename, str(msg))
|
||||
return
|
||||
return None # This module doesn't provide info about what got imported.
|
||||
@ -306,7 +306,7 @@ class VCardParser(object):
|
||||
"""Check the version of the VCard, only version 3.0 is supported."""
|
||||
self.version = data
|
||||
if self.version != "3.0":
|
||||
raise Errors.GrampsImportError(_("Import of VCards version %s is "
|
||||
raise GrampsImportError(_("Import of VCards version %s is "
|
||||
"not supported by Gramps.") % self.version)
|
||||
|
||||
def add_formatted_name(self, fields, data):
|
||||
|
@ -47,7 +47,7 @@ import gen.mime
|
||||
import gen.lib
|
||||
from gen.db import DbTxn
|
||||
from gen.db.write import CLASS_TO_KEY_MAP
|
||||
from Errors import GrampsImportError
|
||||
from gen.errors import GrampsImportError
|
||||
import Utils
|
||||
import gen.datehandler
|
||||
from gen.display.name import displayer as name_displayer
|
||||
|
@ -42,7 +42,6 @@ import libxslt
|
||||
from libgrampsxml import GRAMPS_XML_VERSION
|
||||
|
||||
from const import ROOT_DIR, VERSION
|
||||
import Errors
|
||||
import ImportVCard
|
||||
from ImportVCard import VCardParser
|
||||
|
||||
|
@ -46,7 +46,7 @@ from gen.plug.docgen import (BaseDoc, TextDoc, DrawDoc, ParagraphStyle,
|
||||
TableCellStyle, SOLID, FONT_SANS_SERIF, FONT_SERIF,
|
||||
FONT_MONOSPACE, PARA_ALIGN_CENTER, PARA_ALIGN_LEFT)
|
||||
from gen.plug.report import utils as ReportUtils
|
||||
from Errors import PluginError
|
||||
from gen.errors import PluginError
|
||||
from gen.plug.docbackend import CairoBackend
|
||||
import ImgManip
|
||||
|
||||
|
@ -112,7 +112,7 @@ LOG = logging.getLogger(".libgedcom")
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import Errors
|
||||
from gen.errors import GedcomError
|
||||
import const
|
||||
import gen.lib
|
||||
from gen.db import DbTxn
|
||||
@ -2801,7 +2801,7 @@ class GedcomParser(UpdateCallback):
|
||||
# future to do something else
|
||||
self.__add_msg(self.__TRUNC_MSG)
|
||||
self.groups = None
|
||||
raise Errors.GedcomError(self.__TRUNC_MSG)
|
||||
raise GedcomError(self.__TRUNC_MSG)
|
||||
|
||||
self.backoff = False
|
||||
return self.groups
|
||||
@ -6903,7 +6903,7 @@ class GedcomParser(UpdateCallback):
|
||||
"""
|
||||
line = self.__get_next_line()
|
||||
if line.token != TOKEN_HEAD:
|
||||
raise Errors.GedcomError("%s is not a GEDCOM file" % self.filename)
|
||||
raise GedcomError("%s is not a GEDCOM file" % self.filename)
|
||||
|
||||
def __parse_submission(self, line, state):
|
||||
"""
|
||||
@ -7271,9 +7271,9 @@ class GedcomStageOne(object):
|
||||
input_file.seek(0)
|
||||
return codecs.EncodedFile(input_file, 'utf8', 'utf16')
|
||||
elif not line :
|
||||
raise Errors.GedcomError(self.__EMPTY_GED)
|
||||
raise GedcomError(self.__EMPTY_GED)
|
||||
elif line[0] == "\x00" or line[1] == "\x00":
|
||||
raise Errors.GedcomError(self.__BAD_UTF16)
|
||||
raise GedcomError(self.__BAD_UTF16)
|
||||
else:
|
||||
input_file.seek(0)
|
||||
return input_file
|
||||
|
@ -45,7 +45,7 @@ import os.path
|
||||
from gen.plug.docbackend import DocBackend
|
||||
from libhtml import Html
|
||||
from Utils import xml_lang
|
||||
import Errors
|
||||
from gen.errors import ReportError
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
@ -248,9 +248,9 @@ class HtmlBackend(DocBackend):
|
||||
except IOError,msg:
|
||||
errmsg = "%s\n%s" % (_("Could not create %s") %
|
||||
self._filename, msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
except:
|
||||
raise Errors.ReportError(_("Could not create %s") %
|
||||
raise ReportError(_("Could not create %s") %
|
||||
self._filename)
|
||||
if not os.path.isdir(self.datadirfull()):
|
||||
try:
|
||||
@ -258,9 +258,9 @@ class HtmlBackend(DocBackend):
|
||||
except IOError,msg:
|
||||
errmsg = "%s\n%s" % (_("Could not create %s") %
|
||||
self.datadirfull(), msg)
|
||||
raise Errors.ReportError(errmsg)
|
||||
raise ReportError(errmsg)
|
||||
except:
|
||||
raise Errors.ReportError(_("Could not create %s") %
|
||||
raise ReportError(_("Could not create %s") %
|
||||
self.datadirfull())
|
||||
self.html_page, self.html_header, self.html_body = Html.page(
|
||||
lang=xml_lang(), title=self.title)
|
||||
|
@ -53,7 +53,7 @@ from gui.views.listview import ListView
|
||||
import Utils
|
||||
from gen.display.name import displayer as name_displayer
|
||||
from gui.dialog import ErrorDialog, QuestionDialog
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.views.bookmarks import PersonBookmarks
|
||||
import config
|
||||
from gui.ddtargets import DdTargets
|
||||
@ -270,7 +270,7 @@ class BasePersonView(ListView):
|
||||
|
||||
try:
|
||||
EditPerson(self.dbstate, self.uistate, [], person)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def edit(self, obj):
|
||||
@ -281,7 +281,7 @@ class BasePersonView(ListView):
|
||||
person = self.dbstate.db.get_person_from_handle(handle)
|
||||
try:
|
||||
EditPerson(self.dbstate, self.uistate, [], person)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def remove(self, obj):
|
||||
|
@ -48,7 +48,7 @@ import gtk
|
||||
import gen.lib
|
||||
from gui.views.listview import ListView
|
||||
from gui.utils import add_menuitem
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.views.bookmarks import PlaceBookmarks
|
||||
import config
|
||||
from gui.dialog import ErrorDialog
|
||||
@ -366,7 +366,7 @@ class PlaceBaseView(ListView):
|
||||
def add(self, obj):
|
||||
try:
|
||||
EditPlace(self.dbstate, self.uistate, [], gen.lib.Place())
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def remove(self, obj):
|
||||
@ -397,7 +397,7 @@ class PlaceBaseView(ListView):
|
||||
place = self.dbstate.db.get_place_from_handle(handle)
|
||||
try:
|
||||
EditPlace(self.dbstate, self.uistate, [], place)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def merge(self, obj):
|
||||
|
@ -50,7 +50,7 @@ import Utils
|
||||
from gen.display.name import displayer as _nd
|
||||
from gui.views.navigationview import NavigationView
|
||||
from libformatting import FormattingHelper
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
import const
|
||||
import constfunc
|
||||
from gui.managedwindow import ManagedWindow
|
||||
@ -732,7 +732,7 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
person = self.dbstate.db.get_person_from_gramps_id(mark[8])
|
||||
try:
|
||||
EditPerson(self.dbstate, self.uistate, [], person)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def edit_family(self, menu, event, lat, lon, mark):
|
||||
@ -744,7 +744,7 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
family = self.dbstate.db.get_family_from_gramps_id(mark[11])
|
||||
try:
|
||||
EditFamily(self.dbstate, self.uistate, [], family)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def edit_event(self, menu, event, lat, lon, mark):
|
||||
@ -756,7 +756,7 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
event = self.dbstate.db.get_event_from_gramps_id(mark[10])
|
||||
try:
|
||||
EditEvent(self.dbstate, self.uistate, [], event)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def add_place(self, menu, event, lat, lon):
|
||||
@ -812,7 +812,7 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
try:
|
||||
EditPlace(self.dbstate, self.uistate, [], new_place)
|
||||
self.add_marker(None, None, plat, plon, None, True)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def __edit_place(self, pcountry, pcounty, pstate, plat, plon):
|
||||
@ -831,7 +831,7 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
place.set_main_location(loc)
|
||||
try:
|
||||
EditPlace(self.dbstate, self.uistate, [], place)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
def __link_place(self, pcountry, pcounty, pstate, plat, plon):
|
||||
@ -853,7 +853,7 @@ class GeoGraphyView(OsmGps, NavigationView):
|
||||
try:
|
||||
EditPlace(self.dbstate, self.uistate, [], place)
|
||||
self.add_marker(None, None, plat, plon, None, True)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
pass
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -52,7 +52,7 @@ import gtk
|
||||
# Gramps Modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import Errors
|
||||
from gen.errors import WindowActiveError
|
||||
from gui.managedwindow import ManagedWindow
|
||||
from osmGps import OsmGps
|
||||
|
||||
@ -101,7 +101,7 @@ class PlaceSelection(ManagedWindow, OsmGps):
|
||||
try:
|
||||
ManagedWindow.__init__(self, uistate, [],
|
||||
PlaceSelection)
|
||||
except Errors.WindowActiveError:
|
||||
except WindowActiveError:
|
||||
return
|
||||
self.uistate = uistate
|
||||
self.dbstate = dbstate
|
||||
|
@ -39,7 +39,7 @@ from gen.ggettext import gettext as _
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gen.display.name import displayer as global_name_display
|
||||
from Errors import ReportError
|
||||
from gen.errors import ReportError
|
||||
from gen.lib import ChildRefType
|
||||
from gen.plug.menu import (BooleanOption, NumberOption, PersonOption,
|
||||
EnumeratedListOption)
|
||||
|
@ -38,7 +38,7 @@ import datetime, time
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gen.display.name import displayer as global_name_display
|
||||
from Errors import ReportError
|
||||
from gen.errors import ReportError
|
||||
from gen.lib import NameType, EventType, Name, Date, Person
|
||||
import Relationship
|
||||
from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
|
||||
|
@ -47,7 +47,7 @@ from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
||||
from gen.plug.menu import (NumberOption, PersonOption, BooleanOption,
|
||||
EnumeratedListOption)
|
||||
from gen.display.name import displayer as global_name_display
|
||||
from Errors import ReportError
|
||||
from gen.errors import ReportError
|
||||
from gen.plug.report import Report
|
||||
from gen.plug.report import utils as ReportUtils
|
||||
from gen.plug.report import MenuReportOptions
|
||||
|
@ -43,7 +43,7 @@ from gen.ggettext import gettext as _
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gen.display.name import displayer as global_name_display
|
||||
from Errors import ReportError
|
||||
from gen.errors import ReportError
|
||||
from gen.lib import EventType, FamilyRelType, Person, NoteType
|
||||
from gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
|
||||
FONT_SANS_SERIF, FONT_SERIF,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user