Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
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!")
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