Commit 36a5339a authored by Yori Fournier's avatar Yori Fournier
Browse files

Merge branch '26-BUG-myIOs-empty-error' into 'master'

Corrected the bug which was raising an error when AVAIL_FUNCTIONS was empty.

Closes #26

See merge request !15
parents d37165e3 ccda9f23
......@@ -16,6 +16,7 @@ if debug:
# LIST OF FILE NAMES IN myIOS/*.py (except *_*.py)
functions = []
for function in os.listdir(os.path.dirname(os.path.abspath(__file__))):
if function[-3:] == '.py' and '_' not in os.path.basename(function):
functions.append(function[:-3])
......
......@@ -14,11 +14,23 @@ from . import sys
AVAIL_FUNCTIONS = []
PYVERSION = sys.version_info
def No_function_available():
"""In order to add functions in this list you need to add a file with the function's name in myIOs.
For instance: In order to add 'readMySuperData(file)', create a file readMySuperData.py
in which you code your function and move the file into mydesigngui/myIOs.
For more details refer to the user guide."""
pass
for key in myIOs.__dict__.keys():
if key not in myIOs.__builtins__.keys() and not key.startswith('__'):
if isinstance(myIOs.__dict__[key], FunctionType):
AVAIL_FUNCTIONS.append(myIOs.__dict__[key])
if len(AVAIL_FUNCTIONS) == 0:
AVAIL_FUNCTIONS.append(No_function_available)
class QFunctionFormular(QWidget):
......@@ -108,7 +120,7 @@ class QFunctionFormular(QWidget):
self.layout.addRow('**kwargs', self.wUnexplicitKwArgs)
def getArguments(self):
arguments = []
for widget in self.wRequiredArgs:
......@@ -158,7 +170,7 @@ class QOpenFileWidget(QWidget):
for widget in self.functionWidgets:
widget.hide()
self.functionWidgets[0].show()
self.currentFunctionWidget = self.functionWidgets[0]
......
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