Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
MDANSE
Commits
c7ce7c19
Commit
c7ce7c19
authored
Nov 18, 2016
by
eric pellegrini
Browse files
small refactoring of MDANSE __init__
parent
ea9bedb9
Changes
3
Hide whitespace changes
Inline
Side-by-side
MDANSE/Framework/__init__.py
View file @
c7ce7c19
from
MDANSE.Framework.Configurators
import
*
import
os
from
MDANSE.Framework.Formats
import
*
from
MDANSE.Framework.Handlers
import
*
from
MDANSE
import
PLATFORM
,
REGISTRY
from
MDANSE.Framework.InputData
import
*
from
MDANSE.Framework.InstrumentResolutions
import
*
REGISTRY
.
update
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"*"
))
from
MDANSE.Framework.Jobs
import
*
from
MDANSE.Framework.OutputVariables
import
*
macrosDirectories
=
sorted
([
x
[
0
]
for
x
in
os
.
walk
(
PLATFORM
.
macros_directory
())][
0
:])
from
MDANSE.Framework.Projectors
import
*
for
d
in
macrosDirectories
:
from
MDANSE.Framework.QVectors
import
*
REGISTRY
.
update
(
d
)
from
MDANSE.Framework.Selectors
import
*
MDANSE/GUI/__init__.py
View file @
c7ce7c19
...
@@ -8,18 +8,13 @@ from MDANSE.Externals.pubsub import pub as PUBLISHER
...
@@ -8,18 +8,13 @@ from MDANSE.Externals.pubsub import pub as PUBLISHER
if
platform
.
dist
()[
0
].
lower
()
==
"ubuntu"
:
if
platform
.
dist
()[
0
].
lower
()
==
"ubuntu"
:
os
.
environ
[
"UBUNTU_MENUPROXY"
]
=
"0"
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.DataPlugin
import
DataPlugin
from
MDANSE.GUI.Plugins.JobPlugin
import
JobPlugin
from
MDANSE.GUI.Plugins.JobPlugin
import
JobPlugin
from
MDANSE.GUI.Handlers
import
*
REGISTRY
.
update
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"Handlers"
))
from
MDANSE.GUI.Plugins
import
*
REGISTRY
.
update
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"Plugins"
))
from
MDANSE.GUI.Widgets
import
*
REGISTRY
.
update
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"Widgets"
))
macrosDirectories
=
sorted
([
x
[
0
]
for
x
in
os
.
walk
(
PLATFORM
.
macros_directory
())][
0
:])
for
d
in
macrosDirectories
:
REGISTRY
.
update
(
d
)
for
job
in
REGISTRY
[
"job"
].
values
():
for
job
in
REGISTRY
[
"job"
].
values
():
...
@@ -30,7 +25,7 @@ for job in REGISTRY["job"].values():
...
@@ -30,7 +25,7 @@ for job in REGISTRY["job"].values():
"ancestor"
:
getattr
(
job
,
'ancestor'
,
job
.
ancestor
),
"ancestor"
:
getattr
(
job
,
'ancestor'
,
job
.
ancestor
),
"category"
:
getattr
(
job
,
"category"
,
(
"Miscellaneous"
,)),
"category"
:
getattr
(
job
,
"category"
,
(
"Miscellaneous"
,)),
"label"
:
getattr
(
job
,
"label"
,
job
.
__name__
)}
"label"
:
getattr
(
job
,
"label"
,
job
.
__name__
)}
kls
=
type
(
"%sPlugin"
%
job
.
__name__
,
(
JobPlugin
,),
attrs
)
kls
=
type
(
"%sPlugin"
%
job
.
__name__
,
(
JobPlugin
,),
attrs
)
REGISTRY
[
job
.
_type
]
=
kls
REGISTRY
[
job
.
_type
]
=
kls
...
...
MDANSE/__init__.py
View file @
c7ce7c19
...
@@ -52,8 +52,3 @@ from MMTK import Database
...
@@ -52,8 +52,3 @@ from MMTK import Database
# The default database is still the MMTK one
# The default database is still the MMTK one
Database
.
path
.
append
(
os
.
path
.
join
(
PLATFORM
.
package_directory
(),
'Data'
))
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment