3413: Hidden export plugins still show in list; and rewrote eval() as getattr()
svn: r13708
This commit is contained in:
parent
e9bc3df09b
commit
b876023812
@ -45,6 +45,7 @@ from gettext import gettext as _
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
import config
|
||||||
import gen.utils
|
import gen.utils
|
||||||
from gen.plug import PluginRegister
|
from gen.plug import PluginRegister
|
||||||
|
|
||||||
@ -279,11 +280,13 @@ class BasePluginManager(object):
|
|||||||
if self.__import_plugins == []:
|
if self.__import_plugins == []:
|
||||||
#The module still needs to be imported
|
#The module still needs to be imported
|
||||||
for pdata in self.get_reg_importers():
|
for pdata in self.get_reg_importers():
|
||||||
|
if pdata.id in config.get("plugin.hiddenplugins"):
|
||||||
|
continue
|
||||||
mod = self.load_plugin(pdata)
|
mod = self.load_plugin(pdata)
|
||||||
if mod:
|
if mod:
|
||||||
imp = gen.plug.ImportPlugin(name=pdata.name,
|
imp = gen.plug.ImportPlugin(name=pdata.name,
|
||||||
description = pdata.description,
|
description = pdata.description,
|
||||||
import_function = eval('mod.' + pdata.import_function),
|
import_function = getattr(mod, pdata.import_function),
|
||||||
extension = pdata.extension)
|
extension = pdata.extension)
|
||||||
self.__import_plugins.append(imp)
|
self.__import_plugins.append(imp)
|
||||||
|
|
||||||
@ -300,14 +303,16 @@ class BasePluginManager(object):
|
|||||||
if self.__export_plugins == []:
|
if self.__export_plugins == []:
|
||||||
#The modules still need to be imported
|
#The modules still need to be imported
|
||||||
for pdata in self.get_reg_exporters():
|
for pdata in self.get_reg_exporters():
|
||||||
|
if pdata.id in config.get("plugin.hiddenplugins"):
|
||||||
|
continue
|
||||||
mod = self.load_plugin(pdata)
|
mod = self.load_plugin(pdata)
|
||||||
if mod:
|
if mod:
|
||||||
exp = gen.plug.ExportPlugin(name=pdata.name,
|
exp = gen.plug.ExportPlugin(name=pdata.name,
|
||||||
description = pdata.description,
|
description = pdata.description,
|
||||||
export_function = eval('mod.' + pdata.export_function),
|
export_function = getattr(mod, pdata.export_function),
|
||||||
extension = pdata.extension,
|
extension = pdata.extension,
|
||||||
config = (pdata.export_options_title,
|
config = (pdata.export_options_title,
|
||||||
eval('mod.' + pdata.export_options)))
|
getattr(mod, pdata.export_options)))
|
||||||
self.__export_plugins.append(exp)
|
self.__export_plugins.append(exp)
|
||||||
|
|
||||||
return self.__export_plugins
|
return self.__export_plugins
|
||||||
@ -324,11 +329,13 @@ class BasePluginManager(object):
|
|||||||
if self.__docgen_plugins == []:
|
if self.__docgen_plugins == []:
|
||||||
#The modules still need to be imported
|
#The modules still need to be imported
|
||||||
for pdata in self.get_reg_docgens():
|
for pdata in self.get_reg_docgens():
|
||||||
|
if pdata.id in config.get("plugin.hiddenplugins"):
|
||||||
|
continue
|
||||||
mod = self.load_plugin(pdata)
|
mod = self.load_plugin(pdata)
|
||||||
if mod:
|
if mod:
|
||||||
dgp = gen.plug.DocGenPlugin(name=pdata.name,
|
dgp = gen.plug.DocGenPlugin(name=pdata.name,
|
||||||
description = pdata.description,
|
description = pdata.description,
|
||||||
basedoc = eval('mod.' + pdata.basedocclass),
|
basedoc = getattr(mod, pdata.basedocclass),
|
||||||
paper = pdata.paper,
|
paper = pdata.paper,
|
||||||
style = pdata.style,
|
style = pdata.style,
|
||||||
extension = pdata.extension )
|
extension = pdata.extension )
|
||||||
|
@ -43,7 +43,7 @@ from gen.lib.date import make_gedcom_date, MONTH
|
|||||||
import const
|
import const
|
||||||
import GrampsDbUtils._GedcomInfo as GedcomInfo
|
import GrampsDbUtils._GedcomInfo as GedcomInfo
|
||||||
import Errors
|
import Errors
|
||||||
import ExportOptions
|
from ExportOptions import WriterOptionBox
|
||||||
import BasicUtils
|
import BasicUtils
|
||||||
from Utils import media_path_full
|
from Utils import media_path_full
|
||||||
import gen.proxy
|
import gen.proxy
|
||||||
|
@ -58,7 +58,7 @@ import gtk
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import ExportOptions
|
from ExportOptions import WriterOptionBox
|
||||||
#from BasicUtils import UpdateCallback
|
#from BasicUtils import UpdateCallback
|
||||||
import gen.proxy
|
import gen.proxy
|
||||||
from ExportXml import XmlWriter
|
from ExportXml import XmlWriter
|
||||||
|
@ -44,7 +44,7 @@ log = logging.getLogger(".ExportSql")
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
import ExportOptions
|
from ExportOptions import WriterOptionBox
|
||||||
from Utils import create_id
|
from Utils import create_id
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -60,7 +60,7 @@ from BasicUtils import UpdateCallback
|
|||||||
from gen.db.exceptions import GrampsDbWriteFailure
|
from gen.db.exceptions import GrampsDbWriteFailure
|
||||||
import const
|
import const
|
||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
import ExportOptions
|
from ExportOptions import WriterOptionBox
|
||||||
import gen.proxy
|
import gen.proxy
|
||||||
import libgrampsxml
|
import libgrampsxml
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ plg.status = STABLE
|
|||||||
plg.fname = 'ExportGedcom.py'
|
plg.fname = 'ExportGedcom.py'
|
||||||
plg.ptype = EXPORT
|
plg.ptype = EXPORT
|
||||||
plg.export_function = 'export_data'
|
plg.export_function = 'export_data'
|
||||||
plg.export_options = 'ExportOptions.WriterOptionBox'
|
plg.export_options = 'WriterOptionBox'
|
||||||
plg.export_options_title = ('GEDCOM export options')
|
plg.export_options_title = ('GEDCOM export options')
|
||||||
plg.extension = "ged"
|
plg.extension = "ged"
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ plg.status = STABLE
|
|||||||
plg.fname = 'ExportPkg.py'
|
plg.fname = 'ExportPkg.py'
|
||||||
plg.ptype = EXPORT
|
plg.ptype = EXPORT
|
||||||
plg.export_function = 'writeData'
|
plg.export_function = 'writeData'
|
||||||
plg.export_options = 'ExportOptions.WriterOptionBox'
|
plg.export_options = 'WriterOptionBox'
|
||||||
plg.export_options_title = ('Gramps package export options')
|
plg.export_options_title = ('Gramps package export options')
|
||||||
plg.extension = "gpkg"
|
plg.extension = "gpkg"
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ plg.status = STABLE
|
|||||||
plg.fname = 'ExportXml.py'
|
plg.fname = 'ExportXml.py'
|
||||||
plg.ptype = EXPORT
|
plg.ptype = EXPORT
|
||||||
plg.export_function = 'export_data'
|
plg.export_function = 'export_data'
|
||||||
plg.export_options = 'ExportOptions.WriterOptionBox'
|
plg.export_options = 'WriterOptionBox'
|
||||||
plg.export_options_title = ('Gramps XML export options')
|
plg.export_options_title = ('Gramps XML export options')
|
||||||
plg.extension = "gramps"
|
plg.extension = "gramps"
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ plg.status = UNSTABLE
|
|||||||
plg.fname = 'ExportSql.py'
|
plg.fname = 'ExportSql.py'
|
||||||
plg.ptype = EXPORT
|
plg.ptype = EXPORT
|
||||||
plg.export_function = 'exportData'
|
plg.export_function = 'exportData'
|
||||||
plg.export_options = 'ExportOptions.WriterOptionBox'
|
plg.export_options = 'WriterOptionBox'
|
||||||
plg.export_options_title = ('SQLite options')
|
plg.export_options_title = ('SQLite options')
|
||||||
plg.extension = "sql"
|
plg.extension = "sql"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user