Beispiel #1
0
    def __init__(self, **kwargs):

        Protocol.__init__(self, **kwargs)

        self.lastCheck = datetime.datetime.now()
        self.lastIdSeen = 0
        self._moviesWithSteps = []
Beispiel #2
0
 def _insertChild(self, key, child):
     if isinstance(child, Set):
         child.write()
     Protocol._insertChild(self, key, child)
Beispiel #3
0
 def _insertChild(self, key, child):
     if isinstance(child, Set):
         child.write()
     Protocol._insertChild(self, key, child)
Beispiel #4
0
 def __init__(self, **kwargs):
     Protocol.__init__(self, **kwargs)
Beispiel #5
0
 def __init__(self, **kwargs):
     Protocol.__init__(self, **kwargs)
Beispiel #6
0
 def __init__(self, **args):
     Protocol.__init__(self, **args)        
     self.stepsExecutionMode = params.STEPS_PARALLEL
Beispiel #7
0
def printPluginInfo(pluginName, verbosity):
    """ Print info about a given plugin """
    showBase = verbosity > 0
    subclasses = {}
    emCategories = [('Imports', em.ProtImport),
                    ('Micrographs', em.ProtMicrographs),
                    ('Particles', em.ProtParticles), ('2D', em.Prot2D),
                    ('3D', em.Prot3D)]

    plugin = Domain.getPlugin(pluginName)
    version = PluginInfo('scipion-em-%s' % pluginName).pipVersion
    print("Plugin name: %s, version: %s\n" % (pluginName, version))

    print("Plugin binaries: ")
    env = createEnvironment()
    plugin.Plugin.defineBinaries(env)
    print(env.printHelp())

    # print bibtex
    bib, error2 = getSubmodule(pluginName, 'bibtex')
    if bib is None:
        if error2 is None:
            msg = " missing bibtex"
        else:
            msg = " error -> %s" % error2
    else:
        print("Plugin references:")
        bibtex = pwutils.parseBibTex(bib.__doc__)

        for citeStr in bibtex:
            text = Protocol()._getCiteText(bibtex[citeStr])
            print(text)

    # print protocols
    sub, error = getSubmodule(pluginName, 'protocols')
    if sub is None:
        if error is None:
            msg = " missing protocols"
        else:
            msg = " error -> %s" % error

    else:
        for name in dir(sub):
            attr = getattr(sub, name)
            if inspect.isclass(attr) and issubclass(attr, Protocol):
                # Set this special property used by Scipion
                attr._package = plugin
                subclasses[name] = attr

    print("Plugin protocols:\n")
    print("%-35s %-35s %-10s %-s" %
          ('NAME', 'LABEL', 'CATEGORY', 'DESCRIPTION'))

    prots = OrderedDict(sorted(subclasses.items()))
    for prot in prots:
        label = prots[prot].getClassLabel()
        desc = getFirstLine(prots[prot].__doc__)
        cat = 'None'

        for c in emCategories:
            if issubclass(prots[prot], c[1]):
                cat = c[0]
            if prots[prot].isBase():
                cat = 'Base prot'

        # skip Base protocols if not requested
        if prots[prot].isBase() and not showBase:
            continue
        else:
            print("%-35s %-35s %-10s %-s" % (prot, label, cat, desc))
        print("Plugin binaries: %s" % bin)

        # print bibtex
        bib, error2 = getSubmodule(plugin, pluginName, 'bibtex')
        if bib is None:
            if error2 is None:
                msg = " missing bibtex"
            else:
                exitWithErrors = True
                msg = " error -> %s" % error2
        else:
            print("Plugin references:")
            bibtex = pwutils.parseBibTex(bib.__doc__)

            for citeStr in bibtex:
                text = Protocol()._getCiteText(bibtex[citeStr])
                print(text)

        # print protocols
        sub, error = getSubmodule(plugin, pluginName, 'protocols')
        if sub is None:
            if error is None:
                msg = " missing protocols"
            else:
                exitWithErrors = True
                msg = " error -> %s" % error

        else:
            for name in dir(sub):
                attr = getattr(sub, name)
                if inspect.isclass(attr) and issubclass(attr, Protocol):
 def __init__(self, **args):
     Protocol.__init__(self, **args)
     self.nClass = None