Commit 4291a4f6 authored by eric pellegrini's avatar eric pellegrini

Modified the build_help script: the doc is now built within MDANSE

directory
Bug fix due to the change from configurators to settings class variable
for IJob derived classes
Reintroduced and fixed JobHelpFrame class
parent 01fe5162
#!/bin/sh
rm -rf ./Documentation
MDANSE_HELP="../MDANSE/Doc/Help"
mkdir ./Documentation
mkdir ./Documentation/_static
mkdir ./Documentation/_templates
rm -rf ${MDANSE_HELP}
sphinx-apidoc -o ./Documentation -F --separate -d 5 -H MDANSE -A "G. Goret, B. Aoun & E. Pellegrini" -V 1.0 -R 1.0 ../MDANSE
mkdir -p ${MDANSE_HELP}
mkdir ${MDANSE_HELP}/_static
mkdir ${MDANSE_HELP}/_templates
cp conf_help.py ./Documentation/conf.py
sphinx-apidoc -o ${MDANSE_HELP} -F --separate -d 5 -H MDANSE -A "G. Goret, B. Aoun & E. Pellegrini" -V 1.0 -R 1.0 ../MDANSE
cp layout.html ./Documentation/_templates/
cp conf_help.py ${MDANSE_HELP}/conf.py
cp mdanse_logo.png ./Documentation/_static/
cp layout.html ${MDANSE_HELP}/_templates/
sphinx-build -b htmlhelp ./Documentation ./Documentation/Help/
cp mdanse_logo.png ${MDANSE_HELP}/_static/
sphinx-build -b htmlhelp ${MDANSE_HELP} ${MDANSE_HELP}
import os
import wx
import wx.html as wxhtml
from MDANSE import PLATFORM, REGISTRY
class JobHelpFrame(wx.Frame):
def __init__(self, parent, job):
wx.Frame.__init__(self, parent, wx.ID_ANY, title="About %s" % job.label, size =(800,600))
self.nolog = wx.LogNull()
fully_qualified_name = 'MDANSE.Framework.Jobs' + '.' + job.__class__.__name__
self._doc = PLATFORM.get_path(os.path.join(PLATFORM.documentation_path(), fully_qualified_name + '.html'))
self.build()
def build(self):
htmlPanel = wxhtml.HtmlWindow(self, wx.ID_ANY)
htmlPanel.LoadPage(self._doc)
if __name__ == "__main__":
app = wx.App(False)
f = JobHelpFrame(None,REGISTRY['job']['msd']())
f.Show()
app.MainLoop()
import wx
import wx.lib.agw.pygauge as pygauge
from nMOLDYN.Core.Status import StatusHandler
from nMOLDYN.GUI.Resources.Icons import ICONS, scaled_bitmap
from MDANSE.Framework.Status import StatusHandler
from MDANSE.App.GUI.Icons import ICONS
class ProgressBar(wx.Panel,StatusHandler):
......@@ -14,7 +14,7 @@ class ProgressBar(wx.Panel,StatusHandler):
sizer = wx.BoxSizer(wx.HORIZONTAL)
self._progress = pygauge.PyGauge(self, wx.ID_ANY)
self._stop = wx.BitmapButton(self, wx.ID_ANY, scaled_bitmap(ICONS["stop"], 24, 24))
self._stop = wx.BitmapButton(self, wx.ID_ANY, ICONS["stop",24,24])
sizer.Add(self._progress,1,wx.ALL|wx.EXPAND,5)
sizer.Add(self._stop,0,wx.ALL|wx.EXPAND,5)
......
......@@ -44,6 +44,7 @@ from MDANSE.Externals.pubsub import pub
from MDANSE.App.GUI.ComboWidgets.ConfigurationPanel import ConfigurationPanel
from MDANSE.App.GUI.Framework.Plugins.ComponentPlugin import ComponentPlugin
from MDANSE.App.GUI.ComboWidgets.JobHelpFrame import JobHelpFrame
class JobPlugin(ComponentPlugin):
......@@ -93,9 +94,7 @@ class JobPlugin(ComponentPlugin):
self.Bind(wx.EVT_BUTTON, self.on_run, runButton)
def on_help(self, event):
from nMOLDYN.GUI.Widgets.JobHelpFrame import JobHelpFrame
d = JobHelpFrame(self,self._job)
d.Show()
......
......@@ -42,7 +42,6 @@ from MMTK.Trajectory import Trajectory
from MDANSE import ELEMENTS, LOGGER
from MDANSE.Core.Error import Error
from MDANSE.Extensions import fast_calculation
from MDANSE.Externals.pubsub import pub
from MDANSE.MolecularDynamics.Trajectory import sorted_atoms
......
......@@ -98,7 +98,7 @@ class Platform(object):
:rtype: str
'''
return os.path.join(self.package_directory(), 'GUI', 'Help')
return os.path.join(self.package_directory(), 'Doc', 'Help')
def local_mmtk_database_directory(self):
'''
......
......@@ -175,14 +175,14 @@ class Configurable(object):
:rtype: str
'''
configurators = getattr(cls,"configurators",{})
settings = getattr(cls,"settings",{})
if not isinstance(configurators,_abcoll.Mapping):
raise ConfigurationError("Invalid type for configurators: must be a mapping-like object")
if not isinstance(settings,_abcoll.Mapping):
raise ConfigurationError("Invalid type for settings: must be a mapping-like object")
doclist = []
for name,(typ,kwds) in configurators.items():
for name,(typ,kwds) in settings.items():
cfg=REGISTRY["configurator"][typ](name, **kwds)
descr = kwds.get("description","")
descr += "\n"+str(cfg.__doc__)
......@@ -241,13 +241,13 @@ class Configurable(object):
:rtype: dict
'''
configurators = getattr(cls,"configurators",{})
settings = getattr(cls,"settings",{})
if not isinstance(configurators,_abcoll.Mapping):
raise ConfigurationError("Invalid type for configurators: must be a mapping-like object")
if not isinstance(settings,_abcoll.Mapping):
raise ConfigurationError("Invalid type for settings: must be a mapping-like object")
params = collections.OrderedDict()
for name,(typ,kwds) in configurators.items():
for name,(typ,kwds) in settings.items():
cfg=REGISTRY["configurator"][typ](name, **kwds)
params[name] = cfg.default
......
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