Move _GedcomParse.py to src/plugins/lib/libgedcom.py. Remove GrampsDbUtils.
svn: r13940
This commit is contained in:
parent
bbdf6d80cc
commit
4838650df4
@ -341,10 +341,6 @@ src/docgen/OpenSpreadSheet.py
|
|||||||
src/docgen/SpreadSheetDoc.py
|
src/docgen/SpreadSheetDoc.py
|
||||||
src/docgen/TextBufDoc.py
|
src/docgen/TextBufDoc.py
|
||||||
|
|
||||||
# GrampsDbUtils package
|
|
||||||
src/GrampsDbUtils/_GedcomParse.py
|
|
||||||
src/GrampsDbUtils/__init__.py
|
|
||||||
|
|
||||||
# GrampsLocale package
|
# GrampsLocale package
|
||||||
src/GrampsLocale/_GrampsLocale.py
|
src/GrampsLocale/_GrampsLocale.py
|
||||||
|
|
||||||
@ -439,6 +435,7 @@ src/plugins/import/ImportXml.py
|
|||||||
# plugins/lib directory
|
# plugins/lib directory
|
||||||
src/plugins/lib/libcairodoc.py
|
src/plugins/lib/libcairodoc.py
|
||||||
src/plugins/lib/libformatting.py
|
src/plugins/lib/libformatting.py
|
||||||
|
src/plugins/lib/libgedcom.py
|
||||||
src/plugins/lib/libgrampsxml.py
|
src/plugins/lib/libgrampsxml.py
|
||||||
src/plugins/lib/libgrdb.py
|
src/plugins/lib/libgrdb.py
|
||||||
src/plugins/lib/libholiday.py
|
src/plugins/lib/libholiday.py
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
# This is the src/GrampsDbUtils level Makefile for Gramps
|
|
||||||
# We could use GNU make's ':=' syntax for nice wildcard use,
|
|
||||||
# but that is not necessarily portable.
|
|
||||||
# If not using GNU make, then list all .py files individually
|
|
||||||
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@/GrampsDbUtils
|
|
||||||
|
|
||||||
pkgdata_PYTHON = \
|
|
||||||
_GedcomParse.py\
|
|
||||||
__init__.py
|
|
||||||
|
|
||||||
pkgpyexecdir = @pkgpyexecdir@/GrampsDbUtils
|
|
||||||
pkgpythondir = @pkgpythondir@/GrampsDbUtils
|
|
||||||
|
|
||||||
# Clean up all the byte-compiled files
|
|
||||||
MOSTLYCLEANFILES = *pyc *pyo
|
|
||||||
|
|
||||||
GRAMPS_PY_MODPATH = "../"
|
|
||||||
|
|
||||||
pycheck:
|
|
||||||
(export PYTHONPATH=$(GRAMPS_PY_MODPATH); \
|
|
||||||
pychecker $(pkgdata_PYTHON));
|
|
||||||
|
|
||||||
pylint:
|
|
||||||
(export PYTHONPATH=..:.; pylint --rcfile=pylintrc _GedcomParse.py)
|
|
@ -1,28 +0,0 @@
|
|||||||
#
|
|
||||||
# Gramps - a GTK+/GNOME based genealogy program
|
|
||||||
#
|
|
||||||
# Copyright (C) 2004-2006 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$
|
|
||||||
|
|
||||||
"""
|
|
||||||
This package implements additions to the the GrampsDb database.
|
|
||||||
"""
|
|
||||||
|
|
||||||
from _GedcomParse import GedcomParser
|
|
||||||
|
|
@ -11,7 +11,6 @@ SUBDIRS = \
|
|||||||
FilterEditor \
|
FilterEditor \
|
||||||
gen \
|
gen \
|
||||||
glade \
|
glade \
|
||||||
GrampsDbUtils \
|
|
||||||
GrampsLocale \
|
GrampsLocale \
|
||||||
GrampsLogger \
|
GrampsLogger \
|
||||||
gui \
|
gui \
|
||||||
|
@ -41,7 +41,7 @@ import time
|
|||||||
import gen.lib
|
import gen.lib
|
||||||
from gen.lib.date import make_gedcom_date, MONTH
|
from gen.lib.date import make_gedcom_date, MONTH
|
||||||
import const
|
import const
|
||||||
import GrampsDbUtils._GedcomParse as libgedcom
|
import libgedcom
|
||||||
import Errors
|
import Errors
|
||||||
from ExportOptions import WriterOptionBox
|
from ExportOptions import WriterOptionBox
|
||||||
import BasicUtils
|
import BasicUtils
|
||||||
|
@ -43,10 +43,10 @@ LOG = logging.getLogger(".GedcomImport")
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
import Errors
|
import Errors
|
||||||
from GrampsDbUtils._GedcomParse import GedcomParser, GedcomStageOne
|
|
||||||
from QuestionDialog import ErrorDialog, DBErrorDialog
|
from QuestionDialog import ErrorDialog, DBErrorDialog
|
||||||
from glade import Glade
|
from glade import Glade
|
||||||
from libmixin import DbMixin
|
from libmixin import DbMixin
|
||||||
|
import libgedcom
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import config
|
import config
|
||||||
@ -102,14 +102,14 @@ def importData(database, filename, callback=None):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
ifile = open(filename, "rU")
|
ifile = open(filename, "rU")
|
||||||
stage_one = GedcomStageOne(ifile)
|
stage_one = libgedcom.GedcomStageOne(ifile)
|
||||||
stage_one.parse()
|
stage_one.parse()
|
||||||
|
|
||||||
if code_set:
|
if code_set:
|
||||||
stage_one.set_encoding(code_set)
|
stage_one.set_encoding(code_set)
|
||||||
ifile.seek(0)
|
ifile.seek(0)
|
||||||
gedparse = GedcomParser(database, ifile, filename, callback,
|
gedparse = libgedcom.GedcomParser(database, ifile, filename, callback,
|
||||||
stage_one, DEFAULT_SOURCE)
|
stage_one, DEFAULT_SOURCE)
|
||||||
except IOError, msg:
|
except IOError, msg:
|
||||||
ErrorDialog(_("%s could not be opened\n") % filename, str(msg))
|
ErrorDialog(_("%s could not be opened\n") % filename, str(msg))
|
||||||
return
|
return
|
||||||
|
@ -7,7 +7,8 @@ pkgdatadir = $(datadir)/@PACKAGE@/plugins/lib
|
|||||||
|
|
||||||
pkgdata_PYTHON = \
|
pkgdata_PYTHON = \
|
||||||
libcairodoc.py\
|
libcairodoc.py\
|
||||||
libformatting.py \
|
libformatting.py\
|
||||||
|
libgedcom.py\
|
||||||
libgrampsxml.py\
|
libgrampsxml.py\
|
||||||
libgrdb.py\
|
libgrdb.py\
|
||||||
libhtml.py\
|
libhtml.py\
|
||||||
|
@ -56,6 +56,22 @@ authors_email = ["http://gramps-project.org"],
|
|||||||
#load_on_reg = True
|
#load_on_reg = True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# libgedcom
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------
|
||||||
|
register(GENERAL,
|
||||||
|
id = 'libgedcom',
|
||||||
|
name = "GEDCOM library",
|
||||||
|
description = _("Provides GEDCOM processing functionality"),
|
||||||
|
version = '1.0',
|
||||||
|
status = STABLE,
|
||||||
|
fname = 'libgedcom.py',
|
||||||
|
authors = ["The Gramps project"],
|
||||||
|
authors_email = ["http://gramps-project.org"],
|
||||||
|
)
|
||||||
|
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# libgrampsxml
|
# libgrampsxml
|
||||||
|
@ -30,6 +30,8 @@ import os
|
|||||||
from tempfile import mkstemp
|
from tempfile import mkstemp
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
from glade import Glade
|
from glade import Glade
|
||||||
|
import libgedcom
|
||||||
|
|
||||||
#
|
#
|
||||||
# Interface to phpGedView
|
# Interface to phpGedView
|
||||||
#
|
#
|
||||||
@ -315,7 +317,6 @@ class phpGedViewImporter(object):
|
|||||||
gtk.main_iteration()
|
gtk.main_iteration()
|
||||||
|
|
||||||
def on_next_pressed_cb(self, widget, event=None, data=None):
|
def on_next_pressed_cb(self, widget, event=None, data=None):
|
||||||
from GrampsDbUtils import GedcomParser
|
|
||||||
if event:
|
if event:
|
||||||
print event.type
|
print event.type
|
||||||
|
|
||||||
@ -334,7 +335,7 @@ class phpGedViewImporter(object):
|
|||||||
|
|
||||||
self.update_progressbar( _("Importing GEDCOM..."))
|
self.update_progressbar( _("Importing GEDCOM..."))
|
||||||
|
|
||||||
GedcomParser.importData(self.db, fn)
|
libgedcom.GedcomParser.importData(self.db, fn)
|
||||||
# done. bye.
|
# done. bye.
|
||||||
self.dialog.destroy()
|
self.dialog.destroy()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user