Código fuente para NiBAx.core.baseplugin

# This Python file uses the following encoding: utf-8
"""
Author: Ashish Singh
contact: software@cbica.upenn.edu
Copyright (c) 2018 University of Pennsylvania. All rights reserved.
Use of this source code is governed by license located in license file: https://github.com/CBICA/BrainChart/blob/main/LICENSE
"""

from yapsy.IPlugin import IPlugin
import configparser, os, sys

[documentos]class BasePlugin(IPlugin): def __init__(self): """ init """ # initialise parent class IPlugin.__init__(self)
[documentos] def activate(self): """ On activation tell that this has been successfull. """ # get the automatic procedure from IPlugin IPlugin.activate(self) return
[documentos] def deactivate(self): """ On deactivation check that the 'activated' flag was on then tell everything's ok to the test procedure. """ IPlugin.deactivate(self)
[documentos] def readAdditionalInformation(self,filename): #TODO: extend this function to read more information basename = os.path.basename(filename) suffix = '.yapsy-plugin' configfile = os.path.join(filename,basename + suffix) cfg = configparser.ConfigParser() cfg.read(configfile) if(cfg.has_section("Tab")): if(cfg.has_option("Tab","Position")): self.tabPosition = cfg.getint("Tab","Position")
[documentos] def getTabPosition(self): return self.tabPosition