GNUnet  0.11.x
Public Member Functions | Static Public Attributes
talerbuildconfig.PyBabelTool Class Reference
Inheritance diagram for talerbuildconfig.PyBabelTool:
[legend]
Collaboration diagram for talerbuildconfig.PyBabelTool:
[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 = "pybabel"
 

Detailed Description

Definition at line 178 of file talerbuildconfig.py.

Member Function Documentation

◆ args()

def talerbuildconfig.PyBabelTool.args (   self,
  parser 
)

Definition at line 181 of file talerbuildconfig.py.

181  def args(self, parser):
182  parser.add_argument(
183  "--with-pybabel", type=str, help="name of the pybabel executable"
184  )
185 

◆ check()

def talerbuildconfig.PyBabelTool.check (   self,
  buildconfig 
)

Definition at line 186 of file talerbuildconfig.py.

References talerbuildconfig.existence().

186  def check(self, buildconfig):
187  # No suffix. Would probably be cheaper to do this in
188  # the dict as well. We also need to check the python
189  # version it was build against (TODO).
190  if existence("pybabel"):
191  import babel
192  pybabel_version = babel.__version__
193  buildconfig._set_tool("pybabel", "pybabel", pybabel_version)
194  return True
195  else:
196  # Has suffix, try suffix. We know the names in advance,
197  # so use a dictionary and iterate over it. Use enough names
198  # to safe updating this for another couple of years.
199  #
200  # Food for thought: If we only accept python 3.7 or higher,
201  # is checking pybabel + pybabel-3.[0-9]* too much and could
202  # be broken down to pybabel + pybabel-3.7 and later names?
203  version_dict = {
204  "3.0": "pybabel-3.0",
205  "3.1": "pybabel-3.1",
206  "3.2": "pybabel-3.2",
207  "3.3": "pybabel-3.3",
208  "3.4": "pybabel-3.4",
209  "3.5": "pybabel-3.5",
210  "3.6": "pybabel-3.6",
211  "3.7": "pybabel-3.7",
212  "3.8": "pybabel-3.8",
213  "3.9": "pybabel-3.9",
214  "4.0": "pybabel-4.0",
215  }
216  for key, value in version_dict.items():
217  if existence(value):
218  # FIXME: This version reporting is slightly off
219  # FIXME: and only maps to the suffix.
220  pybabel_version = key
221  buildconfig._set_tool("pybabel", value, pybabel_version)
222  return True
223 
224 
Here is the call graph for this function:

Field Documentation

◆ name

string talerbuildconfig.PyBabelTool.name = "pybabel"
static

Definition at line 179 of file talerbuildconfig.py.


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