Utility functions used in command sub-package.

lmi.scripts.common.command.util.RE_COMMAND_NAME = <_sre.SRE_Pattern object at 0x7f0d971a35d0>

Command name can also be a single or double dash.

lmi.scripts.common.command.util.RE_OPT_BRACKET_ARGUMENT = <_sre.SRE_Pattern object at 0x7f0d962abdb0>

Regular expression matching bracket argument such as <arg_name>.

lmi.scripts.common.command.util.RE_OPT_LONG_OPTION = <_sre.SRE_Pattern object at 0x7f0d97287688>

Regular expression matching long options (prefixed with double dash).

lmi.scripts.common.command.util.RE_OPT_SHORT_OPTION = <_sre.SRE_Pattern object at 0x7f0d97462660>

Regular expression matching showt options. They are one character long, prefixed with single dash.

lmi.scripts.common.command.util.RE_OPT_UPPER_ARGUMENT = <_sre.SRE_Pattern object at 0x7f0d97664d40>

Regular expression matching argument written in upper case such as ARG_NAME.


Get a module name of caller from particular outer frame.

Parameters:frame_level (integer) –

Number of nested frames to skip when searching for called function scope by inspecting stack upwards. When the result of this function is applied directly on the definition of function, it’s value should be 1. When used from inside of some other factory, it must be increased by 1.

Level 0 returns name of this module. Level 1 returns module name of caller. Level 2 returns module name of caller’s caller.

Returns:Module name.
Return type:string
lmi.scripts.common.command.util.is_abstract_method(clss, method, missing_is_abstract=False)

Check, whether the given method is abstract in given class or list of classes. May be used to check, whether we should override particular abstract method in a meta-class in case that no non-abstract implementation is defined.

  • clss (type or tuple) – Class or list of classes that is searched for non-abstract implementation of particular method. If the first class having particular method in this list contain non-abstract implementation, False is returned.
  • method (string) – Name of method to look for.
  • missing_is_abstract (boolean) – This is a value returned, when not such method is defined in a set of given classes.

Are all occurences of given method abstract?

Return type: