You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
589 B
24 lines
589 B
import string |
|
|
|
class PappyException(Exception): |
|
""" |
|
The exception class for Pappy. If a plugin command raises one of these, the |
|
message will be printed to the console rather than displaying a traceback. |
|
""" |
|
pass |
|
|
|
def printable_data(data): |
|
""" |
|
Return ``data``, but replaces unprintable characters with periods. |
|
|
|
:param data: The data to make printable |
|
:type data: String |
|
:rtype: String |
|
""" |
|
chars = [] |
|
for c in data: |
|
if c in string.printable: |
|
chars += c |
|
else: |
|
chars += '.' |
|
return ''.join(chars)
|
|
|