File: register_mixed_component_extension.py

package info (click to toggle)
camitk 6.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 389,496 kB
  • sloc: cpp: 103,476; sh: 2,448; python: 1,618; xml: 984; makefile: 128; perl: 84; sed: 20
file content (22 lines) | stat: -rw-r--r-- 871 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import camitk
# This line will run the mixedcomponentextension/__init__.py 
# which register the component extension to the CamiTK application
from mixedcomponentextension import MixedComponentExtension

def check_registration():
    return "pymixed" in camitk.ExtensionManager.getFileExtensions()

def init(self:camitk.Action):
    isRegistered = check_registration()
    self.setParameterValue("Python Mixed Extension Registered", isRegistered)
    self.setApplyButtonText("Check Registration")
    if isRegistered:
        camitk.trace("MixedComponentExtension registered.")
    else:
        camitk.warning("MixedComponentExtension was not registered")
    return isRegistered

def process(self:camitk.Action):
    self.setParameterValue("Python Mixed Extension Registered", check_registration())
    return True # nothing to do as the registration was already done