Belle II Software  release-08-01-10
NoReplacementField Class Reference
Inheritance diagram for NoReplacementField:
Collaboration diagram for NoReplacementField:

Public Member Functions

def __init__ (self, field_name, conversion=None, format_spec=None)
 
def __getattr__ (self, attr)
 
def __getitem__ (self, attr)
 
def compose (self)
 

Public Attributes

 field_name
 cached value of the field name
 
 conversion
 cached value of the conversion specifier
 
 format_spec
 cached value of the format specifier
 

Detailed Description

This class serves as a placeholder for keys in not found during lookup into
keyword or positional arguments during a call to TolerateMissingKeyFormatter.

It records potential item and attribute lookups, conversion and format_spec to
reproduce original replacement_field entry into the formatted string.

Parameters
----------
field_name : str
    field_name part of the replacement_field specifier
conversion : str
    conversion part of the replacement_field specifier
format_spec : str%
    format_spec part of the replacement_field specifier

Notes
-----
replacement_field, field_name, conversion and format_spec have the meaning as outlined in
https://docs.python.org/2/library/string.html#format-string-syntax

Definition at line 13 of file tolerate_missing_key_formatter.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  field_name,
  conversion = None,
  format_spec = None 
)
Constructor

Definition at line 36 of file tolerate_missing_key_formatter.py.

36  def __init__(self, field_name, conversion=None, format_spec=None):
37  """Constructor"""
38 
39 
40  self.field_name = field_name
41 
42  self.conversion = conversion
43 
44  self.format_spec = format_spec
45 

Member Function Documentation

◆ __getattr__()

def __getattr__ (   self,
  attr 
)
Record attribute lookup

Definition at line 46 of file tolerate_missing_key_formatter.py.

◆ __getitem__()

def __getitem__ (   self,
  attr 
)
Record item lookup

Definition at line 50 of file tolerate_missing_key_formatter.py.

◆ compose()

def compose (   self)
Compose a replacement_field string equivalent to the original replacement_field in the string formatting.

Definition at line 54 of file tolerate_missing_key_formatter.py.


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