add some object copy methods to Line

This commit is contained in:
jesopo 2020-04-13 11:35:14 +01:00
parent cc97234011
commit 554d9a25f5
1 changed files with 7 additions and 0 deletions

View File

@ -58,3 +58,10 @@ class Line(object):
def format(self) -> str:
return self._format(self)
def with_source(self, source: str) -> "Line":
return Line(self.tags, source, self.command, self.params, self._format)
def copy(self) -> "Line":
return Line(self.tags, self.source, self.command, self.params,
self._format)