mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-23 06:21:43 -07:00
parent
1c9950678a
commit
ee0a0b492b
1 changed files with 8 additions and 5 deletions
|
@ -1,9 +1,12 @@
|
||||||
def isprintable(instring):
|
def isprintable(instring):
|
||||||
|
if isinstance(instring, str):
|
||||||
#http://stackoverflow.com/a/3637294
|
#http://stackoverflow.com/a/3637294
|
||||||
import string
|
import string
|
||||||
printset = set(string.printable)
|
printset = set(string.printable)
|
||||||
isprintable = set(instring).issubset(printset)
|
isprintable = set(instring).issubset(printset)
|
||||||
return isprintable
|
return isprintable
|
||||||
|
else:
|
||||||
|
return True
|
||||||
|
|
||||||
def count_newlines_from_end(str):
|
def count_newlines_from_end(str):
|
||||||
i = len(str)
|
i = len(str)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue