Skip to content

Commit 70e79af

Browse files
authored
Update pyfile.py
1 parent 5ce78df commit 70e79af

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pyfoxfile/pyfile.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ def get_importing_script_path():
115115
return os.path.abspath(filename)
116116
return None
117117

118+
def is_only_nonprintable(var):
119+
"""True if every character is non-printable (handles bytes via to_text)."""
120+
if var is None:
121+
return True
122+
return all(not ch.isprintable() for ch in var)
123+
118124
def add_format(reg, key, magic, ext, name=None, ver="001",
119125
new_style=True, use_advanced_list=True, use_alt_inode=False, delim="\x00"):
120126
if key in reg:

0 commit comments

Comments
 (0)