Wow. This uses the Doxygen style very well. It's good if you plan to use Doxygen exclusively, but I'd prefer the Python style.bernd wrote: ↑Sat Aug 17, 2019 6:06 pm Would it be possible to show how you would make it, on an example def in this file https://github.com/FreeCAD/FreeCAD/blob ... cxtools.py ?
Code: Select all
## Sets CalculiX ccx binary path and validates if the binary can be executed
# @param self The python object self
# @ccx_binary path to ccx binary, default is guessed:
# "bin/ccx" windows, "ccx" for other systems
# @ccx_binary_sig expected output form ccx when run empty.
# Default value is "CalculiX.exe -i jobname"
def setup_ccx(self, ccx_binary=None, ccx_binary_sig="CalculiX"):
error_title = "No CalculiX binary ccx"
error_message = ""
from platform import system
ccx_std_location = FreeCAD.ParamGet(
"User parameter:BaseApp/Preferences/Mod/Fem/Ccx"
).GetBool("UseStandardCcxLocation", True)
Code: Select all
def setup_ccx(self, ccx_binary=None, ccx_binary_sig="CalculiX"):
"""Set Calculix binary path and validate its execution.
Parameters
----------
ccx_binary : str, optional
It defaults to `None`. The path to the `ccx` binary. If it is `None`,
the path is guessed.
ccx_binary_sig : str, optional
Defaults to 'CalculiX'. Expected output from `ccx` when run empty.
Raises
------
Exception
"""
error_title = "No CalculiX binary ccx"
error_message = ""
from platform import system
ccx_std_location = FreeCAD.ParamGet(
"User parameter:BaseApp/Preferences/Mod/Fem/Ccx"
).GetBool("UseStandardCcxLocation", True)
By the way, in those type of functions, I find it odd that the argument is a string, but the default is None. The default value should also be a string, with the default path.
Code: Select all
def setup_ccx(self, ccx_binary="bin/ccx", ccx_binary_sig="CalculiX"):