mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-11-02 02:42:04 +00:00
Merge pull request #864 from PR0M3TH3AN/remove-dead-code-imghdr-stub-1860538532359934490
🧹 [code health] Remove dead code from src/utils/imghdr_stub.py
This commit is contained in:
1 file changed
-50
@@ -168,53 +168,3 @@ def test_exr(h, f):
|
||||
|
||||
|
||||
tests.append(test_exr)
|
||||
|
||||
|
||||
# --------------------
|
||||
# Small test program
|
||||
# --------------------
|
||||
|
||||
|
||||
def test(): # pragma: no cover - only used for manual testing
|
||||
import sys
|
||||
|
||||
recursive = 0
|
||||
if sys.argv[1:] and sys.argv[1] == "-r":
|
||||
del sys.argv[1:2]
|
||||
recursive = 1
|
||||
try:
|
||||
if sys.argv[1:]:
|
||||
testall(sys.argv[1:], recursive, 1)
|
||||
else:
|
||||
testall(["."], recursive, 1)
|
||||
except KeyboardInterrupt:
|
||||
sys.stderr.write("\n[Interrupted]\n")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def testall(list, recursive, toplevel): # pragma: no cover - only for manual use
|
||||
import sys
|
||||
import os
|
||||
|
||||
for filename in list:
|
||||
if os.path.isdir(filename):
|
||||
print(filename + "/:", end=" ")
|
||||
if recursive or toplevel:
|
||||
print("recursing down:")
|
||||
import glob
|
||||
|
||||
names = glob.glob(os.path.join(glob.escape(filename), "*"))
|
||||
testall(names, recursive, 0)
|
||||
else:
|
||||
print("*** directory (use -r) ***")
|
||||
else:
|
||||
print(filename + ":", end=" ")
|
||||
sys.stdout.flush()
|
||||
try:
|
||||
print(what(filename))
|
||||
except OSError:
|
||||
print("*** not found ***")
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover - manual run
|
||||
test()
|
||||
Reference in new issue
Block a user