3292: register plugins, load on need, not on start of GRAMPS - GEPS 014
svn: r13400
This commit is contained in:
@@ -51,7 +51,6 @@ import gen.lib
|
||||
from Filters import GenericFilter, Rules, build_filter_model
|
||||
import Utils
|
||||
from QuestionDialog import ErrorDialog
|
||||
from gen.plug import PluginManager, ExportPlugin
|
||||
import gen.proxy
|
||||
import DateHandler
|
||||
from glade import Glade
|
||||
@@ -475,20 +474,3 @@ class CSVWriter(object):
|
||||
|
||||
def format_date(self, date):
|
||||
return DateHandler.get_date(date)
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Register the plugin
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
_name = _('Comma _Separated Values Spreadsheet (CSV)')
|
||||
_description = _('CSV is a common spreadsheet format.')
|
||||
_config = (_('CSV spreadsheet options'),CSVWriterOptionBox)
|
||||
|
||||
pmgr = PluginManager.get_instance()
|
||||
plugin = ExportPlugin(name = _name,
|
||||
description = _description,
|
||||
export_function = exportData,
|
||||
extension = "csv",
|
||||
config = _config )
|
||||
pmgr.register_plugin(plugin)
|
||||
|
@@ -48,7 +48,6 @@ import Utils
|
||||
from Filters import GenericFilter, Rules, build_filter_model
|
||||
import Errors
|
||||
from QuestionDialog import ErrorDialog
|
||||
from gen.plug import PluginManager, ExportPlugin
|
||||
from glade import Glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -282,18 +281,3 @@ def get_name(name, count):
|
||||
(str(count) if count != -1 else '') +
|
||||
(', ' +name.suffix if name.suffix else '')
|
||||
)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Register with the plugin system
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
_config = (_('Web Family Tree export options'), FtreeWriterOptionBox)
|
||||
|
||||
pmgr = PluginManager.get_instance()
|
||||
plugin = ExportPlugin(name = _('_Web Family Tree'),
|
||||
description = _('Web Family Tree format.'),
|
||||
export_function = writeData,
|
||||
extension = "wft",
|
||||
config = _config )
|
||||
pmgr.register_plugin(plugin)
|
||||
|
@@ -48,7 +48,6 @@ import BasicUtils
|
||||
from Utils import media_path_full
|
||||
import gen.proxy
|
||||
from QuestionDialog import ErrorDialog
|
||||
from gen.plug import PluginManager, ExportPlugin
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -1405,20 +1404,3 @@ def export_data(database, filename, option_box=None, callback=None):
|
||||
except:
|
||||
ErrorDialog(_("Could not create %s") % filename)
|
||||
return ret
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Register with the plugin system
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
_description = _('GEDCOM is used to transfer data between genealogy programs. '
|
||||
'Most genealogy software will accept a GEDCOM file as input.')
|
||||
_config = (_('GEDCOM export options'), ExportOptions.WriterOptionBox)
|
||||
|
||||
pmgr = PluginManager.get_instance()
|
||||
plugin = ExportPlugin(name = _('GE_DCOM'),
|
||||
description = _description,
|
||||
export_function = export_data,
|
||||
extension = "ged",
|
||||
config = _config )
|
||||
pmgr.register_plugin(plugin)
|
||||
|
@@ -50,7 +50,6 @@ from Filters import GenericFilter, Rules, build_filter_model
|
||||
#import const
|
||||
import Utils
|
||||
from QuestionDialog import ErrorDialog
|
||||
from gen.plug import PluginManager, ExportPlugin
|
||||
from glade import Glade
|
||||
import config
|
||||
|
||||
@@ -612,19 +611,3 @@ class GeneWebWriter(object):
|
||||
def exportData(database, filename, option_box=None, callback=None):
|
||||
gw = GeneWebWriter(database, filename, option_box, callback)
|
||||
return gw.export_data()
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Register with the plugin system
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
_description = _('GeneWeb is a web based genealogy program.')
|
||||
_config = (_('GeneWeb export options'), GeneWebWriterOptionBox)
|
||||
|
||||
pmgr = PluginManager.get_instance()
|
||||
plugin = ExportPlugin(name = _('_GeneWeb'),
|
||||
description = _description,
|
||||
export_function = exportData,
|
||||
extension = "gw",
|
||||
config = _config )
|
||||
pmgr.register_plugin(plugin)
|
||||
|
@@ -36,9 +36,6 @@ import sys
|
||||
import tarfile
|
||||
from cStringIO import StringIO
|
||||
from gettext import gettext as _
|
||||
import ExportOptions
|
||||
#from BasicUtils import UpdateCallback
|
||||
import gen.proxy
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@@ -60,8 +57,10 @@ import gtk
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import ExportOptions
|
||||
#from BasicUtils import UpdateCallback
|
||||
import gen.proxy
|
||||
from ExportXml import XmlWriter
|
||||
from gen.plug import PluginManager, ExportPlugin
|
||||
import Utils
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -231,20 +230,3 @@ class PackageWriter(object):
|
||||
g.close()
|
||||
|
||||
return True
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Register with the plugin system
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
_description = _('GRAMPS package is an archived XML database together '
|
||||
'with the media object files.')
|
||||
_config = (_('GRAMPS package export options'), ExportOptions.WriterOptionBox)
|
||||
|
||||
pmgr = PluginManager.get_instance()
|
||||
plugin = ExportPlugin(name = _('GRAM_PS package (portable XML)'),
|
||||
description = _description,
|
||||
export_function = writeData,
|
||||
extension = "gpkg",
|
||||
config = _config )
|
||||
pmgr.register_plugin(plugin)
|
||||
|
@@ -44,7 +44,6 @@ log = logging.getLogger(".ExportSql")
|
||||
# GRAMPS modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gen.plug import PluginManager, ExportPlugin
|
||||
import ExportOptions
|
||||
from Utils import create_id
|
||||
|
||||
@@ -1073,20 +1072,3 @@ def exportData(database, filename, option_box=None, callback=None):
|
||||
# Name formats
|
||||
# Namemaps?
|
||||
# GRAMPS Version #, date, exporter
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Register the plugin
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
_name = _('SQLite Export')
|
||||
_description = _('SQLite is a common local database format')
|
||||
_config = (_('SQLite options'), ExportOptions.WriterOptionBox)
|
||||
|
||||
pmgr = PluginManager.get_instance()
|
||||
plugin = ExportPlugin(name = _name,
|
||||
description = _description,
|
||||
export_function = exportData,
|
||||
extension = "sql",
|
||||
config = _config )
|
||||
pmgr.register_plugin(plugin)
|
||||
|
@@ -51,7 +51,6 @@ import Utils
|
||||
from gen.lib import Date, EventType
|
||||
import Errors
|
||||
from QuestionDialog import ErrorDialog
|
||||
from gen.plug import PluginManager, ExportPlugin
|
||||
from glade import Glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -342,19 +341,3 @@ class CalendarWriter(object):
|
||||
def exportData(database, filename, option_box=None, callback=None):
|
||||
cw = CalendarWriter(database, 0, filename, option_box, callback)
|
||||
return cw.export_data(filename)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Register with the plugin system
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
_description = _('vCalendar is used in many calendaring and pim applications.')
|
||||
_config = (_('vCalendar export options'), CalendarWriterOptionBox)
|
||||
|
||||
pmgr = PluginManager.get_instance()
|
||||
plugin = ExportPlugin(name = _('vC_alendar'),
|
||||
description = _description,
|
||||
export_function = exportData,
|
||||
extension = "vcs",
|
||||
config = _config )
|
||||
pmgr.register_plugin(plugin)
|
||||
|
@@ -49,7 +49,6 @@ from Filters import GenericFilter, Rules, build_filter_model
|
||||
from gen.lib import Date
|
||||
import Errors
|
||||
from QuestionDialog import ErrorDialog
|
||||
from gen.plug import PluginManager, ExportPlugin
|
||||
from glade import Glade
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -256,19 +255,3 @@ class CardWriter(object):
|
||||
def exportData(database, filename, option_box=None, callback=None):
|
||||
cw = CardWriter(database, 0, filename, option_box, callback)
|
||||
return cw.export_data(filename)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Register with the plugin system
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
_description = _('vCard is used in many addressbook and pim applications.')
|
||||
_config = (_('vCard export options'), CardWriterOptionBox)
|
||||
|
||||
pmgr = PluginManager.get_instance()
|
||||
plugin = ExportPlugin(name = _('_vCard'),
|
||||
description = _description,
|
||||
export_function = exportData,
|
||||
extension = "vcf",
|
||||
config = _config )
|
||||
pmgr.register_plugin(plugin)
|
||||
|
@@ -62,7 +62,6 @@ import const
|
||||
from QuestionDialog import ErrorDialog
|
||||
import ExportOptions
|
||||
import gen.proxy
|
||||
from gen.plug import PluginManager, ExportPlugin
|
||||
import libgrampsxml
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@@ -1210,21 +1209,3 @@ class XmlWriter(GrampsDbXmlWriter):
|
||||
(m1,m2) = msg.messages()
|
||||
ErrorDialog(m1, m2)
|
||||
return ret
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Register with the plugin system
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
_description = _('GRAMPS XML export is a complete archived XML backup of the'
|
||||
' GRAMPS database without the media object files.'
|
||||
' Suitable for backup purposes.' )
|
||||
_config = (_('GRAMPS XML export options'), ExportOptions.WriterOptionBox)
|
||||
|
||||
pmgr = PluginManager.get_instance()
|
||||
plugin = ExportPlugin(name = _('GRAMPS _XML database'),
|
||||
description = _description,
|
||||
export_function = export_data,
|
||||
extension = "gramps",
|
||||
config = _config )
|
||||
pmgr.register_plugin(plugin)
|
||||
|
@@ -6,6 +6,7 @@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@/plugins/export
|
||||
|
||||
pkgdata_PYTHON = \
|
||||
export.gpr.py \
|
||||
ExportCsv.py \
|
||||
ExportFtree.py \
|
||||
ExportGedcom.py \
|
||||
|
176
src/plugins/export/export.gpr.py
Normal file
176
src/plugins/export/export.gpr.py
Normal file
@@ -0,0 +1,176 @@
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Comma _Separated Values Spreadsheet (CSV)
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
plg = newplugin()
|
||||
plg.id = 'ex_csv'
|
||||
plg.name = _("Comma _Separated Values Spreadsheet (CSV)")
|
||||
plg.description = _("CSV is a common spreadsheet format.")
|
||||
plg.version = '1.0'
|
||||
plg.status = STABLE
|
||||
plg.fname = 'ExportCsv.py'
|
||||
plg.ptype = EXPORT
|
||||
plg.export_function = 'exportData'
|
||||
plg.export_options = 'CSVWriterOptionBox'
|
||||
plg.export_options_title = ('CSV spreadsheet options')
|
||||
plg.extension = "csv"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Web Family Tree export
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
plg = newplugin()
|
||||
plg.id = 'ex_webfamtree'
|
||||
plg.name = _('_Web Family Tree')
|
||||
plg.description = _("Web Family Tree format")
|
||||
plg.version = '1.0'
|
||||
plg.status = STABLE
|
||||
plg.fname = 'ExportFtree.py'
|
||||
plg.ptype = EXPORT
|
||||
plg.export_function = 'writeData'
|
||||
plg.export_options = 'FtreeWriterOptionBox'
|
||||
plg.export_options_title = ('Web Family Tree export options')
|
||||
plg.extension = "wft"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# GEDCOM
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
plg = newplugin()
|
||||
plg.id = 'ex_ged'
|
||||
plg.name = _('GE_DCOM')
|
||||
plg.description = _('GEDCOM is used to transfer data between genealogy programs. '
|
||||
'Most genealogy software will accept a GEDCOM file as input.')
|
||||
plg.version = '1.0'
|
||||
plg.status = STABLE
|
||||
plg.fname = 'ExportGedcom.py'
|
||||
plg.ptype = EXPORT
|
||||
plg.export_function = 'export_data'
|
||||
plg.export_options = 'ExportOptions.WriterOptionBox'
|
||||
plg.export_options_title = ('GEDCOM export options')
|
||||
plg.extension = "ged"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# Geneweb
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
plg = newplugin()
|
||||
plg.id = 'ex_geneweb'
|
||||
plg.name = _('_GeneWeb')
|
||||
plg.description = _('GeneWeb is a web based genealogy program.')
|
||||
plg.version = '1.0'
|
||||
plg.status = STABLE
|
||||
plg.fname = 'ExportGeneWeb.py'
|
||||
plg.ptype = EXPORT
|
||||
plg.export_function = 'exportData'
|
||||
plg.export_options = 'GeneWebWriterOptionBox'
|
||||
plg.export_options_title = ('GeneWeb export options')
|
||||
plg.extension = "gw"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# GRAMPS package (portable XML)
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
plg = newplugin()
|
||||
plg.id = 'ex_gpkg'
|
||||
plg.name = _('GRAM_PS package (portable XML)')
|
||||
plg.description = _('GRAMPS package is an archived XML family tree together '
|
||||
'with the media object files.')
|
||||
plg.version = '1.0'
|
||||
plg.status = STABLE
|
||||
plg.fname = 'ExportPkg.py'
|
||||
plg.ptype = EXPORT
|
||||
plg.export_function = 'writeData'
|
||||
plg.export_options = 'ExportOptions.WriterOptionBox'
|
||||
plg.export_options_title = ('GRAMPS package export options')
|
||||
plg.extension = "gpkg"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# GRAMPS XML database
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
plg = newplugin()
|
||||
plg.id = 'ex_gramps'
|
||||
plg.name = _('GRAMPS _XML family tree')
|
||||
plg.description = _('GRAMPS XML export is a complete archived XML backup of a'
|
||||
' GRAMPS family tree without the media object files.'
|
||||
' Suitable for backup purposes.')
|
||||
plg.version = '1.0'
|
||||
plg.status = STABLE
|
||||
plg.fname = 'ExportXml.py'
|
||||
plg.ptype = EXPORT
|
||||
plg.export_function = 'export_data'
|
||||
plg.export_options = 'ExportOptions.WriterOptionBox'
|
||||
plg.export_options_title = ('GRAMPS XML export options')
|
||||
plg.extension = "gramps"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# SQLITE database
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
plg = newplugin()
|
||||
plg.id = 'ex_sqlite'
|
||||
plg.name = _('SQLite Export')
|
||||
plg.description = _('SQLite is a common local database format')
|
||||
plg.version = '1.0'
|
||||
plg.status = UNSTABLE
|
||||
plg.fname = 'ExportSql.py'
|
||||
plg.ptype = EXPORT
|
||||
plg.export_function = 'exportData'
|
||||
plg.export_options = 'ExportOptions.WriterOptionBox'
|
||||
plg.export_options_title = ('SQLite options')
|
||||
plg.extension = "sql"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# vCalendar
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
plg = newplugin()
|
||||
plg.id = 'ex_vcal'
|
||||
plg.name = _('vC_alendar')
|
||||
plg.description = _('vCalendar is used in many calendaring and pim applications.')
|
||||
plg.version = '1.0'
|
||||
plg.status = STABLE
|
||||
plg.fname = 'ExportVCalendar.py'
|
||||
plg.ptype = EXPORT
|
||||
plg.export_function = 'exportData'
|
||||
plg.export_options = 'CalendarWriterOptionBox'
|
||||
plg.export_options_title = ('vCalendar export options')
|
||||
plg.extension = "vcs"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# vCard
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
plg = newplugin()
|
||||
plg.id = 'ex_vcard'
|
||||
plg.name = _('_vCard')
|
||||
plg.description = _('vCard is used in many addressbook and pim applications.')
|
||||
plg.version = '1.0'
|
||||
plg.status = STABLE
|
||||
plg.fname = 'ExportVCard.py'
|
||||
plg.ptype = EXPORT
|
||||
plg.export_function = 'exportData'
|
||||
plg.export_options = 'CardWriterOptionBox'
|
||||
plg.export_options_title = ('vCard export options')
|
||||
plg.extension = "vcf"
|
||||
|
Reference in New Issue
Block a user