Skip to content

arguments


=== Author: Assaf Ben Zur ===

MNS main arguments core functions and Classes.

This module holds the MnsArgument class as well as all argument handeling functions.

This module was designed to procedurally handle function arguments in order to manipulate them, generate dynamic UI's from them, and pass them along back to their creator function as an execute.


Classes


MnsArgument [Class]

MnsArgument Convieniency Class.

A class instance holds all relevant information regarding an extracted single function argument.

These class members will dectate any behavior derived from an actual function object or a method object.


Constructor: MnsArgument(**kwargs)
Inherits from: object
Class Members:
    • name
    • type
    • default
    • min
    • max
    • comment
    • ob
    • side
    • pathMode
    • pathFileTypes
    • intIncrement
    • blockCreationOnly
    • jntStructMember
    • jntStructSoftMod
    • lockOffAttributes
    • simpleDivider
    • meshComponents
    • disabled
    • multiRowList
    • alphabeticalOnly
Methods:

MnsArgument methods


formatCommentToToolTip [MnsArgument class method]

Constructor: formatCommentToToolTip(self)
Return: None
Arguments:
  • self
Optional Arguments:


Defenitions


convertChannelControlDictToAttr

Constructor: convertChannelControlDictToAttr(channelControlDict = {})
Return: list
Arguments:
  • channelControlDict(dict) ; [default: {}]
Keyword Arguments:


extractArgsFromDef

This function will extract all arguments and optional arguments from a given function object.

Returns two lists containing MnsArgument instances.


Constructor: extractArgsFromDef(defenition)
Return: list (arguments MnsArgument list), list (optional arguments MnsArgument list)
Arguments:
  • defenition
Keyword Arguments:


extractArgsFromSource

This function will extract all arguments and optional arguments from a given function source.

Returns two lists containing MnsArgument instances.


Constructor: extractArgsFromSource(src)
Return: list (arguments MnsArgument list), list (optional arguments MnsArgument list)
Arguments:
  • src
Keyword Arguments:


extractChennelControlDefaultFromLine

Constructor: extractChennelControlDefaultFromLine(line = "", argAame = "")
Return: dict
Arguments:
  • line(str) ; [default: ""]
  • argAame(str) ; [default: ""]
Keyword Arguments:


extractColorSchemeDefaultFromLine

Constructor: extractColorSchemeDefaultFromLine(line = "", argAame = "")
Return: None
Arguments:
  • line(str) ; [default: ""]
  • argAame(str) ; [default: ""]
Keyword Arguments:


formatArgumetsAsDict

Format given list of arguments into a predefined dictionary structure.


Constructor: formatArgumetsAsDict(mnsArgsList = [])
Return: dict (Formated arguments)
Arguments:
  • mnsArgsList(list) ; [default: []]
Keyword Arguments:


recompileArgumetsAsString

A reverse function to the 'extractArgsFromDef'.

In order to pass any arguments back to it's creator, comes a need to re-compile an argument list into a single callable formatted string.

This function covers this need.


Constructor: recompileArgumetsAsString(defenition, arguments, optArgs, values)
Return: string (re-compiled arguments as string)
Arguments:
  • defenition
  • arguments
  • optArgs
  • values
Keyword Arguments:


returnValueAndTypeFromArgString

This function will return a value (as its actual type) and a type (as a type object) from a given extracted argument string


Constructor: returnValueAndTypeFromArgString(argString = "")
Return: value (Dynamic type), type (type object)
Arguments:
  • argString(str) ; [default: ""]
Keyword Arguments:


splitStringToArg

This function return a MnsArgument object from a given argument string.

It will split the argument string into actual elemnts and values and directly ingest them into the class members.


Constructor: splitStringToArg(argAsString)
Return: MnsArgument
Arguments:
  • argAsString
Keyword Arguments: