13 lines
529 B
Python
13 lines
529 B
Python
from fledermaus_formatter.table_handler.Entry import Entry
|
|
|
|
class Copy:
|
|
def __init__(self, source: str, target: str, replace = False):
|
|
self.source = source
|
|
self.target = target
|
|
self.replace = replace
|
|
|
|
def execute_on_row(self, row=dict[str, str], source_col=None):
|
|
return {
|
|
**({} if not self.replace else {self.source_col: Entry(value="")}),
|
|
self.target: Entry(row[self.source].value, bg_color=row[self.source].bg_color, fg_color=row[self.source].fg_color)
|
|
} |