Commit aed7c170 authored by Yori 'AGy' Fournier's avatar Yori 'AGy' Fournier
Browse files

Now function documentation is shown while opening

parent 5b3e936f
......@@ -6,6 +6,14 @@ _D_FILENAME = 'serieParam.org'
def readSerie(path2data, filename=_D_FILENAME, dtName=_D_DTNAME):
"""
Read a serieParam.org file from an MFD serie folder.
inputs are:
- path2data: path to the MFD serie folder
- filename: is filename different than serieParam.org
- dtName: name of the returned MyData object
"""
if(str(path2data)[-1] == '/'): path2data = path2data[:-1]
......
......@@ -7,6 +7,7 @@ from . import QLineEdit
from . import QFormLayout
from . import QPushButton
from . import QSignal
from . import QLabel
from types import FunctionType
from . import sys
......@@ -32,7 +33,9 @@ class QFunctionFormular(QWidget):
self.wOptionalArgs = []
self.unexplicitArgs = False
self.unexplicitKwArgs = False
documentation = None # Documentation of the function
if (PYVERSION < (3, 0)):
argCount = function.func_code.co_argcount # number of explicit arguments
argsName = function.func_code.co_varnames # list of the names of the local variables
......@@ -42,6 +45,8 @@ class QFunctionFormular(QWidget):
argsName = function.__code__.co_varnames # list of the names of the local variables
defaultValues = function.__defaults__ # default value of the optional arguments
documentation = function.__doc__
# extract the known arguments
self.explicitArgs = argsName[:argCount]
......@@ -73,6 +78,11 @@ class QFunctionFormular(QWidget):
self.layout = QFormLayout(self)
if documentation is not None:
self.docLabel = QLabel(documentation)
self.docLabel.setWordWrap(True)
self.layout.addRow(self.docLabel)
if self.requiredArgs != ():
# make a QLineEdit without default variable for each requiredArgs
for arg in self.requiredArgs:
......@@ -162,6 +172,7 @@ class QOpenFileWidget(QWidget):
self.functionWidgets[i].show()
self.currentFunctionWidget = self.functionWidgets[i]
self.resize(self.layout.sizeHint())
# self.filename = QFileDialog.getOpenFileName(self)
......
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