Exemple #1
0
def print_help(prefix=""):
    """
    Built in help - prints out the public function names for the token API
    Parameters:
        filter(string): filters out functions beginning with this text, defaults to all
    """
    formater = common.help_format_lambda(prefix)

    out = __doc__

    out += ("\n**** Functions:\n")
    for item in [print_help, token]:
        out += formater(item.__name__ + "()", item)

    out += "\n**** Token Lambdas:\n"
    for item in [token_literal, token_config, token_file, token_manager]:
        out += formater(item.__name__, item)
    return out
Exemple #2
0
def help_text(prefix: str = '') -> str:
    """
    Built in help - prints out the public function names for the token API
    Parameters:
        filter: filters out functions beginning with this text, defaults to all
    Returns:
        text ready to be passed to print()
    """
    formater = common.help_format_lambda(prefix)

    out = __doc__

    out += ('\n**** Functions:\n')
    for item in [help_text, token]:
        out += formater(item.__name__ + '()', item)

    out += '\n**** Token Lambdas:\n'
    for item in [token_literal, token_config, token_file, token_manager]:
        out += formater(item.__name__, item)
    return out
Exemple #3
0
def print_help(prefix, functions, filters):
    """
    Built in help - prints out the public function names for the token API
    Parameters:
        filter(string): filters out functions beginning with this text, defaults to all
    """
    formater = common.help_format_lambda(prefix)

    out = __doc__
    out += ("\n**** Functions:\n")

    for item in functions:
        out += formater(item.__name__ + "()", item)

    out += "\n**** Filter Lambdas:\n"

    for item in filters:
        out += formater(item.__name__, item)

    return out
Exemple #4
0
 def test_help_format_lambda(self):
     """Test that the lambda function performs as expected"""
     cmd = com.help_format_lambda()
     self.assertTrue("str(object='') -> str" in cmd("str", ""))