GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — shellpy/shellpython/config.py at master · lamerman/shellpy Expand file tree/ Copy pathconfig.pyMore file actions 41 lines (28 loc) · 1.22 KB / Copy pathconfig.pyFile metadata and controls41 lines (28 loc) · 1.22 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 import pickle import base64 import sys # TODO: subject for further refactoring. Config should be serialized in nicer way. Now we cannot do it unless we break # compatibility # prints all commands being executed PRINT_ALL_COMMANDS = False # prints stdout of every command executed PRINT_STDOUT_ALWAYS = False # prints stderr of every command executed PRINT_STDERR_ALWAYS = False # colorama is a plugin that makes output colored, this flag controls whether it is enabled COLORAMA_ENABLED = True def dumps(): config_tuple = (PRINT_ALL_COMMANDS, PRINT_STDOUT_ALWAYS, PRINT_STDERR_ALWAYS, COLORAMA_ENABLED) serialized_config = pickle.dumps(config_tuple) if sys.version_info[0] == 2: return base64.b64encode(serialized_config) else: return str(base64.b64encode(serialized_config), 'utf-8') def loads(data): global PRINT_ALL_COMMANDS, PRINT_STDOUT_ALWAYS, PRINT_STDERR_ALWAYS, COLORAMA_ENABLED if sys.version_info[0] == 2: serialized_config = base64.b64decode(data) else: serialized_config = base64.b64decode(bytes(data, 'utf-8')) config_tuple = pickle.loads(serialized_config) PRINT_ALL_COMMANDS, PRINT_STDOUT_ALWAYS, PRINT_STDERR_ALWAYS, COLORAMA_ENABLED = config_tuple |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |