2006-07-04 Don Allingham <don@gramps-project.org>

* various: pyflakes fixes



svn: r6992
This commit is contained in:
Don Allingham 2006-07-04 23:38:51 +00:00
parent 05b0117c82
commit 051f992afb
38 changed files with 75 additions and 78 deletions

View File

@ -1,3 +1,6 @@
2006-07-04 Don Allingham <don@gramps-project.org>
* various: pyflakes fixes
2006-07-04 Alex Roitman <shura@gramps-project.org>
* src/GrampsWidgets.py (hand_cursor): Use HAND2 instead of HAND1.

View File

@ -57,8 +57,6 @@ log = logging.getLogger(".DateEdit")
#
#-------------------------------------------------------------------------
import gtk
import gtk.gdk
import gtk.glade
#-------------------------------------------------------------------------
#

View File

@ -28,13 +28,6 @@ localized tasks.
__author__ = "Donald N. Allingham"
__version__ = "$Revision$"
#-------------------------------------------------------------------------
#
# python modules
#
#-------------------------------------------------------------------------
from gettext import gettext as _
#-------------------------------------------------------------------------
#
# set up logging

View File

@ -20,6 +20,17 @@
# $Id$
#-------------------------------------------------------------------------
#
# python modules
#
#-------------------------------------------------------------------------
import os
#-------------------------------------------------------------------------
#
# Gramps modules
#
#-------------------------------------------------------------------------
import const
import RelLib

View File

@ -207,7 +207,6 @@ def importData(database, filename, callback=None, use_trans=False):
if not gramps and ansel:
import gtk
import gtk.glade
glade_file = "%s/gedcomimport.glade" % os.path.dirname(__file__)
top = gtk.glade.XML(glade_file,'encoding','gramps')

View File

@ -40,19 +40,12 @@ import re
import logging
log = logging.getLogger(".ReadXML")
#-------------------------------------------------------------------------
#
# GTK+ Modules
#
#-------------------------------------------------------------------------
import gtk
#-------------------------------------------------------------------------
#
# Gramps Modules
#
#-------------------------------------------------------------------------
from QuestionDialog import ErrorDialog, WarningDialog, MissingMediaDialog
from QuestionDialog import ErrorDialog
import Mime
import RelLib
import const
@ -1483,11 +1476,11 @@ class GrampsParser(UpdateCallback):
elif self.alt_name:
# former aka tag -- alternate name
if self.name.get_type() == "":
self.name.set_type(NameType.AKA)
self.name.set_type(RelLib.NameType.AKA)
self.person.add_alternate_name(self.name)
else:
if self.name.get_type() == "":
self.name.set_type(NameType.BIRTH)
self.name.set_type(RelLib.NameType.BIRTH)
self.person.set_primary_name (self.name)
self.name = None
@ -1774,8 +1767,7 @@ def build_place_title(loc):
if __name__ == "__main__":
import sys
import hotshot#, hotshot.stats
import const
from GrampsDb import gramps_db_factory, gramps_db_reader_factory
from GrampsDb import gramps_db_factory
def callback(val):
print val

View File

@ -45,7 +45,6 @@ log = logging.getLogger(".WriteGedcom")
#
#-------------------------------------------------------------------------
import gtk
import gtk.glade
#-------------------------------------------------------------------------
#

View File

@ -44,13 +44,6 @@ from gettext import gettext as _
import logging
log = logging.getLogger(".WriteXML")
#-------------------------------------------------------------------------
#
# load gtk libraries
#
#-------------------------------------------------------------------------
import gtk
#-------------------------------------------------------------------------
#
# load GRAMPS libraries

View File

@ -18,8 +18,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
from QuestionDialog import ErrorDialog
def help(target):
try:
import gnome

View File

@ -18,12 +18,21 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#-------------------------------------------------------------------------
#
# GTK
#
#-------------------------------------------------------------------------
import gtk
import gtk.gdk
import pango
import const
gtk26 = gtk.pygtk_version >= (2,6,0)
#-------------------------------------------------------------------------
#
# constants
#
#-------------------------------------------------------------------------
TEXT = 0
TOGGLE = 1
COMBO = 2
@ -31,6 +40,7 @@ IMAGE = 3
INTEGER = 4
NOSORT = -1
#-------------------------------------------------------------------------
#
# ListModel

View File

@ -33,7 +33,6 @@ from cStringIO import StringIO
#
#-------------------------------------------------------------------------
import gtk
import gtk.glade
#-------------------------------------------------------------------------
#

View File

@ -49,7 +49,6 @@ import DateHandler
import QuestionDialog
import GrampsDisplay
import ManagedWindow
import Utils
import GrampsDb
sex = ( _("female"), _("male"), _("unknown"))

View File

@ -31,7 +31,6 @@ General option handling, including saving and parsing.
#
#-------------------------------------------------------------------------
import os
from gettext import gettext as _
#-------------------------------------------------------------------------
#

View File

@ -44,7 +44,6 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
from ReportBase import MODE_GUI, MODE_CLI, MODE_BKI, book_categories
import Errors
#-------------------------------------------------------------------------
#

View File

@ -33,16 +33,13 @@ importers, exporters, and document generators.
# GTK libraries
#
#-------------------------------------------------------------------------
import gobject
import gtk
import gtk.glade
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
import traceback
import os
import sys
import re
@ -54,14 +51,12 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
import const
import Utils
import Config
import Errors
from ReportBase import report, standalone_categories
import _Tool
import _PluginMgr
import _PluginStatus
import GrampsDisplay
import ManagedWindow
#-------------------------------------------------------------------------
@ -111,7 +106,7 @@ class PluginDialog(ManagedWindow.ManagedWindow):
self.set_window(window, self.title, msg )
self.store = gtk.TreeStore(gobject.TYPE_STRING)
self.store = gtk.TreeStore(str)
self.selection = self.tree.get_selection()
self.selection.connect('changed', self.on_node_selected)
col = gtk.TreeViewColumn('',gtk.CellRendererText(),text=0)

View File

@ -33,7 +33,6 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
import gtk
import gtk.glade
from gtk.gdk import pixbuf_new_from_file
#-------------------------------------------------------------------------

View File

@ -26,6 +26,7 @@
#
#-------------------------------------------------------------------------
from types import ClassType, InstanceType
from gettext import gettext as _
#-------------------------------------------------------------------------
#
@ -41,6 +42,8 @@ import gtk
#-------------------------------------------------------------------------
import NameDisplay
import BaseDoc
import Utils
import ManagedWindow
from Filters import FilterComboBox,Rules
from _StyleComboBox import StyleComboBox

View File

@ -28,7 +28,6 @@
#
#-------------------------------------------------------------------------
import os
from gettext import gettext as _
#-------------------------------------------------------------------------
#

View File

@ -21,6 +21,19 @@
# $Id$
#-------------------------------------------------------------------------
#
# python
#
#-------------------------------------------------------------------------
from gettext import gettext as _
import gtk
#-------------------------------------------------------------------------
#
# Gramps modules
#
#-------------------------------------------------------------------------
import Utils
#-------------------------------------------------------------------------

View File

@ -26,7 +26,10 @@
#
#-------------------------------------------------------------------------
import os
from gettext import gettext as _
import logging
log = logging.getLogger(".")
#-------------------------------------------------------------------------
@ -43,6 +46,9 @@ import gtk
#-------------------------------------------------------------------------
import Config
import Errors
import Utils
import const
from QuestionDialog import ErrorDialog, OptionDialog
from _Constants import CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK, \

View File

@ -30,17 +30,17 @@ Report option handling, including saving and parsing.
# Standard Python modules
#
#-------------------------------------------------------------------------
from gettext import gettext as _
import os
#-------------------------------------------------------------------------
#
# SAX interface
#
#-------------------------------------------------------------------------
try:
from xml.sax import make_parser,handler,SAXParseException
from xml.sax import make_parser, SAXParseException
except:
from _xmlplus.sax import make_parser,handler,SAXParseException
from _xmlplus.sax import make_parser, SAXParseException
#-------------------------------------------------------------------------
#
@ -49,7 +49,6 @@ except:
#-------------------------------------------------------------------------
import const
import Config
import Utils
import BaseDoc
from PluginUtils import _Options

View File

@ -20,6 +20,8 @@
# $Id$
from gettext import gettext as _
import gtk
#-------------------------------------------------------------------------

View File

@ -36,7 +36,6 @@ from gettext import gettext as _
import logging
log = logging.getLogger(".")
#------------------------------------------------------------------------
#
# GNOME/GTK modules
@ -44,7 +43,6 @@ log = logging.getLogger(".")
#------------------------------------------------------------------------
import gtk
from gtk.gdk import Color
import gtk.glade
#------------------------------------------------------------------------
#

View File

@ -37,7 +37,6 @@ from time import strftime as strftime
#
#-------------------------------------------------------------------------
import gtk
import gtk.glade
from gtk.gdk import ACTION_COPY, BUTTON1_MASK
#-------------------------------------------------------------------------
@ -247,7 +246,7 @@ class ScratchPadEvent(ScratchPadWrapper):
# _("Name"),
# escape(short(psrc.get_title())))
return s
# return s
class ScratchPadFamilyEvent(ScratchPadGrampsTypeWrapper):

View File

@ -31,7 +31,6 @@ except:
#
#-------------------------------------------------------------------------
import gtk
import gtk.glade
import pango
#-------------------------------------------------------------------------

View File

@ -33,7 +33,6 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
import gtk
import gtk.glade
import pango
#-------------------------------------------------------------------------

View File

@ -33,7 +33,6 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
import gtk
import gtk.glade
#-------------------------------------------------------------------------
#
@ -65,6 +64,8 @@ def upgrade_prefs():
On failure, print message and return False.
"""
try:
import gconf
client = gconf.client_get_default()
client.add_dir("/apps/gramps",gconf.CLIENT_PRELOAD_NONE)

View File

@ -36,7 +36,6 @@ import os
#
#-------------------------------------------------------------------------
import gtk
import gtk.glade
#-------------------------------------------------------------------------
#

View File

@ -44,7 +44,6 @@ except:
#
#-------------------------------------------------------------------------
import gtk
import gtk.gdk
#-------------------------------------------------------------------------
#
@ -426,7 +425,6 @@ def set_title_label(xmlobj,t):
title_label.set_text('<span weight="bold" size="larger">%s</span>' % t)
title_label.set_use_markup(True)
from ManagedWindow import set_titles as _set_titles
from warnings import warn
def set_titles(window,title,t,msg=None):
warn('The Utils.set_titles is deprecated. Use ManagedWindow methods')

View File

@ -35,7 +35,6 @@ __revision__ = "$Revision$"
import os
from gettext import gettext as _
from bsddb import db
from cStringIO import StringIO
#-------------------------------------------------------------------------

View File

@ -30,7 +30,6 @@ Provides a BaseDoc based interface to the AbiWord document format.
#
#-------------------------------------------------------------------------
import base64
import os
from gettext import gettext as _
#-------------------------------------------------------------------------

View File

@ -25,7 +25,6 @@
# python modules
#
#------------------------------------------------------------------------
import os
from gettext import gettext as _
#------------------------------------------------------------------------

View File

@ -31,7 +31,7 @@ import zipfile
import time
import locale
from cStringIO import StringIO
from math import pi, cos, sin, fabs
from math import pi, cos, sin
#-------------------------------------------------------------------------
#

View File

@ -29,7 +29,7 @@ import os
import zipfile
import time
from cStringIO import StringIO
from math import pi, cos, sin, fabs
from math import pi, cos, sin
from gettext import gettext as _
from xml.sax.saxutils import escape

View File

@ -31,9 +31,11 @@ from gettext import gettext as _
#-------------------------------------------------------------------------
#Gramps modules
#-------------------------------------------------------------------------
from ReportBase import ReportUtils
from ReportBase import ReportUtils, Report
from PluginUtils import register_draw_doc
import BaseDoc
import Errors
from Utils import gformat
def lrgb(grp):

View File

@ -25,7 +25,6 @@
# python modules
#
#------------------------------------------------------------------------
import os
from gettext import gettext as _
#------------------------------------------------------------------------

View File

@ -25,7 +25,6 @@
# python modules
#
#-------------------------------------------------------------------------
from math import pi, cos, sin, fabs
from gettext import gettext as _
#-------------------------------------------------------------------------

View File

@ -341,9 +341,9 @@ class BasePage:
def show_link(self,of,lpath,title,path):
if path:
of.write(' <a href="%s/%s.%s">%s</a>\n' % (path,lpath,self.ext,title))
of.write('<a href="%s/%s.%s">%s</a>\n' % (path,lpath,self.ext,title))
else:
of.write(' <a href="%s.%s">%s</a>\n' % (lpath,self.ext,title))
of.write('<a href="%s.%s">%s</a>\n' % (lpath,self.ext,title))
def display_first_image_as_thumbnail( self, of, db, photolist=None):
@ -741,7 +741,7 @@ class PlacePage(BasePage):
self.display_first_image_as_thumbnail(of, db, media_list)
of.write('<div id="summaryarea">\n')
of.write('<h3>%s</h3>\n' % self.page_title)
of.write('<h3>%s</h3>\n' % self.page_title.strip())
of.write('<table class="infolist">\n')
if not self.noid:
@ -812,7 +812,7 @@ class MediaPage(BasePage):
get_researcher().get_name(),up=True)
of.write('<div id="summaryarea">\n')
of.write('<h3>%s</h3>\n' % self.page_title)
of.write('<h3>%s</h3>\n' % self.page_title.strip())
# gallery navigation
of.write('<div class="img_navbar">')
@ -1163,20 +1163,19 @@ class SourcePage(BasePage):
self.display_first_image_as_thumbnail(of, db, media_list)
of.write('<div id="summaryarea">\n')
of.write('<h3>%s</h3>\n' % self.page_title)
of.write('<table class="infolist">\n')
of.write('<h3>%s</h3>\n' % self.page_title.strip())
of.write('<table class="infolist">')
for (label,val) in [(_('GRAMPS ID'),source.gramps_id),
(_('Author'),source.author),
(_('Publication information'),source.pubinfo),
(_('Abbreviation'),source.abbrev)]:
if val:
of.write('<tr><td class="field">%s</td>\n' % label)
of.write('\n<tr><td class="field">%s</td>' % label)
of.write('<td class="data">%s</td>\n' % val)
of.write('</tr>\n')
of.write('</tr>')
of.write('</table>\n')
of.write('</div>\n')
of.write('</table></div>')
self.display_additional_images_as_gallery(of, db, media_list)
self.display_note_object(of, source.get_note_object())
@ -1585,7 +1584,7 @@ class IndividualPage(BasePage):
self.person.get_media_list())
of.write('<div id="summaryarea">\n')
of.write('<h3>%s</h3>\n' % self.sort_name)
of.write('<h3>%s</h3>\n' % self.sort_name.strip())
of.write('<table class="infolist">\n')