diff --git a/gramps/cli/arghandler.py b/gramps/cli/arghandler.py index 9bf7783ac..f0795d4dc 100644 --- a/gramps/cli/arghandler.py +++ b/gramps/cli/arghandler.py @@ -147,7 +147,7 @@ def _split_options(options_str): #------------------------------------------------------------------------- # ArgHandler #------------------------------------------------------------------------- -class ArgHandler(object): +class ArgHandler: """ This class is responsible for the non GUI handling of commands. The handler is passed a parser object, sanitizes it, and can execute the diff --git a/gramps/cli/argparser.py b/gramps/cli/argparser.py index 035954507..82826eb09 100644 --- a/gramps/cli/argparser.py +++ b/gramps/cli/argparser.py @@ -128,7 +128,7 @@ Syntax may be different for other shells and for Windows. #------------------------------------------------------------------------- # ArgParser #------------------------------------------------------------------------- -class ArgParser(object): +class ArgParser: """ This class is responsible for parsing the command line arguments (if any) given to gramps, and determining if a GUI or a CLI session must be started. diff --git a/gramps/cli/clidbman.py b/gramps/cli/clidbman.py index 6a347e7bd..d4254d9c4 100644 --- a/gramps/cli/clidbman.py +++ b/gramps/cli/clidbman.py @@ -87,7 +87,7 @@ def _errordialog(title, errormessage): # CLIDbManager # #------------------------------------------------------------------------- -class CLIDbManager(object): +class CLIDbManager: """ Database manager without GTK functionality, allows users to create and open databases diff --git a/gramps/cli/grampscli.py b/gramps/cli/grampscli.py index 30f8cdc3c..3672e402d 100644 --- a/gramps/cli/grampscli.py +++ b/gramps/cli/grampscli.py @@ -68,7 +68,7 @@ from gramps.gen.recentfiles import recent_files # CLI DbLoader class # #------------------------------------------------------------------------- -class CLIDbLoader(object): +class CLIDbLoader: """ Base class for Db loading action inside a :class:`.DbState`. Only the minimum is present needed for CLI handling @@ -215,7 +215,7 @@ class CLIDbLoader(object): # #------------------------------------------------------------------------- -class CLIManager(object): +class CLIManager: """ Sessionmanager for Gramps. This is in effect a reduced :class:`.ViewManager` instance (see gui/viewmanager), suitable for CLI actions. diff --git a/gramps/cli/plug/__init__.py b/gramps/cli/plug/__init__.py index 278fc9b2c..9f9ba3485 100644 --- a/gramps/cli/plug/__init__.py +++ b/gramps/cli/plug/__init__.py @@ -197,7 +197,7 @@ def _validate_options(options, dbase): # Command-line report # #------------------------------------------------------------------------ -class CommandLineReport(object): +class CommandLineReport: """ Provide a way to generate report from the command line. """ diff --git a/gramps/gen/datehandler/_datedisplay.py b/gramps/gen/datehandler/_datedisplay.py index 06eab6e4f..9a8f1052a 100644 --- a/gramps/gen/datehandler/_datedisplay.py +++ b/gramps/gen/datehandler/_datedisplay.py @@ -49,7 +49,7 @@ from ._datestrings import DateStrings # DateDisplay # #------------------------------------------------------------------------- -class DateDisplay(object): +class DateDisplay: """ Base date display class. """ diff --git a/gramps/gen/datehandler/_dateparser.py b/gramps/gen/datehandler/_dateparser.py index bf5e24622..25cb3bfa1 100644 --- a/gramps/gen/datehandler/_dateparser.py +++ b/gramps/gen/datehandler/_dateparser.py @@ -186,7 +186,7 @@ def _generate_variants(months): # DateParser class # #------------------------------------------------------------------------- -class DateParser(object): +class DateParser: """ Convert a text string into a :class:`.Date` object. If the date cannot be converted, the text string is assigned. diff --git a/gramps/gen/datehandler/_datestrings.py b/gramps/gen/datehandler/_datestrings.py index 09377dc38..ff0ab63b6 100644 --- a/gramps/gen/datehandler/_datestrings.py +++ b/gramps/gen/datehandler/_datestrings.py @@ -51,7 +51,7 @@ log = logging.getLogger(".DateStrings") # DateStrings # #------------------------------------------------------------------------- -class DateStrings(object): +class DateStrings: """ String tables for :class:`.DateDisplay` and :class:`.DateParser`. """ diff --git a/gramps/gen/db/base.py b/gramps/gen/db/base.py index 5b4890d91..69a66cd4c 100644 --- a/gramps/gen/db/base.py +++ b/gramps/gen/db/base.py @@ -85,7 +85,7 @@ def sort_objects(objects, order_by, db): # #------------------------------------------------------------------------- -class DbReadBase(object): +class DbReadBase: """ Gramps database object. This object is a base class for all database interfaces. All methods raise NotImplementedError @@ -2119,7 +2119,7 @@ class DbWriteBase(DbReadBase): user.uistate.set_busy_cursor(False) user.uistate.progress.hide() -class QuerySet(object): +class QuerySet: """ A container for selection criteria before being actually applied to a database. diff --git a/gramps/gen/db/generic.py b/gramps/gen/db/generic.py index 2f0622d09..2e0bf6467 100644 --- a/gramps/gen/db/generic.py +++ b/gramps/gen/db/generic.py @@ -202,7 +202,7 @@ class DbGenericUndo(DbUndo): db.undo_history_callback() return True -class Environment(object): +class Environment: """ Implements the Environment API. """ @@ -215,7 +215,7 @@ class Environment(object): def txn_checkpoint(self): pass -class Table(object): +class Table: """ Implements Table interface. """ @@ -236,7 +236,7 @@ class Table(object): def put(self, key, data, txn=None): self.funcs["add_func"](data, txn) -class Map(object): +class Map: """ Implements the map API for person_map, etc. @@ -285,7 +285,7 @@ class Map(object): def delete(self, key): self.table.funcs["del_func"](key, self.txn) -class MetaCursor(object): +class MetaCursor: def __init__(self): pass def __enter__(self): @@ -309,7 +309,7 @@ class MetaCursor(object): def close(self): pass -class Cursor(object): +class Cursor: def __init__(self, map): self.map = map self._iter = self.__iter__() @@ -358,7 +358,7 @@ class TreeCursor(Cursor): for handle in handles: yield (handle, self.db._get_raw_place_data(handle)) -class Bookmarks(object): +class Bookmarks: def __init__(self, default=[]): self.handles = list(default) diff --git a/gramps/gen/db/test/test_where.py b/gramps/gen/db/test/test_where.py index 0ef4d0d62..25eb1e918 100644 --- a/gramps/gen/db/test/test_where.py +++ b/gramps/gen/db/test/test_where.py @@ -34,7 +34,7 @@ def make_closure(surname): (person.primary_name.surname_list[0].surname == surname and person.gender == Person.MALE)) -class Thing(object): +class Thing: def __init__(self): self.list = ["I0", "I1", "I2"] diff --git a/gramps/gen/db/undoredo.py b/gramps/gen/db/undoredo.py index d1db5a1d9..487397a43 100644 --- a/gramps/gen/db/undoredo.py +++ b/gramps/gen/db/undoredo.py @@ -7,7 +7,7 @@ import time import pickle from collections import deque -class DbUndo(object): +class DbUndo: """ Base class for the Gramps undo/redo manager. Needs to be subclassed for use with a real backend. diff --git a/gramps/gen/display/name.py b/gramps/gen/display/name.py index bd960b76e..9a5306d03 100644 --- a/gramps/gen/display/name.py +++ b/gramps/gen/display/name.py @@ -318,7 +318,7 @@ def cleanup_name(namestring): # NameDisplay class # #------------------------------------------------------------------------- -class NameDisplay(object): +class NameDisplay: """ Base class for displaying of Name instances. @@ -504,7 +504,7 @@ class NameDisplay(object): We use this in Gramps as understanding the old compare function is not trivial. This should be replaced by a proper key function """ - class K(object): + class K: def __init__(self, obj, *args): self.obj = obj def __lt__(self, other): diff --git a/gramps/gen/display/place.py b/gramps/gen/display/place.py index 7a390f798..318acc88e 100644 --- a/gramps/gen/display/place.py +++ b/gramps/gen/display/place.py @@ -36,7 +36,7 @@ from ..lib import PlaceType # PlaceDisplay class # #------------------------------------------------------------------------- -class PlaceDisplay(object): +class PlaceDisplay: def display_event(self, db, event): if not event: diff --git a/gramps/gen/filters/_filterlist.py b/gramps/gen/filters/_filterlist.py index c07e20a98..c26547a4a 100644 --- a/gramps/gen/filters/_filterlist.py +++ b/gramps/gen/filters/_filterlist.py @@ -43,7 +43,7 @@ PLUGMAN = BasePluginManager.get_instance() # FilterList # #------------------------------------------------------------------------- -class FilterList(object): +class FilterList: """ Container class for managing the generic filters. It stores, saves, and loads the filters. diff --git a/gramps/gen/filters/_genericfilter.py b/gramps/gen/filters/_genericfilter.py index 3cd8da982..accdcb4d8 100644 --- a/gramps/gen/filters/_genericfilter.py +++ b/gramps/gen/filters/_genericfilter.py @@ -46,7 +46,7 @@ from ..lib.tag import Tag # GenericFilter # #------------------------------------------------------------------------- -class GenericFilter(object): +class GenericFilter: """Filter class that consists of several rules.""" logical_functions = ['or', 'and', 'xor', 'one'] diff --git a/gramps/gen/filters/_searchfilter.py b/gramps/gen/filters/_searchfilter.py index 8afab63d9..348e6bcfb 100644 --- a/gramps/gen/filters/_searchfilter.py +++ b/gramps/gen/filters/_searchfilter.py @@ -24,7 +24,7 @@ Package providing filtering framework for GRAMPS. from gramps.gen.constfunc import win -class SearchFilter(object): +class SearchFilter: def __init__(self, func, text, invert): self.func = func self.text = text.upper() diff --git a/gramps/gen/filters/rules/_rule.py b/gramps/gen/filters/rules/_rule.py index acb10246b..e9f0182e0 100644 --- a/gramps/gen/filters/rules/_rule.py +++ b/gramps/gen/filters/rules/_rule.py @@ -45,7 +45,7 @@ LOG = logging.getLogger(".") # Rule # #------------------------------------------------------------------------- -class Rule(object): +class Rule: """Base rule class.""" labels = [] diff --git a/gramps/gen/lib/addressbase.py b/gramps/gen/lib/addressbase.py index b9819425f..713a56075 100644 --- a/gramps/gen/lib/addressbase.py +++ b/gramps/gen/lib/addressbase.py @@ -36,7 +36,7 @@ from .const import IDENTICAL, EQUAL # AddressBase classes # #------------------------------------------------------------------------- -class AddressBase(object): +class AddressBase: """ Base class for address-aware objects. """ diff --git a/gramps/gen/lib/attrbase.py b/gramps/gen/lib/attrbase.py index c2d526969..2f356b949 100644 --- a/gramps/gen/lib/attrbase.py +++ b/gramps/gen/lib/attrbase.py @@ -37,7 +37,7 @@ from .const import IDENTICAL, EQUAL # AttributeRootBase class # #------------------------------------------------------------------------- -class AttributeRootBase(object): +class AttributeRootBase: """ Base class for attribute-aware objects. """ diff --git a/gramps/gen/lib/baseobj.py b/gramps/gen/lib/baseobj.py index 33e13b5df..db5dbd692 100644 --- a/gramps/gen/lib/baseobj.py +++ b/gramps/gen/lib/baseobj.py @@ -34,7 +34,7 @@ import re # Base Object # #------------------------------------------------------------------------- -class BaseObject(object): +class BaseObject: """ The BaseObject is the base class for all data objects in Gramps, whether primary or not. diff --git a/gramps/gen/lib/citationbase.py b/gramps/gen/lib/citationbase.py index 5a7f5bbd6..59e5b60a3 100644 --- a/gramps/gen/lib/citationbase.py +++ b/gramps/gen/lib/citationbase.py @@ -45,7 +45,7 @@ LOG = logging.getLogger(".citation") # CitationBase class # #------------------------------------------------------------------------- -class CitationBase(object): +class CitationBase: """ Base class for storing citations. @@ -272,7 +272,7 @@ class CitationBase(object): for item in self.get_citation_child_list(): item.replace_citation_references(old_handle, new_handle) -class IndirectCitationBase(object): +class IndirectCitationBase: """ Citation management logic for objects that don't have citations for the primary objects, but only for the child (secondary) ones. diff --git a/gramps/gen/lib/date.py b/gramps/gen/lib/date.py index 1a57fb064..b0a20ad07 100644 --- a/gramps/gen/lib/date.py +++ b/gramps/gen/lib/date.py @@ -54,7 +54,7 @@ _ = glocale.translation.sgettext LOG = logging.getLogger(".Date") -class Span(object): +class Span: """ Span is used to represent the difference between two dates for three main purposes: sorting, ranking, and describing. @@ -526,7 +526,7 @@ class Span(object): # Date class # #------------------------------------------------------------------------- -class Date(object): +class Date: """ The core date handling class for Gramps. diff --git a/gramps/gen/lib/datebase.py b/gramps/gen/lib/datebase.py index c065fa7bb..0ffd26c97 100644 --- a/gramps/gen/lib/datebase.py +++ b/gramps/gen/lib/datebase.py @@ -34,7 +34,7 @@ from .date import Date # DateBase classes # #------------------------------------------------------------------------- -class DateBase(object): +class DateBase: """ Base class for storing date information. """ diff --git a/gramps/gen/lib/genderstats.py b/gramps/gen/lib/genderstats.py index 088cfafc7..0b4bc3ed7 100644 --- a/gramps/gen/lib/genderstats.py +++ b/gramps/gen/lib/genderstats.py @@ -35,7 +35,7 @@ from .person import Person # # #------------------------------------------------------------------------- -class GenderStats(object): +class GenderStats: """ Class for keeping track of statistics related to Given Name vs. Gender. diff --git a/gramps/gen/lib/ldsordbase.py b/gramps/gen/lib/ldsordbase.py index cf86d43b3..4b22560ef 100644 --- a/gramps/gen/lib/ldsordbase.py +++ b/gramps/gen/lib/ldsordbase.py @@ -36,7 +36,7 @@ from .const import IDENTICAL, EQUAL # LdsOrdBase classes # #------------------------------------------------------------------------- -class LdsOrdBase(object): +class LdsOrdBase: """ Base class for lds_ord-aware objects. """ diff --git a/gramps/gen/lib/locationbase.py b/gramps/gen/lib/locationbase.py index eb0508fb8..dc7373e12 100644 --- a/gramps/gen/lib/locationbase.py +++ b/gramps/gen/lib/locationbase.py @@ -28,7 +28,7 @@ LocationBase class for Gramps. # LocationBase class # #------------------------------------------------------------------------- -class LocationBase(object): +class LocationBase: """ Base class for all things Address. """ diff --git a/gramps/gen/lib/mediabase.py b/gramps/gen/lib/mediabase.py index 2184bf722..76a252173 100644 --- a/gramps/gen/lib/mediabase.py +++ b/gramps/gen/lib/mediabase.py @@ -36,7 +36,7 @@ from .const import IDENTICAL, EQUAL, DIFFERENT # MediaBase class # #------------------------------------------------------------------------- -class MediaBase(object): +class MediaBase: """ Base class for storing media references. """ diff --git a/gramps/gen/lib/notebase.py b/gramps/gen/lib/notebase.py index 9fa5b1bcc..2859a1886 100644 --- a/gramps/gen/lib/notebase.py +++ b/gramps/gen/lib/notebase.py @@ -30,7 +30,7 @@ from .handle import Handle # NoteBase class # #------------------------------------------------------------------------- -class NoteBase(object): +class NoteBase: """ Base class for storing notes. diff --git a/gramps/gen/lib/placebase.py b/gramps/gen/lib/placebase.py index b84bd4a16..5423e014d 100644 --- a/gramps/gen/lib/placebase.py +++ b/gramps/gen/lib/placebase.py @@ -27,7 +27,7 @@ PlaceBase class for Gramps. # PlaceBase class # #------------------------------------------------------------------------- -class PlaceBase(object): +class PlaceBase: """ Base class for place-aware objects. """ diff --git a/gramps/gen/lib/privacybase.py b/gramps/gen/lib/privacybase.py index 12b2819c2..c4b2d3923 100644 --- a/gramps/gen/lib/privacybase.py +++ b/gramps/gen/lib/privacybase.py @@ -28,7 +28,7 @@ PrivacyBase Object class for Gramps. # PrivacyBase Object # #------------------------------------------------------------------------- -class PrivacyBase(object): +class PrivacyBase: """ Base class for privacy-aware objects. """ diff --git a/gramps/gen/lib/refbase.py b/gramps/gen/lib/refbase.py index 027bb0ae8..3c8723397 100644 --- a/gramps/gen/lib/refbase.py +++ b/gramps/gen/lib/refbase.py @@ -27,7 +27,7 @@ Base Reference class for Gramps. # RefBase class # #------------------------------------------------------------------------- -class RefBase(object): +class RefBase: """ Base reference class to manage references to other objects. diff --git a/gramps/gen/lib/struct.py b/gramps/gen/lib/struct.py index febad4de8..0e8d0b3fb 100644 --- a/gramps/gen/lib/struct.py +++ b/gramps/gen/lib/struct.py @@ -23,7 +23,7 @@ from gramps.gen.lib.handle import HandleClass def from_struct(struct): return Struct.instance_from_struct(struct) -class Struct(object): +class Struct: """ Class for getting and setting parts of a struct by dotted path. diff --git a/gramps/gen/lib/styledtext.py b/gramps/gen/lib/styledtext.py index 374745838..4ec33bee7 100644 --- a/gramps/gen/lib/styledtext.py +++ b/gramps/gen/lib/styledtext.py @@ -33,7 +33,7 @@ from .styledtexttag import StyledTextTag # StyledText class # #------------------------------------------------------------------------- -class StyledText(object): +class StyledText: """Helper class to enable character based text formatting. :py:class:`StyledText` is a wrapper class binding the clear text string and diff --git a/gramps/gen/lib/styledtexttag.py b/gramps/gen/lib/styledtexttag.py index f9daf4f67..61603c3a1 100644 --- a/gramps/gen/lib/styledtexttag.py +++ b/gramps/gen/lib/styledtexttag.py @@ -33,7 +33,7 @@ from .styledtexttagtype import StyledTextTagType # StyledTextTag class # #------------------------------------------------------------------------- -class StyledTextTag(object): +class StyledTextTag: """Hold formatting information for :py:class:`.StyledText`. :py:class:`StyledTextTag` is a container class, it's attributes are diff --git a/gramps/gen/lib/surnamebase.py b/gramps/gen/lib/surnamebase.py index 82a37ed7b..4aae88fb3 100644 --- a/gramps/gen/lib/surnamebase.py +++ b/gramps/gen/lib/surnamebase.py @@ -37,7 +37,7 @@ _ = glocale.translation.gettext # SurnameBase classes # #------------------------------------------------------------------------- -class SurnameBase(object): +class SurnameBase: """ Base class for surname-aware objects. """ diff --git a/gramps/gen/lib/tagbase.py b/gramps/gen/lib/tagbase.py index 20ca269ef..e8e9e32c0 100644 --- a/gramps/gen/lib/tagbase.py +++ b/gramps/gen/lib/tagbase.py @@ -29,7 +29,7 @@ from .handle import Handle # TagBase class # #------------------------------------------------------------------------- -class TagBase(object): +class TagBase: """ Base class for tag-aware objects. """ diff --git a/gramps/gen/lib/test/date_test.py b/gramps/gen/lib/test/date_test.py index 96912921f..e26ac426a 100644 --- a/gramps/gen/lib/test/date_test.py +++ b/gramps/gen/lib/test/date_test.py @@ -162,7 +162,7 @@ for calendar in (Date.CAL_JULIAN, dates.append( d) # CAL_SWEDISH - Swedish calendar 1700-03-01 -> 1712-02-30! -class Context(object): +class Context: def __init__(self, retval): self.retval = retval def __enter__(self): diff --git a/gramps/gen/lib/urlbase.py b/gramps/gen/lib/urlbase.py index e231510a0..f7f6f6a61 100644 --- a/gramps/gen/lib/urlbase.py +++ b/gramps/gen/lib/urlbase.py @@ -35,7 +35,7 @@ from .const import IDENTICAL, EQUAL # UrlBase classes # #------------------------------------------------------------------------- -class UrlBase(object): +class UrlBase: """ Base class for url-aware objects. """ diff --git a/gramps/gen/merge/mergecitationquery.py b/gramps/gen/merge/mergecitationquery.py index bc46bc5c1..bd7e610e1 100644 --- a/gramps/gen/merge/mergecitationquery.py +++ b/gramps/gen/merge/mergecitationquery.py @@ -40,7 +40,7 @@ from ..errors import MergeError # MergeCitationQuery # #------------------------------------------------------------------------- -class MergeCitationQuery(object): +class MergeCitationQuery: """ Create database query to merge two citations. """ diff --git a/gramps/gen/merge/mergeeventquery.py b/gramps/gen/merge/mergeeventquery.py index 920137437..28250424e 100644 --- a/gramps/gen/merge/mergeeventquery.py +++ b/gramps/gen/merge/mergeeventquery.py @@ -38,7 +38,7 @@ from ..errors import MergeError # MergeEventQuery # #------------------------------------------------------------------------- -class MergeEventQuery(object): +class MergeEventQuery: """ Create database query to merge two events. """ diff --git a/gramps/gen/merge/mergefamilyquery.py b/gramps/gen/merge/mergefamilyquery.py index c2e14d90b..1cf8dcce4 100644 --- a/gramps/gen/merge/mergefamilyquery.py +++ b/gramps/gen/merge/mergefamilyquery.py @@ -38,7 +38,7 @@ from . import MergePersonQuery # MergeFamilyQuery # #------------------------------------------------------------------------- -class MergeFamilyQuery(object): +class MergeFamilyQuery: """ Create database query to merge two families. """ diff --git a/gramps/gen/merge/mergemediaquery.py b/gramps/gen/merge/mergemediaquery.py index 8c540f4e5..b03e983b6 100644 --- a/gramps/gen/merge/mergemediaquery.py +++ b/gramps/gen/merge/mergemediaquery.py @@ -38,7 +38,7 @@ from ..errors import MergeError # MergeMediaQuery # #------------------------------------------------------------------------- -class MergeMediaQuery(object): +class MergeMediaQuery: """ Create datqabase query to merge two media objects. """ diff --git a/gramps/gen/merge/mergenotequery.py b/gramps/gen/merge/mergenotequery.py index 0785b52c2..3261ccb09 100644 --- a/gramps/gen/merge/mergenotequery.py +++ b/gramps/gen/merge/mergenotequery.py @@ -39,7 +39,7 @@ from ..errors import MergeError # MergeNoteQuery # #------------------------------------------------------------------------- -class MergeNoteQuery(object): +class MergeNoteQuery: """ Create database query to merge two notes. """ diff --git a/gramps/gen/merge/mergepersonquery.py b/gramps/gen/merge/mergepersonquery.py index 3da91ef74..138323a55 100644 --- a/gramps/gen/merge/mergepersonquery.py +++ b/gramps/gen/merge/mergepersonquery.py @@ -39,7 +39,7 @@ from ..errors import MergeError # MergePersonQuery # #------------------------------------------------------------------------- -class MergePersonQuery(object): +class MergePersonQuery: """ Create database query to merge two persons. """ diff --git a/gramps/gen/merge/mergeplacequery.py b/gramps/gen/merge/mergeplacequery.py index 992637146..95f89677c 100644 --- a/gramps/gen/merge/mergeplacequery.py +++ b/gramps/gen/merge/mergeplacequery.py @@ -39,7 +39,7 @@ from ..errors import MergeError # MergePlaceQuery # #------------------------------------------------------------------------- -class MergePlaceQuery(object): +class MergePlaceQuery: """ Create database query to merge two places. """ diff --git a/gramps/gen/merge/mergerepositoryquery.py b/gramps/gen/merge/mergerepositoryquery.py index 17cb7e0df..dc6c5100e 100644 --- a/gramps/gen/merge/mergerepositoryquery.py +++ b/gramps/gen/merge/mergerepositoryquery.py @@ -38,7 +38,7 @@ from ..errors import MergeError # MergeRepoQuery # #------------------------------------------------------------------------- -class MergeRepositoryQuery(object): +class MergeRepositoryQuery: """ Create database query to merge two repositories. """ diff --git a/gramps/gen/merge/mergesourcequery.py b/gramps/gen/merge/mergesourcequery.py index 2bd5fd705..89d95b604 100644 --- a/gramps/gen/merge/mergesourcequery.py +++ b/gramps/gen/merge/mergesourcequery.py @@ -41,7 +41,7 @@ from ..errors import MergeError # MergeSourceQuery # #------------------------------------------------------------------------- -class MergeSourceQuery(object): +class MergeSourceQuery: """ Create database query to merge two sources. """ diff --git a/gramps/gen/merge/test/merge_ref_test.py b/gramps/gen/merge/test/merge_ref_test.py index 1eaf7570e..a5a1f6a22 100644 --- a/gramps/gen/merge/test/merge_ref_test.py +++ b/gramps/gen/merge/test/merge_ref_test.py @@ -39,7 +39,7 @@ _ = glocale.translation.sgettext HAS_CLIMERGE = os.path.isdir(os.path.join(USER_PLUGINS, 'CliMerge')) HAS_EXPORTRAW = os.path.isdir(os.path.join(USER_PLUGINS, 'ExportRaw')) -class CopiedDoc(object): +class CopiedDoc: """Context manager that creates a deep copy of an libxml-xml document.""" def __init__(self, xmldoc): self.xmldoc = xmldoc @@ -53,7 +53,7 @@ class CopiedDoc(object): self.copy.freeDoc() return False -class XpathContext(object): +class XpathContext: """Context manager that creates a libxml2 xpath context that allows evaluation of xpath expressions.""" def __init__(self, xmldoc): diff --git a/gramps/gen/plug/_gramplet.py b/gramps/gen/plug/_gramplet.py index ffef51c60..60995d933 100644 --- a/gramps/gen/plug/_gramplet.py +++ b/gramps/gen/plug/_gramplet.py @@ -36,7 +36,7 @@ LOG = logging.getLogger(".Gramplets") from ..const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext -class Gramplet(object): +class Gramplet: """ Base class for non-graphical gramplet code. """ diff --git a/gramps/gen/plug/_manager.py b/gramps/gen/plug/_manager.py index 4f1e45157..bfb4712c1 100644 --- a/gramps/gen/plug/_manager.py +++ b/gramps/gen/plug/_manager.py @@ -65,7 +65,7 @@ _UNAVAILABLE = _("No description was provided") # BasePluginManager # #------------------------------------------------------------------------- -class BasePluginManager(object): +class BasePluginManager: """ unique singleton storage class for a :class:`.PluginManager`. """ __instance = None diff --git a/gramps/gen/plug/_options.py b/gramps/gen/plug/_options.py index f30a7d671..e609cf01a 100644 --- a/gramps/gen/plug/_options.py +++ b/gramps/gen/plug/_options.py @@ -62,7 +62,7 @@ _ = glocale.translation.gettext # List of options for a single module # #------------------------------------------------------------------------- -class OptionList(object): +class OptionList: """ Implements a set of options to parse and store for a given module. """ @@ -125,7 +125,7 @@ class OptionList(object): # Collection of option lists # #------------------------------------------------------------------------- -class OptionListCollection(object): +class OptionListCollection: """ Implements a collection of option lists. """ @@ -322,7 +322,7 @@ class OptionParser(handler.ContentHandler): # Class handling options for plugins # #------------------------------------------------------------------------- -class OptionHandler(object): +class OptionHandler: """ Implements handling of the options for the plugins. """ @@ -434,7 +434,7 @@ class OptionHandler(object): # Base Options class # #------------------------------------------------------------------------ -class Options(object): +class Options: """ Defines options and provides handling interface. @@ -512,7 +512,7 @@ class Options(object): # MenuOptions class # #------------------------------------------------------------------------ -class MenuOptions(object): +class MenuOptions: """ **Introduction** diff --git a/gramps/gen/plug/_plugin.py b/gramps/gen/plug/_plugin.py index e55568f60..8c681cd6a 100644 --- a/gramps/gen/plug/_plugin.py +++ b/gramps/gen/plug/_plugin.py @@ -23,7 +23,7 @@ This module provides the base class for plugins. """ -class Plugin(object): +class Plugin: """ This class serves as a base class for all plugins that can be registered with the plugin manager diff --git a/gramps/gen/plug/_pluginreg.py b/gramps/gen/plug/_pluginreg.py index 3d830e8bf..8be18717d 100644 --- a/gramps/gen/plug/_pluginreg.py +++ b/gramps/gen/plug/_pluginreg.py @@ -173,7 +173,7 @@ def valid_plugin_version(plugin_version_string): plugin_version <= VERSION_TUPLE) return False -class PluginData(object): +class PluginData: """ This is the base class for all plugin data objects. The workflow is: @@ -1078,7 +1078,7 @@ def make_environment(**kwargs): # PluginRegister # #------------------------------------------------------------------------- -class PluginRegister(object): +class PluginRegister: """ PluginRegister is a Singleton which holds plugin data diff --git a/gramps/gen/plug/docbackend/docbackend.py b/gramps/gen/plug/docbackend/docbackend.py index e2182d223..4e945ef55 100644 --- a/gramps/gen/plug/docbackend/docbackend.py +++ b/gramps/gen/plug/docbackend/docbackend.py @@ -69,7 +69,7 @@ class DocBackendError(Exception): # #------------------------------------------------------------------------ -class DocBackend(object): +class DocBackend: """ Base class for text document backends. The DocBackend manages a file to which it writes. It further knowns diff --git a/gramps/gen/plug/docgen/basedoc.py b/gramps/gen/plug/docgen/basedoc.py index 4ea418996..885081c58 100644 --- a/gramps/gen/plug/docgen/basedoc.py +++ b/gramps/gen/plug/docgen/basedoc.py @@ -53,7 +53,7 @@ log = logging.getLogger(".basedoc") # BaseDoc # #------------------------------------------------------------------------ -class BaseDoc(object): +class BaseDoc: """ Base class for document generators. Different output formats, such as OpenOffice, AbiWord, and LaTeX are derived from this base diff --git a/gramps/gen/plug/docgen/drawdoc.py b/gramps/gen/plug/docgen/drawdoc.py index 50fffa4e5..fab8141b3 100644 --- a/gramps/gen/plug/docgen/drawdoc.py +++ b/gramps/gen/plug/docgen/drawdoc.py @@ -50,7 +50,7 @@ log = logging.getLogger(".drawdoc") # DrawDoc # #------------------------------------------------------------------------ -class DrawDoc(object): +class DrawDoc: """ Abstract Interface for graphical document generators. Output formats for graphical reports must implement this interface to be used by the diff --git a/gramps/gen/plug/docgen/fontstyle.py b/gramps/gen/plug/docgen/fontstyle.py index 10b7258f0..9e4ddcf9b 100644 --- a/gramps/gen/plug/docgen/fontstyle.py +++ b/gramps/gen/plug/docgen/fontstyle.py @@ -58,7 +58,7 @@ FONT_MONOSPACE = 2 # FontStyle # #------------------------------------------------------------------------ -class FontStyle(object): +class FontStyle: """ Defines a font style. Controls the font face, size, color, and attributes. In order to remain generic, the only font faces available diff --git a/gramps/gen/plug/docgen/graphdoc.py b/gramps/gen/plug/docgen/graphdoc.py index 5e2ee7275..1be45f0e2 100644 --- a/gramps/gen/plug/docgen/graphdoc.py +++ b/gramps/gen/plug/docgen/graphdoc.py @@ -108,7 +108,7 @@ else: # GVOptions # #------------------------------------------------------------------------------- -class GVOptions(): +class GVOptions: """ Defines all of the controls necessary to configure the graph reports. @@ -278,7 +278,7 @@ class GVOptions(): # GVDoc # #------------------------------------------------------------------------------- -class GVDoc(object): +class GVDoc: """ Abstract Interface for Graphviz document generators. Output formats for Graphviz reports must implement this interface to be used by the diff --git a/gramps/gen/plug/docgen/graphicstyle.py b/gramps/gen/plug/docgen/graphicstyle.py index 33cdd92b4..225aa1452 100644 --- a/gramps/gen/plug/docgen/graphicstyle.py +++ b/gramps/gen/plug/docgen/graphicstyle.py @@ -76,7 +76,7 @@ def get_line_style_by_name(style_name): # GraphicsStyle # #------------------------------------------------------------------------ -class GraphicsStyle(object): +class GraphicsStyle: """ Defines the properties of graphics objects, such as line width, color, fill, ect. diff --git a/gramps/gen/plug/docgen/paperstyle.py b/gramps/gen/plug/docgen/paperstyle.py index 0e8de87e9..466dae6af 100644 --- a/gramps/gen/plug/docgen/paperstyle.py +++ b/gramps/gen/plug/docgen/paperstyle.py @@ -58,7 +58,7 @@ PAPER_LANDSCAPE = 1 # PaperSize # #------------------------------------------------------------------------ -class PaperSize(object): +class PaperSize: """ Defines the dimensions of a sheet of paper. All dimensions are in centimeters. @@ -116,7 +116,7 @@ class PaperSize(object): # PaperStyle # #------------------------------------------------------------------------ -class PaperStyle(object): +class PaperStyle: """ Define the various options for a sheet of paper. """ diff --git a/gramps/gen/plug/docgen/paragraphstyle.py b/gramps/gen/plug/docgen/paragraphstyle.py index aea4b6acf..55791068a 100644 --- a/gramps/gen/plug/docgen/paragraphstyle.py +++ b/gramps/gen/plug/docgen/paragraphstyle.py @@ -58,7 +58,7 @@ PARA_ALIGN_JUSTIFY = 3 # ParagraphStyle # #------------------------------------------------------------------------ -class ParagraphStyle(object): +class ParagraphStyle: """ Defines the characteristics of a paragraph. The characteristics are: font (a :class:`.FontStyle` instance), right margin, left margin, diff --git a/gramps/gen/plug/docgen/stylesheet.py b/gramps/gen/plug/docgen/stylesheet.py index b072da18b..bbed730b3 100644 --- a/gramps/gen/plug/docgen/stylesheet.py +++ b/gramps/gen/plug/docgen/stylesheet.py @@ -83,7 +83,7 @@ def cnv2color(text): # StyleSheetList # #------------------------------------------------------------------------ -class StyleSheetList(object): +class StyleSheetList: """ Interface into the user's defined style sheets. Each StyleSheetList has a predefined default style specified by the report. Additional @@ -284,7 +284,7 @@ class StyleSheetList(object): # StyleSheet # #------------------------------------------------------------------------ -class StyleSheet(object): +class StyleSheet: """ A collection of named paragraph styles. """ diff --git a/gramps/gen/plug/docgen/tablestyle.py b/gramps/gen/plug/docgen/tablestyle.py index 2bf15165a..2f5e8fe3b 100644 --- a/gramps/gen/plug/docgen/tablestyle.py +++ b/gramps/gen/plug/docgen/tablestyle.py @@ -47,7 +47,7 @@ log = logging.getLogger(".tablestyle") # TableStyle # #------------------------------------------------------------------------ -class TableStyle(object): +class TableStyle: """ Specifies the style or format of a table. The TableStyle contains the characteristics of table width (in percentage of the full width), the @@ -131,7 +131,7 @@ class TableStyle(object): # TableCellStyle # #------------------------------------------------------------------------ -class TableCellStyle(object): +class TableCellStyle: """ Defines the style of a particular table cell. Characteristics are: right border, left border, top border, bottom border, and padding. diff --git a/gramps/gen/plug/docgen/textdoc.py b/gramps/gen/plug/docgen/textdoc.py index ff895a459..186349ea0 100644 --- a/gramps/gen/plug/docgen/textdoc.py +++ b/gramps/gen/plug/docgen/textdoc.py @@ -68,7 +68,7 @@ LOCAL_TARGET = 3 # IndexMark # #------------------------------------------------------------------------ -class IndexMark(object): +class IndexMark: """ Defines a mark to be associated with text for indexing. """ @@ -87,7 +87,7 @@ class IndexMark(object): # #------------------------------------------------------------------------ -class TextDoc(object): +class TextDoc: """ Abstract Interface for text document generators. Output formats for text reports must implement this interface to be used by the report diff --git a/gramps/gen/plug/menu/_menu.py b/gramps/gen/plug/menu/_menu.py index 001a841e8..f807d76cf 100644 --- a/gramps/gen/plug/menu/_menu.py +++ b/gramps/gen/plug/menu/_menu.py @@ -28,7 +28,7 @@ Abstracted option handling. # Menu class # #------------------------------------------------------------------------- -class Menu(object): +class Menu: """ **Introduction** diff --git a/gramps/gen/plug/report/_bibliography.py b/gramps/gen/plug/report/_bibliography.py index 26fcc7144..49e91194c 100644 --- a/gramps/gen/plug/report/_bibliography.py +++ b/gramps/gen/plug/report/_bibliography.py @@ -39,7 +39,7 @@ import math #------------------------------------------------------------------------- from ...lib.citation import Citation as lib_Citation -class Citation(object): +class Citation: """ Store information about a citation and all of its references. """ @@ -115,7 +115,7 @@ class Citation(object): self.__ref_list.append((key, source_ref)) return key -class Bibliography(object): +class Bibliography: """ Store and organize multiple citations into a bibliography. """ diff --git a/gramps/gen/plug/report/_book.py b/gramps/gen/plug/report/_book.py index 8e7c405a2..27c3f5db2 100644 --- a/gramps/gen/plug/report/_book.py +++ b/gramps/gen/plug/report/_book.py @@ -77,7 +77,7 @@ _UNSUPPORTED = _("Unsupported") # Book Item class # #------------------------------------------------------------------------ -class BookItem(object): +class BookItem: """ Interface into the book item -- a smallest element of the book. """ @@ -150,7 +150,7 @@ class BookItem(object): # Book class # #------------------------------------------------------------------------ -class Book(object): +class Book: """ Interface into the user-defined book -- a collection of book items. """ @@ -398,7 +398,7 @@ class Book(object): # BookList class # #------------------------------------------------------------------------ -class BookList(object): +class BookList: """ Interface into the user-defined list of books. diff --git a/gramps/gen/plug/report/_options.py b/gramps/gen/plug/report/_options.py index 35c0aebab..ba938d685 100644 --- a/gramps/gen/plug/report/_options.py +++ b/gramps/gen/plug/report/_options.py @@ -607,7 +607,7 @@ class OptionParser(_options.OptionParser): # we don't have to handle them for reports that don't use documents (web) # #------------------------------------------------------------------------ -class EmptyDoc(object): +class EmptyDoc: def init(self): pass diff --git a/gramps/gen/plug/report/_reportbase.py b/gramps/gen/plug/report/_reportbase.py index b412a4e82..c6bb68930 100644 --- a/gramps/gen/plug/report/_reportbase.py +++ b/gramps/gen/plug/report/_reportbase.py @@ -35,7 +35,7 @@ from gramps.gen.config import config # Report # #------------------------------------------------------------------------- -class Report(object): +class Report: """ The Report base class. This is a base class for generating customized reports. It cannot be used as is, but it can be easily diff --git a/gramps/gen/plug/utils.py b/gramps/gen/plug/utils.py index 255bbb299..0a7f9ac2f 100644 --- a/gramps/gen/plug/utils.py +++ b/gramps/gen/plug/utils.py @@ -75,7 +75,7 @@ def version_str_to_tup(sversion, positions): tup = (0,) * positions return tup[:positions] -class newplugin(object): +class newplugin: """ Fake newplugin. """ @@ -96,7 +96,7 @@ def register(ptype, **kwargs): else: globals()["register_results"] = [retval] -class Zipfile(object): +class Zipfile: """ Class to duplicate the methods of tarfile.TarFile, for Python 2.5. """ @@ -127,7 +127,7 @@ class Zipfile(object): >>> Zipfile(buffer).extractfile("Dir/dile.py").read() """ - class ExtractFile(object): + class ExtractFile: def __init__(self, zip_obj, name): self.zip_obj = zip_obj self.name = name diff --git a/gramps/gen/proxy/proxybase.py b/gramps/gen/proxy/proxybase.py index 5aa31af82..b3700772a 100644 --- a/gramps/gen/proxy/proxybase.py +++ b/gramps/gen/proxy/proxybase.py @@ -41,7 +41,7 @@ from ..lib import (MediaRef, Attribute, Address, EventRef, Family, ChildRef, Repository, LdsOrd, Surname, Citation, SrcAttribute, Note, Tag) -class ProxyCursor(object): +class ProxyCursor: """ A cursor for moving through proxied data. """ @@ -62,7 +62,7 @@ class ProxyCursor(object): for handle in self.get_handles(): yield bytes(handle, "utf-8"), self.get_raw(handle) -class ProxyMap(object): +class ProxyMap: """ A dictionary-like object for accessing "raw" proxied data. Of course, proxied data may have been changed by the proxy. diff --git a/gramps/gen/recentfiles.py b/gramps/gen/recentfiles.py index ddcde977b..bfdc0f28f 100644 --- a/gramps/gen/recentfiles.py +++ b/gramps/gen/recentfiles.py @@ -53,7 +53,7 @@ MAX_GRAMPS_ITEMS = 10 # RecentItem # #------------------------------------------------------------------------- -class RecentItem(object): +class RecentItem: """ Interface to a single Gramps recent-items item """ @@ -122,7 +122,7 @@ class RecentItem(object): # RecentFiles # #------------------------------------------------------------------------- -class RecentFiles(object): +class RecentFiles: """ Interface to a RecentFiles collection """ @@ -235,7 +235,7 @@ class RecentFiles(object): # RecentParser # #------------------------------------------------------------------------- -class RecentParser(object): +class RecentParser: """ Parsing class for the RecentFiles collection. """ diff --git a/gramps/gen/relationship.py b/gramps/gen/relationship.py index 0517bf1e6..320cb3602 100644 --- a/gramps/gen/relationship.py +++ b/gramps/gen/relationship.py @@ -376,7 +376,7 @@ _NEPHEWS_NIECES_LEVEL = ["", # RelationshipCalculator # #------------------------------------------------------------------------- -class RelationshipCalculator(object): +class RelationshipCalculator: """ The relationship calculator helps to determine the relationship between two people. diff --git a/gramps/gen/simple/_simpleaccess.py b/gramps/gen/simple/_simpleaccess.py index 0a6c87c9c..a9a11ed4e 100644 --- a/gramps/gen/simple/_simpleaccess.py +++ b/gramps/gen/simple/_simpleaccess.py @@ -42,7 +42,7 @@ _ = glocale.translation.gettext # Local functions # #------------------------------------------------------------------------- -class SimpleAccess(object): +class SimpleAccess: """ Provide a simplified database access system. This system has been designed to ease the development of reports. diff --git a/gramps/gen/simple/_simpledoc.py b/gramps/gen/simple/_simpledoc.py index 687ed7174..2ff7564c1 100644 --- a/gramps/gen/simple/_simpledoc.py +++ b/gramps/gen/simple/_simpledoc.py @@ -24,7 +24,7 @@ Provide a simplified database access interface to the Gramps database. from ..plug.docgen import StyleSheet, ParagraphStyle, TableStyle,\ TableCellStyle, FONT_SANS_SERIF, PARA_ALIGN_LEFT -class SimpleDoc(object): +class SimpleDoc: """ Provide a simplified database access interface to the Gramps database. """ diff --git a/gramps/gen/simple/_simpletable.py b/gramps/gen/simple/_simpletable.py index 9bb635207..d661b7a2d 100644 --- a/gramps/gen/simple/_simpletable.py +++ b/gramps/gen/simple/_simpletable.py @@ -32,7 +32,7 @@ from ..lib import (Person, Family, Event, Source, Place, Citation, from ..config import config from ..datehandler import displayer -class SimpleTable(object): +class SimpleTable: """ Provide a simplified table creation interface. """ diff --git a/gramps/gen/sort.py b/gramps/gen/sort.py index 26651125c..e6624ffb9 100644 --- a/gramps/gen/sort.py +++ b/gramps/gen/sort.py @@ -48,7 +48,7 @@ from .const import GRAMPS_LOCALE as glocale # #------------------------------------------------------------------------- -class Sort(object): +class Sort: def __init__(self, database): self.database = database diff --git a/gramps/gen/test/user_test.py b/gramps/gen/test/user_test.py index 045f70394..5e31fca84 100644 --- a/gramps/gen/test/user_test.py +++ b/gramps/gen/test/user_test.py @@ -24,7 +24,7 @@ import unittest from .. import user -class TestUser(object): +class TestUser: TITLE = "Testing prompt" MSG = "Choices are hard. Nevertheless, please choose!" ACCEPT = "To be" diff --git a/gramps/gen/updatecallback.py b/gramps/gen/updatecallback.py index 71a27045f..6d80d0832 100644 --- a/gramps/gen/updatecallback.py +++ b/gramps/gen/updatecallback.py @@ -41,7 +41,7 @@ _LOG = logging.getLogger(".gen") # Callback updater # #------------------------------------------------------------------------- -class UpdateCallback(object): +class UpdateCallback: """ Basic class providing way of calling the callback to update things during lengthy operations. diff --git a/gramps/gen/user.py b/gramps/gen/user.py index e37d48ed0..2f6ca2baf 100644 --- a/gramps/gen/user.py +++ b/gramps/gen/user.py @@ -25,7 +25,7 @@ The User class provides basic interaction with the user. import sys from contextlib import contextmanager -class User(): +class User: """ 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 diff --git a/gramps/gen/utils/alive.py b/gramps/gen/utils/alive.py index dbbe7b796..65bf1f162 100644 --- a/gramps/gen/utils/alive.py +++ b/gramps/gen/utils/alive.py @@ -66,7 +66,7 @@ except ImportError: # ProbablyAlive class # #------------------------------------------------------------------------- -class ProbablyAlive(object): +class ProbablyAlive: """ An object to hold the parameters for considering someone alive. """ diff --git a/gramps/gen/utils/callback.py b/gramps/gen/utils/callback.py index f4997a271..f6bb15bde 100644 --- a/gramps/gen/utils/callback.py +++ b/gramps/gen/utils/callback.py @@ -47,7 +47,7 @@ log = sys.stderr.write # #------------------------------------------------------------------------- -class Callback(object): +class Callback: """ Callback and signal support objects. @@ -104,7 +104,7 @@ class Callback(object): t.connect('test-signal', fn) # connect to a bound method - class C(object): + class C: def cb_func(self, i): print 'got class signal = ', 1 @@ -124,7 +124,7 @@ class Callback(object): t = TestSignals() # connect to a bound method - class C(object): + class C: def cb_func(self, i): print 'got class signal = ', 1 diff --git a/gramps/gen/utils/callman.py b/gramps/gen/utils/callman.py index abb4a7ec6..e60c1a268 100644 --- a/gramps/gen/utils/callman.py +++ b/gramps/gen/utils/callman.py @@ -96,7 +96,7 @@ def _return(*args): # #------------------------------------------------------------------------- -class CallbackManager(object): +class CallbackManager: """ Manage callback handling from GUI to the db. It is unique to a db and some GUI element. When a db is changed, one should diff --git a/gramps/gen/utils/configmanager.py b/gramps/gen/utils/configmanager.py index 96cbb192d..c168d7617 100644 --- a/gramps/gen/utils/configmanager.py +++ b/gramps/gen/utils/configmanager.py @@ -59,7 +59,7 @@ def safe_eval(exp): # Classes # #--------------------------------------------------------------- -class ConfigManager(object): +class ConfigManager: """ Class to construct the singleton CONFIGMAN where all settings are stored. diff --git a/gramps/gen/utils/docgen/tabbeddoc.py b/gramps/gen/utils/docgen/tabbeddoc.py index 5ee0c8dd8..308b32621 100644 --- a/gramps/gen/utils/docgen/tabbeddoc.py +++ b/gramps/gen/utils/docgen/tabbeddoc.py @@ -23,7 +23,7 @@ # # #------------------------------------------------------------------------ -class TabbedDoc(object): +class TabbedDoc: def __init__(self, columns): self.columns = columns self.name = "" diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py index a88fc206d..6075dea4d 100644 --- a/gramps/gen/utils/grampslocale.py +++ b/gramps/gen/utils/grampslocale.py @@ -141,7 +141,7 @@ def _check_mswin_locale_reverse(locale): # GrampsLocale Class # #------------------------------------------------------------------------ -class GrampsLocale(object): +class GrampsLocale: """ Encapsulate a locale. This class is a sort-of-singleton: The first instance created will query the environment and OSX defaults diff --git a/gramps/gen/utils/lds.py b/gramps/gen/utils/lds.py index 07c77ae79..05ad7b3af 100644 --- a/gramps/gen/utils/lds.py +++ b/gramps/gen/utils/lds.py @@ -32,7 +32,7 @@ _ = glocale.translation.gettext LOG = logging.getLogger(".") -class LdsTemples(object): +class LdsTemples: """ Parsing class for the LDS temples file """ diff --git a/gramps/gen/utils/libformatting.py b/gramps/gen/utils/libformatting.py index 24658eb1d..7d4f8efe6 100644 --- a/gramps/gen/utils/libformatting.py +++ b/gramps/gen/utils/libformatting.py @@ -47,7 +47,7 @@ from .db import (get_birth_or_fallback, get_death_or_fallback, # FormattingHelper class # #------------------------------------------------------------------------- -class FormattingHelper(object): +class FormattingHelper: """Format of commonly used expressions, making use of a cache to not recompute """ @@ -199,7 +199,7 @@ class FormattingHelper(object): self._markup_cache = {} -class ImportInfo(object): +class ImportInfo: """ Class object that can hold information about the import """ diff --git a/gramps/gen/utils/resourcepath.py b/gramps/gen/utils/resourcepath.py index c77b89d79..dc7d2aa4d 100644 --- a/gramps/gen/utils/resourcepath.py +++ b/gramps/gen/utils/resourcepath.py @@ -27,7 +27,7 @@ LOG.addHandler(_hdlr) from ..constfunc import get_env_var -class ResourcePath(object): +class ResourcePath: """ ResourcePath is a singleton, meaning that only one of them is ever created. At startup it finds the paths to Gramps's resource files and diff --git a/gramps/gui/autocomp.py b/gramps/gui/autocomp.py index 2e03908b9..c1c58da13 100644 --- a/gramps/gui/autocomp.py +++ b/gramps/gui/autocomp.py @@ -73,7 +73,7 @@ def fill_entry(entry, data_list): # StandardCustomSelector class # #------------------------------------------------------------------------- -class StandardCustomSelector(object): +class StandardCustomSelector: """ This class provides an interface to selecting from the predefined options or entering custom string. diff --git a/gramps/gui/basesidebar.py b/gramps/gui/basesidebar.py index 83599b62e..02c689d39 100644 --- a/gramps/gui/basesidebar.py +++ b/gramps/gui/basesidebar.py @@ -23,7 +23,7 @@ # BaseSidebar class # #------------------------------------------------------------------------- -class BaseSidebar(object): +class BaseSidebar: """ The base class for all sidebar plugins. """ diff --git a/gramps/gui/clipboard.py b/gramps/gui/clipboard.py index bc3045887..85f8ddc1f 100644 --- a/gramps/gui/clipboard.py +++ b/gramps/gui/clipboard.py @@ -172,7 +172,7 @@ def model_contains(model, data): # wrapper classes to provide object specific listing in the ListView # #------------------------------------------------------------------------- -class ClipWrapper(object): +class ClipWrapper: UNAVAILABLE_ICON = 'dialog-error' def __init__(self, dbstate, obj): @@ -849,7 +849,7 @@ class ClipRepositoryLink(ClipHandleWrapper): # #------------------------------------------------------------------------- -class ClipDropList(object): +class ClipDropList: DROP_TARGETS = [DdTargets.LINK_LIST] DRAG_TARGET = None @@ -941,7 +941,7 @@ class ClipboardListModel(Gtk.ListStore): # ClipboardListView class # #------------------------------------------------------------------------- -class ClipboardListView(object): +class ClipboardListView: LOCAL_DRAG_TYPE = 'MY_TREE_MODEL_ROW' LOCAL_DRAG_ATOM_TYPE = Gdk.atom_intern(LOCAL_DRAG_TYPE, False) diff --git a/gramps/gui/dbguielement.py b/gramps/gui/dbguielement.py index 0fdd3901e..4f0b3ef27 100644 --- a/gramps/gui/dbguielement.py +++ b/gramps/gui/dbguielement.py @@ -38,7 +38,7 @@ from gramps.gen.utils.callman import CallbackManager # DbGUIElement class # #------------------------------------------------------------------------- -class DbGUIElement(object): +class DbGUIElement: """ Most interaction with the DB should be done via the callman attribute. On initialization, the method :meth:`_connect_db_signals` is called. diff --git a/gramps/gui/ddtargets.py b/gramps/gui/ddtargets.py index b8508a5ff..3d7139fbb 100644 --- a/gramps/gui/ddtargets.py +++ b/gramps/gui/ddtargets.py @@ -105,7 +105,7 @@ class _DdType: """ return [self.atom_drag_type, self.target_flags, self.app_id] -class _DdTargets(object): +class _DdTargets: """A single class that manages all the drag and drop targets.""" _instance = None # Singleton instance diff --git a/gramps/gui/dialog.py b/gramps/gui/dialog.py index d9f5062ac..541d050fd 100644 --- a/gramps/gui/dialog.py +++ b/gramps/gui/dialog.py @@ -52,7 +52,7 @@ try: except: ICON = None -class SaveDialog(object): +class SaveDialog: def __init__(self, msg1, msg2, task1, task2, parent=None): self.xml = Glade(toplevel='savedialog') @@ -83,7 +83,7 @@ class SaveDialog(object): config.set('interface.dont-ask', self.dontask.get_active()) self.top.destroy() -class QuestionDialog(object): +class QuestionDialog: def __init__(self, msg1, msg2, label, task, parent=None): self.xml = Glade(toplevel='questiondialog') @@ -115,7 +115,7 @@ def on_activate_link(label, uri): display_url(uri) return True -class QuestionDialog2(object): +class QuestionDialog2: def __init__(self, msg1, msg2, label_msg1, label_msg2, parent=None): self.xml = Glade(toplevel='questiondialog') @@ -147,7 +147,7 @@ class QuestionDialog2(object): self.top.destroy() return (response == Gtk.ResponseType.ACCEPT) -class OptionDialog(object): +class OptionDialog: def __init__(self, msg1, msg2, btnmsg1, task1, btnmsg2, task2, parent=None): self.xml = Glade(toplevel='optiondialog') @@ -252,7 +252,7 @@ class OkDialog(Gtk.MessageDialog): self.run() self.destroy() -class InfoDialog(object): +class InfoDialog: """ Non modal dialog to show selectable info in a scrolled window """ @@ -285,7 +285,7 @@ class InfoDialog(object): #no matter how it finishes, destroy dialog dialog.destroy() -class MissingMediaDialog(object): +class MissingMediaDialog: def __init__(self, msg1, msg2, task1, task2, task3, parent=None): self.xml = Glade(toplevel='missmediadialog') @@ -339,7 +339,7 @@ class MissingMediaDialog(object): parent=self.top) return True -class MultiSelectDialog(object): +class MultiSelectDialog: def __init__(self, msg1_func, msg2_func, items, lookup, cancel_func=None, no_func=None, yes_func=None, parent=None): @@ -412,7 +412,7 @@ class MultiSelectDialog(object): parent=self.top) return True -class MessageHideDialog(object): +class MessageHideDialog: def __init__(self, title, message, key, parent=None): self.xml = Glade(toplevel='hidedialog') diff --git a/gramps/gui/displaystate.py b/gramps/gui/displaystate.py index 58737f75e..3d20a19fb 100644 --- a/gramps/gui/displaystate.py +++ b/gramps/gui/displaystate.py @@ -250,7 +250,7 @@ _RCT_BTM = '' from gramps.gen.recentfiles import RecentFiles -class RecentDocsMenu(object): +class RecentDocsMenu: def __init__(self, uistate, state, fileopen): self.action_group = Gtk.ActionGroup(name='RecentFiles') self.active = DISABLED diff --git a/gramps/gui/editors/editcitation.py b/gramps/gui/editors/editcitation.py index d5b607ab4..191d1d357 100644 --- a/gramps/gui/editors/editcitation.py +++ b/gramps/gui/editors/editcitation.py @@ -345,7 +345,7 @@ class EditCitation(EditPrimary): cmp_obj = self.empty_object() return cmp_obj.serialize(True)[1:] != self.obj.serialize()[1:] -class DeleteCitationQuery(object): +class DeleteCitationQuery: def __init__(self, dbstate, uistate, citation, the_lists): self.citation = citation self.db = dbstate.db diff --git a/gramps/gui/editors/editevent.py b/gramps/gui/editors/editevent.py index 8daeb240b..061f45e97 100644 --- a/gramps/gui/editors/editevent.py +++ b/gramps/gui/editors/editevent.py @@ -307,7 +307,7 @@ class EditEvent(EditPrimary): # Delete Query class # #------------------------------------------------------------------------- -class DeleteEventQuery(object): +class DeleteEventQuery: def __init__(self, dbstate, uistate, event, person_list, family_list): self.event = event self.db = dbstate.db diff --git a/gramps/gui/editors/editfamily.py b/gramps/gui/editors/editfamily.py index 7828dd170..333a9375c 100644 --- a/gramps/gui/editors/editfamily.py +++ b/gramps/gui/editors/editfamily.py @@ -316,7 +316,7 @@ class ChildEmbedList(EmbeddedList): else: return name -class FastMaleFilter(object): +class FastMaleFilter: def __init__(self, db): self.db = db @@ -325,7 +325,7 @@ class FastMaleFilter(object): value = self.db.get_raw_person_data(handle) return value[2] == Person.MALE -class FastFemaleFilter(object): +class FastFemaleFilter: def __init__(self, db): self.db = db diff --git a/gramps/gui/editors/editmedia.py b/gramps/gui/editors/editmedia.py index 42cc4abcc..594d2cb42 100644 --- a/gramps/gui/editors/editmedia.py +++ b/gramps/gui/editors/editmedia.py @@ -357,7 +357,7 @@ class EditMedia(EditPrimary): cmp_obj = self.empty_object() return cmp_obj.serialize(True)[1:] != self.obj.serialize()[1:] -class DeleteMediaQuery(object): +class DeleteMediaQuery: def __init__(self, dbstate, uistate, media_handle, the_lists): self.db = dbstate.db diff --git a/gramps/gui/editors/editnote.py b/gramps/gui/editors/editnote.py index fc18d0fbb..63ab37602 100644 --- a/gramps/gui/editors/editnote.py +++ b/gramps/gui/editors/editnote.py @@ -343,7 +343,7 @@ class EditNote(EditPrimary): self.callback(self.obj.get_handle()) self._do_close() -class DeleteNoteQuery(object): +class DeleteNoteQuery: def __init__(self, dbstate, uistate, note, the_lists): self.note = note self.db = dbstate.db diff --git a/gramps/gui/editors/editperson.py b/gramps/gui/editors/editperson.py index ca1d2eaec..8f16d47fb 100644 --- a/gramps/gui/editors/editperson.py +++ b/gramps/gui/editors/editperson.py @@ -90,7 +90,7 @@ _select_gender = ((True, False, False), (False, True, False), (False, False, True)) -class SingSurn(object): +class SingSurn: """ Managing the single surname components """ diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 189c88c69..e6c734cba 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -324,7 +324,7 @@ class EditPlace(EditPrimary): # DeletePlaceQuery # #------------------------------------------------------------------------- -class DeletePlaceQuery(object): +class DeletePlaceQuery: def __init__(self, dbstate, uistate, place, person_list, family_list, event_list): diff --git a/gramps/gui/editors/editrepository.py b/gramps/gui/editors/editrepository.py index d4efb2c30..d0e898c95 100644 --- a/gramps/gui/editors/editrepository.py +++ b/gramps/gui/editors/editrepository.py @@ -209,7 +209,7 @@ class EditRepository(EditPrimary): self._do_close() -class DeleteRepositoryQuery(object): +class DeleteRepositoryQuery: def __init__(self, dbstate, uistate, repository, sources): self.obj = repository self.db = dbstate.db diff --git a/gramps/gui/editors/editsource.py b/gramps/gui/editors/editsource.py index 16e903066..c75d9ba99 100644 --- a/gramps/gui/editors/editsource.py +++ b/gramps/gui/editors/editsource.py @@ -231,7 +231,7 @@ class EditSource(EditPrimary): if self.callback: self.callback(self.obj) -class DeleteSrcQuery(object): +class DeleteSrcQuery: def __init__(self, dbstate, uistate, source, the_lists): self.source = source self.db = dbstate.db diff --git a/gramps/gui/editors/objectentries.py b/gramps/gui/editors/objectentries.py index 0db99368b..c90e69a7b 100644 --- a/gramps/gui/editors/objectentries.py +++ b/gramps/gui/editors/objectentries.py @@ -59,7 +59,7 @@ from gramps.gen.display.place import displayer as place_displayer # ObjEntry # #------------------------------------------------------------------------- -class ObjEntry(object): +class ObjEntry: """ Handles the selection of a existing or new Object. Supports Drag and Drop to select the object. diff --git a/gramps/gui/editors/test/test_editreference.py b/gramps/gui/editors/test/test_editreference.py index 393f3feac..c11ab6cbe 100644 --- a/gramps/gui/editors/test/test_editreference.py +++ b/gramps/gui/editors/test/test_editreference.py @@ -38,7 +38,7 @@ from gramps.gen.dbstate import DbState from gramps.gen.merge.diff import * from gramps.gui.editors.editreference import EditReference -class MockWindow(): +class MockWindow: def set_transient_for(self, *args, **kwargs): pass def show_all(self): diff --git a/gramps/gui/filters/_searchbar.py b/gramps/gui/filters/_searchbar.py index b4ccdbc28..986a67390 100644 --- a/gramps/gui/filters/_searchbar.py +++ b/gramps/gui/filters/_searchbar.py @@ -41,7 +41,7 @@ _KP_ENTER = Gdk.keyval_from_name("KP_Enter") # SearchBar # #------------------------------------------------------------------------- -class SearchBar(object): +class SearchBar: def __init__( self, dbstate, uistate, on_apply, apply_done = None, apply_clear = None): self.on_apply_callback = on_apply self.apply_done_callback = apply_done diff --git a/gramps/gui/grampsgui.py b/gramps/gui/grampsgui.py index b7a55071b..1fbd94ce3 100644 --- a/gramps/gui/grampsgui.py +++ b/gramps/gui/grampsgui.py @@ -155,7 +155,7 @@ def _display_welcome_message(): # Main Gramps class # #------------------------------------------------------------------------- -class Gramps(object): +class Gramps: """ Main class corresponding to a running gramps process. diff --git a/gramps/gui/listmodel.py b/gramps/gui/listmodel.py index 7150e45f6..e70c72d37 100644 --- a/gramps/gui/listmodel.py +++ b/gramps/gui/listmodel.py @@ -49,7 +49,7 @@ NOSORT = -1 # ListModel # #------------------------------------------------------------------------- -class ListModel(object): +class ListModel: """ Simple model for lists in smaller dialogs (not views). diff --git a/gramps/gui/logger/_errorview.py b/gramps/gui/logger/_errorview.py index f70f8f157..0bdedd8ea 100644 --- a/gramps/gui/logger/_errorview.py +++ b/gramps/gui/logger/_errorview.py @@ -44,7 +44,7 @@ from ..display import display_help WIKI_HELP_PAGE = '%s_-_Error_and_Warning_Reference' % URL_MANUAL_PAGE WIKI_HELP_SEC = _('manual|Error_Report') -class ErrorView(object): +class ErrorView: """ A Dialog for displaying errors. """ diff --git a/gramps/gui/managedwindow.py b/gramps/gui/managedwindow.py index caaff047b..786026ef1 100644 --- a/gramps/gui/managedwindow.py +++ b/gramps/gui/managedwindow.py @@ -76,7 +76,7 @@ def get_object(self,value): return object return None -class GrampsWindowManager(object): +class GrampsWindowManager: """ Manage hierarchy of open GRAMPS windows. @@ -302,7 +302,7 @@ class GrampsWindowManager(object): # Gramps Managed Window class # #------------------------------------------------------------------------- -class ManagedWindow(object): +class ManagedWindow: """ Managed window base class. diff --git a/gramps/gui/navigator.py b/gramps/gui/navigator.py index 38bb63745..36a86e997 100644 --- a/gramps/gui/navigator.py +++ b/gramps/gui/navigator.py @@ -76,7 +76,7 @@ CATEGORY_ICON = { # Navigator class # #------------------------------------------------------------------------- -class Navigator(object): +class Navigator: """ A class which defines the graphical representation of the Gramps navigator. """ diff --git a/gramps/gui/plug/_windows.py b/gramps/gui/plug/_windows.py index 45903a541..f1384a034 100644 --- a/gramps/gui/plug/_windows.py +++ b/gramps/gui/plug/_windows.py @@ -1052,7 +1052,7 @@ class ToolManagedWindow(tool.Tool, ToolManagedWindowBase): # UpdateAddons # #------------------------------------------------------------------------- -class UpdateAddons(): +class UpdateAddons: def __init__(self, addon_update_list, parent_window): self.title = _('Available Gramps Updates for Addons') diff --git a/gramps/gui/plug/export/_exportoptions.py b/gramps/gui/plug/export/_exportoptions.py index 52bee5823..a5cacbd5c 100644 --- a/gramps/gui/plug/export/_exportoptions.py +++ b/gramps/gui/plug/export/_exportoptions.py @@ -57,7 +57,7 @@ try: except: _gzip_ok = 0 -class Progress(object): +class Progress: """ Mirros the same interface that the ExportAssistant uses in the selection, but this is for the preview selection. @@ -99,7 +99,7 @@ class Progress(object): # WriterOptionBox # #------------------------------------------------------------------------- -class WriterOptionBox(object): +class WriterOptionBox: """ Create a VBox with the option widgets and define methods to retrieve the options. diff --git a/gramps/gui/plug/quick/_textbufdoc.py b/gramps/gui/plug/quick/_textbufdoc.py index 7164cf439..56b9e81b5 100644 --- a/gramps/gui/plug/quick/_textbufdoc.py +++ b/gramps/gui/plug/quick/_textbufdoc.py @@ -77,7 +77,7 @@ class DisplayBuf(ManagedWindow): def get_title(self): return self.title -class DocumentManager(object): +class DocumentManager: def __init__(self, title, document, text_view): self.title = title self.document = document diff --git a/gramps/gui/plug/report/_bookdialog.py b/gramps/gui/plug/report/_bookdialog.py index 8f3218960..52da8e9e2 100644 --- a/gramps/gui/plug/report/_bookdialog.py +++ b/gramps/gui/plug/report/_bookdialog.py @@ -194,7 +194,7 @@ def _get_subject(options, dbase): # BookList Display class # #------------------------------------------------------------------------ -class BookListDisplay(object): +class BookListDisplay: """ Interface into a dialog with the list of available books. diff --git a/gramps/gui/plug/report/_styleeditor.py b/gramps/gui/plug/report/_styleeditor.py index d8f3ac281..324c44555 100644 --- a/gramps/gui/plug/report/_styleeditor.py +++ b/gramps/gui/plug/report/_styleeditor.py @@ -63,7 +63,7 @@ from ...glade import Glade # StyleListDisplay class # #------------------------------------------------------------------------ -class StyleListDisplay(object): +class StyleListDisplay: """ Shows the available paragraph/font styles. Allows the user to select, add, edit, and delete styles from a StyleSheet. @@ -175,7 +175,7 @@ class StyleListDisplay(object): # StyleEditor class # #------------------------------------------------------------------------ -class StyleEditor(object): +class StyleEditor: """ Edits the current style definition. Presents a dialog allowing the values of the paragraphs in the style to be altered. diff --git a/gramps/gui/plug/tool.py b/gramps/gui/plug/tool.py index 146b341f3..bfa787a4b 100644 --- a/gramps/gui/plug/tool.py +++ b/gramps/gui/plug/tool.py @@ -64,7 +64,7 @@ tool_categories = { # Tool # #------------------------------------------------------------------------- -class Tool(object): +class Tool: """ The Tool base class. This is a base class for generating customized tools. It cannot be used as is, but it can be easily @@ -147,7 +147,7 @@ class ActivePersonTool(Tool): # Command-line tool # #------------------------------------------------------------------------ -class CommandLineTool(object): +class CommandLineTool: """ Provide a way to run tool from the command line. diff --git a/gramps/gui/spell.py b/gramps/gui/spell.py index 15d416734..b016250ca 100644 --- a/gramps/gui/spell.py +++ b/gramps/gui/spell.py @@ -86,7 +86,7 @@ from gramps.gen.config import config # #------------------------------------------------------------------------- -class Spell(object): +class Spell: """Attach a gtkspell instance to the passed TextView instance. """ _spellcheck_options = {'off': _('Off')} diff --git a/gramps/gui/tipofday.py b/gramps/gui/tipofday.py index 4977fae28..3d4bbce4b 100644 --- a/gramps/gui/tipofday.py +++ b/gramps/gui/tipofday.py @@ -123,7 +123,7 @@ class TipOfDay(ManagedWindow): # Tip parser class # #------------------------------------------------------------------------- -class TipParser(object): +class TipParser: """ Interface to the document template file """ diff --git a/gramps/gui/utils.py b/gramps/gui/utils.py index a83fff7e7..baf572f01 100644 --- a/gramps/gui/utils.py +++ b/gramps/gui/utils.py @@ -64,7 +64,7 @@ from gramps.gen.errors import WindowActiveError # #------------------------------------------------------------------------- -class CLIVbox(): +class CLIVbox: """ Command-line interface vbox, to keep compatible with Dialog. """ @@ -103,7 +103,7 @@ class CLIDialog: # #------------------------------------------------------------------------- -class ProgressMeter(object): +class ProgressMeter: """ Progress meter class for Gramps. @@ -315,7 +315,7 @@ class ProgressMeter(object): # #------------------------------------------------------------------------- -class SystemFonts(object): +class SystemFonts: """ Define fonts available to Gramps diff --git a/gramps/gui/views/pageview.py b/gramps/gui/views/pageview.py index f2b7ee9bb..84694cdcb 100644 --- a/gramps/gui/views/pageview.py +++ b/gramps/gui/views/pageview.py @@ -238,12 +238,12 @@ class PageView(DbGUIElement): # Construct a drop: drag_type = obj2target(objclass) if drag_type: - class Selection(object): + class Selection: def __init__(self, data): self.data = data def get_data(self): return self.data - class Context(object): + class Context: targets = [drag_type] action = 1 def list_targets(self): diff --git a/gramps/gui/views/tags.py b/gramps/gui/views/tags.py index 6a285abc2..83bf56072 100644 --- a/gramps/gui/views/tags.py +++ b/gramps/gui/views/tags.py @@ -308,7 +308,7 @@ def make_callback(func, tag_handle): # Organize Tags Dialog # #------------------------------------------------------------------------- -class OrganizeTagsDialog(object): +class OrganizeTagsDialog: """ A dialog to enable the user to organize tags. """ @@ -537,7 +537,7 @@ class OrganizeTagsDialog(object): # Tag editor # #------------------------------------------------------------------------- -class EditTag(object): +class EditTag: """ A dialog to enable the user to create a new tag. """ diff --git a/gramps/gui/views/treemodels/basemodel.py b/gramps/gui/views/treemodels/basemodel.py index 46dc3713a..e83310b0c 100644 --- a/gramps/gui/views/treemodels/basemodel.py +++ b/gramps/gui/views/treemodels/basemodel.py @@ -28,7 +28,7 @@ from .lru import LRU from gramps.gen.config import config -class BaseModel(object): +class BaseModel: # LRU cache size _CACHE_SIZE = config.get('interface.treemodel-cache-size') diff --git a/gramps/gui/views/treemodels/citationbasemodel.py b/gramps/gui/views/treemodels/citationbasemodel.py index f566465c2..d925a6680 100644 --- a/gramps/gui/views/treemodels/citationbasemodel.py +++ b/gramps/gui/views/treemodels/citationbasemodel.py @@ -80,7 +80,7 @@ INVALID_DATE_FORMAT = config.get('preferences.invalid-date-format') # CitationModel # #------------------------------------------------------------------------- -class CitationBaseModel(object): +class CitationBaseModel: # Fields access when 'data' is a Citation diff --git a/gramps/gui/views/treemodels/flatbasemodel.py b/gramps/gui/views/treemodels/flatbasemodel.py index e080c30d8..e762abef8 100644 --- a/gramps/gui/views/treemodels/flatbasemodel.py +++ b/gramps/gui/views/treemodels/flatbasemodel.py @@ -82,7 +82,7 @@ from .basemodel import BaseModel UEMPTY = "" -class FlatNodeMap(object): +class FlatNodeMap: """ A NodeMap for a flat treeview. In such a TreeView, the paths possible are 0, 1, 2, ..., n-1, where n is the number of items to show. For the model diff --git a/gramps/gui/views/treemodels/lru.py b/gramps/gui/views/treemodels/lru.py index ac798838c..d19305696 100644 --- a/gramps/gui/views/treemodels/lru.py +++ b/gramps/gui/views/treemodels/lru.py @@ -25,7 +25,7 @@ Least recently used algorithm """ -class Node(object): +class Node: """ Node to be stored in the LRU structure """ @@ -34,7 +34,7 @@ class Node(object): self.value = value self.next = None -class LRU(object): +class LRU: """ Implementation of a length-limited O(1) LRU cache """ diff --git a/gramps/gui/views/treemodels/placemodel.py b/gramps/gui/views/treemodels/placemodel.py index c580a0ad2..a6e1d5e5b 100644 --- a/gramps/gui/views/treemodels/placemodel.py +++ b/gramps/gui/views/treemodels/placemodel.py @@ -64,7 +64,7 @@ _ = glocale.translation.gettext # PlaceBaseModel # #------------------------------------------------------------------------- -class PlaceBaseModel(object): +class PlaceBaseModel: def __init__(self, db): self.gen_cursor = db.get_place_cursor diff --git a/gramps/gui/views/treemodels/treebasemodel.py b/gramps/gui/views/treemodels/treebasemodel.py index ea95fd9b7..829360ce7 100644 --- a/gramps/gui/views/treemodels/treebasemodel.py +++ b/gramps/gui/views/treemodels/treebasemodel.py @@ -62,7 +62,7 @@ from .basemodel import BaseModel # Node # #------------------------------------------------------------------------- -class Node(object): +class Node: """ This class defines an individual node of a tree in the model. The node stores the following data: @@ -174,7 +174,7 @@ class Node(object): # NodeMap # #------------------------------------------------------------------------- -class NodeMap(object): +class NodeMap: """ Map of id of Node classes to real object """ diff --git a/gramps/gui/widgets/buttons.py b/gramps/gui/widgets/buttons.py index 870913d0a..5fb8f6835 100644 --- a/gramps/gui/widgets/buttons.py +++ b/gramps/gui/widgets/buttons.py @@ -124,7 +124,7 @@ class SimpleButton(Gtk.Button): # PrivacyButton class # #------------------------------------------------------------------------- -class PrivacyButton(object): +class PrivacyButton: def __init__(self, button, obj, readonly=False): self.button = button diff --git a/gramps/gui/widgets/fanchart.py b/gramps/gui/widgets/fanchart.py index 4b42b503a..ff1e0dbdf 100644 --- a/gramps/gui/widgets/fanchart.py +++ b/gramps/gui/widgets/fanchart.py @@ -1519,7 +1519,7 @@ class FanChartWidget(FanChartBaseWidget): self._mouse_click = False self.queue_draw() -class FanChartGrampsGUI(object): +class FanChartGrampsGUI: """ class for functions fanchart GUI elements will need in Gramps """ def __init__(self, on_childmenu_changed): diff --git a/gramps/gui/widgets/grampletpane.py b/gramps/gui/widgets/grampletpane.py index 75f55d8a5..2a9286f7c 100644 --- a/gramps/gui/widgets/grampletpane.py +++ b/gramps/gui/widgets/grampletpane.py @@ -333,7 +333,7 @@ class GrampletWindow(ManagedWindow): #------------------------------------------------------------------------ -class GuiGramplet(object): +class GuiGramplet: """ Class that handles the GUI representation of a Gramplet. """ @@ -1593,7 +1593,7 @@ class GrampletPane(Gtk.ScrolledWindow): return gramplet.title, grid return gramplet_panel -class Configuration(object): +class Configuration: """ A config wrapper to redirect set/get to GrampletPane. """ diff --git a/gramps/gui/widgets/interactivesearchbox.py b/gramps/gui/widgets/interactivesearchbox.py index 6c979b485..891d5a214 100644 --- a/gramps/gui/widgets/interactivesearchbox.py +++ b/gramps/gui/widgets/interactivesearchbox.py @@ -45,7 +45,7 @@ from gi.repository import GObject, Gtk, Gdk #------------------------------------------------------------------------- -class InteractiveSearchBox(): +class InteractiveSearchBox: """ Mainly adapted from gtktreeview.c """ diff --git a/gramps/gui/widgets/monitoredwidgets.py b/gramps/gui/widgets/monitoredwidgets.py index 5f7d91bd3..52bb8ceb0 100644 --- a/gramps/gui/widgets/monitoredwidgets.py +++ b/gramps/gui/widgets/monitoredwidgets.py @@ -69,7 +69,7 @@ _KP_ENTER = Gdk.keyval_from_name("KP_Enter") # MonitoredCheckbox class # #------------------------------------------------------------------------- -class MonitoredCheckbox(object): +class MonitoredCheckbox: def __init__(self, obj, button, set_val, get_val, on_toggle=None, readonly = False): @@ -100,7 +100,7 @@ class MonitoredCheckbox(object): # MonitoredEntry class # #------------------------------------------------------------------------- -class MonitoredEntry(object): +class MonitoredEntry: def __init__(self, obj, set_val, get_val, read_only=False, autolist=None, changed=None): @@ -208,7 +208,7 @@ class MonitoredEntryIndicator(MonitoredEntry): # MonitoredSpinButton class # #------------------------------------------------------------------------- -class MonitoredSpinButton(object): +class MonitoredSpinButton: """ Class for signal handling of spinbuttons. (Code is a modified copy of :class:`MonitoredEntry`) @@ -339,7 +339,7 @@ class MonitoredSpinButton(object): # MonitoredText class # #------------------------------------------------------------------------- -class MonitoredText(object): +class MonitoredText: def __init__(self, obj, set_val, get_val, read_only=False): self.buf = obj.get_buffer() @@ -368,7 +368,7 @@ class MonitoredText(object): # MonitoredType class # #------------------------------------------------------------------------- -class MonitoredType(object): +class MonitoredType: def __init__(self, obj, set_val, get_val, mapping, custom, readonly=False, custom_values=None): @@ -415,7 +415,7 @@ class MonitoredType(object): # MonitoredDataType class # #------------------------------------------------------------------------- -class MonitoredDataType(object): +class MonitoredDataType: def __init__(self, obj, set_val, get_val, readonly=False, @@ -504,7 +504,7 @@ class MonitoredDataType(object): # MonitoredMenu class # #------------------------------------------------------------------------- -class MonitoredMenu(object): +class MonitoredMenu: def __init__(self, obj, set_val, get_val, mapping, readonly=False, changed=None): @@ -550,7 +550,7 @@ class MonitoredMenu(object): # MonitoredStrMenu class # #------------------------------------------------------------------------- -class MonitoredStrMenu(object): +class MonitoredStrMenu: def __init__(self, obj, set_val, get_val, mapping, readonly=False): self.set_val = set_val @@ -601,7 +601,7 @@ class MonitoredStrMenu(object): # MonitoredDate class # #------------------------------------------------------------------------- -class MonitoredDate(object): +class MonitoredDate: """ Class that associates a pixmap with a text widget, providing visual feedback that indicates if the text widget contains a valid date. @@ -679,7 +679,7 @@ class MonitoredDate(object): # MonitoredComboSelectedEntry class # #------------------------------------------------------------------------- -class MonitoredComboSelectedEntry(object): +class MonitoredComboSelectedEntry: """ A MonitoredEntry driven by a Combobox to select what the entry field works upon @@ -809,7 +809,7 @@ class MonitoredComboSelectedEntry(object): # MonitoredTagList class # #------------------------------------------------------------------------- -class MonitoredTagList(object): +class MonitoredTagList: """ A MonitoredTagList consists of a label to display a list of tags and a button to invoke the tag editor. diff --git a/gramps/gui/widgets/progressdialog.py b/gramps/gui/widgets/progressdialog.py index db06a3521..3280d0d54 100644 --- a/gramps/gui/widgets/progressdialog.py +++ b/gramps/gui/widgets/progressdialog.py @@ -83,7 +83,7 @@ class LongOpStatus(Callback): status.end() - class MyListener(object): + class MyListener: def __init__(self): self._op = MyClass() @@ -255,7 +255,7 @@ class LongOpStatus(Callback): # _StatusObjectFacade # #------------------------------------------------------------------------- -class _StatusObjectFacade(object): +class _StatusObjectFacade: """ This provides a simple structure for recording the information needs about a status object. @@ -281,7 +281,7 @@ class _StatusObjectFacade(object): # ProgressMonitor # #------------------------------------------------------------------------- -class ProgressMonitor(object): +class ProgressMonitor: """ A dialog for displaying the status of long running operations. diff --git a/gramps/gui/widgets/selectionwidget.py b/gramps/gui/widgets/selectionwidget.py index 365f23ec1..ed3a5bb44 100644 --- a/gramps/gui/widgets/selectionwidget.py +++ b/gramps/gui/widgets/selectionwidget.py @@ -103,7 +103,7 @@ def minimum_region(point1, point2): abs(point1[1] - point2[1]) >= MIN_SELECTION_SIZE) -class Region(object): +class Region: """ Representation of a region of image that can be associated with a person. diff --git a/gramps/gui/widgets/styledtextbuffer.py b/gramps/gui/widgets/styledtextbuffer.py index 84530a2fc..59bd657e9 100644 --- a/gramps/gui/widgets/styledtextbuffer.py +++ b/gramps/gui/widgets/styledtextbuffer.py @@ -111,7 +111,7 @@ class LinkTag(Gtk.TextTag): # GtkSpellState class # #------------------------------------------------------------------------- -class GtkSpellState(object): +class GtkSpellState: """ A simple state machine kinda thingy. diff --git a/gramps/gui/widgets/undoablebuffer.py b/gramps/gui/widgets/undoablebuffer.py index f15f6ce86..1bac0d905 100644 --- a/gramps/gui/widgets/undoablebuffer.py +++ b/gramps/gui/widgets/undoablebuffer.py @@ -46,7 +46,7 @@ class Stack(list): self.pop(0) return super(Stack, self).append(item) -class UndoableInsert(object): +class UndoableInsert: """something that has been inserted into our textbuffer""" def __init__(self, text_iter, text, length, text_buffer): self.offset = text_iter.get_offset() @@ -60,7 +60,7 @@ class UndoableInsert(object): self.mergeable = True self.tags = None -class UndoableDelete(object): +class UndoableDelete: """something that has been deleted from our textbuffer""" def __init__(self, text_buffer, start_iter, end_iter): self.text = str(text_buffer.get_text(start_iter, end_iter, True)) diff --git a/gramps/gui/widgets/undoableentry.py b/gramps/gui/widgets/undoableentry.py index a71b66b0e..aaad3fb65 100644 --- a/gramps/gui/widgets/undoableentry.py +++ b/gramps/gui/widgets/undoableentry.py @@ -49,7 +49,7 @@ from gi.repository import Gtk #------------------------------------------------------------------------- from .undoablebuffer import Stack -class UndoableInsertEntry(object): +class UndoableInsertEntry: """something that has been inserted into our Gtk.editable""" def __init__(self, text, length, position, editable): self.offset = position @@ -62,7 +62,7 @@ class UndoableInsertEntry(object): else: self.mergeable = True -class UndoableDeleteEntry(object): +class UndoableDeleteEntry: """something that has been deleted from our textbuffer""" def __init__(self, editable, start, end): self.text = editable.get_chars(start, end) diff --git a/gramps/gui/widgets/undoablestyledbuffer.py b/gramps/gui/widgets/undoablestyledbuffer.py index 7de415870..2684711be 100644 --- a/gramps/gui/widgets/undoablestyledbuffer.py +++ b/gramps/gui/widgets/undoablestyledbuffer.py @@ -51,7 +51,7 @@ class UndoableDeleteStyled(UndoableDelete): self.tags = text_buffer.get_text(text_buffer.get_start_iter(), text_buffer.get_end_iter(), True).get_tags() -class UndoableApplyStyle(): +class UndoableApplyStyle: """a style has been applied to our textbuffer""" def __init__(self, text_buffer, tag, start, end): self.offset = text_buffer.get_iter_at_mark(text_buffer.get_insert()).get_offset() diff --git a/gramps/gui/widgets/validatedmaskedentry.py b/gramps/gui/widgets/validatedmaskedentry.py index 5f2b45af0..365a94f33 100644 --- a/gramps/gui/widgets/validatedmaskedentry.py +++ b/gramps/gui/widgets/validatedmaskedentry.py @@ -1322,7 +1322,7 @@ class ValidatableMaskedEntry(MaskedEntry): self.queue_draw() fadeout.disconnect(c.signal_id) - class SignalContainer(object): + class SignalContainer: pass c = SignalContainer() c.signal_id = self._fade.connect('done', done, c) diff --git a/gramps/plugins/database/bsddb_support/bsddbtxn.py b/gramps/plugins/database/bsddb_support/bsddbtxn.py index c89ed1296..6902c48fb 100644 --- a/gramps/plugins/database/bsddb_support/bsddbtxn.py +++ b/gramps/plugins/database/bsddb_support/bsddbtxn.py @@ -28,7 +28,7 @@ BSDDBTxn class: Wrapper for BSDDB transaction-oriented methods # #------------------------------------------------------------------------- -class BSDDBTxn(object): +class BSDDBTxn: """ Wrapper for BSDDB methods that set up and manage transactions. Implements context management functionality allowing constructs like: diff --git a/gramps/plugins/database/bsddb_support/cursor.py b/gramps/plugins/database/bsddb_support/cursor.py index 5161fefed..f22c6b9ef 100644 --- a/gramps/plugins/database/bsddb_support/cursor.py +++ b/gramps/plugins/database/bsddb_support/cursor.py @@ -44,7 +44,7 @@ except: # #------------------------------------------------------------------------- -class BsddbBaseCursor(object): +class BsddbBaseCursor: """ Provide a basic iterator that allows the user to cycle through the elements in a particular map. diff --git a/gramps/plugins/database/bsddb_support/read.py b/gramps/plugins/database/bsddb_support/read.py index f73797554..cb5d1f99b 100644 --- a/gramps/plugins/database/bsddb_support/read.py +++ b/gramps/plugins/database/bsddb_support/read.py @@ -170,7 +170,7 @@ def __index_surname(surn_list): # class DbBookmarks # #------------------------------------------------------------------------- -class DbBookmarks(object): +class DbBookmarks: def __init__(self, default=[]): self.bookmarks = list(default) # want a copy (not an alias) diff --git a/gramps/plugins/database/bsddb_support/test/cursor_test.py b/gramps/plugins/database/bsddb_support/test/cursor_test.py index beae6ae77..de020c3cc 100644 --- a/gramps/plugins/database/bsddb_support/test/cursor_test.py +++ b/gramps/plugins/database/bsddb_support/test/cursor_test.py @@ -27,7 +27,7 @@ from bsddb3 import dbshelve, db from ..read import DbBsddbTreeCursor -class Data(object): +class Data: def __init__(self, handle,surname, name): self.handle = handle diff --git a/gramps/plugins/database/bsddb_support/undoredo.py b/gramps/plugins/database/bsddb_support/undoredo.py index c2f977a7a..be62072ce 100644 --- a/gramps/plugins/database/bsddb_support/undoredo.py +++ b/gramps/plugins/database/bsddb_support/undoredo.py @@ -71,7 +71,7 @@ _SIGBASE = ('person', 'family', 'source', 'event', 'media', # DbUndo class # #------------------------------------------------------------------------- -class DbUndo(object): +class DbUndo: """ Base class for the Gramps undo/redo manager. Needs to be subclassed for use with a real backend. diff --git a/gramps/plugins/database/dbapi_support/mysql.py b/gramps/plugins/database/dbapi_support/mysql.py index cc92024e0..52e6d45ba 100644 --- a/gramps/plugins/database/dbapi_support/mysql.py +++ b/gramps/plugins/database/dbapi_support/mysql.py @@ -3,7 +3,7 @@ import re MySQLdb.paramstyle = 'qmark' ## Doesn't work -class MySQL(object): +class MySQL: @classmethod def get_summary(cls): """ diff --git a/gramps/plugins/database/dbapi_support/postgresql.py b/gramps/plugins/database/dbapi_support/postgresql.py index e43635978..7904c855d 100644 --- a/gramps/plugins/database/dbapi_support/postgresql.py +++ b/gramps/plugins/database/dbapi_support/postgresql.py @@ -3,7 +3,7 @@ import re psycopg2.paramstyle = 'format' -class Postgresql(object): +class Postgresql: @classmethod def get_summary(cls): """ diff --git a/gramps/plugins/database/dbapi_support/sqlite.py b/gramps/plugins/database/dbapi_support/sqlite.py index 117c40eb0..1776ff187 100644 --- a/gramps/plugins/database/dbapi_support/sqlite.py +++ b/gramps/plugins/database/dbapi_support/sqlite.py @@ -5,7 +5,7 @@ import re sqlite3.paramstyle = 'qmark' -class Sqlite(object): +class Sqlite: @classmethod def get_summary(cls): """ diff --git a/gramps/plugins/database/test/db_test.py b/gramps/plugins/database/test/db_test.py index 5f6e161a5..70ab1a62f 100644 --- a/gramps/plugins/database/test/db_test.py +++ b/gramps/plugins/database/test/db_test.py @@ -29,7 +29,7 @@ ddir = os.path.dirname(__file__) example = os.path.join(ddir, "..", "..", "..", "..", "example", "gramps", "data.gramps") -class BSDDB(object): +class BSDDB: NAME = "Example BSDDB Test" backend = "bsddb" diff --git a/gramps/plugins/docgen/gtkprint.py b/gramps/plugins/docgen/gtkprint.py index 00f4048d2..0dbf3d7fe 100644 --- a/gramps/plugins/docgen/gtkprint.py +++ b/gramps/plugins/docgen/gtkprint.py @@ -167,7 +167,7 @@ def paperstyle_to_pagesetup(paper_style): # PrintPreview class # #------------------------------------------------------------------------ -class PrintPreview(object): +class PrintPreview: """Implement a dialog to show print preview. """ zoom_factors = { diff --git a/gramps/plugins/docgen/latexdoc.py b/gramps/plugins/docgen/latexdoc.py index 27d574f39..443d79f84 100644 --- a/gramps/plugins/docgen/latexdoc.py +++ b/gramps/plugins/docgen/latexdoc.py @@ -489,18 +489,18 @@ def str_incr(str_counter): # #------------------------------------------------------------------------ -class Tab_Cell(): +class Tab_Cell: def __init__(self, colchar, span, head, content): self.colchar = colchar self.span = span self.head = head self.content = content -class Tab_Row(): +class Tab_Row: def __init__(self): self.cells =[] self.tail = '' self.addit = '' # for: \\hline, \\cline{} -class Tab_Mem(): +class Tab_Mem: def __init__(self, head): self.head = head self.tail ='' @@ -629,7 +629,7 @@ class LateXBackend(DocBackend): # #------------------------------------------------------------------------ -class TexFont(object): +class TexFont: def __init__(self, style=None): if style: self.font_beg = style.font_beg diff --git a/gramps/plugins/drawreport/ancestortree.py b/gramps/plugins/drawreport/ancestortree.py index f5bb7a234..46054ddd8 100644 --- a/gramps/plugins/drawreport/ancestortree.py +++ b/gramps/plugins/drawreport/ancestortree.py @@ -136,7 +136,7 @@ class TitleA(TitleBox): # make_ancestor_tree (main recursive functions) # #------------------------------------------------------------------------ -class CalcItems(object): +class CalcItems: """ A helper class to calculate the default box text and text for each person / marriage """ @@ -371,7 +371,7 @@ class MakeAncestorTree(AscendPerson): #------------------------------------------------------------------------ # Class lr_Transform #------------------------------------------------------------------------ -class LRTransform(object): +class LRTransform: """ setup all of the boxes on the canvas in for a left/right report """ @@ -406,7 +406,7 @@ class LRTransform(object): # class make_report # #------------------------------------------------------------------------ -class MakeReport(object): +class MakeReport: def __init__(self, dbase, doc, canvas, font_normal): @@ -476,7 +476,7 @@ class MakeReport(object): transform.place() -class GUIConnect(object): +class GUIConnect: """ This is a BORG object. There is ONLY one. This give some common routines that EVERYONE can use like get the value from a GUI variable diff --git a/gramps/plugins/drawreport/descendtree.py b/gramps/plugins/drawreport/descendtree.py index 64c9ed930..bfc39b663 100644 --- a/gramps/plugins/drawreport/descendtree.py +++ b/gramps/plugins/drawreport/descendtree.py @@ -936,7 +936,7 @@ class MakeFamilyTree(RecurseDown): # Class MakeReport # #------------------------------------------------------------------------ -class MakeReport(object): +class MakeReport: """ Make a report out of a list of people. The list of people is already made. Use this information to find where @@ -1181,7 +1181,7 @@ class MakeReport(object): self.Make_report() -class GuiConnect(): +class GuiConnect: """ This is a BORG object. There is ONLY one. This give some common routines that EVERYONE can use like get the value from a GUI variable diff --git a/gramps/plugins/drawreport/statisticschart.py b/gramps/plugins/drawreport/statisticschart.py index b818180b8..288493a1e 100644 --- a/gramps/plugins/drawreport/statisticschart.py +++ b/gramps/plugins/drawreport/statisticschart.py @@ -320,7 +320,7 @@ def _T_(value): # enable deferred translations (see Python docs 22.1.3.4) # Data extraction methods from the database # #------------------------------------------------------------------------ -class Extract(object): +class Extract: def __init__(self): """Methods for extracting statistical data from the database""" diff --git a/gramps/plugins/export/exportcsv.py b/gramps/plugins/export/exportcsv.py index 857281482..6329c87ff 100644 --- a/gramps/plugins/export/exportcsv.py +++ b/gramps/plugins/export/exportcsv.py @@ -107,7 +107,7 @@ def get_primary_source_title(db, obj): # Encoding support for CSV, from http://docs.python.org/lib/csv-examples.html # #------------------------------------------------------------------------- -class UTF8Recoder(object): +class UTF8Recoder: """Iterator that reads an encoded stream and reencodes the input to UTF-8.""" def __init__(self, f, encoding): self.reader = codecs.getreader(encoding)(f) @@ -118,7 +118,7 @@ class UTF8Recoder(object): def __next__(self): return self.reader.next().encode("utf-8") -class UnicodeReader(object): +class UnicodeReader: """ A CSV reader which will iterate over lines in the CSV file "f", which is encoded in the given encoding. @@ -136,7 +136,7 @@ class UnicodeReader(object): def __iter__(self): return self -class UnicodeWriter(object): +class UnicodeWriter: """ A CSV writer which will write rows to CSV file "f", which is encoded in the given encoding. @@ -231,7 +231,7 @@ class CSVWriterOptionBox(WriterOptionBox): # CSVWriter class # #------------------------------------------------------------------------- -class CSVWriter(object): +class CSVWriter: def __init__(self, database, filename, user, option_box=None): self.db = database self.option_box = option_box diff --git a/gramps/plugins/export/exportftree.py b/gramps/plugins/export/exportftree.py index 0d4849af0..0659b26e0 100644 --- a/gramps/plugins/export/exportftree.py +++ b/gramps/plugins/export/exportftree.py @@ -63,7 +63,7 @@ def writeData(database, filename, user, option_box=None): # FtreeWriter # #------------------------------------------------------------------------- -class FtreeWriter(object): +class FtreeWriter: def __init__(self, database, filename, user, option_box=None): self.db = database diff --git a/gramps/plugins/export/exportgeneweb.py b/gramps/plugins/export/exportgeneweb.py index 64572a019..e557c13be 100644 --- a/gramps/plugins/export/exportgeneweb.py +++ b/gramps/plugins/export/exportgeneweb.py @@ -54,7 +54,7 @@ from gramps.gui.glade import Glade from gramps.gen.config import config from gramps.gen.display.place import displayer as _pd -class GeneWebWriter(object): +class GeneWebWriter: def __init__(self, database, filename, user, option_box=None): self.db = database self.filename = filename diff --git a/gramps/plugins/export/exportpkg.py b/gramps/plugins/export/exportpkg.py index d029d0618..0bd18d232 100644 --- a/gramps/plugins/export/exportpkg.py +++ b/gramps/plugins/export/exportpkg.py @@ -91,7 +91,7 @@ def writeData(database, filename, user, option_box=None): # PackageWriter # #------------------------------------------------------------------------- -class PackageWriter(object): +class PackageWriter: def __init__(self, database, filename, user): self.db = database diff --git a/gramps/plugins/export/exportvcalendar.py b/gramps/plugins/export/exportvcalendar.py index 5d37dfa36..ccaa788aa 100644 --- a/gramps/plugins/export/exportvcalendar.py +++ b/gramps/plugins/export/exportvcalendar.py @@ -54,7 +54,7 @@ from gramps.gen.lib import Date, EventType from gramps.gui.glade import Glade from gramps.gen.display.place import displayer as _pd -class CalendarWriter(object): +class CalendarWriter: def __init__(self, database, filename, user, option_box=None): self.db = database self.filename = filename diff --git a/gramps/plugins/export/exportvcard.py b/gramps/plugins/export/exportvcard.py index fab99113a..ff8150a78 100644 --- a/gramps/plugins/export/exportvcard.py +++ b/gramps/plugins/export/exportvcard.py @@ -80,7 +80,7 @@ def exportData(database, filename, user, option_box=None): # VCardWriter class # #------------------------------------------------------------------------- -class VCardWriter(object): +class VCardWriter: """Class to create a file with data in VCard format.""" LINELENGTH = 73 # unclear if the 75 chars of spec includes \r\n. ESCAPE_CHAR = '\\' diff --git a/gramps/plugins/gramplet/whatsnext.py b/gramps/plugins/gramplet/whatsnext.py index cc783cc8d..7d8a19fc1 100644 --- a/gramps/plugins/gramplet/whatsnext.py +++ b/gramps/plugins/gramplet/whatsnext.py @@ -599,9 +599,9 @@ class WhatNextGramplet(Gramplet): return (father, mother, family) -class UnknownPersonClass(object): +class UnknownPersonClass: pass -class UnknownFamilyClass(object): +class UnknownFamilyClass: pass UnknownPerson = UnknownPersonClass() diff --git a/gramps/plugins/importer/importcsv.py b/gramps/plugins/importer/importcsv.py index bc5baaeff..6152cedca 100644 --- a/gramps/plugins/importer/importcsv.py +++ b/gramps/plugins/importer/importcsv.py @@ -118,7 +118,7 @@ def importData(dbase, filename, user): # CSV Parser # #------------------------------------------------------------------------- -class CSVParser(object): +class CSVParser: """Class to read data in CSV format from a file object.""" def __init__(self, dbase, user, default_tag_format=None): self.db = dbase diff --git a/gramps/plugins/importer/importgeneweb.py b/gramps/plugins/importer/importgeneweb.py index 60676b07e..59e60b8f5 100644 --- a/gramps/plugins/importer/importgeneweb.py +++ b/gramps/plugins/importer/importgeneweb.py @@ -165,7 +165,7 @@ def importData(database, filename, user): # http://cristal.inria.fr/~ddr/GeneWeb/en/gwformat.htm # https://github.com/geneanet/geneweb/issues/315 #------------------------------------------------------------------------- -class GeneWebParser(object): +class GeneWebParser: def __init__(self, dbase, file): self.db = dbase if file: # Unit tests can create the parser w/o underlying file diff --git a/gramps/plugins/importer/importprogen.py b/gramps/plugins/importer/importprogen.py index ef64b8df9..083cdc8c2 100644 --- a/gramps/plugins/importer/importprogen.py +++ b/gramps/plugins/importer/importprogen.py @@ -494,7 +494,7 @@ class PG30_Def: return '\n\n'.join([self.tables[t].diag() for t in self.tables]) -class ProgenParser(object): +class ProgenParser: def __init__(self, dbase, file_): self.bname, ext = os.path.splitext(file_) if ext.lower() in ('.per', '.rel', '.mem'): diff --git a/gramps/plugins/importer/importvcard.py b/gramps/plugins/importer/importvcard.py index 09a004a6e..ecfd3a7c1 100644 --- a/gramps/plugins/importer/importvcard.py +++ b/gramps/plugins/importer/importvcard.py @@ -129,7 +129,7 @@ def fitin(prototype, receiver, element): # VCardParser class # #------------------------------------------------------------------------- -class VCardParser(object): +class VCardParser: """Class to read data in VCard format from a file.""" DATE_RE = re.compile(r'^(\d{4}-\d{1,2}-\d{1,2})|(?:(\d{4})-?(\d\d)-?(\d\d))') GROUP_RE = re.compile(r'^(?:[-0-9A-Za-z]+\.)?(.+)$') # see RFC 2425 sec5.8.2 diff --git a/gramps/plugins/importer/importxml.py b/gramps/plugins/importer/importxml.py index 1a6307408..65856caae 100644 --- a/gramps/plugins/importer/importxml.py +++ b/gramps/plugins/importer/importxml.py @@ -184,7 +184,7 @@ def fix_spaces(text_list): # #------------------------------------------------------------------------- -class ImportInfo(object): +class ImportInfo: """ Class object that can hold information about the import """ @@ -330,7 +330,7 @@ class ImportInfo(object): return txt -class LineParser(object): +class LineParser: def __init__(self, filename): self.count = 0 diff --git a/gramps/plugins/lib/libcairodoc.py b/gramps/plugins/lib/libcairodoc.py index 692cc33f8..01d61896c 100644 --- a/gramps/plugins/lib/libcairodoc.py +++ b/gramps/plugins/lib/libcairodoc.py @@ -250,7 +250,7 @@ def raw_length(s): ##""" ##return self.colwid[index] -class FrameStyle(object): +class FrameStyle: """Define the style properties of a Frame. - width: Width of the frame in cm. @@ -273,7 +273,7 @@ class FrameStyle(object): # #------------------------------------------------------------------------ -class GtkDocBaseElement(object): +class GtkDocBaseElement: """Base of all document elements. Support document element structuring and can render itself onto diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index 159a62809..c06f61c80 100755 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -676,7 +676,7 @@ class GedcomDateParser(DateParser): # Lexer - serves as the lexical analysis engine # #------------------------------------------------------------------------- -class Lexer(object): +class Lexer: def __init__(self, ifile, __add_msg): self.ifile = ifile @@ -798,7 +798,7 @@ class Lexer(object): # GedLine - represents a tokenized version of a GEDCOM line # #----------------------------------------------------------------------- -class GedLine(object): +class GedLine: """ GedLine is a class the represents a GEDCOM line. The form of a GEDCOM line is: @@ -1025,7 +1025,7 @@ _MAP_DATA = { # GedcomDescription # #------------------------------------------------------------------------- -class GedcomDescription(object): +class GedcomDescription: def __init__(self, name): self.name = name self.dest = "" @@ -1120,7 +1120,7 @@ class GedcomDescription(object): # GedcomInfoDB # #------------------------------------------------------------------------- -class GedcomInfoDB(object): +class GedcomInfoDB: def __init__(self): self.map = {} @@ -1157,7 +1157,7 @@ class GedcomInfoDB(object): # GedInfoParser # #------------------------------------------------------------------------- -class GedInfoParser(object): +class GedInfoParser: def __init__(self, parent): self.parent = parent self.current = None @@ -1226,7 +1226,7 @@ class GedInfoParser(object): # File Readers # #------------------------------------------------------------------------- -class BaseReader(object): +class BaseReader: def __init__(self, ifile, encoding, __add_msg): self.ifile = ifile self.enc = encoding @@ -1572,7 +1572,7 @@ class AnselReader(BaseReader): # CurrentState # #------------------------------------------------------------------------- -class CurrentState(object): +class CurrentState: """ Keep track of the current state variables. """ @@ -1632,7 +1632,7 @@ class CurrentState(object): # PlaceParser # #------------------------------------------------------------------------- -class PlaceParser(object): +class PlaceParser: """ Provide the ability to parse GEDCOM FORM statements for places, and the parse the line of text, mapping the text components to Location @@ -1726,7 +1726,7 @@ class PlaceParser(object): # IdFinder # #------------------------------------------------------------------------- -class IdFinder(object): +class IdFinder: """ Provide method of finding the next available ID. """ @@ -1760,7 +1760,7 @@ class IdFinder(object): # IdMapper # #------------------------------------------------------------------------- -class IdMapper(object): +class IdMapper: def __init__(self, trans, find_next, id2user_format): self.trans = trans @@ -7711,7 +7711,7 @@ class GedcomParser(UpdateCallback): # GedcomStageOne # #------------------------------------------------------------------------- -class GedcomStageOne(object): +class GedcomStageOne: """ The GedcomStageOne parser scans the file quickly, looking for a few things. This includes: diff --git a/gramps/plugins/lib/libholiday.py b/gramps/plugins/lib/libholiday.py index b552f0c12..1167deb40 100644 --- a/gramps/plugins/lib/libholiday.py +++ b/gramps/plugins/lib/libholiday.py @@ -149,7 +149,7 @@ def cmp(a, b): # HolidayTable # #------------------------------------------------------------------------ -class HolidayTable(object): +class HolidayTable: """ HolidayTable is a class which provides holidays for various countries and years. diff --git a/gramps/plugins/lib/libmapservice.py b/gramps/plugins/lib/libmapservice.py index 03670ef31..aecd1c770 100644 --- a/gramps/plugins/lib/libmapservice.py +++ b/gramps/plugins/lib/libmapservice.py @@ -36,7 +36,7 @@ Base class for map services. Example: open place in openstreetmap.org from gramps.gen.utils.place import conv_lat_lon from gramps.gui.display import display_url -class MapService(): +class MapService: """Generic base class for map services A service is a singleton, we only need one to exist Usage is as a callable when used diff --git a/gramps/plugins/lib/libmixin.py b/gramps/plugins/lib/libmixin.py index 6cdb8a995..226c5995f 100644 --- a/gramps/plugins/lib/libmixin.py +++ b/gramps/plugins/lib/libmixin.py @@ -35,7 +35,7 @@ from gramps.gen.lib import (Person, Family, Event, Place, Source, # DbMixin class # #------------------------------------------------------------------------------ -class DbMixin(object): +class DbMixin: """ DbMixin -- a collection of methods to be added to the main gramps database class for use with import functions. To enable these diff --git a/gramps/plugins/lib/libnarrate.py b/gramps/plugins/lib/libnarrate.py index b5c4e2472..b6a5dab11 100644 --- a/gramps/plugins/lib/libnarrate.py +++ b/gramps/plugins/lib/libnarrate.py @@ -1344,7 +1344,7 @@ relationship_also_only = { # Narrator # #------------------------------------------------------------------------ -class Narrator(object): +class Narrator: """ Narrator is a class which provides narration text. """ diff --git a/gramps/plugins/lib/libplaceimport.py b/gramps/plugins/lib/libplaceimport.py index 58293b6bc..f27720609 100644 --- a/gramps/plugins/lib/libplaceimport.py +++ b/gramps/plugins/lib/libplaceimport.py @@ -34,7 +34,7 @@ from gramps.gen.lib import Place, PlaceName, PlaceType, PlaceRef # PlaceImport class # #------------------------------------------------------------------------- -class PlaceImport(object): +class PlaceImport: """ Helper class for importing places. """ diff --git a/gramps/plugins/lib/librecurse.py b/gramps/plugins/lib/librecurse.py index f8d6b550b..430c69a68 100644 --- a/gramps/plugins/lib/librecurse.py +++ b/gramps/plugins/lib/librecurse.py @@ -30,7 +30,7 @@ from gramps.gen.lib import ChildRefType # Livrecurse base objects only # #------------------------------------------------------------------------ -class _PersonSeen(object): +class _PersonSeen: """ librecurse base boject only Keep track of people that have been seen so we can call the correct virtual method. @@ -56,7 +56,7 @@ class _PersonSeen(object): if person_handle is not None: self.people_seen.add(person_handle) -class _FamilySeen(object): +class _FamilySeen: """ librecurse base boject only Keep track of the famalies that have been seen so we can call the correct virtual method. @@ -80,7 +80,7 @@ class _FamilySeen(object): self.add_marriage(level, person_handle, family_handle) self.families_seen.add(family_handle) -class _StopRecurse(object): +class _StopRecurse: """ A simple class to break out the . stop_recursion . can_recurse diff --git a/gramps/plugins/lib/libsubstkeyword.py b/gramps/plugins/lib/libsubstkeyword.py index 8c4407681..e0423550b 100644 --- a/gramps/plugins/lib/libsubstkeyword.py +++ b/gramps/plugins/lib/libsubstkeyword.py @@ -50,7 +50,7 @@ from gramps.gen.const import GRAMPS_LOCALE as glocale # Local constants # #------------------------------------------------------------------------ -class TextTypes(): +class TextTypes: """Four enumerations that are used to for the four main parts of a string. and used for states. Separator is not used in states. @@ -66,7 +66,7 @@ TXT = TextTypes() # Formatting classes # #------------------------------------------------------------------------ -class GenericFormat(object): +class GenericFormat: """A Generic parsing class. Will be subclassed by specific format strings """ @@ -471,7 +471,7 @@ class EventFormat(GenericFormat): #------------------------------------------------------------------------ # gramps info Format strings #------------------------------------------------------------------------ -class GrampsFormat(): +class GrampsFormat: """ The Gramps Info Format class. This only polls information from system information. """ @@ -588,7 +588,7 @@ class GalleryFormat(GenericFormat): # ConsumableString - The Input string class # #------------------------------------------------------------------------ -class ConsumableString(object): +class ConsumableString: """ A simple string implementation with extras to help with parsing. @@ -665,7 +665,7 @@ class ConsumableString(object): # VarString class - The Output string class # #------------------------------------------------------------------------ -class VarString(object): +class VarString: """ The current state of the entire string (integer from TextTypes) A list to hold tuple object (integer from TextTypes, string) @@ -759,7 +759,7 @@ class VarString(object): #------------------------------------------------------------------------ # SeparatorParse #------------------------------------------------------------------------ -class SeparatorParse(object): +class SeparatorParse: """ parse out a separator """ def __init__(self, consumer_in): self._in = consumer_in @@ -777,7 +777,7 @@ class SeparatorParse(object): #------------------------------------------------------------------------ # AttributeParse #------------------------------------------------------------------------ -class AttributeParse(object): +class AttributeParse: """ Parse attributes """ def __init__(self, consumer_in): @@ -811,7 +811,7 @@ class AttributeParse(object): #------------------------------------------------------------------------ # VariableParse #------------------------------------------------------------------------ -class VariableParse(object): +class VariableParse: """ Parse the individual variables """ def __init__(self, friend, database, consumer_in, locale, name_displayer): @@ -1057,7 +1057,7 @@ class VariableParse(object): # SubstKeywords # #------------------------------------------------------------------------ -class SubstKeywords(object): +class SubstKeywords: """Accepts a person/family with format lines and returns a new set of lines using variable substitution to make it. diff --git a/gramps/plugins/lib/libtreebase.py b/gramps/plugins/lib/libtreebase.py index 4d3fca717..b5a185b60 100644 --- a/gramps/plugins/lib/libtreebase.py +++ b/gramps/plugins/lib/libtreebase.py @@ -39,7 +39,7 @@ PT2CM = ReportUtils.pt2cm # Class Calc_Lines # #------------------------------------------------------------------------ -class CalcLines(object): +class CalcLines: """ wrapper for libsubstkeyword and added functionality for replacements. @@ -84,7 +84,7 @@ class CalcLines(object): # Class Canvas/Pages # #------------------------------------------------------------------------ -class Page(object): +class Page: """ This class is a printable page. Offsets from the canvas, Page numbers boxes and lines @@ -563,7 +563,7 @@ class Canvas(Page): # Class Box_Base # #------------------------------------------------------------------------ -class BoxBase(object): +class BoxBase: """ boxes are always in/on a Page Needed to print are: boxstr, text, x_cm, y_cm, width, height """ @@ -742,7 +742,7 @@ class PageNumberBox(BoxBase): self.text % (page.x_page_num+1, page.y_page_num+1), self.x_cm, self.y_cm) -class NoteType(object): +class NoteType: """ Provide the different options (corners) to place the note """ TOPLEFT = 0 @@ -827,7 +827,7 @@ class NoteBox(BoxBase, NoteType): # Class Line_base # #------------------------------------------------------------------------ -class LineBase(object): +class LineBase: """ A simple line class. self.start is the box that we are drawing a line from self.end are the boxes that we are drawing lines to. @@ -901,7 +901,7 @@ class LineBase(object): # Class report_options # #------------------------------------------------------------------------ -class ReportOptions(object): +class ReportOptions: """ A simple class to hold various report information Calculates diff --git a/gramps/plugins/lib/maps/cairoprint.py b/gramps/plugins/lib/maps/cairoprint.py index 718e2d6c4..bb68a342e 100644 --- a/gramps/plugins/lib/maps/cairoprint.py +++ b/gramps/plugins/lib/maps/cairoprint.py @@ -45,7 +45,7 @@ PRINT_SETTINGS = None # CairoPrintSave class # #------------------------------------------------------------------------ -class CairoPrintSave(object): +class CairoPrintSave: """ Act as an abstract document that can render onto a cairo context. diff --git a/gramps/plugins/lib/maps/osmgps.py b/gramps/plugins/lib/maps/osmgps.py index aefb6eb6c..f62979ca6 100644 --- a/gramps/plugins/lib/maps/osmgps.py +++ b/gramps/plugins/lib/maps/osmgps.py @@ -81,7 +81,7 @@ except: # pylint: disable=no-member # pylint: disable=maybe-no-member -class OsmGps(object): +class OsmGps: """ This class is used to create a map """ diff --git a/gramps/plugins/quickview/all_relations.py b/gramps/plugins/quickview/all_relations.py index 99654163d..44a19892b 100644 --- a/gramps/plugins/quickview/all_relations.py +++ b/gramps/plugins/quickview/all_relations.py @@ -49,7 +49,7 @@ def run(database, document, person): report = AllRelReport(database, document, person) report.run() -class AllRelReport(): +class AllRelReport: """ Obtains all relationships, displays the relations, and in details, the relation path diff --git a/gramps/plugins/rel/rel_hr.py b/gramps/plugins/rel/rel_hr.py index aa6ddcbb7..739ccf13a 100644 --- a/gramps/plugins/rel/rel_hr.py +++ b/gramps/plugins/rel/rel_hr.py @@ -43,7 +43,7 @@ _CHILDS_SP = ['', 'snahe i zetovi', 'prasnahe i prazetovi', # Class HrDeclination # #------------------------------------------------------------------------- -class HrDeclination(object): +class HrDeclination: """ Croatian declination system """ diff --git a/gramps/plugins/test/test_reports.py b/gramps/plugins/test/test_reports.py index d362a9f0c..46979e896 100644 --- a/gramps/plugins/test/test_reports.py +++ b/gramps/plugins/test/test_reports.py @@ -34,7 +34,7 @@ sample = os.path.join(ddir, "..", "..", "..", TREE_NAME = "Test_reporttest" -class ReportControl(object): +class ReportControl: def tearDown(self): out, err = self.call("-y", "--remove", TREE_NAME) out, err = self.call("-y", "--remove", TREE_NAME + "_import_gedcom") diff --git a/gramps/plugins/textreport/descendreport.py b/gramps/plugins/textreport/descendreport.py index 43084cfcf..7104f9ef4 100644 --- a/gramps/plugins/textreport/descendreport.py +++ b/gramps/plugins/textreport/descendreport.py @@ -62,7 +62,7 @@ from gramps.gen.utils.db import (get_birth_or_fallback, get_death_or_fallback, # Simple numbering system # #------------------------------------------------------------------------ -class PrintSimple(): +class PrintSimple: def __init__(self, showdups): self.showdups = showdups self.num = {0:1} @@ -89,7 +89,7 @@ class PrintSimple(): # de_Villiers_Pama numbering system # #------------------------------------------------------------------------ -class PrintVilliers(): +class PrintVilliers: def __init__(self): self.pama = 'abcdefghijklmnopqrstuvwxyz' self.num = {0:1} @@ -112,7 +112,7 @@ class PrintVilliers(): # Meurgey_de_Tupigny numbering system # #------------------------------------------------------------------------ -class PrintMeurgey(): +class PrintMeurgey: def __init__(self): self.childnum = [""] @@ -138,7 +138,7 @@ class PrintMeurgey(): # Printinfo # #------------------------------------------------------------------------ -class Printinfo(): +class Printinfo: """ A base class used to help make the individual numbering system classes. This class must first be initialized with set_class_vars @@ -246,7 +246,7 @@ class Printinfo(): # RecurseDown # #------------------------------------------------------------------------ -class RecurseDown(): +class RecurseDown: """ A simple object to recurse from a person down through their descendants diff --git a/gramps/plugins/tool/check.py b/gramps/plugins/tool/check.py index 0bf982b24..8ac8c096b 100644 --- a/gramps/plugins/tool/check.py +++ b/gramps/plugins/tool/check.py @@ -76,7 +76,7 @@ from gramps.gui.glade import Glade # All except 09, 0A, 0D are replaced with space. strip_dict = dict.fromkeys(list(range(9))+list(range(11,13))+list(range(14, 32)), " ") -class ProgressMeter(object): +class ProgressMeter: def __init__(self, *args, **kwargs): pass def set_pass(self, *args): pass def step(self): pass @@ -211,7 +211,7 @@ class Check(tool.BatchTool): # # #------------------------------------------------------------------------- -class CheckIntegrity(object): +class CheckIntegrity: def __init__(self, dbstate, uistate, trans): self.uistate = uistate diff --git a/gramps/plugins/tool/eventcmp.py b/gramps/plugins/tool/eventcmp.py index 85722016e..72e471f60 100644 --- a/gramps/plugins/tool/eventcmp.py +++ b/gramps/plugins/tool/eventcmp.py @@ -74,7 +74,7 @@ WIKI_HELP_SEC = _('manual|Compare_Individual_Events') # EventCmp # #------------------------------------------------------------------------ -class TableReport(object): +class TableReport: """ This class provides an interface for the spreadsheet table used to save the data into the file. diff --git a/gramps/plugins/tool/verify.py b/gramps/plugins/tool/verify.py index ea9e4e475..a3f61d444 100644 --- a/gramps/plugins/tool/verify.py +++ b/gramps/plugins/tool/verify.py @@ -780,7 +780,7 @@ class VerifyOptions(tool.ToolOptions): # Base classes for different tests -- the rules # #------------------------------------------------------------------------- -class Rule(object): +class Rule: """ Basic class for use in this tool. diff --git a/gramps/plugins/view/fanchartdescview.py b/gramps/plugins/view/fanchartdescview.py index 77c44c04b..b92976db0 100644 --- a/gramps/plugins/view/fanchartdescview.py +++ b/gramps/plugins/view/fanchartdescview.py @@ -394,7 +394,7 @@ class FanChartDescView(fanchartdesc.FanChartDescGrampsGUI, NavigationView): # CairoPrintSave class # #------------------------------------------------------------------------ -class CairoPrintSave(): +class CairoPrintSave: """Act as an abstract document that can render onto a cairo context. It can render the model onto cairo context pages, according to the received diff --git a/gramps/plugins/view/fanchartview.py b/gramps/plugins/view/fanchartview.py index 5671eca45..08418b492 100644 --- a/gramps/plugins/view/fanchartview.py +++ b/gramps/plugins/view/fanchartview.py @@ -403,7 +403,7 @@ class FanChartView(fanchart.FanChartGrampsGUI, NavigationView): # CairoPrintSave class # #------------------------------------------------------------------------ -class CairoPrintSave(): +class CairoPrintSave: """Act as an abstract document that can render onto a cairo context. It can render the model onto cairo context pages, according to the received diff --git a/gramps/plugins/webreport/narrativeweb.py b/gramps/plugins/webreport/narrativeweb.py index 72f67b2de..a26ad9eac 100644 --- a/gramps/plugins/webreport/narrativeweb.py +++ b/gramps/plugins/webreport/narrativeweb.py @@ -570,7 +570,7 @@ def copy_thumbnail(report, handle, photo, region=None): # pylint: disable=unused-variable # pylint: disable=unused-argument -class BasePage(object): +class BasePage: """ Manages all the functions, variables, and everything needed for all of the classes contained within this plugin diff --git a/gramps/test/test_util.py b/gramps/test/test_util.py index 3740f8033..d78d6fa86 100644 --- a/gramps/test/test_util.py +++ b/gramps/test/test_util.py @@ -180,7 +180,7 @@ def delete_tree(dir): # NB: current code reflects limited expertise on the # uses of the logging module # --------------------------------------------------------- -class TestLogger(): +class TestLogger: """this class mainly just encapsulates some globals namely lfname, lfh for a file log name and handle @@ -242,7 +242,7 @@ def capture(stdin): output[0] = output[0].getvalue() output[1] = output[1].getvalue() -class Gramps(object): +class Gramps: def __init__(self, user=None, dbstate=None): ## Setup: from gramps.cli.clidbman import CLIDbManager