GNUnet  0.11.x
Public Member Functions | Static Public Attributes
talerbuildconfig.PythonTool Class Reference
Inheritance diagram for talerbuildconfig.PythonTool:
[legend]
Collaboration diagram for talerbuildconfig.PythonTool:
[legend]

Public Member Functions

def args (self, parser)
 
def check (self, buildconfig)
 
- Public Member Functions inherited from talerbuildconfig.Tool
def args (self)
 
def check (self, buildconfig)
 

Static Public Attributes

string name = "python"
 

Detailed Description

Definition at line 225 of file talerbuildconfig.py.

Member Function Documentation

◆ args()

def talerbuildconfig.PythonTool.args (   self,
  parser 
)

Definition at line 230 of file talerbuildconfig.py.

230  def args(self, parser):
231  parser.add_argument(
232  "--with-python", type=str, help="name of the python executable"
233  )
234 

◆ check()

def talerbuildconfig.PythonTool.check (   self,
  buildconfig 
)

Definition at line 235 of file talerbuildconfig.py.

References talerbuildconfig.existence().

235  def check(self, buildconfig):
236  # No suffix. Would probably be cheaper to do this in
237  # the dict as well. We need at least version 3.7.
238  if existence("python") and (shlex.split(subprocess.getstatusoutput("python --version")[1])[1] >= '3.7'):
239  # python might not be python3. It might not even be
240  # python 3.x.
241  python_version = shlex.split(subprocess.getstatusoutput("python --version")[1])[1]
242  if python_version >= '3.7':
243  buildconfig._set_tool("python", "python", python_version)
244  return True
245  else:
246  # Has suffix, try suffix. We know the names in advance,
247  # so use a dictionary and iterate over it. Use enough names
248  # to safe updating this for another couple of years.
249  #
250  # Food for thought: If we only accept python 3.7 or higher,
251  # is checking pybabel + pybabel-3.[0-9]* too much and could
252  # be broken down to pybabel + pybabel-3.7 and later names?
253  version_dict = {
254  "3.7": "python3.7",
255  "3.8": "python3.8",
256  "3.9": "python3.9",
257  "4.0": "python4.0",
258  }
259  for key, value in version_dict.items():
260  if existence(value):
261  python3_version = key
262  buildconfig._set_tool("python", value, python3_version)
263  return True
264 
265 
266 # TODO: Make this really optional, not use a hack ("true").
Here is the call graph for this function:

Field Documentation

◆ name

string talerbuildconfig.PythonTool.name = "python"
static

Definition at line 228 of file talerbuildconfig.py.


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