Belle II Software development
print_info.py
1#!/usr/bin/env python3
2
3
10
11from basf2.core import basf2label, basf2copyright, basf2license, list_module_search_paths, LogPythonInterface
12from basf2.version import get_version, get_release
13from basf2 import conditions
14
15import os
16import sys
17
18# The Belle II logo graphics
19logo = """\
20
21 eeeeeeee
22 eeeeeeeeeeeeeeeeeeee
23 eeeeeeee eeeeeeeeeeeeeeee
24 eeeeee eeee eeeeee
25 eeee eeee eeee
26 eeee eeee eeee
27 eeeee eeee eeee
28 eeee eeeeeeeeeeeeeeeee
29 eeeeeeeeeeeee
30
31 eeeeeeeeeeeeee
32 eeeeeeeeeeeeeeeeeee
33 eeee eeee eeeeee
34 eeee eeee eeeeee
35 eeee eeee eeeee
36 eeee eeee eeeee
37 eeee eeee eeeeeee
38 eeeeee eeeeeeeeeeeeeeeeeeeee
39 eeeeeeeeeeeeeeeeeeeeeeeeee
40 eeeeeeeeeeeeeeeee
41
42 BBBBBBB ll ll 2222222
43 BB BB eeee ll ll eeee 22 22
44 BB BB ee ee ll ll ee ee 22 22
45 BBBBBBB eeeeeeee ll ll eeeeeeee 22 22
46 BB BB ee ll ll ee 22 22
47 BB BB ee ee ll ll ee ee 22 22
48 BBBBBBBB eeeee ll ll eeeee 2222222
49
50"""
51
52if LogPythonInterface.terminal_supports_colors():
53 CSI = "\x1B["
54 color = CSI + '93;44m'
55 reset = CSI + '0m'
56else:
57 color = ""
58 reset = ""
59
60for line in logo.splitlines():
61 print(color + line.ljust(48) + reset)
62
63print('')
64print(basf2label.center(48))
65print(basf2copyright.center(48))
66print(basf2license.center(48))
67print(('Release ' + get_release()).center(48))
68print(('Version ' + get_version()).center(48))
69print('')
70print('-' * 48)
71for var in ["RELEASE", "RELEASE_DIR", "LOCAL_DIR", "SUBDIR", "EXTERNALS_VERSION", "ARCH"]:
72 name = "BELLE2_" + var
73 print((name + ":").ljust(25), os.environ.get(name, ''))
74
75print('Default global tags:'.ljust(25), conditions.default_globaltags)
76print('Kernel version:'.ljust(25), os.uname()[2])
77python_version = sys.version_info[:3]
78print('Python version:'.ljust(25), '.'.join(str(ver) for ver in python_version))
79try:
80 from ROOT import gROOT
81 gROOT.SetBatch()
82 rootver = gROOT.GetVersion()
83except ImportError:
84 rootver = 'PyROOT broken, cannot get version!'
85print('ROOT version:'.ljust(25), rootver)
86print('')
87print('basf2 module directories:'.ljust(25))
88for dirname in list_module_search_paths():
89 print(' ', dirname)
90
91print('-' * 48)