From 8c73b202c360f495190d67b461cb804641114c40 Mon Sep 17 00:00:00 2001 From: Gerald Britton Date: Thu, 21 May 2009 17:58:31 +0000 Subject: [PATCH] Bug 3017: change old-style classes to new-style classes svn: r12560 --- src/ArgHandler.py | 2 +- src/AutoComp.py | 2 +- src/BaseDoc.py | 28 +++++++++++------------ src/BasicUtils/_NameDisplay.py | 2 +- src/BasicUtils/_UpdateCallback.py | 2 +- src/Config/_GrampsIniKeys.py | 2 +- src/DataViews/GeoView.py | 2 +- src/DataViews/GrampletView.py | 2 +- src/DataViews/MapView.py | 4 ++-- src/DataViews/PedigreeView.py | 2 +- src/DataViews/RelationView.py | 2 +- src/DateEdit.py | 2 +- src/DateHandler/_DateDisplay.py | 2 +- src/DateHandler/_DateParser.py | 2 +- src/DbLoader.py | 2 +- src/DbManager.py | 2 +- src/DisplayModels/_BaseModel.py | 2 +- src/DisplayModels/_PeopleModel.py | 2 +- src/DisplayState.py | 2 +- src/Editors/ObjectEntries.py | 2 +- src/Editors/_EditEvent.py | 2 +- src/Editors/_EditFamily.py | 4 ++-- src/Editors/_EditMedia.py | 2 +- src/Editors/_EditNote.py | 2 +- src/Editors/_EditPlace.py | 2 +- src/Editors/_EditRepository.py | 2 +- src/Editors/_EditSource.py | 2 +- src/ExportOptions.py | 2 +- src/Filters/Rules/_Rule.py | 2 +- src/Filters/SideBar/_SidebarFilter.py | 2 +- src/Filters/_FilterList.py | 2 +- src/Filters/_GenericFilter.py | 2 +- src/Filters/_SearchBar.py | 2 +- src/Filters/_SearchFilter.py | 2 +- src/GrampsCfg.py | 2 +- src/GrampsDbUtils/_GedcomChar.py | 2 +- src/GrampsDbUtils/_GedcomInfo.py | 6 ++--- src/GrampsDbUtils/_GedcomLex.py | 4 ++-- src/GrampsDbUtils/_GedcomStageOne.py | 2 +- src/GrampsDbUtils/_GedcomUtils.py | 8 +++---- src/GrampsDbUtils/test/GR_test.py | 4 ++-- src/GrampsLogger/_ErrorReportAssistant.py | 2 +- src/LdsUtils.py | 2 +- src/ListModel.py | 2 +- src/Lru.py | 4 ++-- src/ManagedWindow.py | 4 ++-- src/Merge/_MergePerson.py | 2 +- src/Navigation.py | 2 +- src/PageView.py | 2 +- src/PluginUtils/_GuiOptions.py | 2 +- src/PluginUtils/_Options.py | 8 +++---- src/PluginUtils/_Tool.py | 17 +++++++------- src/QuestionDialog.py | 14 ++++++------ src/RecentFiles.py | 6 ++--- src/Relationship.py | 2 +- src/ReportBase/_Bibliography.py | 4 ++-- src/ReportBase/_CommandLineReport.py | 2 +- src/ReportBase/_GraphvizReportDialog.py | 10 ++++---- src/ReportBase/_Report.py | 2 +- src/ReportBase/_ReportDialog.py | 8 ++++--- src/ReportBase/_ReportOptions.py | 2 +- src/ReportBase/_StyleEditor.py | 4 ++-- src/ScratchPad.py | 2 +- src/Simple/_SimpleAccess.py | 2 +- src/Simple/_SimpleDoc.py | 2 +- src/Simple/_SimpleTable.py | 2 +- src/Sort.py | 2 +- src/Spell.py | 2 +- src/SubstKeywords.py | 2 +- src/TipOfDay.py | 2 +- src/ToolTips.py | 8 +++---- src/Utils.py | 2 +- src/ViewManager.py | 2 +- src/docgen/SpreadSheetDoc.py | 2 +- src/docgen/TabbedDoc.py | 2 +- src/docgen/TextBufDoc.py | 2 +- src/gen/db/base.py | 4 ++-- src/gen/db/cursor.py | 2 +- src/gen/db/dbdir.py | 4 ++-- src/gen/lib/addressbase.py | 2 +- src/gen/lib/attrbase.py | 2 +- src/gen/lib/baseobj.py | 2 +- src/gen/lib/date.py | 4 ++-- src/gen/lib/datebase.py | 2 +- src/gen/lib/genderstats.py | 2 +- src/gen/lib/ldsordbase.py | 2 +- src/gen/lib/locationbase.py | 2 +- src/gen/lib/mediabase.py | 2 +- src/gen/lib/notebase.py | 2 +- src/gen/lib/placebase.py | 2 +- src/gen/lib/privacybase.py | 2 +- src/gen/lib/refbase.py | 2 +- src/gen/lib/srcbase.py | 2 +- src/gen/lib/srcnote.py | 2 +- src/gen/lib/styledtexttag.py | 2 +- src/gen/lib/urlbase.py | 2 +- src/gen/lib/witness.py | 2 +- src/gen/plug/_plugin.py | 2 +- src/gen/plug/menu/_menu.py | 2 +- src/gen/proxy/dbbase.py | 2 +- src/gramps_main.py | 2 +- src/plugins/BookReport.py | 8 +++---- src/plugins/docgen/GtkPrint.py | 2 +- src/plugins/docgen/LaTeXDoc.py | 2 +- src/plugins/drawreport/AncestorTree.py | 2 +- src/plugins/drawreport/DescendTree.py | 2 +- src/plugins/drawreport/StatisticsChart.py | 2 +- src/plugins/export/ExportCd.py | 2 +- src/plugins/export/ExportCsv.py | 10 ++++---- src/plugins/export/ExportFtree.py | 4 ++-- src/plugins/export/ExportGeneWeb.py | 4 ++-- src/plugins/export/ExportPkg.py | 2 +- src/plugins/export/ExportSql.py | 2 +- src/plugins/export/ExportVCalendar.py | 4 ++-- src/plugins/export/ExportVCard.py | 4 ++-- src/plugins/import/ImportCsv.py | 8 +++---- src/plugins/import/ImportGeneWeb.py | 2 +- src/plugins/import/ImportProGen.py | 2 +- src/plugins/import/ImportVCard.py | 2 +- src/plugins/import/ImportXml.py | 6 ++--- src/plugins/lib/libholiday.py | 2 +- src/plugins/lib/libmapservice.py | 2 +- src/plugins/quickview/Query.py | 2 +- src/plugins/quickview/all_relations.py | 2 +- src/plugins/tool/Check.py | 2 +- src/plugins/tool/EventCmp.py | 2 +- src/plugins/tool/PHPGedViewConnector.py | 4 ++-- src/plugins/tool/Verify.py | 2 +- src/plugins/webreport/NarrativeWeb.py | 2 +- src/test/test_util.py | 2 +- src/widgets/buttons.py | 2 +- src/widgets/monitoredwidgets.py | 20 ++++++++-------- src/widgets/styledtextbuffer.py | 2 +- src/widgets/validatedmaskedentry.py | 2 +- 134 files changed, 220 insertions(+), 215 deletions(-) diff --git a/src/ArgHandler.py b/src/ArgHandler.py index 21df04526..d23b930d2 100644 --- a/src/ArgHandler.py +++ b/src/ArgHandler.py @@ -80,7 +80,7 @@ Application options #------------------------------------------------------------------------- # ArgHandler #------------------------------------------------------------------------- -class ArgHandler: +class ArgHandler(object): """ This class is responsible for handling command line arguments (if any) given to gramps. The valid arguments are: diff --git a/src/AutoComp.py b/src/AutoComp.py index 3207794ed..ba7580521 100644 --- a/src/AutoComp.py +++ b/src/AutoComp.py @@ -76,7 +76,7 @@ def fill_entry(entry, data_list): # StandardCustomSelector class # #------------------------------------------------------------------------- -class StandardCustomSelector: +class StandardCustomSelector(object): """ This class provides an interface to selecting from the predefined options or entering custom string. diff --git a/src/BaseDoc.py b/src/BaseDoc.py index 8cf0b3c9f..17192e0c9 100644 --- a/src/BaseDoc.py +++ b/src/BaseDoc.py @@ -138,7 +138,7 @@ def cnv2color(text): # PaperSize # #------------------------------------------------------------------------ -class PaperSize: +class PaperSize(object): """ Defines the dimensions of a sheet of paper. All dimensions are in centimeters. @@ -188,7 +188,7 @@ class PaperSize: # PaperStyle # #------------------------------------------------------------------------ -class PaperStyle: +class PaperStyle(object): """ Define the various options for a sheet of paper. """ @@ -301,7 +301,7 @@ class PaperStyle: # FontStyle # #------------------------------------------------------------------------ -class FontStyle: +class FontStyle(object): """ Defines a font style. Controls the font face, size, color, and attributes. In order to remain generic, the only font faces available @@ -415,7 +415,7 @@ class FontStyle: # TableStyle # #------------------------------------------------------------------------ -class TableStyle: +class TableStyle(object): """ Specifies the style or format of a table. The TableStyle contains the characteristics of table width (in percentage of the full width), the @@ -498,7 +498,7 @@ class TableStyle: # TableCellStyle # #------------------------------------------------------------------------ -class TableCellStyle: +class TableCellStyle(object): """ Defines the style of a particular table cell. Characteristics are: right border, left border, top border, bottom border, and padding. @@ -592,7 +592,7 @@ class TableCellStyle: # ParagraphStyle # #------------------------------------------------------------------------ -class ParagraphStyle: +class ParagraphStyle(object): """ Defines the characteristics of a paragraph. The characteristics are: font (a FontStyle instance), right margin, left margin, first indent, @@ -885,7 +885,7 @@ class ParagraphStyle: # StyleSheetList # #------------------------------------------------------------------------ -class StyleSheetList: +class StyleSheetList(object): """ Interface into the user's defined style sheets. Each StyleSheetList has a predefined default style specified by the report. Additional @@ -1013,7 +1013,7 @@ class StyleSheetList: # StyleSheet # #------------------------------------------------------------------------ -class StyleSheet: +class StyleSheet(object): """ A collection of named paragraph styles. """ @@ -1239,7 +1239,7 @@ class SheetParser(handler.ContentHandler): # GraphicsStyle # #------------------------------------------------------------------------ -class GraphicsStyle: +class GraphicsStyle(object): """ Defines the properties of graphics objects, such as line width, color, fill, ect. @@ -1318,7 +1318,7 @@ class GraphicsStyle: # IndexMark # #------------------------------------------------------------------------ -class IndexMark: +class IndexMark(object): """ Defines a mark to be associated with text for indexing. """ @@ -1335,7 +1335,7 @@ class IndexMark: # BaseDoc # #------------------------------------------------------------------------ -class BaseDoc: +class BaseDoc(object): """ Base class for document generators. Different output formats, such as OpenOffice, AbiWord, and LaTeX are derived from this base @@ -1412,7 +1412,7 @@ class BaseDoc: def noescape(text): return text -class TextDoc: +class TextDoc(object): """ Abstract Interface for text document generators. Output formats for text reports must implment this interface to be used by the report @@ -1760,7 +1760,7 @@ class TextDoc: # DrawDoc # #------------------------------------------------------------------------ -class DrawDoc: +class DrawDoc(object): """ Abstract Interface for graphical document generators. Output formats for graphical reports must implment this interface to be used by the @@ -1820,7 +1820,7 @@ class DrawDoc: # GVDoc # #------------------------------------------------------------------------------- -class GVDoc: +class GVDoc(object): """ Abstract Interface for Graphviz document generators. Output formats for Graphviz reports must implment this interface to be used by the diff --git a/src/BasicUtils/_NameDisplay.py b/src/BasicUtils/_NameDisplay.py index 3cb140fa1..950bd2cf2 100644 --- a/src/BasicUtils/_NameDisplay.py +++ b/src/BasicUtils/_NameDisplay.py @@ -86,7 +86,7 @@ def _make_cmp(a,b): return -cmp(a[1], b[1]) # NameDisplay class # #------------------------------------------------------------------------- -class NameDisplay: +class NameDisplay(object): """ Base class for displaying of Name instances. """ diff --git a/src/BasicUtils/_UpdateCallback.py b/src/BasicUtils/_UpdateCallback.py index 95befebfa..51f5453ed 100644 --- a/src/BasicUtils/_UpdateCallback.py +++ b/src/BasicUtils/_UpdateCallback.py @@ -40,7 +40,7 @@ import time # Callback updater # #------------------------------------------------------------------------- -class UpdateCallback: +class UpdateCallback(object): """ Basic class providing way of calling the callback to update things during lenghty operations. diff --git a/src/Config/_GrampsIniKeys.py b/src/Config/_GrampsIniKeys.py index ffa6aefd4..d92d45ea1 100644 --- a/src/Config/_GrampsIniKeys.py +++ b/src/Config/_GrampsIniKeys.py @@ -42,7 +42,7 @@ def make_bool(val): else: return True -class IniKeyClient: +class IniKeyClient(object): """ Class to emulate gconf's client """ def __init__(self, filename = None): """ Constructor takes an optional filename """ diff --git a/src/DataViews/GeoView.py b/src/DataViews/GeoView.py index a449cd51a..3de1a39b2 100644 --- a/src/DataViews/GeoView.py +++ b/src/DataViews/GeoView.py @@ -104,7 +104,7 @@ NB_MARKERS_PER_PAGE = 200 # Renderer # #------------------------------------------------------------------------- -class Renderer(): +class Renderer(object): """ Renderer renders the webpage. Several backend implementations are possible diff --git a/src/DataViews/GrampletView.py b/src/DataViews/GrampletView.py index 7ca8bf63f..ab7e0824c 100644 --- a/src/DataViews/GrampletView.py +++ b/src/DataViews/GrampletView.py @@ -600,7 +600,7 @@ class Gramplet(object): def save_options(self): pass -class GuiGramplet: +class GuiGramplet(object): """ Class that handles the plugin interfaces for the GrampletView. """ diff --git a/src/DataViews/MapView.py b/src/DataViews/MapView.py index b75302308..bea5b2cf1 100644 --- a/src/DataViews/MapView.py +++ b/src/DataViews/MapView.py @@ -152,7 +152,7 @@ class GuideMap(gtk.DrawingArea): return (px,py) # Map tile files used by the ZoomMap -class MapTile: +class MapTile(object): def __init__( self, filename, x, y, w, h, pw, ph): self.filename = filename self.full_path = os.path.join(const.IMAGE_DIR,filename) @@ -226,7 +226,7 @@ class MapTile: self.scale = None self.scaled_pixbuf = None -class WMSMapTile: +class WMSMapTile(object): def __init__(self,capabilities,change_cb=None): self.change_cb = change_cb self.scaled_pixbuf = None diff --git a/src/DataViews/PedigreeView.py b/src/DataViews/PedigreeView.py index 393ebbd10..3346ba08c 100644 --- a/src/DataViews/PedigreeView.py +++ b/src/DataViews/PedigreeView.py @@ -357,7 +357,7 @@ class PersonBoxWidget( gtk.DrawingArea, _PersonWidget_base): else: self.window.draw_rectangle(self.border_gc, False, 0, 0, alloc.width-4, alloc.height-4) -class FormattingHelper: +class FormattingHelper(object): def __init__(self,dbstate): self.dbstate = dbstate self._text_cache = {} diff --git a/src/DataViews/RelationView.py b/src/DataViews/RelationView.py index b52688d64..ad7228ac2 100644 --- a/src/DataViews/RelationView.py +++ b/src/DataViews/RelationView.py @@ -94,7 +94,7 @@ _KP_ENTER = gtk.gdk.keyval_from_name("KP_Enter") _LEFT_BUTTON = 1 _RIGHT_BUTTON = 3 -class AttachList: +class AttachList(object): def __init__(self): self.list = [] diff --git a/src/DateEdit.py b/src/DateEdit.py index ce2ea8ad3..6c6fa1c4b 100644 --- a/src/DateEdit.py +++ b/src/DateEdit.py @@ -105,7 +105,7 @@ WIKI_HELP_SEC = _('manual|Editing_Dates') # DateEdit # #------------------------------------------------------------------------- -class DateEdit: +class DateEdit(object): """Class that associates a pixmap with a text widget, providing visual feedback that indicates if the text widget contains a valid date""" diff --git a/src/DateHandler/_DateDisplay.py b/src/DateHandler/_DateDisplay.py index 559ab8d36..3880e67e6 100644 --- a/src/DateHandler/_DateDisplay.py +++ b/src/DateHandler/_DateDisplay.py @@ -46,7 +46,7 @@ import GrampsLocale # DateDisplay # #------------------------------------------------------------------------- -class DateDisplay: +class DateDisplay(object): _months = GrampsLocale.long_months MONS = GrampsLocale.short_months diff --git a/src/DateHandler/_DateParser.py b/src/DateHandler/_DateParser.py index 3bb6b1b6a..6c78742f8 100644 --- a/src/DateHandler/_DateParser.py +++ b/src/DateHandler/_DateParser.py @@ -122,7 +122,7 @@ def french_valid(date_tuple): # Parser class # #------------------------------------------------------------------------- -class DateParser: +class DateParser(object): """ Convert a text string into a Date object. If the date cannot be converted, the text string is assigned. diff --git a/src/DbLoader.py b/src/DbLoader.py index 12c63143f..0c018a1a1 100644 --- a/src/DbLoader.py +++ b/src/DbLoader.py @@ -68,7 +68,7 @@ import Errors # DbLoader class # #------------------------------------------------------------------------- -class DbLoader: +class DbLoader(object): def __init__(self, dbstate, uistate): self.dbstate = dbstate self.uistate = uistate diff --git a/src/DbManager.py b/src/DbManager.py index c355ccddb..9f5028275 100644 --- a/src/DbManager.py +++ b/src/DbManager.py @@ -102,7 +102,7 @@ STOCK_COL = 6 RCS_BUTTON = { True : _('_Extract'), False : _('_Archive') } -class CLIDbManager: +class CLIDbManager(object): """ Database manager without GTK functionality, allows users to create and open databases diff --git a/src/DisplayModels/_BaseModel.py b/src/DisplayModels/_BaseModel.py index 6aa66440a..82e155fe2 100644 --- a/src/DisplayModels/_BaseModel.py +++ b/src/DisplayModels/_BaseModel.py @@ -46,7 +46,7 @@ import Config # NodeMap # #------------------------------------------------------------------------- -class NodeMap: +class NodeMap(object): """ Provide the Path to Iter mappings for a TreeView model. The implementation provides a list of nodes and a dictionary of handles. The datalist provides diff --git a/src/DisplayModels/_PeopleModel.py b/src/DisplayModels/_PeopleModel.py index f7d4ecc39..26e1b864b 100644 --- a/src/DisplayModels/_PeopleModel.py +++ b/src/DisplayModels/_PeopleModel.py @@ -68,7 +68,7 @@ from Lru import LRU _CACHE_SIZE = 250 invalid_date_format = Config.get(Config.INVALID_DATE_FORMAT) -class NodeTreeMap: +class NodeTreeMap(object): def __init__(self): diff --git a/src/DisplayState.py b/src/DisplayState.py index 189f1e881..b8f237a3d 100644 --- a/src/DisplayState.py +++ b/src/DisplayState.py @@ -192,7 +192,7 @@ _RCT_BTM = '' import RecentFiles import os -class RecentDocsMenu: +class RecentDocsMenu(object): def __init__(self, uistate, state, fileopen): self.action_group = gtk.ActionGroup('RecentFiles') self.active = DISABLED diff --git a/src/Editors/ObjectEntries.py b/src/Editors/ObjectEntries.py index ebb14b129..245131da7 100644 --- a/src/Editors/ObjectEntries.py +++ b/src/Editors/ObjectEntries.py @@ -53,7 +53,7 @@ from DdTargets import DdTargets from Errors import WindowActiveError from Selectors import selector_factory -class ObjEntry: +class ObjEntry(object): """ Handles the selection of a existing or new Object. Supports Drag and Drop to select the object. diff --git a/src/Editors/_EditEvent.py b/src/Editors/_EditEvent.py index b2a992e1c..002ae4d4f 100644 --- a/src/Editors/_EditEvent.py +++ b/src/Editors/_EditEvent.py @@ -292,7 +292,7 @@ class EditFamilyEvent(EditEvent): # Delete Query class # #------------------------------------------------------------------------- -class DelEventQuery: +class DelEventQuery(object): def __init__(self, dbstate, uistate, event, person_list, family_list): self.event = event self.db = dbstate.db diff --git a/src/Editors/_EditFamily.py b/src/Editors/_EditFamily.py index e8c859d63..3accdc40f 100644 --- a/src/Editors/_EditFamily.py +++ b/src/Editors/_EditFamily.py @@ -380,7 +380,7 @@ class ChildEmbedList(EmbeddedList): else: return ("", "") -class FastMaleFilter: +class FastMaleFilter(object): def __init__(self, db): self.db = db @@ -389,7 +389,7 @@ class FastMaleFilter: value = self.db.get_raw_person_data(handle) return value[2] == gen.lib.Person.MALE -class FastFemaleFilter: +class FastFemaleFilter(object): def __init__(self, db): self.db = db diff --git a/src/Editors/_EditMedia.py b/src/Editors/_EditMedia.py index 81bfa07be..d09b12b4f 100644 --- a/src/Editors/_EditMedia.py +++ b/src/Editors/_EditMedia.py @@ -301,7 +301,7 @@ class EditMedia(EditPrimary): return cmp(cmp_obj.serialize(True)[1:], self.obj.serialize()[1:]) != 0 -class DeleteMediaQuery: +class DeleteMediaQuery(object): def __init__(self, dbstate, uistate, media_handle, the_lists): self.db = dbstate.db diff --git a/src/Editors/_EditNote.py b/src/Editors/_EditNote.py index 0ed088ce4..70b20d7ae 100644 --- a/src/Editors/_EditNote.py +++ b/src/Editors/_EditNote.py @@ -315,7 +315,7 @@ class EditNote(EditPrimary): self.callback(self.obj.get_handle()) self.close() -class DeleteNoteQuery: +class DeleteNoteQuery(object): def __init__(self, dbstate, uistate, note, the_lists): self.note = note self.db = dbstate.db diff --git a/src/Editors/_EditPlace.py b/src/Editors/_EditPlace.py index 12744cf1a..e490f347a 100644 --- a/src/Editors/_EditPlace.py +++ b/src/Editors/_EditPlace.py @@ -301,7 +301,7 @@ class EditPlace(EditPrimary): # DeletePlaceQuery # #------------------------------------------------------------------------- -class DeletePlaceQuery: +class DeletePlaceQuery(object): def __init__(self, dbstate, uistate, place, person_list, family_list, event_list): diff --git a/src/Editors/_EditRepository.py b/src/Editors/_EditRepository.py index adb203335..a0c0ed2a6 100644 --- a/src/Editors/_EditRepository.py +++ b/src/Editors/_EditRepository.py @@ -176,7 +176,7 @@ class EditRepository(EditPrimary): def _cleanup_on_exit(self): self.backref_tab.close() -class DelRepositoryQuery: +class DelRepositoryQuery(object): def __init__(self, dbstate, uistate, repository, sources): self.obj = repository self.db = dbstate.db diff --git a/src/Editors/_EditSource.py b/src/Editors/_EditSource.py index 8472b60f3..3b4bd22c5 100644 --- a/src/Editors/_EditSource.py +++ b/src/Editors/_EditSource.py @@ -193,7 +193,7 @@ class EditSource(EditPrimary): def _cleanup_on_exit(self): self.backref_tab.close() -class DelSrcQuery: +class DelSrcQuery(object): def __init__(self, dbstate, uistate, source, the_lists): self.source = source self.db = dbstate.db diff --git a/src/ExportOptions.py b/src/ExportOptions.py index 1839f7786..185b5ae1d 100644 --- a/src/ExportOptions.py +++ b/src/ExportOptions.py @@ -46,7 +46,7 @@ from Filters import GenericFilter, Rules # WriterOptionBox # #------------------------------------------------------------------------- -class WriterOptionBox: +class WriterOptionBox(object): """ Create a VBox with the option widgets and define methods to retrieve the options. diff --git a/src/Filters/Rules/_Rule.py b/src/Filters/Rules/_Rule.py index f8307d9ea..9f0c0be3a 100644 --- a/src/Filters/Rules/_Rule.py +++ b/src/Filters/Rules/_Rule.py @@ -32,7 +32,7 @@ from gettext import gettext as _ # Rule # #------------------------------------------------------------------------- -class Rule: +class Rule(object): """Base rule class.""" labels = [] diff --git a/src/Filters/SideBar/_SidebarFilter.py b/src/Filters/SideBar/_SidebarFilter.py index 01831191a..1fac5cea7 100644 --- a/src/Filters/SideBar/_SidebarFilter.py +++ b/src/Filters/SideBar/_SidebarFilter.py @@ -30,7 +30,7 @@ import Config _RETURN = gtk.gdk.keyval_from_name("Return") _KP_ENTER = gtk.gdk.keyval_from_name("KP_Enter") -class SidebarFilter: +class SidebarFilter(object): _FILTER_WIDTH = 200 _FILTER_ELLIPSIZE = pango.ELLIPSIZE_END diff --git a/src/Filters/_FilterList.py b/src/Filters/_FilterList.py index 0ef228f13..73cb81ebd 100644 --- a/src/Filters/_FilterList.py +++ b/src/Filters/_FilterList.py @@ -40,7 +40,7 @@ from Filters._FilterParser import FilterParser # FilterList # #------------------------------------------------------------------------- -class FilterList: +class FilterList(object): """ Container class for managing the generic filters. It stores, saves, and loads the filters. diff --git a/src/Filters/_GenericFilter.py b/src/Filters/_GenericFilter.py index bd6ec7dc1..f993e3feb 100644 --- a/src/Filters/_GenericFilter.py +++ b/src/Filters/_GenericFilter.py @@ -30,7 +30,7 @@ import gen.lib # GenericFilter # #------------------------------------------------------------------------- -class GenericFilter: +class GenericFilter(object): """Filter class that consists of several rules.""" logical_functions = ['or', 'and', 'xor', 'one'] diff --git a/src/Filters/_SearchBar.py b/src/Filters/_SearchBar.py index 6c7497710..fe7f997a6 100644 --- a/src/Filters/_SearchBar.py +++ b/src/Filters/_SearchBar.py @@ -41,7 +41,7 @@ _KP_ENTER = gtk.gdk.keyval_from_name("KP_Enter") # SearchBar # #------------------------------------------------------------------------- -class SearchBar: +class SearchBar(object): def __init__( self, dbstate, uistate, on_apply, apply_done = None): self.on_apply_callback = on_apply self.apply_done_callback = apply_done diff --git a/src/Filters/_SearchFilter.py b/src/Filters/_SearchFilter.py index ce64ad056..dfe7a65b6 100644 --- a/src/Filters/_SearchFilter.py +++ b/src/Filters/_SearchFilter.py @@ -24,7 +24,7 @@ Package providing filtering framework for GRAMPS. """ -class SearchFilter: +class SearchFilter(object): def __init__(self, func, text, invert): self.func = func self.text = text.upper() diff --git a/src/GrampsCfg.py b/src/GrampsCfg.py index 970c57de4..441851b18 100644 --- a/src/GrampsCfg.py +++ b/src/GrampsCfg.py @@ -1097,7 +1097,7 @@ class GrampsPreferences(ManagedWindow.ManagedWindow): button.show() return button -class NameFormatEditDlg: +class NameFormatEditDlg(object): """ """ diff --git a/src/GrampsDbUtils/_GedcomChar.py b/src/GrampsDbUtils/_GedcomChar.py index a30682aa5..7efc8abc8 100644 --- a/src/GrampsDbUtils/_GedcomChar.py +++ b/src/GrampsDbUtils/_GedcomChar.py @@ -21,7 +21,7 @@ from ansel_utf8 import ansel_to_utf8 import codecs -class BaseReader: +class BaseReader(object): def __init__(self, ifile, encoding): self.ifile = ifile self.enc = encoding diff --git a/src/GrampsDbUtils/_GedcomInfo.py b/src/GrampsDbUtils/_GedcomInfo.py index c558716aa..cee591ef2 100644 --- a/src/GrampsDbUtils/_GedcomInfo.py +++ b/src/GrampsDbUtils/_GedcomInfo.py @@ -156,7 +156,7 @@ lds_status = { #------------------------------------------------------------------------- from xml.parsers.expat import ParserCreate -class GedcomDescription: +class GedcomDescription(object): def __init__(self, name): self.name = name self.dest = "" @@ -246,7 +246,7 @@ class GedcomDescription: return self.tag2gramps_map[key] return key -class GedcomInfoDB: +class GedcomInfoDB(object): def __init__(self): self.map = {} @@ -288,7 +288,7 @@ class GedcomInfoDB: # # #------------------------------------------------------------------------- -class GedInfoParser: +class GedInfoParser(object): def __init__(self,parent): self.parent = parent self.current = None diff --git a/src/GrampsDbUtils/_GedcomLex.py b/src/GrampsDbUtils/_GedcomLex.py index 70895d4bc..1fe2e97d3 100644 --- a/src/GrampsDbUtils/_GedcomLex.py +++ b/src/GrampsDbUtils/_GedcomLex.py @@ -116,7 +116,7 @@ class GedcomDateParser(DateParser): # GedLine - represents a tokenized version of a GEDCOM line # #----------------------------------------------------------------------- -class GedLine: +class GedLine(object): """ GedLine is a class the represents a GEDCOM line. The form of a GEDCOM line is: @@ -325,7 +325,7 @@ def extract_date(text): # Reader - serves as the lexical analysis engine # #------------------------------------------------------------------------- -class Reader: +class Reader(object): def __init__(self, ifile): self.ifile = ifile diff --git a/src/GrampsDbUtils/_GedcomStageOne.py b/src/GrampsDbUtils/_GedcomStageOne.py index 2f0ad38bf..e0160cc92 100644 --- a/src/GrampsDbUtils/_GedcomStageOne.py +++ b/src/GrampsDbUtils/_GedcomStageOne.py @@ -89,7 +89,7 @@ def add_to_list(table, key, value): # StageOne # #------------------------------------------------------------------------- -class StageOne: +class StageOne(object): """ The StageOne parser scans the file quickly, looking for a few things. This includes: diff --git a/src/GrampsDbUtils/_GedcomUtils.py b/src/GrampsDbUtils/_GedcomUtils.py index a82e06626..dcc90578a 100644 --- a/src/GrampsDbUtils/_GedcomUtils.py +++ b/src/GrampsDbUtils/_GedcomUtils.py @@ -33,7 +33,7 @@ SURNAME_RE = re.compile(r"/([^/]*)/([^/]*)") # CurrentState # #------------------------------------------------------------------------- -class CurrentState: +class CurrentState(object): """ Keep track of the current state variables. """ @@ -65,7 +65,7 @@ class CurrentState: # PlaceParser # #------------------------------------------------------------------------- -class PlaceParser: +class PlaceParser(object): """ Provide the ability to parse GEDCOM FORM statements for places, and the parse the line of text, mapping the text components to Location @@ -128,7 +128,7 @@ class PlaceParser: # IdFinder # #------------------------------------------------------------------------- -class IdFinder: +class IdFinder(object): """ Provide method of finding the next available ID. """ @@ -161,7 +161,7 @@ class IdFinder: # IdMapper # #------------------------------------------------------------------------- -class IdMapper: +class IdMapper(object): def __init__(self, trans, find_next, translate): if translate: diff --git a/src/GrampsDbUtils/test/GR_test.py b/src/GrampsDbUtils/test/GR_test.py index 86d65e9c0..3a14981af 100644 --- a/src/GrampsDbUtils/test/GR_test.py +++ b/src/GrampsDbUtils/test/GR_test.py @@ -46,7 +46,7 @@ from test import gedread_util as gr # # ? candidate for inclusion in gedread_util.py # -class nc(): +class nc(object): """nc object -- creates a numcheck function instantiate a nc object as follows @@ -72,7 +72,7 @@ class nc(): dbcall = getattr(db,self.getname) self.dbncheck(dbcall) -class fnci(): +class fnci(object): """fnci (frag-numcheckset item) is a data container for: a fragment of gedcom a sequence of nc items to check diff --git a/src/GrampsLogger/_ErrorReportAssistant.py b/src/GrampsLogger/_ErrorReportAssistant.py index dd908c2d2..df1b90797 100644 --- a/src/GrampsLogger/_ErrorReportAssistant.py +++ b/src/GrampsLogger/_ErrorReportAssistant.py @@ -6,7 +6,7 @@ import sys, os,bsddb -class ErrorReportAssistant: +class ErrorReportAssistant(object): def __init__(self,error_detail,rotate_handler): self._error_detail = error_detail diff --git a/src/LdsUtils.py b/src/LdsUtils.py index 6aa1a9a11..44ec47d2a 100644 --- a/src/LdsUtils.py +++ b/src/LdsUtils.py @@ -33,7 +33,7 @@ from gettext import gettext as _ LOG = logging.getLogger(".") -class LdsTemples: +class LdsTemples(object): """ Parsing class for the LDS temples file """ diff --git a/src/ListModel.py b/src/ListModel.py index c69d9dbd6..ba6580971 100644 --- a/src/ListModel.py +++ b/src/ListModel.py @@ -49,7 +49,7 @@ NOSORT = -1 # ListModel # #------------------------------------------------------------------------- -class ListModel: +class ListModel(object): """ Simple model for lists in smaller dialogs (not DataViews). """ diff --git a/src/Lru.py b/src/Lru.py index 45a79b1ff..64858dc9e 100644 --- a/src/Lru.py +++ b/src/Lru.py @@ -21,7 +21,7 @@ Least recently used algorithm """ -class Node: +class Node(object): """ Node to be stored in the LRU structure """ @@ -30,7 +30,7 @@ class Node: self.value = value self.next = None -class LRU: +class LRU(object): """ Implementation of a length-limited O(1) LRU cache """ diff --git a/src/ManagedWindow.py b/src/ManagedWindow.py index c36b7f68d..a798b153b 100644 --- a/src/ManagedWindow.py +++ b/src/ManagedWindow.py @@ -60,7 +60,7 @@ _win_top = '' _win_btm = '' DISABLED = -1 -class GrampsWindowManager: +class GrampsWindowManager(object): """ Manage hierarchy of open GRAMPS windows. @@ -285,7 +285,7 @@ class GrampsWindowManager: # Gramps Managed Window class # #------------------------------------------------------------------------- -class ManagedWindow: +class ManagedWindow(object): """ Managed window base class. diff --git a/src/Merge/_MergePerson.py b/src/Merge/_MergePerson.py index 51b9f458b..242048f1f 100644 --- a/src/Merge/_MergePerson.py +++ b/src/Merge/_MergePerson.py @@ -340,7 +340,7 @@ def name_of(p): # Merge People # #------------------------------------------------------------------------- -class MergePeople: +class MergePeople(object): def __init__(self, db, person1, person2): self.db = db diff --git a/src/Navigation.py b/src/Navigation.py index f7380d1cc..607e506ea 100644 --- a/src/Navigation.py +++ b/src/Navigation.py @@ -55,7 +55,7 @@ _btm = [ ] -class BaseNavigation: +class BaseNavigation(object): """ Base history navigation class. Builds the action group and ui for the uimanager. Changes to the associated history objects are tracked. When diff --git a/src/PageView.py b/src/PageView.py index e6c8ef67b..cd48df69b 100644 --- a/src/PageView.py +++ b/src/PageView.py @@ -64,7 +64,7 @@ NAVIGATION_PERSON = 0 # PageView # #------------------------------------------------------------------------------ -class PageView: +class PageView(object): """ The PageView class is the base class for all Data Views in GRAMPS. All Views should derive from this class. The ViewManager understands the public diff --git a/src/PluginUtils/_GuiOptions.py b/src/PluginUtils/_GuiOptions.py index 63b4d1796..e6ff8a6b2 100644 --- a/src/PluginUtils/_GuiOptions.py +++ b/src/PluginUtils/_GuiOptions.py @@ -1331,7 +1331,7 @@ class GuiStyleOption(GuiEnumeratedListOption): # GuiMenuOptions class # #------------------------------------------------------------------------ -class GuiMenuOptions: +class GuiMenuOptions(object): """ Introduction ============ diff --git a/src/PluginUtils/_Options.py b/src/PluginUtils/_Options.py index dffaefdb1..6b1786530 100644 --- a/src/PluginUtils/_Options.py +++ b/src/PluginUtils/_Options.py @@ -56,7 +56,7 @@ import Utils # List of options for a single module # #------------------------------------------------------------------------- -class OptionList: +class OptionList(object): """ Implements a set of options to parse and store for a given module. """ @@ -114,7 +114,7 @@ class OptionList: # Collection of option lists # #------------------------------------------------------------------------- -class OptionListCollection: +class OptionListCollection(object): """ Implements a collection of option lists. """ @@ -288,7 +288,7 @@ class OptionParser(handler.ContentHandler): # Class handling options for plugins # #------------------------------------------------------------------------- -class OptionHandler: +class OptionHandler(object): """ Implements handling of the options for the plugins. """ @@ -394,7 +394,7 @@ class OptionHandler: # Base Options class # #------------------------------------------------------------------------ -class Options: +class Options(object): """ Defines options and provides handling interface. diff --git a/src/PluginUtils/_Tool.py b/src/PluginUtils/_Tool.py index 386ba139f..639bcc96c 100644 --- a/src/PluginUtils/_Tool.py +++ b/src/PluginUtils/_Tool.py @@ -71,7 +71,7 @@ tool_categories = { # Tool # #------------------------------------------------------------------------- -class Tool: +class Tool(object): """ The Tool base class. This is a base class for generating customized tools. It cannot be used as is, but it can be easily @@ -82,12 +82,13 @@ class Tool: from PluginUtils import MenuToolOptions self.db = dbstate.db self.person = dbstate.active - if issubclass(options_class, MenuToolOptions): - # FIXME: pass in person_id - self.options = options_class(name, None, dbstate) - elif isinstance(options_class, ClassType): - self.options = options_class(name) - elif isinstance(options_class, InstanceType): + try: + if issubclass(options_class, MenuToolOptions): + # FIXME: pass in person_id + self.options = options_class(name, None, dbstate) + else: # must be some kind of class or we get a TypeError + self.options = options_class(name) + except TypeError: self.options = options_class self.options.load_previous_values() @@ -147,7 +148,7 @@ class ActivePersonTool(Tool): # Command-line tool # #------------------------------------------------------------------------ -class CommandLineTool: +class CommandLineTool(object): """ Provide a way to run tool from the command line. diff --git a/src/QuestionDialog.py b/src/QuestionDialog.py index 8825a6d10..bdd2e7852 100644 --- a/src/QuestionDialog.py +++ b/src/QuestionDialog.py @@ -49,7 +49,7 @@ try: except: ICON = None -class SaveDialog: +class SaveDialog(object): def __init__(self,msg1,msg2,task1,task2,parent=None): self.xml = glade.XML(const.GLADE_FILE,"savedialog","gramps") self.top = self.xml.get_widget('savedialog') @@ -79,7 +79,7 @@ class SaveDialog: Config.set(Config.DONT_ASK,self.dontask.get_active()) self.top.destroy() -class QuestionDialog: +class QuestionDialog(object): def __init__(self,msg1,msg2,label,task,parent=None): self.xml = glade.XML(const.GLADE_FILE,"questiondialog","gramps") self.top = self.xml.get_widget('questiondialog') @@ -104,7 +104,7 @@ class QuestionDialog: if response == gtk.RESPONSE_ACCEPT: task() -class QuestionDialog2: +class QuestionDialog2(object): def __init__(self,msg1,msg2,label_msg1,label_msg2,parent=None): self.xml = glade.XML(const.GLADE_FILE,"questiondialog","gramps") self.top = self.xml.get_widget('questiondialog') @@ -133,7 +133,7 @@ class QuestionDialog2: self.top.destroy() return (response == gtk.RESPONSE_ACCEPT) -class OptionDialog: +class OptionDialog(object): def __init__(self,msg1,msg2,btnmsg1,task1,btnmsg2,task2,parent=None): self.xml = glade.XML(const.GLADE_FILE,"optiondialog","gramps") self.top = self.xml.get_widget('optiondialog') @@ -231,7 +231,7 @@ class OkDialog(gtk.MessageDialog): self.run() self.destroy() -class InfoDialog: +class InfoDialog(object): """ Dialog to show selectable info in a scrolled window """ @@ -260,7 +260,7 @@ class InfoDialog: def get_response(self): return self.response -class MissingMediaDialog: +class MissingMediaDialog(object): def __init__(self,msg1,msg2,task1,task2,task3,parent=None): self.xml = glade.XML(const.GLADE_FILE,"missmediadialog","gramps") self.top = self.xml.get_widget('missmediadialog') @@ -313,7 +313,7 @@ class MissingMediaDialog: self.top) return True -class MessageHideDialog: +class MessageHideDialog(object): def __init__(self, title, message, key, parent=None): diff --git a/src/RecentFiles.py b/src/RecentFiles.py index fdb3066fb..cbd7770d1 100644 --- a/src/RecentFiles.py +++ b/src/RecentFiles.py @@ -52,7 +52,7 @@ MAX_GRAMPS_ITEMS = 10 # RecentItem # #------------------------------------------------------------------------- -class RecentItem: +class RecentItem(object): """ Interface to a single GRAMPS recent-items item """ @@ -88,7 +88,7 @@ class RecentItem: # RecentFiles # #------------------------------------------------------------------------- -class RecentFiles: +class RecentFiles(object): """ Interface to a RecentFiles collection """ @@ -187,7 +187,7 @@ class RecentFiles: # RecentParser # #------------------------------------------------------------------------- -class RecentParser: +class RecentParser(object): """ Parsing class for the RecentFiles collection. """ diff --git a/src/Relationship.py b/src/Relationship.py index 3bec4ffd6..2ebb0ab4f 100644 --- a/src/Relationship.py +++ b/src/Relationship.py @@ -340,7 +340,7 @@ _nephews_nieces_level = [ "", #------------------------------------------------------------------------- -class RelationshipCalculator: +class RelationshipCalculator(object): REL_MOTHER = 'm' # going up to mother REL_FATHER = 'f' # going up to father diff --git a/src/ReportBase/_Bibliography.py b/src/ReportBase/_Bibliography.py index 8c7fc6e6a..058f8ce3f 100644 --- a/src/ReportBase/_Bibliography.py +++ b/src/ReportBase/_Bibliography.py @@ -26,7 +26,7 @@ import string import math from gen.lib import SourceRef as SourceRef -class Citation: +class Citation(object): """ Store information about a citation and all of its references. """ @@ -99,7 +99,7 @@ class Citation: self.__ref_list.append((key, source_ref)) return key -class Bibliography: +class Bibliography(object): """ Store and organize multiple citations into a bibliography. """ diff --git a/src/ReportBase/_CommandLineReport.py b/src/ReportBase/_CommandLineReport.py index 8afc4920c..d6b78a0da 100644 --- a/src/ReportBase/_CommandLineReport.py +++ b/src/ReportBase/_CommandLineReport.py @@ -101,7 +101,7 @@ def _validate_options(options, dbase): # Command-line report # #------------------------------------------------------------------------ -class CommandLineReport: +class CommandLineReport(object): """ Provide a way to generate report from the command line. """ diff --git a/src/ReportBase/_GraphvizReportDialog.py b/src/ReportBase/_GraphvizReportDialog.py index 838469e26..93e33427a 100644 --- a/src/ReportBase/_GraphvizReportDialog.py +++ b/src/ReportBase/_GraphvizReportDialog.py @@ -926,11 +926,13 @@ class GraphvizReportDialog(ReportDialog): name, translated_name) def init_options(self, option_class): - if isinstance(option_class, ClassType): - self.options = option_class(self.raw_name, + try: + if (issubclass(option_class, object) or # New-style class + isinstance(options_class, ClassType)): # Old-style class + self.options = option_class(self.raw_name, self.dbstate.get_database()) - elif isinstance(option_class, InstanceType): - self.options = option_class + except TypeError: + self.options = option_class ################################ category = _("GraphViz Layout") diff --git a/src/ReportBase/_Report.py b/src/ReportBase/_Report.py index 0e4a28639..b1bbe5d87 100644 --- a/src/ReportBase/_Report.py +++ b/src/ReportBase/_Report.py @@ -27,7 +27,7 @@ # Report # #------------------------------------------------------------------------- -class Report: +class Report(object): """ 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/src/ReportBase/_ReportDialog.py b/src/ReportBase/_ReportDialog.py index b9dd3e563..bd1d28471 100644 --- a/src/ReportBase/_ReportDialog.py +++ b/src/ReportBase/_ReportDialog.py @@ -96,9 +96,11 @@ class ReportDialog(ManagedWindow.ManagedWindow): self.init_interface() def init_options(self, option_class): - if isinstance(option_class, ClassType): - self.options = option_class(self.raw_name, self.db) - elif isinstance(option_class, InstanceType): + try: + if (issubclass(option_class, object) or # New-style class + isinstance(options_class, ClassType)): # Old-style class + self.options = option_class(self.raw_name, self.db) + except TypeError: self.options = option_class self.options.load_previous_values() diff --git a/src/ReportBase/_ReportOptions.py b/src/ReportBase/_ReportOptions.py index 39ea24785..97006eaa8 100644 --- a/src/ReportBase/_ReportOptions.py +++ b/src/ReportBase/_ReportOptions.py @@ -542,7 +542,7 @@ class OptionParser(_Options.OptionParser): # we don't have to handle them for reports that don't use documents (web) # #------------------------------------------------------------------------ -class EmptyDoc: +class EmptyDoc(object): def init(self): pass diff --git a/src/ReportBase/_StyleEditor.py b/src/ReportBase/_StyleEditor.py index 8c4e05754..a8f1acac7 100644 --- a/src/ReportBase/_StyleEditor.py +++ b/src/ReportBase/_StyleEditor.py @@ -60,7 +60,7 @@ import ManagedWindow # StyleList class # #------------------------------------------------------------------------ -class StyleListDisplay: +class StyleListDisplay(object): """ Shows the available paragraph/font styles. Allows the user to select, add, edit, and delete styles from a StyleSheet. @@ -171,7 +171,7 @@ class StyleListDisplay: # StyleEditor class # #------------------------------------------------------------------------ -class StyleEditor: +class StyleEditor(object): """ Edits the current style definition. Presents a dialog allowing the values of the paragraphs in the style to be altered. diff --git a/src/ScratchPad.py b/src/ScratchPad.py index 6f93a8c7e..df7fb56fc 100644 --- a/src/ScratchPad.py +++ b/src/ScratchPad.py @@ -888,7 +888,7 @@ class ScratchPadListModel(gtk.ListStore): # ScratchPadListView class # Now shown as 'Clipboard' #------------------------------------------------------------------------- -class ScratchPadListView: +class ScratchPadListView(object): LOCAL_DRAG_TARGET = ('MY_TREE_MODEL_ROW', gtk.TARGET_SAME_WIDGET, 0) LOCAL_DRAG_TYPE = 'MY_TREE_MODEL_ROW' diff --git a/src/Simple/_SimpleAccess.py b/src/Simple/_SimpleAccess.py index 3d8a43ed6..391c474d3 100644 --- a/src/Simple/_SimpleAccess.py +++ b/src/Simple/_SimpleAccess.py @@ -33,7 +33,7 @@ from ReportBase import ReportUtils from gen.lib import EventType import Config -class SimpleAccess: +class SimpleAccess(object): """ Provide a simplified database access system. This system has been designed to ease the development of reports. diff --git a/src/Simple/_SimpleDoc.py b/src/Simple/_SimpleDoc.py index 2688f19a5..acd9f950c 100644 --- a/src/Simple/_SimpleDoc.py +++ b/src/Simple/_SimpleDoc.py @@ -23,7 +23,7 @@ Provide a simplified database access interface to the GRAMPS database. """ import BaseDoc -class SimpleDoc: +class SimpleDoc(object): """ Provide a simplified database access interface to the GRAMPS database. """ diff --git a/src/Simple/_SimpleTable.py b/src/Simple/_SimpleTable.py index 2ca928784..f933d06a3 100644 --- a/src/Simple/_SimpleTable.py +++ b/src/Simple/_SimpleTable.py @@ -32,7 +32,7 @@ import Errors import Config import DateHandler -class SimpleTable: +class SimpleTable(object): """ Provide a simplified table creation interface. """ diff --git a/src/Sort.py b/src/Sort.py index 4667f9c26..35d7d65e4 100644 --- a/src/Sort.py +++ b/src/Sort.py @@ -49,7 +49,7 @@ from ReportBase import ReportUtils # #------------------------------------------------------------------------- -class Sort: +class Sort(object): def __init__(self, database): self.database = database diff --git a/src/Spell.py b/src/Spell.py index 374bfccc6..3f7323b78 100644 --- a/src/Spell.py +++ b/src/Spell.py @@ -168,7 +168,7 @@ LANGUAGES = { 'zu': _('Zulu'), } -class Spell: +class Spell(object): """Attach a gtkspell instance to the passed TextView instance. """ lang = locale.getlocale()[0] diff --git a/src/SubstKeywords.py b/src/SubstKeywords.py index b5e3ce7fa..993851398 100644 --- a/src/SubstKeywords.py +++ b/src/SubstKeywords.py @@ -48,7 +48,7 @@ import gen.lib # SubstKeywords # #------------------------------------------------------------------------ -class SubstKeywords: +class SubstKeywords(object): """ Produce an object that will substitute information about a person into a passed string. diff --git a/src/TipOfDay.py b/src/TipOfDay.py index 928561751..6b97464b0 100644 --- a/src/TipOfDay.py +++ b/src/TipOfDay.py @@ -124,7 +124,7 @@ class TipOfDay(ManagedWindow.ManagedWindow): # Tip parser class # #------------------------------------------------------------------------- -class TipParser: +class TipParser(object): """ Interface to the document template file """ diff --git a/src/ToolTips.py b/src/ToolTips.py index e1de0b7b3..8da804d68 100644 --- a/src/ToolTips.py +++ b/src/ToolTips.py @@ -85,7 +85,7 @@ def short(val,size=60): # #------------------------------------------------------------------------- -class TipFromFunction: +class TipFromFunction(object): """ TipFromFunction generates a tooltip callable. """ @@ -118,7 +118,7 @@ class TipFromFunction: # #------------------------------------------------------------------------- -class RepositoryTip: +class RepositoryTip(object): def __init__(self,db,repos): self._db = db self._obj = repos @@ -176,7 +176,7 @@ class RepositoryTip: __call__ = get_tip -class PersonTip: +class PersonTip(object): def __init__(self,db,repos): self._db = db self._obj = repos @@ -214,7 +214,7 @@ class PersonTip: __call__ = get_tip -class FamilyTip: +class FamilyTip(object): def __init__(self,db, obj): self._db = db self._obj = obj diff --git a/src/Utils.py b/src/Utils.py index f8f60cc79..8d32e0aae 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -994,7 +994,7 @@ def media_path_full(db, filename): return os.path.join(mpath, filename) -class ProgressMeter: +class ProgressMeter(object): """ Progress meter class for GRAMPS. diff --git a/src/ViewManager.py b/src/ViewManager.py index 022079fa3..ce7c221cc 100644 --- a/src/ViewManager.py +++ b/src/ViewManager.py @@ -183,7 +183,7 @@ WIKI_HELP_PAGE_MAN = '%s' % const.URL_MANUAL_PAGE # ViewManager # #------------------------------------------------------------------------- -class ViewManager: +class ViewManager(object): """ Overview ======== diff --git a/src/docgen/SpreadSheetDoc.py b/src/docgen/SpreadSheetDoc.py index 0b427c548..345640054 100644 --- a/src/docgen/SpreadSheetDoc.py +++ b/src/docgen/SpreadSheetDoc.py @@ -25,7 +25,7 @@ import BaseDoc # # #------------------------------------------------------------------------ -class SpreadSheetDoc: +class SpreadSheetDoc(object): def __init__(self,type, orientation=BaseDoc.PAPER_PORTRAIT): self.orientation = orientation if orientation == BaseDoc.PAPER_PORTRAIT: diff --git a/src/docgen/TabbedDoc.py b/src/docgen/TabbedDoc.py index 39e0797c5..6058092f9 100644 --- a/src/docgen/TabbedDoc.py +++ b/src/docgen/TabbedDoc.py @@ -23,7 +23,7 @@ # # #------------------------------------------------------------------------ -class TabbedDoc: +class TabbedDoc(object): def __init__(self, columns): self.columns = columns self.name = "" diff --git a/src/docgen/TextBufDoc.py b/src/docgen/TextBufDoc.py index 5d59b7335..61a666169 100644 --- a/src/docgen/TextBufDoc.py +++ b/src/docgen/TextBufDoc.py @@ -81,7 +81,7 @@ class DisplayBuf(ManagedWindow.ManagedWindow): def get_title(self): return self.title -class DocumentManager: +class DocumentManager(object): def __init__(self, title, document, text_view): self.title = title self.document = document diff --git a/src/gen/db/base.py b/src/gen/db/base.py index 1677737f4..f07e32237 100644 --- a/src/gen/db/base.py +++ b/src/gen/db/base.py @@ -94,7 +94,7 @@ KEY_TO_CLASS_MAP = {PERSON_KEY: Person.__name__, _SIGBASE = ('person', 'family', 'source', 'event', 'media', 'place', 'repository', 'reference', 'note') -class GrampsDbBookmarks: +class GrampsDbBookmarks(object): def __init__(self, default=[]): self.bookmarks = list(default) # want a copy (not an alias) @@ -2540,7 +2540,7 @@ class GrampsDbBase(Callback): """ return self._bm_changes > 0 -class Transaction: +class Transaction(object): """ Define a group of database commits that define a single logical operation. """ diff --git a/src/gen/db/cursor.py b/src/gen/db/cursor.py index e59887508..fb30836b3 100644 --- a/src/gen/db/cursor.py +++ b/src/gen/db/cursor.py @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -class GrampsCursor: +class GrampsCursor(object): """ Provide a basic iterator that allows the user to cycle through the elements in a particular map. diff --git a/src/gen/db/dbdir.py b/src/gen/db/dbdir.py index 13a1fda62..8ef321eff 100644 --- a/src/gen/db/dbdir.py +++ b/src/gen/db/dbdir.py @@ -1109,7 +1109,7 @@ class GrampsDBDir(GrampsDbBase, UpdateCallback): class_func = primary_tables[primary_table_name]['class_func'] while data: found_handle, val = data - obj = InstanceType(class_func) + obj = class_func() obj.unserialize(val) the_txn = self.env.txn_begin() @@ -1516,7 +1516,7 @@ class GrampsDBDir(GrampsDbBase, UpdateCallback): if data_map: _LOG.error("Failed to get from handle", exc_info=True) if data: - newobj = InstanceType(class_type) + newobj = class_type() newobj.unserialize(data) return newobj return None diff --git a/src/gen/lib/addressbase.py b/src/gen/lib/addressbase.py index b0296ea96..3d6476385 100644 --- a/src/gen/lib/addressbase.py +++ b/src/gen/lib/addressbase.py @@ -36,7 +36,7 @@ from gen.lib.address import Address # AddressBase classes # #------------------------------------------------------------------------- -class AddressBase: +class AddressBase(object): """ Base class for address-aware objects. """ diff --git a/src/gen/lib/attrbase.py b/src/gen/lib/attrbase.py index 69b9f5d88..4b006bb35 100644 --- a/src/gen/lib/attrbase.py +++ b/src/gen/lib/attrbase.py @@ -36,7 +36,7 @@ from gen.lib.attribute import Attribute # AttributeBase class # #------------------------------------------------------------------------- -class AttributeBase: +class AttributeBase(object): """ Base class for attribute-aware objects. """ diff --git a/src/gen/lib/baseobj.py b/src/gen/lib/baseobj.py index f605462ca..97d362de9 100644 --- a/src/gen/lib/baseobj.py +++ b/src/gen/lib/baseobj.py @@ -36,7 +36,7 @@ import re # Base Object # #------------------------------------------------------------------------- -class BaseObject: +class BaseObject(object): """ The BaseObject is the base class for all data objects in GRAMPS, whether primary or not. diff --git a/src/gen/lib/date.py b/src/gen/lib/date.py index 6f91ea07a..ea786335c 100644 --- a/src/gen/lib/date.py +++ b/src/gen/lib/date.py @@ -73,7 +73,7 @@ class DateError(Exception): def __str__(self): return self.value -class Span: +class Span(object): """ Span is used to represent the difference between two dates for three main purposes: sorting, ranking, and describing. @@ -578,7 +578,7 @@ class Span: # Date class # #------------------------------------------------------------------------- -class Date: +class Date(object): """ The core date handling class for GRAMPs. diff --git a/src/gen/lib/datebase.py b/src/gen/lib/datebase.py index d90e1b797..7ab00cc0a 100644 --- a/src/gen/lib/datebase.py +++ b/src/gen/lib/datebase.py @@ -36,7 +36,7 @@ from gen.lib.date import Date # Base classes # #------------------------------------------------------------------------- -class DateBase: +class DateBase(object): """ Base class for storing date information. """ diff --git a/src/gen/lib/genderstats.py b/src/gen/lib/genderstats.py index e1ac9b07f..573699c6d 100644 --- a/src/gen/lib/genderstats.py +++ b/src/gen/lib/genderstats.py @@ -36,7 +36,7 @@ from gen.lib.person import Person # # #------------------------------------------------------------------------- -class GenderStats: +class GenderStats(object): """ Class for keeping track of statistics related to Given Name vs. Gender. diff --git a/src/gen/lib/ldsordbase.py b/src/gen/lib/ldsordbase.py index 29599d54e..1b11bb271 100644 --- a/src/gen/lib/ldsordbase.py +++ b/src/gen/lib/ldsordbase.py @@ -36,7 +36,7 @@ from gen.lib.ldsord import LdsOrd # LdsOrdBase classes # #------------------------------------------------------------------------- -class LdsOrdBase: +class LdsOrdBase(object): """ Base class for lds_ord-aware objects. """ diff --git a/src/gen/lib/locationbase.py b/src/gen/lib/locationbase.py index a71f2046c..5f435c2e6 100644 --- a/src/gen/lib/locationbase.py +++ b/src/gen/lib/locationbase.py @@ -29,7 +29,7 @@ LocationBase class for GRAMPS. # LocationBase class # #------------------------------------------------------------------------- -class LocationBase: +class LocationBase(object): """ Base class for all things Address. """ diff --git a/src/gen/lib/mediabase.py b/src/gen/lib/mediabase.py index 192a7da1c..121a3e23e 100644 --- a/src/gen/lib/mediabase.py +++ b/src/gen/lib/mediabase.py @@ -36,7 +36,7 @@ from gen.lib.mediaref import MediaRef # MediaBase class # #------------------------------------------------------------------------- -class MediaBase: +class MediaBase(object): """ Base class for storing media references. """ diff --git a/src/gen/lib/notebase.py b/src/gen/lib/notebase.py index e10a04c2c..9d2560df8 100644 --- a/src/gen/lib/notebase.py +++ b/src/gen/lib/notebase.py @@ -29,7 +29,7 @@ NoteBase class for GRAMPS. # NoteBase class # #------------------------------------------------------------------------- -class NoteBase: +class NoteBase(object): """ Base class for storing notes. diff --git a/src/gen/lib/placebase.py b/src/gen/lib/placebase.py index 6a1374a6a..f89fb718c 100644 --- a/src/gen/lib/placebase.py +++ b/src/gen/lib/placebase.py @@ -29,7 +29,7 @@ PlaceBase class for GRAMPS. # PlaceBase class # #------------------------------------------------------------------------- -class PlaceBase: +class PlaceBase(object): """ Base class for place-aware objects. """ diff --git a/src/gen/lib/privacybase.py b/src/gen/lib/privacybase.py index b78531f13..9a82e12de 100644 --- a/src/gen/lib/privacybase.py +++ b/src/gen/lib/privacybase.py @@ -29,7 +29,7 @@ PrivacyBase Object class for GRAMPS. # PrivacyBase Object # #------------------------------------------------------------------------- -class PrivacyBase: +class PrivacyBase(object): """ Base class for privacy-aware objects. """ diff --git a/src/gen/lib/refbase.py b/src/gen/lib/refbase.py index 8f2567238..603007d4e 100644 --- a/src/gen/lib/refbase.py +++ b/src/gen/lib/refbase.py @@ -29,7 +29,7 @@ Base Reference class for GRAMPS. # RefBase class # #------------------------------------------------------------------------- -class RefBase: +class RefBase(object): """ Base reference class to manage references to other objects. diff --git a/src/gen/lib/srcbase.py b/src/gen/lib/srcbase.py index b8d7df2c4..bf925477f 100644 --- a/src/gen/lib/srcbase.py +++ b/src/gen/lib/srcbase.py @@ -36,7 +36,7 @@ from gen.lib.srcref import SourceRef # SourceBase classes # #------------------------------------------------------------------------- -class SourceBase: +class SourceBase(object): """ Base class for storing source references. """ diff --git a/src/gen/lib/srcnote.py b/src/gen/lib/srcnote.py index 36f2d3c7b..b39417295 100644 --- a/src/gen/lib/srcnote.py +++ b/src/gen/lib/srcnote.py @@ -29,7 +29,7 @@ SourceNote class for GRAMPS. # SourceNote classes # #------------------------------------------------------------------------- -class SourceNote: +class SourceNote(object): """This class is only present to enable db upgrade.""" def __init__(self): diff --git a/src/gen/lib/styledtexttag.py b/src/gen/lib/styledtexttag.py index 5ee4b6164..5a480da88 100644 --- a/src/gen/lib/styledtexttag.py +++ b/src/gen/lib/styledtexttag.py @@ -34,7 +34,7 @@ from gen.lib.styledtexttagtype import StyledTextTagType # StyledTextTag class # #------------------------------------------------------------------------- -class StyledTextTag(): +class StyledTextTag(object): """Hold formatting information for StyledText. StyledTextTag is a container class, it's attributes are directly accessed. diff --git a/src/gen/lib/urlbase.py b/src/gen/lib/urlbase.py index 01e232bc1..165bf14e2 100644 --- a/src/gen/lib/urlbase.py +++ b/src/gen/lib/urlbase.py @@ -36,7 +36,7 @@ from gen.lib.url import Url # UrlBase classes # #------------------------------------------------------------------------- -class UrlBase: +class UrlBase(object): """ Base class for url-aware objects. """ diff --git a/src/gen/lib/witness.py b/src/gen/lib/witness.py index a97a156e0..8c551ceab 100644 --- a/src/gen/lib/witness.py +++ b/src/gen/lib/witness.py @@ -29,7 +29,7 @@ Witness class for GRAMPS. # Witness class # #------------------------------------------------------------------------- -class Witness: +class Witness(object): """This class is only present to enable db upgrade.""" def __init__(self): pass diff --git a/src/gen/plug/_plugin.py b/src/gen/plug/_plugin.py index 718f58a21..6b8f323cf 100644 --- a/src/gen/plug/_plugin.py +++ b/src/gen/plug/_plugin.py @@ -23,7 +23,7 @@ This module provides the base class for plugins. """ -class Plugin: +class Plugin(object): """ This class serves as a base class for all plugins that can be registered with the plugin manager diff --git a/src/gen/plug/menu/_menu.py b/src/gen/plug/menu/_menu.py index a35c3f73d..dcb086062 100644 --- a/src/gen/plug/menu/_menu.py +++ b/src/gen/plug/menu/_menu.py @@ -29,7 +29,7 @@ Abstracted option handling. # Menu class # #------------------------------------------------------------------------- -class Menu: +class Menu(object): """ Introduction ============ diff --git a/src/gen/proxy/dbbase.py b/src/gen/proxy/dbbase.py index 863fc3ca6..ae10f8dbe 100644 --- a/src/gen/proxy/dbbase.py +++ b/src/gen/proxy/dbbase.py @@ -34,7 +34,7 @@ from gettext import gettext as _ #------------------------------------------------------------------------- from gen.lib import * -class DbBase: +class DbBase(object): """ DbBase is intended to be an abstract base class for building classes that implement the Gramps database. All functions raise a NotImplementedError to diff --git a/src/gramps_main.py b/src/gramps_main.py index 8cf659045..96ffd11bd 100644 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -196,7 +196,7 @@ def build_user_paths(): # Main Gramps class # #------------------------------------------------------------------------- -class Gramps: +class Gramps(object): """ Main class corresponding to a running gramps process. diff --git a/src/plugins/BookReport.py b/src/plugins/BookReport.py index f330cc542..b6e00a7ec 100644 --- a/src/plugins/BookReport.py +++ b/src/plugins/BookReport.py @@ -182,7 +182,7 @@ def _get_subject(options, dbase): # Book Item class # #------------------------------------------------------------------------ -class BookItem: +class BookItem(object): """ Interface into the book item -- a smallest element of the book. """ @@ -253,7 +253,7 @@ class BookItem: # Book class # #------------------------------------------------------------------------ -class Book: +class Book(object): """ Interface into the user-defined book -- a collection of book items. """ @@ -360,7 +360,7 @@ class Book: # BookList class # #------------------------------------------------------------------------ -class BookList: +class BookList(object): """ Interface into the user-defined list of books. @@ -553,7 +553,7 @@ class BookParser(handler.ContentHandler): # BookList Display class # #------------------------------------------------------------------------ -class BookListDisplay: +class BookListDisplay(object): """ Interface into a dialog with the list of available books. diff --git a/src/plugins/docgen/GtkPrint.py b/src/plugins/docgen/GtkPrint.py index bb0e76069..db9824cd3 100644 --- a/src/plugins/docgen/GtkPrint.py +++ b/src/plugins/docgen/GtkPrint.py @@ -171,7 +171,7 @@ def paperstyle_to_pagesetup(paper_style): # PrintPreview class # #------------------------------------------------------------------------ -class PrintPreview: +class PrintPreview(object): """Implement a dialog to show print preview. """ zoom_factors = { diff --git a/src/plugins/docgen/LaTeXDoc.py b/src/plugins/docgen/LaTeXDoc.py index c118d379b..bd2f3e9eb 100644 --- a/src/plugins/docgen/LaTeXDoc.py +++ b/src/plugins/docgen/LaTeXDoc.py @@ -112,7 +112,7 @@ def roman2arabic(strval): # Paragraph Handling # #------------------------------------------------------------------------ -class TexFont: +class TexFont(object): def __init__(self, style=None): if style: self.font_beg = style.font_beg diff --git a/src/plugins/drawreport/AncestorTree.py b/src/plugins/drawreport/AncestorTree.py index 2e4e9ac20..9bba5e47a 100644 --- a/src/plugins/drawreport/AncestorTree.py +++ b/src/plugins/drawreport/AncestorTree.py @@ -68,7 +68,7 @@ def log2(val): # Layout class # #------------------------------------------------------------------------ -class GenChart: +class GenChart(object): def __init__(self, generations): self.generations = generations diff --git a/src/plugins/drawreport/DescendTree.py b/src/plugins/drawreport/DescendTree.py index 3d4e76820..c6fbfff7f 100644 --- a/src/plugins/drawreport/DescendTree.py +++ b/src/plugins/drawreport/DescendTree.py @@ -66,7 +66,7 @@ _PERSON_SPOUSE = 2 # Layout class # #------------------------------------------------------------------------ -class GenChart: +class GenChart(object): def __init__(self, generations): self.generations = generations diff --git a/src/plugins/drawreport/StatisticsChart.py b/src/plugins/drawreport/StatisticsChart.py index 456126e73..cd16a1ba9 100644 --- a/src/plugins/drawreport/StatisticsChart.py +++ b/src/plugins/drawreport/StatisticsChart.py @@ -78,7 +78,7 @@ class _options: # Data extraction methods from the database # #------------------------------------------------------------------------ -class Extract: +class Extract(object): def __init__(self): """Methods for extracting statistical data from the database""" diff --git a/src/plugins/export/ExportCd.py b/src/plugins/export/ExportCd.py index 753f32cda..6e552151e 100644 --- a/src/plugins/export/ExportCd.py +++ b/src/plugins/export/ExportCd.py @@ -94,7 +94,7 @@ def writeData(database, filename, option_box=None, callback=None): # PackageWriter # #------------------------------------------------------------------------- -class PackageWriter: +class PackageWriter(object): def __init__(self, database, filename="", cl=0, callback=None): self.db = database diff --git a/src/plugins/export/ExportCsv.py b/src/plugins/export/ExportCsv.py index 0ae9f6b08..a679ba73b 100644 --- a/src/plugins/export/ExportCsv.py +++ b/src/plugins/export/ExportCsv.py @@ -91,7 +91,7 @@ def sortable_string_representation(text): # Encoding support for CSV, from http://docs.python.org/lib/csv-examples.html # #------------------------------------------------------------------------- -class UTF8Recoder: +class UTF8Recoder(object): """Iterator that reads an encoded stream and reencodes the input to UTF-8.""" def __init__(self, f, encoding): self.reader = codecs.getreader(encoding)(f) @@ -102,7 +102,7 @@ class UTF8Recoder: def next(self): return self.reader.next().encode("utf-8") -class UnicodeReader: +class UnicodeReader(object): """ A CSV reader which will iterate over lines in the CSV file "f", which is encoded in the given encoding. @@ -120,7 +120,7 @@ class UnicodeReader: def __iter__(self): return self -class UnicodeWriter: +class UnicodeWriter(object): """ A CSV writer which will write rows to CSV file "f", which is encoded in the given encoding. @@ -158,7 +158,7 @@ class UnicodeWriter: # CSVWriter Options # #------------------------------------------------------------------------- -class CSVWriterOptionBox: +class CSVWriterOptionBox(object): """ Create a VBox with the option widgets and define methods to retrieve the options. @@ -227,7 +227,7 @@ class CSVWriterOptionBox: # CSVWriter class # #------------------------------------------------------------------------- -class CSVWriter: +class CSVWriter(object): def __init__(self, database, filename, option_box=None, callback=None): self.db = database self.option_box = option_box diff --git a/src/plugins/export/ExportFtree.py b/src/plugins/export/ExportFtree.py index 96658887c..933b67467 100644 --- a/src/plugins/export/ExportFtree.py +++ b/src/plugins/export/ExportFtree.py @@ -66,7 +66,7 @@ def writeData(database, filename, option_box=None, callback=None): writer = FtreeWriter(database, filename, option_box, callback) return writer.export_data() -class FtreeWriterOptionBox: +class FtreeWriterOptionBox(object): """ Create a VBox with the option widgets and define methods to retrieve the options. @@ -130,7 +130,7 @@ class FtreeWriterOptionBox: # FtreeWriter # #------------------------------------------------------------------------- -class FtreeWriter: +class FtreeWriter(object): def __init__(self, database, filename="", option_box=None, callback = None): diff --git a/src/plugins/export/ExportGeneWeb.py b/src/plugins/export/ExportGeneWeb.py index 3914d3d67..b72e70d9d 100644 --- a/src/plugins/export/ExportGeneWeb.py +++ b/src/plugins/export/ExportGeneWeb.py @@ -64,7 +64,7 @@ from gen.plug import PluginManager, ExportPlugin # # #------------------------------------------------------------------------- -class GeneWebWriterOptionBox: +class GeneWebWriterOptionBox(object): """ Create a VBox with the option widgets and define methods to retrieve the options. @@ -152,7 +152,7 @@ class GeneWebWriterOptionBox: else: self.images_path = "" -class GeneWebWriter: +class GeneWebWriter(object): def __init__(self, database, filename="", option_box=None, callback=None): self.db = database diff --git a/src/plugins/export/ExportPkg.py b/src/plugins/export/ExportPkg.py index 053051db2..fb96584ff 100644 --- a/src/plugins/export/ExportPkg.py +++ b/src/plugins/export/ExportPkg.py @@ -102,7 +102,7 @@ def writeData(database, filename, option_box=None, callback=None): # PackageWriter # #------------------------------------------------------------------------- -class PackageWriter: +class PackageWriter(object): def __init__(self, database, filename, callback=None): self.db = database diff --git a/src/plugins/export/ExportSql.py b/src/plugins/export/ExportSql.py index d9cd14c03..8db37256f 100644 --- a/src/plugins/export/ExportSql.py +++ b/src/plugins/export/ExportSql.py @@ -242,7 +242,7 @@ def makeDB(db): value TEXT, private BOOLEAN);""") -class Database: +class Database(object): """ The db connection. """ diff --git a/src/plugins/export/ExportVCalendar.py b/src/plugins/export/ExportVCalendar.py index 4eb96b346..cad4619b4 100644 --- a/src/plugins/export/ExportVCalendar.py +++ b/src/plugins/export/ExportVCalendar.py @@ -66,7 +66,7 @@ from gen.plug import PluginManager, ExportPlugin # # #------------------------------------------------------------------------- -class CalendarWriterOptionBox: +class CalendarWriterOptionBox(object): """ Create a VBox with the option widgets and define methods to retrieve the options. @@ -127,7 +127,7 @@ class CalendarWriterOptionBox: self.cfilter = self.filter_menu.get_active().get_data("filter") -class CalendarWriter: +class CalendarWriter(object): def __init__(self, database, cl=0, filename="", option_box=None, callback=None): self.db = database diff --git a/src/plugins/export/ExportVCard.py b/src/plugins/export/ExportVCard.py index 0b7a4c537..8154de3f0 100644 --- a/src/plugins/export/ExportVCard.py +++ b/src/plugins/export/ExportVCard.py @@ -63,7 +63,7 @@ from gen.plug import PluginManager, ExportPlugin # # #------------------------------------------------------------------------- -class CardWriterOptionBox: +class CardWriterOptionBox(object): """ Create a VBox with the option widgets and define methods to retrieve the options. @@ -123,7 +123,7 @@ class CardWriterOptionBox: def parse_options(self): self.cfilter = self.filter_menu.get_active().get_data("filter") -class CardWriter: +class CardWriter(object): def __init__(self, database, cl=0, filename="", option_box=None, callback=None): self.db = database diff --git a/src/plugins/import/ImportCsv.py b/src/plugins/import/ImportCsv.py index 511c5e6ce..539425f61 100644 --- a/src/plugins/import/ImportCsv.py +++ b/src/plugins/import/ImportCsv.py @@ -62,7 +62,7 @@ from Utils import create_id # Encoding support for CSV, from http://docs.python.org/lib/csv-examples.html # #------------------------------------------------------------------------- -class UTF8Recoder: +class UTF8Recoder(object): """ Iterator that reads an encoded stream and reencodes the input to UTF-8 """ @@ -75,7 +75,7 @@ class UTF8Recoder: def next(self): return self.reader.next().encode("utf-8") -class UnicodeReader: +class UnicodeReader(object): """ A CSV reader which will iterate over lines in the CSV file "f", which is encoded in the given encoding. @@ -92,7 +92,7 @@ class UnicodeReader: def __iter__(self): return self -class UnicodeWriter: +class UnicodeWriter(object): """ A CSV writer which will write rows to CSV file "f", which is encoded in the given encoding. @@ -302,7 +302,7 @@ def importData(db, filename, callback=None): # CSV Parser # #------------------------------------------------------------------------- -class CSVParser: +class CSVParser(object): def __init__(self, db, filename, callback): self.db = db self.filename = filename diff --git a/src/plugins/import/ImportGeneWeb.py b/src/plugins/import/ImportGeneWeb.py index 983dc5194..0f6a7bb11 100644 --- a/src/plugins/import/ImportGeneWeb.py +++ b/src/plugins/import/ImportGeneWeb.py @@ -95,7 +95,7 @@ def importData(database, filename, cb=None): # For a description of the file format see # http://cristal.inria.fr/~ddr/GeneWeb/en/gwformat.htm #------------------------------------------------------------------------- -class GeneWebParser: +class GeneWebParser(object): def __init__(self, dbase, file): self.db = dbase self.f = open(file,"rU") diff --git a/src/plugins/import/ImportProGen.py b/src/plugins/import/ImportProGen.py index e92d3cd4d..6ec20813b 100644 --- a/src/plugins/import/ImportProGen.py +++ b/src/plugins/import/ImportProGen.py @@ -473,7 +473,7 @@ class PG30_Def: return '\n\n'.join([self.tables[t].diag() for t in self.tables]) -class ProgenParser: +class ProgenParser(object): def __init__(self, dbase, file_): self.bname, ext = os.path.splitext(file_) if ext.lower() in ('.per', '.rel', '.mem'): diff --git a/src/plugins/import/ImportVCard.py b/src/plugins/import/ImportVCard.py index 9d9c00c23..fa1644630 100644 --- a/src/plugins/import/ImportVCard.py +++ b/src/plugins/import/ImportVCard.py @@ -76,7 +76,7 @@ def importData(database, filename, cb=None): # # #------------------------------------------------------------------------- -class VCardParser: +class VCardParser(object): def __init__(self, dbase, file): self.db = dbase self.f = open(file,"rU") diff --git a/src/plugins/import/ImportXml.py b/src/plugins/import/ImportXml.py index ccdb9a92c..769510d17 100644 --- a/src/plugins/import/ImportXml.py +++ b/src/plugins/import/ImportXml.py @@ -187,7 +187,7 @@ def fix_spaces(text_list): # #------------------------------------------------------------------------- -class ImportInfo: +class ImportInfo(object): """ Class object that can hold information about the import """ @@ -288,7 +288,7 @@ class ImportInfo: ) return txt -class LineParser: +class LineParser(object): def __init__(self, filename): self.count = 0 @@ -2382,7 +2382,7 @@ def build_place_title(loc): # VersionParser # #------------------------------------------------------------------------- -class VersionParser: +class VersionParser(object): """ Utility class to quickly get the versions from an XML file. """ diff --git a/src/plugins/lib/libholiday.py b/src/plugins/lib/libholiday.py index 53744b73b..acc9d3692 100644 --- a/src/plugins/lib/libholiday.py +++ b/src/plugins/lib/libholiday.py @@ -53,7 +53,7 @@ def g2iso(dow): # HolidayTable # #------------------------------------------------------------------------ -class HolidayTable: +class HolidayTable(object): """ HolidayTable is a class which provides holidays for various countries and years. diff --git a/src/plugins/lib/libmapservice.py b/src/plugins/lib/libmapservice.py index 774381aa2..2a74cc37c 100644 --- a/src/plugins/lib/libmapservice.py +++ b/src/plugins/lib/libmapservice.py @@ -38,7 +38,7 @@ from gen.plug import PluginManager, Plugin from PlaceUtils import conv_lat_lon import GrampsDisplay -class MapService(): +class MapService(object): """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/src/plugins/quickview/Query.py b/src/plugins/quickview/Query.py index 94518ae8f..a408768bb 100644 --- a/src/plugins/quickview/Query.py +++ b/src/plugins/quickview/Query.py @@ -183,7 +183,7 @@ def cleanup_column_name(column): return retval -class DBI: +class DBI(object): def __init__(self, database, document): self.database = database self.document = document diff --git a/src/plugins/quickview/all_relations.py b/src/plugins/quickview/all_relations.py index 082c5a147..c56191c5d 100644 --- a/src/plugins/quickview/all_relations.py +++ b/src/plugins/quickview/all_relations.py @@ -48,7 +48,7 @@ def run(database, document, person): report = AllRelReport(database, document, person) report.run() -class AllRelReport(): +class AllRelReport(object): """ Obtains all relationships, displays the relations, and in details, the relation path diff --git a/src/plugins/tool/Check.py b/src/plugins/tool/Check.py index dbb5b4dd6..b2fca5a56 100644 --- a/src/plugins/tool/Check.py +++ b/src/plugins/tool/Check.py @@ -209,7 +209,7 @@ class Check(Tool.BatchTool): # # #------------------------------------------------------------------------- -class CheckIntegrity: +class CheckIntegrity(object): def __init__(self, dbstate, uistate, trans): self.db = dbstate.db diff --git a/src/plugins/tool/EventCmp.py b/src/plugins/tool/EventCmp.py index 12f018a32..aa17cb446 100644 --- a/src/plugins/tool/EventCmp.py +++ b/src/plugins/tool/EventCmp.py @@ -73,7 +73,7 @@ WIKI_HELP_SEC = _('manual|Compare_Individual_Events...') # EventCmp # #------------------------------------------------------------------------ -class TableReport: +class TableReport(object): """ This class provides an interface for the spreadsheet table used to save the data into the file. diff --git a/src/plugins/tool/PHPGedViewConnector.py b/src/plugins/tool/PHPGedViewConnector.py index f66105539..143d52a7d 100644 --- a/src/plugins/tool/PHPGedViewConnector.py +++ b/src/plugins/tool/PHPGedViewConnector.py @@ -35,7 +35,7 @@ from gettext import gettext as _ # # See http://phpgedview.sourceforge.net/racp.php # -class PHPGedViewConnector: +class PHPGedViewConnector(object): TYPE_INDI = 1 TYPE_FAM = 2 @@ -273,7 +273,7 @@ class PHPGedViewConnector: # Wrapper that uses the PHPGedViewConnector to download # the GEDCOM file and import it into the database. # -class phpGedViewImporter: +class phpGedViewImporter(object): def __init__(self, database): self.db = database diff --git a/src/plugins/tool/Verify.py b/src/plugins/tool/Verify.py index 7060f59bd..776e85559 100644 --- a/src/plugins/tool/Verify.py +++ b/src/plugins/tool/Verify.py @@ -793,7 +793,7 @@ class VerifyOptions(Tool.ToolOptions): # Base classes for different tests -- the rules # #------------------------------------------------------------------------- -class Rule: +class Rule(object): """ Basic class for use in this tool. diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 1f6d071d5..900f40328 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -243,7 +243,7 @@ def name_to_md5(text): """This creates an MD5 hex string to be used as filename.""" return md5(text).hexdigest() -class BasePage: +class BasePage(object): """ This is the base class to write certain HTML pages. """ diff --git a/src/test/test_util.py b/src/test/test_util.py index b6451c968..bce00ec25 100644 --- a/src/test/test_util.py +++ b/src/test/test_util.py @@ -151,7 +151,7 @@ def delete_tree(dir): # NB: current code reflects limited expertise on the # uses of the logging module # --------------------------------------------------------- -class TestLogger(): +class TestLogger(object): """this class mainly just encapsulates some globals namely lfname, lfh for a file log name and handle diff --git a/src/widgets/buttons.py b/src/widgets/buttons.py index 800331e48..fa059ecd4 100644 --- a/src/widgets/buttons.py +++ b/src/widgets/buttons.py @@ -118,7 +118,7 @@ class SimpleButton(gtk.Button): # PrivacyButton class # #------------------------------------------------------------------------- -class PrivacyButton: +class PrivacyButton(object): def __init__(self, button, obj, readonly=False): self.button = button diff --git a/src/widgets/monitoredwidgets.py b/src/widgets/monitoredwidgets.py index 120733294..a8322f671 100644 --- a/src/widgets/monitoredwidgets.py +++ b/src/widgets/monitoredwidgets.py @@ -55,7 +55,7 @@ import DateEdit # MonitoredCheckbox class # #------------------------------------------------------------------------- -class MonitoredCheckbox: +class MonitoredCheckbox(object): def __init__(self, obj, button, set_val, get_val, on_toggle=None, readonly = False): self.button = button @@ -77,7 +77,7 @@ class MonitoredCheckbox: # MonitoredEntry class # #------------------------------------------------------------------------- -class MonitoredEntry: +class MonitoredEntry(object): def __init__(self, obj, set_val, get_val, read_only=False, autolist=None, changed=None): @@ -132,7 +132,7 @@ class MonitoredEntry: # MonitoredSpinButton class # #------------------------------------------------------------------------- -class MonitoredSpinButton: +class MonitoredSpinButton(object): """ Class for signal handling of spinbuttons. (Code is a modified copy of MonitoredEntry) @@ -253,7 +253,7 @@ class MonitoredSpinButton: # MonitoredText class # #------------------------------------------------------------------------- -class MonitoredText: +class MonitoredText(object): def __init__(self, obj, set_val, get_val, read_only=False): self.buf = obj.get_buffer() @@ -274,7 +274,7 @@ class MonitoredText: # MonitoredType class # #------------------------------------------------------------------------- -class MonitoredType: +class MonitoredType(object): def __init__(self, obj, set_val, get_val, mapping, custom, readonly=False, custom_values=None): @@ -313,7 +313,7 @@ class MonitoredType: # MonitoredDataType class # #------------------------------------------------------------------------- -class MonitoredDataType: +class MonitoredDataType(object): def __init__(self, obj, set_val, get_val, readonly=False, @@ -395,7 +395,7 @@ class MonitoredDataType: # MonitoredMenu class # #------------------------------------------------------------------------- -class MonitoredMenu: +class MonitoredMenu(object): def __init__(self, obj, set_val, get_val, mapping, readonly=False, changed=None): @@ -433,7 +433,7 @@ class MonitoredMenu: # MonitoredStrMenu class # #------------------------------------------------------------------------- -class MonitoredStrMenu: +class MonitoredStrMenu(object): def __init__(self, obj, set_val, get_val, mapping, readonly=False): self.set_val = set_val @@ -472,7 +472,7 @@ class MonitoredStrMenu: # MonitoredDate class # #------------------------------------------------------------------------- -class MonitoredDate: +class MonitoredDate(object): def __init__(self, field, button, value, uistate, track, readonly=False): self.date = value @@ -486,7 +486,7 @@ class MonitoredDate: # MonitoredComboSelectedEntry class # #------------------------------------------------------------------------- -class MonitoredComboSelectedEntry: +class MonitoredComboSelectedEntry(object): """ A MonitoredEntry driven by a Combobox to select what the entry field works upon diff --git a/src/widgets/styledtextbuffer.py b/src/widgets/styledtextbuffer.py index bf73b5a06..c857eca79 100644 --- a/src/widgets/styledtextbuffer.py +++ b/src/widgets/styledtextbuffer.py @@ -87,7 +87,7 @@ STYLE_TO_PROPERTY = { # GtkSpellState class # #------------------------------------------------------------------------- -class GtkSpellState: +class GtkSpellState(object): """A simple state machine kinda thingy. Trying to track gtk.Spell activities on a buffer and re-apply formatting diff --git a/src/widgets/validatedmaskedentry.py b/src/widgets/validatedmaskedentry.py index d0d6421cf..e81c9789b 100644 --- a/src/widgets/validatedmaskedentry.py +++ b/src/widgets/validatedmaskedentry.py @@ -1624,7 +1624,7 @@ class ValidatableMaskedEntry(MaskedEntry): self.queue_draw() fadeout.disconnect(c.signal_id) - class SignalContainer: + class SignalContainer(object): pass c = SignalContainer() c.signal_id = self._fade.connect('done', done, c)