typedargs/shell.py
def list_dir(self, context):
        """Return a listing of all of the functions in this context including builtins.

        Args:
            context (object): The context to print a directory for.

        Returns:
            str
        """

        doc = inspect.getdoc(context)

        listing = ""
        listing += "\n"

        listing += annotate.context_name(context) + "\n"

        if doc is not None:
            doc = inspect.cleandoc(doc)
            listing += doc + "\n"

        listing += "\nDefined Functions:\n"
        is_dict = False

        if isinstance(context, dict):
            funs = context.keys()
            is_dict = True
        else:
            funs = utils.find_all(context)

        for fun in sorted(funs):
            override_name = None
            if is_dict:
                override_name = fun

            fun = self.find_function(context, fun)

            if isinstance(fun, dict):
                if is_dict:
                    listing += " - " + override_name + '\n'
                else:
                    listing += " - " + fun.metadata.name + '\n'
            else:
                listing += " - " + fun.metadata.signature(name=override_name) + '\n'

            if annotate.short_description(fun) != "":
                listing += "   " + annotate.short_description(fun) + '\n'

        listing += "\nBuiltin Functions\n"
        for bif in sorted(self.builtins.keys()):
            listing += ' - ' + bif + '\n'

        listing += '\n'
        return listing
def list_dir(self, context):
        doc = inspect.getdoc(context)

        listing = ""
        listing += "\n"

        listing += annotate.context_name(context) + "\n"

        if doc is not None:
            doc = inspect.cleandoc(doc)
            listing += doc + "\n"

        listing += "\nDefined Functions:\n"
        is_dict = False

        if isinstance(context, dict):
            funs = context.keys()
            is_dict = True
        else:
            funs = utils.find_all(context)

        for fun in sorted(funs):
            override_name = None
            if is_dict:
                override_name = fun

            fun = self.find_function(context, fun)

            if isinstance(fun, dict):
                if is_dict:
                    listing += " - " + override_name + '\n'
                else:
                    listing += " - " + fun.metadata.name + '\n'
            else:
                listing += " - " + fun.metadata.signature(name=override_name) + '\n'

            if annotate.short_description(fun) != "":
                listing += "   " + annotate.short_description(fun) + '\n'

        listing += "\nBuiltin Functions\n"
        for bif in sorted(self.builtins.keys()):
            listing += ' - ' + bif + '\n'

        listing += '\n'
        return listing
def list_dir ( self , context ) : doc = inspect . getdoc ( context ) listing = "" listing += "\n" listing += annotate . context_name ( context ) + "\n" if doc is not None : doc = inspect . cleandoc ( doc ) listing += doc + "\n" listing += "\nDefined Functions:\n" is_dict = False if isinstance ( context , dict ) : funs = context . keys ( ) is_dict = True else : funs = utils . find_all ( context ) for fun in sorted ( funs ) : override_name = None if is_dict : override_name = fun fun = self . find_function ( context , fun ) if isinstance ( fun , dict ) : if is_dict : listing += " - " + override_name + '\n' else : listing += " - " + fun . metadata . name + '\n' else : listing += " - " + fun . metadata . signature ( name = override_name ) + '\n' if annotate . short_description ( fun ) != "" : listing += "   " + annotate . short_description ( fun ) + '\n' listing += "\nBuiltin Functions\n" for bif in sorted ( self . builtins . keys ( ) ) : listing += ' - ' + bif + '\n' listing += '\n' return listing
Return a listing of all of the functions in this context including builtins.

        Args:
            context (object): The context to print a directory for.

        Returns:
            str
Return a listing of all of the functions in this context including builtins .