mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-09-09 15:07:43 +00:00
Add the prefix for Source's show_format.
This commit is contained in:
@@ -110,7 +110,7 @@ class Source(BaseModel):
|
|||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return f"{self.label}"
|
return f"{self.label}"
|
||||||
|
|
||||||
def show_format(self) -> str:
|
def show_format(self, prefix='') -> str:
|
||||||
output = f"[b]label:[/] {self.label}\n" \
|
output = f"[b]label:[/] {self.label}\n" \
|
||||||
f"[b]source:[/] {self.source.path}\n" \
|
f"[b]source:[/] {self.source.path}\n" \
|
||||||
f"[b]args:[/] {self.args}\n" \
|
f"[b]args:[/] {self.args}\n" \
|
||||||
@@ -119,6 +119,10 @@ class Source(BaseModel):
|
|||||||
for destination in self.destinations:
|
for destination in self.destinations:
|
||||||
output+=f"\t{destination.path}\n"
|
output+=f"\t{destination.path}\n"
|
||||||
|
|
||||||
|
if prefix != '':
|
||||||
|
keepends = True
|
||||||
|
output = prefix + f'{prefix}'.join(output.splitlines(keepends))
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
class Destination(BaseModel):
|
class Destination(BaseModel):
|
||||||
|
|||||||
Reference in New Issue
Block a user