The gen module provides packages that are common to all gramps interfaces (gui, cli and web).
Provide the database state class
Bases: gramps.gen.utils.callback.Callback
Provide a class to encapsulate the state of the database.
Add a proxy to the current database. Use pop_proxy() to revert to previous db.
>>> dbstate.apply_proxy(gen.proxy.LivingProxyDb, 1)
>>> dbstate.apply_proxy(gen.proxy.PrivateProxyDb)
Closes the existing db, and opens a new one. Retained for backward compatibility.
Change the current database. and resets the configuration prefixes.
Provide Error objects
Bases: exceptions.Exception
Error used to report database errors
Bases: exceptions.Exception
Error used to report Date errors
Might have a .date attribute holding an invalid Date object that triggered the error.
Bases: exceptions.Exception
Error used to report BerkeleyDB errors.
TODO
Bases: object
Interface to a RecentFiles collection
Provide sorting routines for use in Gramps. Since these functions are intended to provide fast sorting, they tend to bypass access methods, and directly use class members. For this reason, care needs to be taken to make sure these remain in sync with the rest of the design.
Bases: object
Sort routine for comparing two people by birth dates. If the birth dates are equal, sorts by name
Sort routine for comparing two events by their descriptions.
A set of basic utilities that everything in Gramps can depend upon.
The goal is to have this module not depend on any other gramps module. That way, e.g. database classes can safely depend on that without other Gramps baggage.
This class provides a means to interact with the user in an abstract way. This class should be overridden by each respective user interface to provide the appropriate interaction (eg. dialogs for GTK, prompts for CLI).
Start showing a progress indicator to the user.
Don’t use this method directly, use progress instead.
Parameters: |
|
---|---|
Returns: | none |
Stop showing the progress indicator to the user.
Don’t use this method directly, use progress instead.
Notify the user of a DB error.
Parameters: | error (str) – the error message |
---|---|
Returns: | none |
Notify the user of an error.
Parameters: |
|
---|---|
Returns: | none |
Preferred form of progress reporting.
Parameters: same as for begin_progress.
Usage example (see gramps/cli/test/user_test.py):
with self.user.progress("Foo", "Bar", 0) as step:
for i in range(10):
step()
Ensures end_progress will be called even if an exception was thrown.
Prompt the user with a message to select an alternative.
Parameters: |
|
---|---|
Returns: | the user’s answer to the question |
Return type: | bool |