From af3e34fef552dac09eaadb76134fa0972d954691 Mon Sep 17 00:00:00 2001
From: Paul Franklin <pf98052@gmail.com>
Date: Sun, 10 Mar 2013 21:52:07 +0000
Subject: [PATCH] sync a few files in gramps40 and trunk

svn: r21604
---
 gramps/gen/db/read.py              |  5 ++++-
 gramps/gen/plug/_pluginreg.py      | 10 ----------
 gramps/gui/views/tags.py           |  2 +-
 gramps/gui/widgets/grampletpane.py |  2 +-
 gramps/plugins/webreport/webcal.py |  4 ++--
 5 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/gramps/gen/db/read.py b/gramps/gen/db/read.py
index 21f3506d8..c96349d6f 100644
--- a/gramps/gen/db/read.py
+++ b/gramps/gen/db/read.py
@@ -760,7 +760,8 @@ class DbBsddbRead(DbReadBase, Callback):
         return self.get_from_handle(handle, Tag, self.tag_map)
 
     def __get_obj_from_gramps_id(self, val, tbl, class_, prim_tbl):
-        if isinstance(tbl, dict): return None ## trying to get object too early        
+        if isinstance(tbl, dict): 
+            return None ## trying to get object too early        
         if isinstance(val, UNITYPE):
             val = val.encode('utf-8')
         try:
@@ -1529,6 +1530,8 @@ class DbBsddbRead(DbReadBase, Callback):
         """
         Helper method for get_raw_<object>_data methods
         """
+        if table is None:
+            return None ## trying to get object too early
         if isinstance(handle, UNITYPE):
             handle = handle.encode('utf-8')
         try:
diff --git a/gramps/gen/plug/_pluginreg.py b/gramps/gen/plug/_pluginreg.py
index bb7d2fabb..9eb3bbe60 100644
--- a/gramps/gen/plug/_pluginreg.py
+++ b/gramps/gen/plug/_pluginreg.py
@@ -377,7 +377,6 @@ class PluginData(object):
         self._toolclass = None
         self._tool_modes = [TOOL_MODE_GUI]
         #DOCGEN attr
-        self._basedocclass = None
         self._paper = True
         self._style = True  
         self._extension = ''
@@ -679,14 +678,6 @@ class PluginData(object):
     tool_modes = property(_get_tool_modes, _set_tool_modes)
 
     #DOCGEN attributes
-    def _set_basedocclass(self, basedocclass):
-        if not self._ptype == DOCGEN:
-            raise ValueError('basedocclass may only be set for DOCGEN plugins')
-        self._basedocclass = basedocclass
-    
-    def _get_basedocclass(self):
-        return self._basedocclass
-    
     def _set_paper(self, paper):
         if not self._ptype == DOCGEN:
             raise ValueError('paper may only be set for DOCGEN plugins')
@@ -717,7 +708,6 @@ class PluginData(object):
     def _get_extension(self):
         return self._extension
     
-    basedocclass = property(_get_basedocclass, _set_basedocclass)
     paper = property(_get_paper, _set_paper)
     style = property(_get_style, _set_style)    
     extension = property(_get_extension, _set_extension)
diff --git a/gramps/gui/views/tags.py b/gramps/gui/views/tags.py
index 6b0fd1374..e59511403 100644
--- a/gramps/gui/views/tags.py
+++ b/gramps/gui/views/tags.py
@@ -266,7 +266,7 @@ class Tags(DbGUIElement):
         # Make the dialog modal so that the user can't start another
         # database transaction while the one setting tags is still running.
         pmon = progressdlg.ProgressMonitor(progressdlg.GtkProgressDialog, 
-                     ("", self.uistate.window, Gtk.DialogFlags.MODAL), popup_time=2)
+                ("", self.uistate.window, Gtk.DialogFlags.MODAL), popup_time=2)
         status = progressdlg.LongOpStatus(msg=_("Adding Tags"),
                                           total_steps=len(selected),
                                           interval=len(selected)//20)
diff --git a/gramps/gui/widgets/grampletpane.py b/gramps/gui/widgets/grampletpane.py
index b3dd10bcf..c10190387 100644
--- a/gramps/gui/widgets/grampletpane.py
+++ b/gramps/gui/widgets/grampletpane.py
@@ -1178,7 +1178,7 @@ class GrampletPane(Gtk.ScrolledWindow):
             return # something is the matter
         filename = self.configfile
         try:
-                fp = io.open(filename, "w", encoding='utf-8')
+            fp = io.open(filename, "w", encoding='utf-8')
         except IOError as err:
             LOG.warn("Failed to open %s because $s; gramplets not saved",
                      filename, str(err))
diff --git a/gramps/plugins/webreport/webcal.py b/gramps/plugins/webreport/webcal.py
index 1956bad4e..250604278 100644
--- a/gramps/plugins/webreport/webcal.py
+++ b/gramps/plugins/webreport/webcal.py
@@ -14,10 +14,10 @@
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful, calendar
+# This program is distributed in the hope that it will be useful, 
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.calendar
+# GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software