diff options
| author | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2023-07-12 14:02:44 +0200 |
|---|---|---|
| committer | Theofilos Augoustis <theofilos.augoustis@gmail.com> | 2023-07-12 14:02:44 +0200 |
| commit | 9e88720e1fbccc4ccb96f8a4770169c36037ef94 (patch) | |
| tree | 59c64320067e83d73584f917045da7ffb2dabbcd /utils.py | |
| parent | 594ad72157c8b8a232e14d55f27e2fdb4881887d (diff) | |
| download | focaccia-9e88720e1fbccc4ccb96f8a4770169c36037ef94.tar.gz focaccia-9e88720e1fbccc4ccb96f8a4770169c36037ef94.zip | |
Add development scripts for comparing Arancini dumps
Diffstat (limited to 'utils.py')
| -rw-r--r-- | utils.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..d841c7c --- /dev/null +++ b/utils.py @@ -0,0 +1,18 @@ +#! /bin/python3 + +import sys +import shutil + +def print_separator(separator: str = '-', stream=sys.stdout, count: int = 80): + maxtermsize = count + termsize = shutil.get_terminal_size((80, 20)).columns + print(separator * min(termsize, maxtermsize), file=stream) + +def check_version(version: str): + # Script depends on ordered dicts in default dict() + split = version.split('.') + major = int(split[0]) + minor = int(split[1]) + if sys.version_info.major < major and sys.version_info.minor < minor: + raise EnvironmentError("Expected at least Python 3.7") + |