2008-10-14 08:04:28 +05:30
|
|
|
#
|
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
|
|
|
# Copyright (C) 2008 Brian G. Matherly
|
|
|
|
#
|
|
|
|
# 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 module provides the base class for plugins.
|
|
|
|
"""
|
|
|
|
|
2009-05-21 22:49:50 +05:30
|
|
|
class Plugin(object):
|
2008-10-14 08:04:28 +05:30
|
|
|
"""
|
|
|
|
This class serves as a base class for all plugins that can be registered
|
|
|
|
with the plugin manager
|
|
|
|
"""
|
2009-01-30 07:46:00 +05:30
|
|
|
def __init__(self, name, description, module_name):
|
2008-10-14 08:04:28 +05:30
|
|
|
"""
|
|
|
|
@param name: A friendly name to call this plugin.
|
|
|
|
Example: "GEDCOM Import"
|
|
|
|
@type name: string
|
2009-01-30 07:46:00 +05:30
|
|
|
@param description: A short description of the plugin.
|
2008-10-14 08:04:28 +05:30
|
|
|
Example: "This plugin will import a GEDCOM file into a database"
|
|
|
|
@type description: string
|
2009-01-30 07:46:00 +05:30
|
|
|
@param module_name: The name of the module that contains this plugin.
|
|
|
|
Example: "gedcom"
|
|
|
|
@type module_name: string
|
2008-10-14 08:04:28 +05:30
|
|
|
@return: nothing
|
|
|
|
"""
|
|
|
|
self.__name = name
|
|
|
|
self.__desc = description
|
2009-01-30 07:46:00 +05:30
|
|
|
self.__mod_name = module_name
|
2008-10-14 08:04:28 +05:30
|
|
|
|
|
|
|
def get_name(self):
|
|
|
|
"""
|
|
|
|
Get the name of this plugin.
|
|
|
|
|
|
|
|
@return: a string representing the name of the plugin
|
|
|
|
"""
|
|
|
|
return self.__name
|
|
|
|
|
|
|
|
def get_description(self):
|
|
|
|
"""
|
|
|
|
Get the description of this plugin.
|
|
|
|
|
|
|
|
@return: a string that describes the plugin
|
|
|
|
"""
|
|
|
|
return self.__desc
|
|
|
|
|
|
|
|
def get_module_name(self):
|
|
|
|
"""
|
|
|
|
Get the name of the module that this plugin lives in.
|
|
|
|
|
|
|
|
@return: a string representing the name of the module for this plugin
|
|
|
|
"""
|
2009-01-30 07:46:00 +05:30
|
|
|
return self.__mod_name
|
2008-10-14 08:04:28 +05:30
|
|
|
|