How to use the area4.util.get_raw_file function in area4

To help you get started, we’ve selected a few area4 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github area4lib / area4 / area4 / __init__.py View on Github external
"""
    Get the divider you requested.

    :param number: The divider number (can't be 0).
    :type number: int
    :return: The requested divider.
    :rtype: str
    :raises ValueError: If you request an invalid divider.
    :Example:
        :code:`area4.divider(3)` will return '............'
    """
    if number == 0 or type(number) != int:
        raise ValueError("Please use a number bigger then 0!")
    else:
        try:
            return utils.get_raw_file()[number].replace("\n", "")
        except IndexError:
            raise ValueError("That divider doesn't exist!")
github area4lib / area4 / area4 / __init__.py View on Github external
def splitter(div, *args):
    """
    Split text with dividers easily.

    :return: The newly made value.
    :rtype: str
    :param div: The divider.
    :type div: str
    """
    if type(div) is int:
        div = utils.get_raw_file()[div]
    if len(args) == 1:
        return args[0]
    retstr = ""
    for s in args:
        retstr += "\n".join([s, div])
    return retstr