From 13ff200ba134b8704f37eca99c42b70dab0d17dc Mon Sep 17 00:00:00 2001 From: Xusheng Date: Thu, 1 Jul 2021 12:34:30 +0800 Subject: Remove snippet and kaitai plugin. Note their individual links. --- python/examples/kaitai/__main__.py | 183 ------------------------------------- 1 file changed, 183 deletions(-) delete mode 100755 python/examples/kaitai/__main__.py (limited to 'python/examples/kaitai/__main__.py') diff --git a/python/examples/kaitai/__main__.py b/python/examples/kaitai/__main__.py deleted file mode 100755 index 33e8e549..00000000 --- a/python/examples/kaitai/__main__.py +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env python - -# test script - -from __future__ import print_function - -import io -import sys -import types -import importlib - -if sys.version_info[0] == 2: - import kaitaistruct - import kshelpers -else: - from . import kaitaistruct - from . import kshelpers - -NORMAL = '\033[0m' -BLACK = '\033[0;30m' -RED = '\033[0;31m' -GREEN = '\033[0;32m' -YELLOW = '\033[0;33m' -BLUE = '\033[0;34m' -PURPLE = '\033[0;35m' -CYAN = '\033[0;36m' -GRAY = '\033[0;37m' - -LBLACK = '\033[1;30m' -LRED = '\033[1;31m' -LGREEN = '\033[1;32m' -LYELLOW = '\033[1;33m' -LBLUE = '\033[1;34m' -LPURPLE = '\033[1;35m' -LCYAN = '\033[1;36m' -LGRAY = '\033[1;37m' - -def dump(obj, depth=0): - indent = ' '*depth - - print(('%s'+PURPLE+'%s'+NORMAL) % (indent, repr(obj))) - - kshelpers.exercise(obj) - for fieldName in kshelpers.getFieldNamesPrint(obj): - subObj = None - try: - subObj = getattr(obj, fieldName) - except Exception: - continue - if subObj == None: - continue - - subObjStr = kshelpers.objToStr(subObj) - - color = '' - - if type(subObj) == types.MethodType: - pass - elif isinstance(subObj, type): - pass - elif fieldName == '_debug': - color = RED - elif isinstance(subObj, list): - pass - elif isinstance(subObj, dict): - pass - elif isinstance(subObj, str): - color = CYAN - elif isinstance(subObj, bytes): - color = CYAN - elif type(subObj) == int: - color = YELLOW - elif str(type(subObj)).startswith('