Commit c7ce7c19 authored by eric pellegrini's avatar eric pellegrini

small refactoring of MDANSE __init__

parent ea9bedb9
from MDANSE.Framework.Configurators import *
from MDANSE.Framework.Formats import *
from MDANSE.Framework.Handlers import *
from MDANSE.Framework.InputData import *
from MDANSE.Framework.InstrumentResolutions import *
from MDANSE.Framework.Jobs import *
from MDANSE.Framework.OutputVariables import *
from MDANSE.Framework.Projectors import *
from MDANSE.Framework.QVectors import *
from MDANSE.Framework.Selectors import *
import os
from MDANSE import PLATFORM, REGISTRY
REGISTRY.update(os.path.join(os.path.dirname(__file__),"*"))
macrosDirectories = sorted([x[0] for x in os.walk(PLATFORM.macros_directory())][0:])
for d in macrosDirectories:
REGISTRY.update(d)
......@@ -8,18 +8,13 @@ from MDANSE.Externals.pubsub import pub as PUBLISHER
if platform.dist()[0].lower() == "ubuntu":
os.environ["UBUNTU_MENUPROXY"] = "0"
from MDANSE import PLATFORM, REGISTRY
from MDANSE import REGISTRY
from MDANSE.GUI.Plugins.DataPlugin import DataPlugin
from MDANSE.GUI.Plugins.JobPlugin import JobPlugin
from MDANSE.GUI.Handlers import *
from MDANSE.GUI.Plugins import *
from MDANSE.GUI.Widgets import *
macrosDirectories = sorted([x[0] for x in os.walk(PLATFORM.macros_directory())][0:])
for d in macrosDirectories:
REGISTRY.update(d)
REGISTRY.update(os.path.join(os.path.dirname(__file__),"Handlers"))
REGISTRY.update(os.path.join(os.path.dirname(__file__),"Plugins"))
REGISTRY.update(os.path.join(os.path.dirname(__file__),"Widgets"))
for job in REGISTRY["job"].values():
......@@ -30,7 +25,7 @@ for job in REGISTRY["job"].values():
"ancestor" : getattr(job,'ancestor',job.ancestor),
"category" : getattr(job, "category", ("Miscellaneous",)),
"label" : getattr(job, "label", job.__name__)}
kls = type("%sPlugin" % job.__name__, (JobPlugin,), attrs)
REGISTRY[job._type] = kls
......
......@@ -52,8 +52,3 @@ from MMTK import Database
# The default database is still the MMTK one
Database.path.append(os.path.join(PLATFORM.package_directory(), 'Data'))
macrosDirectories = sorted([x[0] for x in os.walk(PLATFORM.macros_directory())][0:])
for d in macrosDirectories:
REGISTRY.update(d)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment