2008-02-18 Raphael Ackermann <raphael.ackermann@gmail.com>

* src/* 143 files
    * test/try_tree_model.py
    * windows/nsis/gcheck.py
    imports cleanup

svn: r10055
This commit is contained in:
Raphael Ackermann 2008-02-18 20:07:09 +00:00
parent d0cb3a8451
commit 90f883e46d
146 changed files with 385 additions and 443 deletions

View File

@ -1,3 +1,9 @@
2008-02-18 Raphael Ackermann <raphael.ackermann@gmail.com>
* src/* 143 files
* test/try_tree_model.py
* windows/nsis/gcheck.py
imports cleanup
2008-02-18 Frederik De Richter <frederik.de.richter@pandora.be>
* src/Editors/_EditEvent.py
link to wiki manual

View File

@ -42,7 +42,6 @@ import sys
import getopt
from gettext import gettext as _
import logging
import glob
#-------------------------------------------------------------------------
#

View File

@ -35,7 +35,8 @@ import logging
# GTK modules
#
#-------------------------------------------------------------------------
import gtk.glade
import gtk
from gtk import glade
import gobject
#-------------------------------------------------------------------------
@ -65,7 +66,7 @@ class ColumnOrder(ManagedWindow.ManagedWindow):
"""
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self)
self.glade = gtk.glade.XML(const.GLADE_FILE, "columns", "gramps")
self.glade = glade.XML(const.GLADE_FILE, "columns", "gramps")
self.set_window(self.glade.get_widget('columns'), None, win_name)

View File

@ -37,7 +37,6 @@ except ImportError:
import gnome.gconf
gconf = gnome.gconf
import gobject
import Errors
from _GrampsConfigKeys import default_value

View File

@ -23,13 +23,12 @@
"""
Low-level handling of .ini keys.
"""
import os
import time
import ConfigParser
import errno
import const
from _GrampsConfigKeys import *
from Config import DATE_FORMAT, NAME_FORMAT, default_value
NL = "\n" # FIX: newlines on Mac/Windows, if different?

View File

@ -27,7 +27,7 @@ copy = """#
"""
from xml.parsers.expat import ExpatError, ParserCreate
from xml.parsers.expat import ParserCreate
class SchemaHandler:

View File

@ -23,6 +23,20 @@
FamilyList View.
"""
#-------------------------------------------------------------------------
#
# Standard python modules
#
#-------------------------------------------------------------------------
from gettext import gettext as _
#-------------------------------------------------------------------------
#
# GNOME/GTK+ modules
#
#-------------------------------------------------------------------------
import gtk
#-------------------------------------------------------------------------
#
# gramps modules
@ -37,14 +51,6 @@ import Config
from Filters.SideBar import FamilySidebarFilter
from ReportBase import CATEGORY_QR_FAMILY
#-------------------------------------------------------------------------
#
# internationalization
#
#-------------------------------------------------------------------------
from gettext import gettext as _
import gtk
#-------------------------------------------------------------------------
#
# FamilyListView

View File

@ -24,12 +24,19 @@
GrampletView interface.
"""
#-------------------------------------------------------------------------
#
# gtk modules
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
import gobject
import pango
import traceback
import time
import types
import pango
import os
from gettext import gettext as _
@ -415,7 +422,7 @@ class GuiGramplet:
self.pui = None # user code
self.tooltips = None
self.tooltips_text = None
self.xml = gtk.glade.XML(const.GLADE_FILE, 'gvgramplet', "gramps")
self.xml = glade.XML(const.GLADE_FILE, 'gvgramplet', "gramps")
self.mainframe = self.xml.get_widget('gvgramplet')
self.textview = self.xml.get_widget('gvtextview')
self.buffer = self.textview.get_buffer()

View File

@ -940,16 +940,13 @@ class PersonView(PageView.PersonNavView):
def write_tabbed_file(self, name, type):
"""
Writes a tabbed file to the specified name. The output file type is determined
by the type variable.
Write a tabbed file to the specified name.
The output file type is determined by the type variable.
"""
# Select the correct output format
if type == 0:
from CSVTab import CSVTab as tabgen
else:
from ODSTab import ODSTab as tabgen
from docgen import CSVTab, ODSTab
ofile = None
# build the active data columns, prepending 0 for the name column, then
# derive the column names fromt the active data columns
@ -958,10 +955,13 @@ class PersonView(PageView.PersonNavView):
if pair[0]]
cnames = [column_names[i] for i in data_cols]
# Select the correct output format
if type == 0:
ofile = CSVTab(len(cnames))
else:
ofile = ODSTab(len(cnames))
# create the output tabbed document, and open it
ofile = tabgen(len(cnames))
ofile.open(name)
# start the current page

View File

@ -54,6 +54,7 @@ __LOG = logging.getLogger(".DateEdit")
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -187,7 +188,7 @@ class DateEditorDialog(ManagedWindow.ManagedWindow):
# Create self.date as a copy of the given Date object.
self.date = Date(date)
self.top = gtk.glade.XML(const.GLADE_FILE, "date_edit","gramps" )
self.top = glade.XML(const.GLADE_FILE, "date_edit","gramps" )
self.set_window(
self.top.get_widget('date_edit'),

View File

@ -25,8 +25,8 @@ Class handling language-specific selection for date parser and displayer.
"""
# import prerequisites for localized handlers
from _DateHandler import LANG, LANG_SHORT, \
LANG_TO_PARSER, LANG_TO_DISPLAY, register_datehandler
from _DateHandler import (LANG, LANG_SHORT, LANG_TO_PARSER, LANG_TO_DISPLAY,
register_datehandler)
# Import all the localized handlers
import _Date_cs
@ -37,11 +37,11 @@ import _Date_fr
import _Date_lt
import _Date_nb
import _Date_nl
import _Date_ru
import _Date_sv
import _Date_sk
import _Date_pl
import _Date_pt
import _Date_ru
import _Date_sk
import _Date_sv
# Initialize global parser
try:

View File

@ -30,7 +30,6 @@ Handling of loading new/existing databases.
#
#-------------------------------------------------------------------------
import os
import sys
from gettext import gettext as _
import logging

View File

@ -52,7 +52,7 @@ else:
#
#-------------------------------------------------------------------------
import gtk
import gtk.glade
from gtk import glade
from gtk.gdk import ACTION_COPY
import pango
@ -267,7 +267,7 @@ class DbManager(CLIDbManager):
the GTK widgets that are needed.
"""
CLIDbManager.__init__(self, dbstate)
self.glade = gtk.glade.XML(const.GLADE_FILE, "dbmanager", "gramps")
self.glade = glade.XML(const.GLADE_FILE, "dbmanager", "gramps")
self.top = self.glade.get_widget('dbmanager')
if parent:
self.top.set_transient_for(parent)
@ -1018,7 +1018,7 @@ def check_in(dbase, filename, callback, cursor_func = None):
init = [ "rcs", '-i', '-U', '-q', '-t-"GRAMPS database"', ]
ci_cmd = [ "ci", "-q", "-f" ]
glade = gtk.glade.XML(const.GLADE_FILE, "comment", "gramps")
glade = glade.XML(const.GLADE_FILE, "comment", "gramps")
top = glade.get_widget('comment')
text = glade.get_widget('description')

View File

@ -40,9 +40,6 @@ import gtk
# GRAMPS modules
#
#-------------------------------------------------------------------------
import const
import ToolTips
import GrampsLocale
from _BaseModel import BaseModel
import gen.lib

View File

@ -32,7 +32,6 @@ TreeModel for the GRAMPS Person tree.
from gettext import gettext as _
import time
import cgi
import sys
import locale
#-------------------------------------------------------------------------
@ -56,7 +55,7 @@ import gtk
#
#-------------------------------------------------------------------------
import const
from gen.lib import *
from gen.lib import Name, EventRef, EventType, EventRoleType, MarkerType
from BasicUtils import name_displayer
import DateHandler
import ToolTips

View File

@ -41,8 +41,9 @@ _LOG = logging.getLogger(".DisplayState")
# GNOME python modules
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
import gobject
import gtk.glade
#-------------------------------------------------------------------------
#
@ -282,7 +283,7 @@ class WarnHandler(RotateHandler):
def display(self, obj):
obj.hide()
xml = gtk.glade.XML(const.GLADE_FILE, 'scrollmsg')
xml = glade.XML(const.GLADE_FILE, 'scrollmsg')
top = xml.get_widget('scrollmsg')
msg = xml.get_widget('msg')
buf = msg.get_buffer()

View File

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

View File

@ -26,24 +26,20 @@
#
#-------------------------------------------------------------------------
from gettext import gettext as _
import cPickle as pickle
#-------------------------------------------------------------------------
#
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk
#-------------------------------------------------------------------------
#
# GRAMPS classes
#
#-------------------------------------------------------------------------
import Spell
import Errors
import gen.lib
from DisplayTabs import log
from _NoteModel import NoteModel
from _EmbeddedList import EmbeddedList
from DdTargets import DdTargets

View File

@ -30,7 +30,6 @@ Provides the interface to allow a person to add a media object to the database.
#
#-------------------------------------------------------------------------
import os
import sys
#-------------------------------------------------------------------------
#
@ -44,8 +43,8 @@ from gettext import gettext as _
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
from QuestionDialog import ErrorDialog, WarningDialog
import gtk.glade
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -55,10 +54,10 @@ import gtk.glade
import const
import Config
import Utils
import gen.lib
import Mime
import GrampsDisplay
import ManagedWindow
from QuestionDialog import ErrorDialog, WarningDialog
#-------------------------------------------------------------------------
#
@ -96,7 +95,7 @@ class AddMediaObject(ManagedWindow.ManagedWindow):
self.last_directory = Config.get(Config.ADDMEDIA_IMGDIR)
self.relative_path = Config.get(Config.ADDMEDIA_RELPATH)
self.glade = gtk.glade.XML(const.GLADE_FILE, "imageSelect", "gramps")
self.glade = glade.XML(const.GLADE_FILE, "imageSelect", "gramps")
self.set_window(
self.glade.get_widget("imageSelect"),

View File

@ -37,7 +37,7 @@ from gettext import gettext as _
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk.glade
from gtk import glade
#-------------------------------------------------------------------------
#
@ -50,7 +50,7 @@ from _EditSecondary import EditSecondary
from gen.lib import NoteType
from DisplayTabs import SourceEmbedList, NoteTab
from GrampsWidgets import *
from GrampsWidgets import MonitoredDate, MonitoredEntry, PrivacyButton
#-------------------------------------------------------------------------
#
@ -75,7 +75,7 @@ class EditAddress(EditSecondary):
EditSecondary.__init__(self, dbstate, uistate, track, addr, callback)
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "addr_edit","gramps")
self.top = glade.XML(const.GLADE_FILE, "addr_edit","gramps")
self.set_window(self.top.get_widget("addr_edit"),
self.top.get_widget("title"),
_('Address Editor'))

View File

@ -37,7 +37,8 @@ from gettext import gettext as _
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk.glade
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -50,7 +51,7 @@ from _EditSecondary import EditSecondary
from gen.lib import NoteType
from DisplayTabs import SourceEmbedList, NoteTab
from GrampsWidgets import *
from GrampsWidgets import MonitoredEntry, PrivacyButton, MonitoredDataType
#-------------------------------------------------------------------------
#
@ -78,7 +79,7 @@ class EditAttribute(EditSecondary):
EditSecondary.__init__(self, state, uistate, track, attrib, callback)
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "attr_edit","gramps")
self.top = glade.XML(const.GLADE_FILE, "attr_edit","gramps")
self.set_window(self.top.get_widget("attr_edit"),
self.top.get_widget('title'),
_('Attribute Editor'))

View File

@ -38,6 +38,7 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -83,7 +84,7 @@ class EditChildRef(EditSecondary):
childref, callback)
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "cref_edit","gramps")
self.top = glade.XML(const.GLADE_FILE, "cref_edit","gramps")
self.set_window(self.top.get_widget("cref_edit"),
self.top.get_widget("title"),
self.name,

View File

@ -32,7 +32,7 @@ from gettext import gettext as _
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -43,8 +43,10 @@ import const
import Config
import gen.lib
from DisplayTabs import SourceEmbedList,NoteTab,GalleryTab,EventBackRefList,AttrEmbedList
from GrampsWidgets import *
from DisplayTabs import (SourceEmbedList, NoteTab, GalleryTab,
EventBackRefList, AttrEmbedList)
from GrampsWidgets import (PrivacyButton, MonitoredEntry, PlaceEntry,
MonitoredDate, MonitoredDataType)
from _EditReference import RefTab, EditReference
#-------------------------------------------------------------------------
@ -71,7 +73,7 @@ class EditEventRef(EditReference):
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "event_eref_edit","gramps")
self.top = glade.XML(const.GLADE_FILE, "event_eref_edit","gramps")
self.set_window(self.top.get_widget('event_eref_edit'),
self.top.get_widget('eer_title'),
_('Event Reference Editor'))

View File

@ -17,6 +17,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
import gtk
# $Id$
@ -37,7 +38,7 @@ from gettext import gettext as _
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk.glade
from gtk import glade
#-------------------------------------------------------------------------
#
@ -53,7 +54,8 @@ import LdsUtils
from _EditSecondary import EditSecondary
from DisplayTabs import SourceEmbedList,NoteTab
from GrampsWidgets import *
from GrampsWidgets import (PrivacyButton, MonitoredDate, PlaceEntry,
MonitoredMenu, MonitoredStrMenu)
_DATA_MAP = {
gen.lib.LdsOrd.BAPTISM : [
@ -143,7 +145,7 @@ class EditLdsOrd(EditSecondary):
EditSecondary.__init__(self, state, uistate, track, attrib, callback)
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "lds_person_edit","gramps")
self.top = glade.XML(const.GLADE_FILE, "lds_person_edit","gramps")
self.set_window(self.top.get_widget("lds_person_edit"),
self.top.get_widget('title'),
_('LDS Ordinance Editor'))
@ -329,7 +331,7 @@ class EditFamilyLdsOrd(EditSecondary):
EditSecondary.__init__(self, state, uistate, track, attrib, callback)
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "lds_person_edit","gramps")
self.top = glade.XML(const.GLADE_FILE, "lds_person_edit","gramps")
self.set_window(self.top.get_widget("lds_person_edit"),
self.top.get_widget('title'),
_('LDS Ordinance Editor'))

View File

@ -25,7 +25,7 @@
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -36,7 +36,7 @@ import const
import Config
from _EditSecondary import EditSecondary
from GrampsWidgets import *
from GrampsWidgets import MonitoredEntry
from gettext import gettext as _
#-------------------------------------------------------------------------
@ -54,7 +54,7 @@ class EditLocation(EditSecondary):
location, callback)
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "loc_edit","gramps")
self.top = glade.XML(const.GLADE_FILE, "loc_edit","gramps")
self.set_window(self.top.get_widget("loc_edit"), None,
_('Location Editor'))

View File

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

View File

@ -33,6 +33,7 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -46,9 +47,9 @@ import ThumbNails
from Utils import media_path_full
from gen.lib import NoteType
from DisplayTabs import \
SourceEmbedList,AttrEmbedList,MediaBackRefList,NoteTab
from GrampsWidgets import *
from DisplayTabs import (SourceEmbedList, AttrEmbedList, MediaBackRefList,
NoteTab)
from GrampsWidgets import MonitoredSpinButton, MonitoredEntry, PrivacyButton
from _EditReference import RefTab, EditReference
from AddMedia import AddMediaObject
@ -72,7 +73,7 @@ class EditMediaRef(EditReference):
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE,
self.top = glade.XML(const.GLADE_FILE,
"change_description","gramps")
self.set_window(self.top.get_widget('change_description'),

View File

@ -32,7 +32,7 @@ from gettext import gettext as _
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk.glade
from gtk import glade
#-------------------------------------------------------------------------
#
@ -41,13 +41,12 @@ import gtk.glade
#-------------------------------------------------------------------------
import const
import Config
import Utils
from BasicUtils import name_displayer
from _EditSecondary import EditSecondary
from gen.lib import NoteType
from DisplayTabs import GrampsTab,SourceEmbedList,NoteTab
from GrampsWidgets import *
from GrampsWidgets import (MonitoredEntry, MonitoredMenu, MonitoredDate,
MonitoredDataType, PrivacyButton)
#-------------------------------------------------------------------------
@ -110,7 +109,7 @@ class EditName(EditSecondary):
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "name_edit","gramps")
self.top = glade.XML(const.GLADE_FILE, "name_edit","gramps")
self.set_window(self.top.get_widget("name_edit"),
self.top.get_widget("title"),
_("Name Editor"))

View File

@ -37,7 +37,7 @@ from gettext import gettext as _
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk.glade
from gtk import glade
#-------------------------------------------------------------------------
#
@ -49,9 +49,8 @@ import Config
from BasicUtils import name_displayer
from _EditSecondary import EditSecondary
from gen.lib import NoteType
from GrampsWidgets import MonitoredEntry, PrivacyButton
from DisplayTabs import SourceEmbedList, NoteTab
from GrampsWidgets import *
#-------------------------------------------------------------------------
#
@ -76,7 +75,7 @@ class EditPersonRef(EditSecondary):
EditSecondary.__init__(self, dbstate, uistate, track, addr, callback)
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "pref_edit","gramps")
self.top = glade.XML(const.GLADE_FILE, "pref_edit","gramps")
self.set_window(self.top.get_widget("pref_edit"),
self.top.get_widget("title"),
_('Person Reference Editor'))

View File

@ -20,13 +20,19 @@
# $Id$
#-------------------------------------------------------------------------
#
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk
#-------------------------------------------------------------------------
#
# gramps modules
#
#-------------------------------------------------------------------------
import ManagedWindow
from GrampsWidgets import *
from DisplayTabs import GrampsTab
import Config

View File

@ -32,7 +32,7 @@ from gettext import gettext as _
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -45,7 +45,7 @@ import Config
from gen.lib import NoteType
from DisplayTabs import NoteTab,AddrEmbedList,WebEmbedList,SourceBackRefList
from GrampsWidgets import *
from GrampsWidgets import MonitoredEntry, PrivacyButton, MonitoredDataType
from _EditReference import RefTab, EditReference
#-------------------------------------------------------------------------
@ -65,7 +65,7 @@ class EditRepoRef(EditReference):
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "repository_ref_edit","gramps")
self.top = glade.XML(const.GLADE_FILE, "repository_ref_edit","gramps")
self.set_window(self.top.get_widget('repository_ref_edit'),
self.top.get_widget('repo_title'),

View File

@ -32,7 +32,7 @@ from gettext import gettext as _
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -42,9 +42,10 @@ import gtk
import const
import gen.lib
from DisplayTabs import \
NoteTab,GalleryTab,SourceBackRefList,DataEmbedList,RepoEmbedList
from GrampsWidgets import *
from DisplayTabs import (NoteTab, GalleryTab, SourceBackRefList,
DataEmbedList, RepoEmbedList)
from GrampsWidgets import (PrivacyButton, MonitoredEntry, MonitoredMenu,
MonitoredDate)
from _EditReference import RefTab, EditReference
#-------------------------------------------------------------------------
@ -60,7 +61,7 @@ class EditSourceRef(EditReference):
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "source_ref_edit","gramps")
self.top = glade.XML(const.GLADE_FILE, "source_ref_edit","gramps")
self.set_window(self.top.get_widget('source_ref_edit'),
self.top.get_widget('source_title'),

View File

@ -32,7 +32,7 @@ from gettext import gettext as _
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk.glade
from gtk import glade
#-------------------------------------------------------------------------
#
@ -42,8 +42,7 @@ import gtk.glade
import const
import Config
from _EditSecondary import EditSecondary
from GrampsWidgets import *
from GrampsWidgets import MonitoredEntry, PrivacyButton, MonitoredDataType
#-------------------------------------------------------------------------
#
@ -61,7 +60,7 @@ class EditUrl(EditSecondary):
url, callback)
def _local_init(self):
self.top = gtk.glade.XML(const.GLADE_FILE, "url_edit", "gramps")
self.top = glade.XML(const.GLADE_FILE, "url_edit", "gramps")
self.jump = self.top.get_widget('jump')
self.set_window(self.top.get_widget("url_edit"),
@ -80,26 +79,20 @@ class EditUrl(EditSecondary):
GrampsDisplay.url(self.obj.get_path())
def _setup_fields(self):
self.des = MonitoredEntry(
self.top.get_widget("url_des"),
self.des = MonitoredEntry(self.top.get_widget("url_des"),
self.obj.set_description,
self.obj.get_description,
self.db.readonly)
self.obj.get_description, self.db.readonly)
self.addr = MonitoredEntry(
self.top.get_widget("url_addr"),
self.obj.set_path,
self.obj.get_path,
self.addr = MonitoredEntry(self.top.get_widget("url_addr"),
self.obj.set_path, self.obj.get_path,
self.db.readonly)
self.priv = PrivacyButton(self.top.get_widget("priv"),
self.obj, self.db.readonly)
self.type_sel = MonitoredDataType(
self.top.get_widget("type"),
self.type_sel = MonitoredDataType(self.top.get_widget("type"),
self.obj.set_type,
self.obj.get_type,
self.db.readonly)
self.obj.get_type, self.db.readonly)
def build_menu_names(self,obj):
etitle =_('Internet Address Editor')

View File

@ -43,7 +43,6 @@ log = logging.getLogger(".ExportAssistant")
#
#-------------------------------------------------------------------------
import gtk
#-------------------------------------------------------------------------
#
# gramps modules

View File

@ -27,6 +27,7 @@
#-------------------------------------------------------------------------
import random
from gettext import gettext as _
import os
from xml.sax.saxutils import escape
#-------------------------------------------------------------------------
@ -35,6 +36,8 @@ from xml.sax.saxutils import escape
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
import gobject
#-------------------------------------------------------------------------
#
@ -48,7 +51,7 @@ from BasicUtils import name_displayer as _nd
import Utils
from gen.lib import Name
import ManagedWindow
from GrampsWidgets import *
from GrampsWidgets import MarkupLabel, BasicLabel
from QuestionDialog import ErrorDialog, QuestionDialog2
from Errors import NameDisplayError
@ -884,7 +887,7 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
return (_('Preferences'), None)
# FIXME: is this needed?
def _set_button(stock):
def _set_button(self, stock):
button = gtk.Button()
image = gtk.Image()
image.set_from_stock(stock, gtk.ICON_SIZE_BUTTON)
@ -903,7 +906,7 @@ class NameFormatEditDlg:
self.name = name
self.valid = True
self.top = gtk.glade.XML(const.GLADE_FILE, 'namefmt_edit', 'gramps')
self.top = glade.XML(const.GLADE_FILE, 'namefmt_edit', 'gramps')
self.dlg = self.top.get_widget('namefmt_edit')
ManagedWindow.set_titles(self.dlg, None, _('Name Format Editor'))

View File

@ -34,7 +34,8 @@ import re
#
#-------------------------------------------------------------------------
from _GedcomInfo import *
from GrampsDbUtils import (personalConstantEvents, personalConstantAttributes,
familyConstantEvents)
import _GedcomTokens as GedcomTokens
import gen.lib
from DateHandler._DateParser import DateParser

View File

@ -33,7 +33,6 @@ to version 2.2.x
#-------------------------------------------------------------------------
import cPickle as pickle
import os
import shutil
import time
from gettext import gettext as _
from bsddb import dbshelve, db
@ -45,14 +44,20 @@ __LOG = logging.getLogger(".GrampsDb")
# Gramps modules
#
#-------------------------------------------------------------------------
from gen.lib import *
from gen.db.base import *
from gen.lib import (GenderStats, Source, Person, Family, Event, Place,
MediaObject, Repository, Note, Attribute, AttributeType,
NoteType)
from gen.db.base import (GrampsDbBase, KEY_TO_CLASS_MAP, CLASS_TO_KEY_MAP,
Transaction)
from gen.db.cursor import GrampsCursor
from gen.db.dbconst import (REFERENCE_KEY, PERSON_COL_KEY, EVENT_COL_KEY,
EVENT_KEY, FAMILY_KEY, SOURCE_KEY, PLACE_KEY,
MEDIA_KEY, REPOSITORY_KEY, PERSON_KEY, NOTE_KEY)
from gen.db.exceptions import FileVersionError
from gen.utils import db_copy
import const
from gen.db.exceptions import FileVersionError
from BasicUtils import UpdateCallback
from gen.db.cursor import GrampsCursor
_MINVERSION = 9
_DBVERSION = 13

View File

@ -29,7 +29,7 @@
#------------------------------------------------------------------------
import os
from gettext import gettext as _
import gtk
from gtk import glade
#------------------------------------------------------------------------
#
@ -84,7 +84,7 @@ def importData(database, filename, callback=None, use_trans=False):
if not gramps and ansel:
glade_file = "%s/gedcomimport.glade" % os.path.dirname(__file__)
top = gtk.glade.XML(glade_file, 'encoding', 'gramps')
top = glade.XML(glade_file, 'encoding','gramps')
code = top.get_widget('codeset')
code.set_active(0)
dialog = top.get_widget('encoding')

View File

@ -28,7 +28,6 @@
import os
import sys
import sets
import shutil
from xml.parsers.expat import ExpatError, ParserCreate
from gettext import gettext as _
import re
@ -41,13 +40,11 @@ import re
from QuestionDialog import ErrorDialog
import Mime
import gen.lib
import const
import Utils
import DateHandler
from BasicUtils import name_displayer
from gen.db.dbconst import \
PERSON_KEY, FAMILY_KEY, SOURCE_KEY, EVENT_KEY, \
MEDIA_KEY, PLACE_KEY, REPOSITORY_KEY, NOTE_KEY
from gen.db.dbconst import (PERSON_KEY, FAMILY_KEY, SOURCE_KEY, EVENT_KEY,
MEDIA_KEY, PLACE_KEY, REPOSITORY_KEY, NOTE_KEY)
from BasicUtils import UpdateCallback
#-------------------------------------------------------------------------

View File

@ -35,9 +35,9 @@ on using these factories see the _GrampsDbUtilsFactories.py file comments.
"""
from _GrampsDbWRFactories import \
gramps_db_reader_factory
from _GedcomInfo import (personalConstantEvents, familyConstantEvents,
personalConstantAttributes)
from _GrampsDbWRFactories import gramps_db_reader_factory
from _GedcomParse import GedcomParser
from _WriteGedcom import GedcomWriter

View File

@ -18,7 +18,7 @@ A controlling principle for such structures is that they should be
designed for maximum ease (and intuitiveness) of data declaration
"""
import sys, os, os.path as op
import os.path as op
import unittest as U
import re

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
import unittest
import os, os.path
import os.path
import codecs
import struct

View File

@ -38,6 +38,7 @@ from cStringIO import StringIO
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -395,7 +396,7 @@ class ManagedWindow:
def define_glade(self, top_module, glade_file=None):
if glade_file == None:
glade_file = const.GLADE_FILE
self._gladeobj = gtk.glade.XML(glade_file, top_module, "gramps")
self._gladeobj = glade.XML(glade_file, top_module, "gramps")
return self._gladeobj
def get_widget(self, name):

View File

@ -33,6 +33,7 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
import pango
#-------------------------------------------------------------------------
@ -58,7 +59,7 @@ class PersonCompare(ManagedWindow.ManagedWindow):
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self.__class__)
self.glade = gtk.glade.XML(const.MERGE_GLADE, "merge")
self.glade = glade.XML(const.MERGE_GLADE, "merge")
window = self.glade.get_widget('merge')
self.text1 = self.glade.get_widget('text1')
self.text2 = self.glade.get_widget('text2')
@ -276,7 +277,7 @@ class MergePeopleUI(ManagedWindow.ManagedWindow):
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self.__class__)
glade = gtk.glade.XML(const.MERGE_GLADE, 'merge_people')
glade = glade.XML(const.MERGE_GLADE, 'merge_people')
window = glade.get_widget('merge_people')
self.set_window(window, glade.get_widget('title'), _("Merge People"))

View File

@ -32,8 +32,7 @@ from gettext import gettext as _
# GNOME
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
# GRAMPS modules
@ -63,7 +62,7 @@ class MergePlaces(ManagedWindow.ManagedWindow):
self.p1 = self.db.get_place_from_handle(self.new_handle)
self.p2 = self.db.get_place_from_handle(self.old_handle)
self.glade = gtk.glade.XML(const.MERGE_GLADE,"merge_places","gramps")
self.glade = glade.XML(const.MERGE_GLADE,"merge_places","gramps")
self.set_window(self.glade.get_widget("merge_places"),
self.glade.get_widget('title'),
_("Merge Places"))

View File

@ -32,7 +32,7 @@ from gettext import gettext as _
# GNOME
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -64,7 +64,7 @@ class MergeSources(ManagedWindow.ManagedWindow):
self.s1 = self.db.get_source_from_handle(self.new_handle)
self.s2 = self.db.get_source_from_handle(self.old_handle)
self.glade = gtk.glade.XML(const.MERGE_GLADE,"merge_sources","gramps")
self.glade = glade.XML(const.MERGE_GLADE,"merge_sources","gramps")
self.set_window(self.glade.get_widget("merge_sources"),
self.glade.get_widget('title'),

View File

@ -1,6 +1,5 @@
import gtk
import time
import logging
log = logging.getLogger(".")

View File

@ -1,6 +1,5 @@
import gtk
import time
import logging
log = logging.getLogger(".")

View File

@ -1,14 +1,4 @@
import gtk
import time
import bsddb
import cPickle
import logging
log = logging.getLogger(".")
from _PathCursor import PathCursor
from _ListCursor import ListCursor
from _FastFilterModel import FastFilterModel
import gen.lib

View File

@ -1,12 +1,8 @@
import gtk
import time
import bsddb
import cPickle
import logging
log = logging.getLogger(".")
from _PathCursor import PathCursor
from _ListCursor import ListCursor
from _FastModel import FastModel

View File

@ -1,13 +1,8 @@
import gtk
import time
import bsddb
import cPickle
import logging
log = logging.getLogger(".")
from _PathCursor import PathCursor
from _ListCursor import ListCursor
from _FastModel import FastModel
import gen.lib

View File

@ -1033,30 +1033,33 @@ class ListView(BookMarkView):
self.write_tabbed_file(fn, fl)
def write_tabbed_file(self, name, type):
"""
Write a tabbed file to the specified name.
if type == 0:
from CSVTab import CSVTab as tabgen
else:
from ODSTab import ODSTab as tabgen
The output file type is determined by the type variable.
"""
from docgen import CSVTab, ODSTab
ofile = None
data_cols = [pair[1] for pair in self.column_order() if pair[0]]
column_names = [self.colinfo[i] for i in data_cols]
if type == 0:
ofile = CSVTab(len(column_names))
else:
ofile = ODSTab(len(column_names))
o = tabgen(len(column_names))
o.open(name)
o.start_page()
o.start_row()
ofile.open(name)
ofile.start_page()
ofile.start_row()
for name in column_names:
o.write_cell(name)
o.end_row()
ofile.write_cell(name)
ofile.end_row()
for row in self.model:
o.start_row()
ofile.start_row()
for index in data_cols:
o.write_cell(row[index])
o.end_row()
o.end_page()
o.close()
ofile.write_cell(row[index])
ofile.end_row()
ofile.end_page()
ofile.close()

View File

@ -46,7 +46,6 @@ import ManagedWindow
import Errors
import _PluginMgr as PluginMgr
import _Tool as Tool
from BasicUtils import name_displayer
#-------------------------------------------------------------------------
#

View File

@ -34,6 +34,7 @@ importers, exporters, and document generators.
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -94,7 +95,7 @@ class PluginDialog(ManagedWindow.ManagedWindow):
self.state = state
self.uistate = uistate
self.dialog = gtk.glade.XML(const.PLUGINS_GLADE,"report","gramps")
self.dialog = glade.XML(const.PLUGINS_GLADE,"report","gramps")
self.dialog.signal_autoconnect({
"on_report_apply_clicked" : self.on_apply_clicked,
"destroy_passed_object" : self.close,

View File

@ -39,11 +39,10 @@ log = logging.getLogger(".")
#-------------------------------------------------------------------------
import const
import Utils
from Filters import CustomFilters
from BasicUtils import name_displayer
import Errors
from _Options import *
from PluginUtils import (Options, OptionHandler, OptionList,
OptionListCollection)
#-------------------------------------------------------------------------
#
# Constants

View File

@ -43,6 +43,8 @@ from _PluginMgr import (register_export, register_import, register_tool,
register_draw_doc, register_book_doc,
register_quick_report)
from _Options import Options, OptionListCollection, OptionList, OptionHandler
import _Tool as Tool
import _Plugins as Plugins
import _PluginWindows as PluginWindows

View File

@ -33,6 +33,7 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
from gtk.gdk import pixbuf_new_from_file
#-------------------------------------------------------------------------
@ -50,7 +51,7 @@ except:
class SaveDialog:
def __init__(self,msg1,msg2,task1,task2,parent=None):
self.xml = gtk.glade.XML(const.GLADE_FILE,"savedialog","gramps")
self.xml = glade.XML(const.GLADE_FILE,"savedialog","gramps")
self.top = self.xml.get_widget('savedialog')
self.top.set_icon(ICON)
self.top.set_title("%s - GRAMPS" % msg1)
@ -80,7 +81,7 @@ class SaveDialog:
class QuestionDialog:
def __init__(self,msg1,msg2,label,task,parent=None):
self.xml = gtk.glade.XML(const.GLADE_FILE,"questiondialog","gramps")
self.xml = glade.XML(const.GLADE_FILE,"questiondialog","gramps")
self.top = self.xml.get_widget('questiondialog')
self.top.set_icon(ICON)
self.top.set_title("%s - GRAMPS" % msg1)
@ -105,7 +106,7 @@ class QuestionDialog:
class QuestionDialog2:
def __init__(self,msg1,msg2,label_msg1,label_msg2,parent=None):
self.xml = gtk.glade.XML(const.GLADE_FILE,"questiondialog","gramps")
self.xml = glade.XML(const.GLADE_FILE,"questiondialog","gramps")
self.top = self.xml.get_widget('questiondialog')
self.top.set_icon(ICON)
self.top.set_title("%s - GRAMPS" % msg1)
@ -133,7 +134,7 @@ class QuestionDialog2:
class OptionDialog:
def __init__(self,msg1,msg2,btnmsg1,task1,btnmsg2,task2,parent=None):
self.xml = gtk.glade.XML(const.GLADE_FILE,"optiondialog","gramps")
self.xml = glade.XML(const.GLADE_FILE,"optiondialog","gramps")
self.top = self.xml.get_widget('optiondialog')
self.top.set_icon(ICON)
self.top.set_title("%s - GRAMPS" % msg1)
@ -231,7 +232,7 @@ class OkDialog(gtk.MessageDialog):
class MissingMediaDialog:
def __init__(self,msg1,msg2,task1,task2,task3,parent=None):
self.xml = gtk.glade.XML(const.GLADE_FILE,"missmediadialog","gramps")
self.xml = glade.XML(const.GLADE_FILE,"missmediadialog","gramps")
self.top = self.xml.get_widget('missmediadialog')
self.top.set_icon(ICON)
self.top.set_title("%s - GRAMPS" % msg1)
@ -286,7 +287,7 @@ class MessageHideDialog:
def __init__(self, title, message, key, parent=None):
glade_xml = gtk.glade.XML(const.GLADE_FILE, "hide_dialog", "gramps")
glade_xml = glade.XML(const.GLADE_FILE, "hide_dialog", "gramps")
top = glade_xml.get_widget('hide_dialog')
top.set_icon(ICON)
top.set_title("%s - GRAMPS" % title)

View File

@ -53,11 +53,10 @@ import gtk
#
#-------------------------------------------------------------------------
from PluginUtils import Plugins
from ReportBase import CATEGORY_QR_PERSON, CATEGORY_QR_FAMILY,\
CATEGORY_QR_EVENT, CATEGORY_QR_SOURCE,\
CATEGORY_QR_PLACE, CATEGORY_QR_REPOSITORY, \
CATEGORY_QR_NOTE, CATEGORY_QR_DATE
#from PluginUtils import Plugins
from ReportBase import (CATEGORY_QR_PERSON, CATEGORY_QR_FAMILY,
CATEGORY_QR_EVENT, CATEGORY_QR_SOURCE,
CATEGORY_QR_PLACE, CATEGORY_QR_REPOSITORY)
def create_quickreport_menu(category,dbstate,uistate,handle) :
@ -125,7 +124,7 @@ def run_quick_report_by_name(dbstate, uistate, report_name, handle):
run_report(dbstate, uistate, report[2], handle, report[0])
def run_report(dbstate, uistate, category,handle,func):
from TextBufDoc import TextBufDoc
from docgen import TextBufDoc
from Simple import make_basic_stylesheet
if dbstate.active and handle:

View File

@ -27,7 +27,6 @@
#-------------------------------------------------------------------------
import gen.lib
import types
from TransUtils import sgettext as _

View File

@ -20,8 +20,9 @@
from gettext import gettext as _
from gtk import glade
import const
import gtk
from BasicUtils import name_displayer
import ListModel
@ -34,7 +35,7 @@ FAMILY_TITLES = [(_('Spouse'), -1, 200), (_('Relationship'), -1, 200), ('', -1,
class Reorder(ManagedWindow.ManagedWindow):
def __init__(self, state, uistate, track, handle):
xml = gtk.glade.XML(const.GLADE_FILE, "reorder", "gramps")
xml = glade.XML(const.GLADE_FILE, "reorder", "gramps")
top = xml.get_widget('reorder')
self.dbstate = state

View File

@ -31,7 +31,6 @@ from _Constants import CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK
from _PaperMenu import paper_sizes
import os
import const
from Filters import CustomFilters
#------------------------------------------------------------------------
#

View File

@ -50,8 +50,7 @@ import Config
from _Constants import CATEGORY_GRAPHVIZ
from _ReportDialog import ReportDialog
from _PaperMenu import PaperFrame
from PluginUtils import NumberOption, EnumeratedListOption, \
TextOption, BooleanOption
from PluginUtils import NumberOption, EnumeratedListOption, TextOption
#-------------------------------------------------------------------------------
#

View File

@ -34,6 +34,7 @@ import os
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
import gobject
#-------------------------------------------------------------------------
@ -147,7 +148,7 @@ class PaperFrame(gtk.HBox):
margins=[2.54,2.54,2.54,2.54], custom=[29.7,21.0]):
gtk.HBox.__init__(self)
glade_file = os.path.join(const.GLADE_DIR, "paper_settings.glade")
glade_xml = gtk.glade.XML(glade_file, "paper_table", "gramps")
glade_xml = glade.XML(glade_file, "paper_table", "gramps")
self.paper_table = glade_xml.get_widget('paper_table')

View File

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

View File

@ -46,19 +46,12 @@ import gtk
#-------------------------------------------------------------------------
import Config
import Errors
import Utils
import const
from QuestionDialog import ErrorDialog, OptionDialog, RunDatabaseRepair
from _Constants import CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK, \
CATEGORY_VIEW, CATEGORY_CODE, CATEGORY_WEB, CATEGORY_GRAPHVIZ, \
standalone_categories
from QuestionDialog import ErrorDialog, OptionDialog
from _Constants import (CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_BOOK,
CATEGORY_VIEW, CATEGORY_CODE, CATEGORY_WEB,
CATEGORY_GRAPHVIZ, standalone_categories)
from _BareReportDialog import BareReportDialog
from _FileEntry import FileEntry
from _PaperMenu import PaperComboBox, OrientationComboBox, paper_sizes
from _TemplateParser import _template_map, _default_template, _user_template
from BaseDoc import PaperStyle
#-------------------------------------------------------------------------
#

View File

@ -75,7 +75,7 @@ class StyleListDisplay:
self.callback = callback
self.sheetlist = stylesheetlist
self.top = gtk.glade.XML(const.GLADE_FILE, "styles", "gramps")
self.top = glade.XML(const.GLADE_FILE, "styles", "gramps")
self.window = self.top.get_widget('styles')
ManagedWindow.set_titles( self.window,
@ -187,7 +187,7 @@ class StyleEditor:
self.style = BaseDoc.StyleSheet(style)
self.parent = parent
self.top = gtk.glade.XML(const.GLADE_FILE, "editor", "gramps")
self.top = glade.XML(const.GLADE_FILE, "editor", "gramps")
self.top.signal_autoconnect({
"on_save_style_clicked" : self.on_save_style_clicked,

View File

@ -44,6 +44,7 @@ except:
#-------------------------------------------------------------------------
import gtk
from gtk.gdk import ACTION_COPY, BUTTON1_MASK, ACTION_MOVE
from gtk import glade
#-------------------------------------------------------------------------
#
@ -1178,7 +1179,7 @@ class ScratchPadWindow(ManagedWindow.ManagedWindow):
self.glade_file = os.path.join(const.GLADE_DIR, "scratchpad.glade")
self.top = gtk.glade.XML(self.glade_file,"scratch_pad","gramps")
self.top = glade.XML(self.glade_file,"scratch_pad","gramps")
self.set_window(self.top.get_widget("scratch_pad"),
None, None, msg=_("Clipboard"))

View File

@ -27,6 +27,7 @@
#-------------------------------------------------------------------------
import gtk
import pango
from gtk import glade
#-------------------------------------------------------------------------
#
@ -67,7 +68,7 @@ class BaseSelector(ManagedWindow.ManagedWindow):
self.renderer.set_property('ellipsize',pango.ELLIPSIZE_END)
self.db = dbstate.db
self.glade = gtk.glade.XML(const.GLADE_FILE,"select_person","gramps")
self.glade = glade.XML(const.GLADE_FILE,"select_person","gramps")
window = self.glade.get_widget('select_person')
title_label = self.glade.get_widget('title')
vbox = self.glade.get_widget('select_person_vbox')

View File

@ -33,6 +33,7 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
import pango
#-------------------------------------------------------------------------
@ -75,7 +76,7 @@ class SelectPerson(ManagedWindow.ManagedWindow):
self.renderer = gtk.CellRendererText()
self.renderer.set_property('ellipsize',pango.ELLIPSIZE_END)
self.dbstate = dbstate
self.glade = gtk.glade.XML(const.GLADE_FILE,"select_person","gramps")
self.glade = glade.XML(const.GLADE_FILE,"select_person","gramps")
self.plist = self.glade.get_widget('plist')
self.showall = self.glade.get_widget('showall')
self.notebook = self.glade.get_widget('notebook')

View File

@ -39,7 +39,7 @@ import os
# GTK/GNOME modules
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
#-------------------------------------------------------------------------
#
@ -61,7 +61,7 @@ class TipOfDay(ManagedWindow.ManagedWindow):
ManagedWindow.ManagedWindow.__init__(self, uistate, [], self)
xml = gtk.glade.XML(const.GLADE_FILE, "tod_window", "gramps")
xml = glade.XML(const.GLADE_FILE, "tod_window", "gramps")
window = xml.get_widget("tod_window")
self.set_window(window,
xml.get_widget("title"),

View File

@ -1122,7 +1122,7 @@ def launch(prog_str, path):
os.spawnvpe(os.P_NOWAIT, prog, prog_list, os.environ)
def profile(func, *args):
import hotshot, hotshot.stats
import hotshot.stats
prf = hotshot.Profile('mystats.profile')
print "Start"

View File

@ -30,8 +30,6 @@ import traceback
import locale
import gettext
import gtk
if os.environ.has_key("GRAMPSI18N"):
loc = os.environ["GRAMPSI18N"]
else:

View File

@ -18,20 +18,26 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id: $
# $Id$
import os
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
import csv
import codecs
from gettext import gettext as _
#-------------------------------------------------------------------------
#
# gramps modules
#
#-------------------------------------------------------------------------
from docgen import TabbedDoc
import TabbedDoc
class CSVTab(TabbedDoc.TabbedDoc):
class CSVTab(TabbedDoc):
def __init__(self, columns):
TabbedDoc.TabbedDoc.__init__(self, columns)
TabbedDoc.__init__(self, columns)
self.filename = None
self.f = None
self.dlist = []

View File

@ -28,7 +28,6 @@
# Python modules
#
#------------------------------------------------------------------------
from gettext import gettext as _
from math import radians
#------------------------------------------------------------------------
@ -38,7 +37,6 @@ from math import radians
#------------------------------------------------------------------------
import BaseDoc
from ReportBase import ReportUtils
##rgb_color = ReportUtils.rgb_color
#------------------------------------------------------------------------
#
@ -54,7 +52,6 @@ log = logging.getLogger(".CairoDoc")
#
#-------------------------------------------------------------------------
import gtk
import cairo
import pango
import pangocairo

View File

@ -60,6 +60,7 @@ log = logging.getLogger(".GtkPrint")
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
import cairo
if gtk.pygtk_version < (2, 10, 0):
@ -200,7 +201,7 @@ class PrintPreview:
glade_file = os.path.join(os.path.dirname(__file__),
'gtkprintpreview.glade')
glade_xml = gtk.glade.XML(glade_file, 'window', 'gramps')
glade_xml = glade.XML(glade_file, 'window', 'gramps')
self._window = glade_xml.get_widget('window')
#self._window.set_transient_for(parent)

View File

@ -5,6 +5,7 @@
docgendir=$(prefix)/share/gramps/docgen
docgen_PYTHON = \
__init__.py\
AsciiDoc.py\
CairoDoc.py\
CSVTab.py\

View File

@ -36,7 +36,7 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
import BaseDoc
from SpreadSheetDoc import *
from docgen import SpreadSheetDoc
import const

View File

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

View File

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

View File

@ -37,9 +37,6 @@ import pango
#------------------------------------------------------------------------
import BaseDoc
from PluginUtils import register_text_doc
import const
import Errors
import Utils
import ManagedWindow
try:

27
src/docgen/__init__.py Normal file
View File

@ -0,0 +1,27 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2008 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# 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,
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# $Id$
from TabbedDoc import TabbedDoc
from ODSTab import ODSTab
from TextBufDoc import TextBufDoc
from CSVTab import CSVTab
from SpreadSheetDoc import SpreadSheetDoc

View File

@ -47,7 +47,8 @@ LOG = logging.getLogger(".GrampsDb")
# GRAMPS libraries
#
#-------------------------------------------------------------------------
from gen.lib import *
from gen.lib import (MediaObject, Person, Family, Source, Event, Place,
Repository, Note, GenderStats, Researcher)
from gen.utils.callback import GrampsDBCallback
from iterator import CursorIterator
@ -56,8 +57,12 @@ from iterator import CursorIterator
# constants
#
#-------------------------------------------------------------------------
from dbconst import *
from cursor import GrampsCursor
from gen.db.dbconst import (PERSON_KEY, FAMILY_KEY, SOURCE_KEY, EVENT_KEY,
MEDIA_KEY, PLACE_KEY, REPOSITORY_KEY, NOTE_KEY,
REFERENCE_KEY, PERSON_COL_KEY, FAMILY_COL_KEY,
CHILD_COL_KEY, PLACE_COL_KEY, SOURCE_COL_KEY,
MEDIA_COL_KEY, EVENT_COL_KEY, REPOSITORY_COL_KEY,
NOTE_COL_KEY)
_UNDO_SIZE = 1000

View File

@ -25,7 +25,6 @@
# standard python modules
#
#-------------------------------------------------------------------------
import os
#-------------------------------------------------------------------------
#

View File

@ -33,7 +33,6 @@ This is used since GRAMPS version 3.0
#-------------------------------------------------------------------------
import cPickle as pickle
import os
import shutil
import time
from types import InstanceType
@ -48,9 +47,10 @@ log = logging.getLogger(".GrampsDb")
# Gramps modules
#
#-------------------------------------------------------------------------
from gen.lib import *
from base import *
import dbconst as const
from gen.lib import (GenderStats, Person, Family, Event, Place, Source,
MediaObject, Repository, Note)
from gen.db import (GrampsDbBase, KEY_TO_CLASS_MAP, CLASS_TO_KEY_MAP,
REFERENCE_KEY, Transaction)
from exceptions import FileVersionError
from BasicUtils import UpdateCallback
from cursor import GrampsCursor
@ -612,7 +612,7 @@ class GrampsDBDir(GrampsDbBase, UpdateCallback):
def load_from(self, other_database, filename, callback):
try:
self.load(filename,callback)
from GrampsDb import db_copy
from gen.utils import db_copy
db_copy(other_database,self,callback)
return 1
except DBERRS, msg:
@ -1764,7 +1764,6 @@ def write_lock_file(name):
if os.name == 'nt':
text = os.environ['USERNAME']
else:
import pwd
host = os.uname()[1]
# An ugly workaround for os.getlogin() issue with Konsole
try:

View File

@ -34,7 +34,6 @@ from eventref import EventRef
from ldsord import LdsOrd
from mediaref import MediaRef
from name import Name
from note import Note
from reporef import RepoRef
from srcref import SourceRef
from url import Url
@ -51,6 +50,7 @@ from place import Place
from src import Source
from mediaobj import MediaObject
from repo import Repository
from note import Note
# These are actually metadata
from genderstats import GenderStats

View File

@ -50,7 +50,10 @@ log = logging.getLogger(".Date")
# Gramps modules
#
#------------------------------------------------------------------------
from gen.lib.calendar import *
from gen.lib.calendar import (gregorian_sdn, julian_sdn, hebrew_sdn,
french_sdn, persian_sdn, islamic_sdn,
gregorian_ymd, julian_ymd, hebrew_ymd,
french_ymd, persian_ymd, islamic_ymd)
import Config
#-------------------------------------------------------------------------

View File

@ -27,8 +27,6 @@ from test import test_util
test_util.path_append_parent()
import Config
from gen.lib import date
##import date
from DateHandler import parser as df
class Tester(unittest.TestCase):

View File

@ -30,7 +30,7 @@ Proxy class for the GRAMPS databases. Filter out all living people.
#
#-------------------------------------------------------------------------
from proxybase import ProxyDbBase
from gen.lib import *
from gen.lib import Date, Person, Name
from Utils import probably_alive
#-------------------------------------------------------------------------

View File

@ -29,7 +29,9 @@ Proxy class for the GRAMPS databases. Filter out all data marked private.
# GRAMPS libraries
#
#-------------------------------------------------------------------------
from gen.lib import *
from gen.lib import (MediaRef, SourceRef, Attribute, Address, EventRef,
Person, Name, Source, RepoRef, MediaObject, Place, Event,
Family, ChildRef, Repository)
from proxybase import ProxyDbBase
class PrivateProxyDb(ProxyDbBase):

View File

@ -40,9 +40,6 @@ import os
import types
import traceback
import inspect
from gettext import gettext as _
import Errors
log = sys.stderr.write

View File

@ -3,9 +3,7 @@ import unittest
from test import test_util as tu
tu.path_append_parent()
import sys
from callback import GrampsDBCallback, log
from gen.utils import GrampsDBCallback
class TestGrampsDBCallback(unittest.TestCase):

View File

@ -51,7 +51,8 @@ except ImportError:
# Miscellaneous initialization
#
#-------------------------------------------------------------------------
import gtk.glade
import gtk
from gtk import glade
import gobject
gobject.threads_init()
@ -77,10 +78,10 @@ except ValueError:
pass
gettext.bindtextdomain("gramps",loc)
gtk.glade.bindtextdomain("gramps",loc)
glade.bindtextdomain("gramps",loc)
try:
gtk.glade.textdomain("gramps")
glade.textdomain("gramps")
except:
pass
@ -109,8 +110,6 @@ if not sys.version_info >= MIN_PYTHON_VERSION :
# gramps libraries
#
#-------------------------------------------------------------------------
import gobject
try:
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
except:
@ -121,7 +120,6 @@ args = sys.argv
def setup_logging():
"""Setup basic logging support."""
import logging
from GrampsLogger import RotateHandler, GtkHandler
# Setup a formatter

View File

@ -55,8 +55,9 @@ except:
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk
from gtk import glade
from gtk import RESPONSE_OK
import gtk.glade
#-------------------------------------------------------------------------
#
@ -589,7 +590,7 @@ class BookListDisplay:
self.dosave = dosave
base = os.path.dirname(__file__)
glade_file = os.path.join(base,"book.glade")
self.xml = gtk.glade.XML(glade_file, "booklist", "gramps")
self.xml = glade.XML(glade_file, "booklist", "gramps")
self.top = self.xml.get_widget('booklist')
ManagedWindow.set_titles(self.top,
@ -703,7 +704,7 @@ class BookReportSelector(ManagedWindow.ManagedWindow):
base = os.path.dirname(__file__)
glade_file = os.path.join(base,"book.glade")
self.xml = gtk.glade.XML(glade_file, "top", "gramps")
self.xml = glade.XML(glade_file, "top", "gramps")
window = self.xml.get_widget("top")
title_label = self.xml.get_widget('title')
self.set_window(window, title_label, self.title)

View File

@ -37,17 +37,16 @@ import os
#------------------------------------------------------------------------
import BaseDoc
from BasicUtils import name_displayer
from DateHandler import displayer
from PluginUtils import register_report, relationship_class
from ReportBase import Report, ReportUtils, MenuReportOptions, \
CATEGORY_DRAW, CATEGORY_TEXT, \
MODE_GUI, MODE_BKI, MODE_CLI
from PluginUtils import NumberOption, BooleanOption, StringOption, \
FilterOption, EnumeratedListOption, PersonOption
from ReportBase import (Report, ReportUtils, MenuReportOptions,
CATEGORY_DRAW, CATEGORY_TEXT,
MODE_GUI, MODE_BKI, MODE_CLI)
from PluginUtils import (NumberOption, BooleanOption, StringOption,
FilterOption, EnumeratedListOption, PersonOption)
import GrampsLocale
import gen.lib
from Utils import probably_alive, ProgressMeter
from FontScale import string_trim, string_width
from FontScale import string_trim
pt2cm = ReportUtils.pt2cm
cm2pt = ReportUtils.cm2pt

View File

@ -37,7 +37,7 @@ from gettext import gettext as _
#-------------------------------------------------------------------------
import gobject
import gtk
import gtk.glade
from gtk import glade
#-------------------------------------------------------------------------
#
@ -178,7 +178,7 @@ class ChangeNames(Tool.BatchTool, ManagedWindow.ManagedWindow):
base = os.path.dirname(__file__)
glade_file = os.path.join(base,"changenames.glade")
self.top = gtk.glade.XML(glade_file,"top","gramps")
self.top = glade.XML(glade_file,"top","gramps")
window = self.top.get_widget('top')
self.top.signal_autoconnect({
"destroy_passed_object" : self.close,

View File

@ -35,15 +35,13 @@ from gettext import gettext as _
# GNOME/GTK modules
#
#------------------------------------------------------------------------
import gtk
import gtk.glade
from gtk import glade
#------------------------------------------------------------------------
#
# GRAMPS modules
#
#------------------------------------------------------------------------
import const
import Utils
import locale
import ManagedWindow
@ -78,7 +76,7 @@ class ChangeTypes(Tool.BatchTool, ManagedWindow.ManagedWindow):
base = os.path.dirname(__file__)
glade_file = "%s/%s" % (base,"changetype.glade")
self.glade = gtk.glade.XML(glade_file,"top","gramps")
self.glade = glade.XML(glade_file,"top","gramps")
self.auto1 = self.glade.get_widget("original")
self.auto2 = self.glade.get_widget("new")

View File

@ -47,7 +47,7 @@ log = logging.getLogger(".CheckRepair")
#
#-------------------------------------------------------------------------
import gtk
import gtk.glade
from gtk import glade
#-------------------------------------------------------------------------
#
@ -56,7 +56,7 @@ import gtk.glade
#-------------------------------------------------------------------------
import gen.lib
import Utils
import const
#import const
import ManagedWindow
from PluginUtils import Tool, register_tool
@ -109,8 +109,9 @@ def _table_low_level(db,table):
print " No dupes found for this table"
return True
import gen.db
table_cursor = gen.db.GrampsDBDirDupCursor(table)
# import gen.db
from gen.db import GrampsDBDirDupCursor
table_cursor = GrampsDBDirDupCursor(table)
for handle in dup_handles:
print " Duplicates found for handle: %s" % handle
try:
@ -1472,7 +1473,7 @@ class Report(ManagedWindow.ManagedWindow):
base = os.path.dirname(__file__)
glade_file = base + os.sep + "summary.glade"
topDialog = gtk.glade.XML(glade_file,"summary","gramps")
topDialog = glade.XML(glade_file,"summary","gramps")
topDialog.get_widget("close").connect('clicked',self.close)
window = topDialog.get_widget("summary")

View File

@ -38,7 +38,7 @@ from gettext import gettext as _
#
#-------------------------------------------------------------------------
from PluginUtils import Tool, cl_list, cli_tool_list, register_tool
from ReportBase import CATEGORY_BOOK, CATEGORY_CODE, CATEGORY_WEB
from ReportBase import CATEGORY_BOOK, CATEGORY_WEB
from ReportBase._CommandLineReport import CommandLineReport
#-------------------------------------------------------------------------

View File

@ -38,7 +38,7 @@ from math import pow
# GNOME/GTK modules
#
#------------------------------------------------------------------------
import gtk.glade
from gtk import glade
#------------------------------------------------------------------------
#
@ -65,7 +65,7 @@ class CountAncestors(ManagedWindow.ManagedWindow):
database = dbstate.db
text = ""
glade_file = "%s/summary.glade" % os.path.dirname(__file__)
topDialog = gtk.glade.XML(glade_file,"summary","gramps")
topDialog = glade.XML(glade_file,"summary","gramps")
topDialog.signal_autoconnect({
"destroy_passed_object" : self.close,
})

View File

@ -34,7 +34,6 @@ from gettext import gettext as _
# gtk
#
#------------------------------------------------------------------------
import gtk
#------------------------------------------------------------------------
#

Some files were not shown because too many files have changed in this diff Show More