Belle II Software light-2406-ragdoll
EnvironmentInformation Class Reference
Inheritance diagram for EnvironmentInformation:

Public Member Functions

def __init__ (self)
 
def revision_number (self)
 
def __str__ (self)
 
def __repr__ (self)
 
def get_current_revision_number (self)
 

Public Attributes

 externals_version
 Externals version.
 
 externals_option
 Compile options of externals.
 
 option
 Compile options.
 
 architecture
 OS.
 
 release
 Release version.
 
 release_folder
 Release folder.
 

Protected Attributes

 _cached_revision
 Revision number (cached, the real getter is the property)
 

Detailed Description

Helper class for accessing the information about the environment.

Definition at line 12 of file information.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)
Get the variables from the environment variables.

Reimplemented in Basf2EnvironmentInformation.

Definition at line 18 of file information.py.

18 def __init__(self):
19 """
20 Get the variables from the environment variables.
21 """
22
23 self.externals_version = ""
24
25 self.externals_option = ""
26
27 self.option = ""
28
29 self.architecture = ""
30
31 self.release = ""
32
33 self.release_folder = ""
34
35 self._cached_revision = ""
36

Member Function Documentation

◆ __repr__()

def __repr__ (   self)
Also for ipython.

Definition at line 62 of file information.py.

62 def __repr__(self):
63 """
64 Also for ipython.
65 """
66 return self.__str__()
67

◆ __str__()

def __str__ (   self)
A nice representation.

Definition at line 47 of file information.py.

47 def __str__(self):
48 """
49 A nice representation.
50 """
51 result = ""
52 result += "externals version: " + self.externals_version + "\n"
53 result += "externals option: " + self.externals_option + "\n"
54 result += "option: " + self.option + "\n"
55 result += "architecture: " + self.architecture + "\n"
56 result += "release: " + self.release + "\n"
57 result += "release folder: " + self.release_folder + "\n"
58 result += "revision number: " + self.revision_number + "\n"
59 result += "date: " + datetime.now().strftime("%Y-%m-%d") + "\n"
60 return result
61

◆ get_current_revision_number()

def get_current_revision_number (   self)
Try to download the current revision number from SVN.

Definition at line 68 of file information.py.

68 def get_current_revision_number(self):
69 """
70 Try to download the current revision number from SVN.
71 """
72 try:
73 return check_output(["git", "log", "-1", "--format='%H'"], cwd=self.release_folder).decode()
74 except BaseException:
75 return ""

◆ revision_number()

def revision_number (   self)
Get the cached revision number from SVN or get it from SVN directly.

Definition at line 38 of file information.py.

38 def revision_number(self):
39 """
40 Get the cached revision number from SVN or get it from SVN directly.
41 """
42 if not self._cached_revision:
43 self._cached_revision = self.get_current_revision_number()
44
45 return self._cached_revision
46

Member Data Documentation

◆ _cached_revision

_cached_revision
protected

Revision number (cached, the real getter is the property)

Definition at line 35 of file information.py.

◆ architecture

architecture

OS.

Definition at line 29 of file information.py.

◆ externals_option

externals_option

Compile options of externals.

Definition at line 25 of file information.py.

◆ externals_version

externals_version

Externals version.

Definition at line 23 of file information.py.

◆ option

option

Compile options.

Definition at line 27 of file information.py.

◆ release

release

Release version.

Definition at line 31 of file information.py.

◆ release_folder

release_folder

Release folder.

Definition at line 33 of file information.py.


The documentation for this class was generated from the following file: