The Gaudi Framework  master (37c0b60a)
update_version.Fields Class Reference

Public Member Functions

def __init__ (self, str version, datetime.date date)
 
def __repr__ (self)
 
def data (self)
 

Private Attributes

 _data
 

Detailed Description

Helper to carry the allowed fields for formatting replacement strings.

>>> f = Fields("v37r1", datetime.date(2023, 9, 25))
>>> f
Fields('37.1', datetime.date(2023, 9, 25))
>>> f.data
{'cmake_version': '37.1', 'tag_version': 'v37r1', 'date': datetime.date(2023, 9, 25)}

Definition at line 43 of file update_version.py.

Constructor & Destructor Documentation

◆ __init__()

def update_version.Fields.__init__ (   self,
str  version,
datetime.date  date 
)

Definition at line 54 of file update_version.py.

54  def __init__(self, version: str, date: datetime.date):
55  cmake_version, tag_version = normalize_version(version)
56  self._data = dict(
57  cmake_version=cmake_version,
58  tag_version=tag_version,
59  date=date,
60  )
61 

Member Function Documentation

◆ __repr__()

def update_version.Fields.__repr__ (   self)

Definition at line 62 of file update_version.py.

62  def __repr__(self):
63  return (
64  f"Fields({repr(self._data['cmake_version'])}, {repr(self._data['date'])})"
65  )
66 

◆ data()

def update_version.Fields.data (   self)

Definition at line 68 of file update_version.py.

68  def data(self):
69  return self._data
70 
71 

Member Data Documentation

◆ _data

update_version.Fields._data
private

Definition at line 56 of file update_version.py.


The documentation for this class was generated from the following file:
GaudiPartProp.decorators.__repr__
__repr__
decorate the vector of properties
Definition: decorators.py:173
update_version.normalize_version
tuple[str, str] normalize_version(str version)
Definition: update_version.py:26